From 297902393e4152d2a44107a1347154980aac69b2 Mon Sep 17 00:00:00 2001 From: zxy <353513737@qq.com> Date: Fri, 9 Feb 2024 14:31:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E7=82=B9=E5=87=BB=E4=B8=8B?= =?UTF-8?q?=E9=92=BB=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/chengdu/index.html | 64 +------ public/chengdu/js/index.js | 220 +++++++++++++++++++++- src/api/desk/notice.js | 8 + src/views/workstation/workbench/index.vue | 9 + 4 files changed, 237 insertions(+), 64 deletions(-) diff --git a/public/chengdu/index.html b/public/chengdu/index.html index f992dc9..972025a 100644 --- a/public/chengdu/index.html +++ b/public/chengdu/index.html @@ -65,7 +65,7 @@ -
+
@@ -114,21 +114,6 @@
-
    @@ -169,51 +154,6 @@
-
diff --git a/public/chengdu/js/index.js b/public/chengdu/js/index.js index 8fab66b..90fc453 100644 --- a/public/chengdu/js/index.js +++ b/public/chengdu/js/index.js @@ -1,5 +1,210 @@ //var baseUrl = 'http://cgsu81beft.51xd.pub'; var baseUrl = "http://39.101.167.152:8088/shekecaiji"; +var testUrl = "http://39.98.184.58:8000/jobslink-api/jkworksreport" + +console.log(document.cookie) +// 获取cookie +function getCookie(cookieName) { + var cookies = document.cookie.split("; "); + for (var i = 0; i < cookies.length; i++) { + var cookie = cookies[i].split("="); + if (cookie[0] === cookieName) { + return cookie[1]; + } + } + return ""; +} + +var token = getCookie("jobslink-access-token"); +// $.ajaxSetup({ +// headers: { +// 'Content-Type': 'application/json', // 指定请求体为JSON格式 +// 'Jobslink-Auth': `bearer ${token}` +// } +// }); +//测试方法 +function getMapData1() { + $.ajax({ + type: "GET", + url: testUrl + "/getMapData1", + headers: { + 'Content-Type': 'application/json', // 指定请求体为JSON格式 + 'Jobslink-Auth': `bearer ${token}` + }, + async: false, + success: function (res) { + // console.log(res); + // formattedDateTime = res.data; + // var text = res.data.split("-")[1]; + // if (Number(text) >= 10) { + // $("#btn1").text(text + "月分析"); + // } else { + // $("#btn1").text(text.substring(1, 2) + "月分析"); + // } + }, + }); +} + +// 分行业需求 +function getMapData2() { + $.ajax({ + type: "GET", + headers: { + 'Content-Type': 'application/json', // 指定请求体为JSON格式 + 'Jobslink-Auth': `bearer ${token}` + }, + url: testUrl + "/getMapData2", + async: false, + success: function (res) { + + console.log(res) + }, + }); +} + +function getMapData3() { + $.ajax({ + type: "GET", + headers: { + 'Content-Type': 'application/json', // 指定请求体为JSON格式 + 'Jobslink-Auth': `bearer ${token}` + }, + url: testUrl + "/getMapData3", + async: false, + success: function (res) { + }, + }); +} + +function testData4() { + $.ajax({ + type: "GET", + headers: { + 'Content-Type': 'application/json', // 指定请求体为JSON格式 + 'Jobslink-Auth': `bearer ${token}` + }, + url: testUrl + "/getData1", + data: { date: '2023-10', province: '四川省' }, + async: false, + success: function (res) { + }, + }); +} + +function getIndustryData() { + console.log('6666666666666') + $.ajax({ + type: "GET", + headers: { + 'Content-Type': 'application/json', // 指定请求体为JSON格式 + 'Jobslink-Auth': `bearer ${token}` + }, + url: testUrl + "/getData2", + data: { date: '2023-10', province: '四川省' }, + async: false, + success: function (res) { + console.log('6666666666666') + // data1 岗位数, // data2 求职人数 + console.log(res.data) + var name = res.data.name; + if(name && name.length > 0) { + for(var i = 0; i < name.length; i++) { + console.log(name[i]) + } + } + }, + }); +} + +function testData6() { + $.ajax({ + type: "GET", + headers: { + 'Content-Type': 'application/json', // 指定请求体为JSON格式 + 'Jobslink-Auth': `bearer ${token}` + }, + url: testUrl + "/getData3", + data: { date: '2023-10', province: '四川省' }, + async: false, + success: function (res) { + }, + }); +} + +function testData7() { + $.ajax({ + type: "GET", + headers: { + 'Content-Type': 'application/json', // 指定请求体为JSON格式 + 'Jobslink-Auth': `bearer ${token}` + }, + url: testUrl + "/getData4", + data: { date: '2023-10', province: '四川省' }, + async: false, + success: function (res) { + }, + }); +} + +function testData8() { + $.ajax({ + type: "GET", + headers: { + 'Content-Type': 'application/json', // 指定请求体为JSON格式 + 'Jobslink-Auth': `bearer ${token}` + }, + url: testUrl + "/getData5", + data: { date: '2023-10', province: '四川省' }, + async: false, + success: function (res) { + }, + }); +} + +function testData9() { + $.ajax({ + type: "GET", + headers: { + 'Content-Type': 'application/json', // 指定请求体为JSON格式 + 'Jobslink-Auth': `bearer ${token}` + }, + url: testUrl + "/getData6", + data: { date: '2023-10', province: '四川省' }, + async: false, + success: function (res) { + }, + }); +} + +function testData10() { + $.ajax({ + type: "GET", + headers: { + 'Content-Type': 'application/json', // 指定请求体为JSON格式 + 'Jobslink-Auth': `bearer ${token}` + }, + url: testUrl + "/getData7", + data: { date: '2023-10', province: '四川省' }, + async: false, + success: function (res) { + }, + }); +} + +function testData11() { + $.ajax({ + type: "GET", + headers: { + 'Content-Type': 'application/json', // 指定请求体为JSON格式 + 'Jobslink-Auth': `bearer ${token}` + }, + url: testUrl + "/getData8", + data: { date: '2023-10', province: '四川省' }, + async: false, + success: function (res) { + }, + }); +} //头部数据-------------------------------------- //获取当前时间 @@ -11,7 +216,7 @@ function getDate() { url: baseUrl + "/dataNew/getDate", async: false, success: function (res) { - console.log(res); + // console.log(res); formattedDateTime = res.data; var text = res.data.split("-")[1]; if (Number(text) >= 10) { @@ -352,7 +557,7 @@ function getData1() { function getCityListByProvinceCode(zhName, pyName, name) { console.log(zhName, pyName, name); window.location.href = - "area.html?longnName=" + + "detail.html?longnName=" + escape(zhName) + "&abbreviation=" + pyName + @@ -1416,6 +1621,17 @@ function getData18() { }); } $(function () { + getMapData1(); + getMapData2(); // 分行业 + getMapData3(); + testData4(); + getIndustryData(); + testData6(); + testData7(); + testData8(); + testData9(); + testData10(); + testData11(); getDate(); getData1(); getData2(); diff --git a/src/api/desk/notice.js b/src/api/desk/notice.js index 98790f3..eefdfc0 100644 --- a/src/api/desk/notice.js +++ b/src/api/desk/notice.js @@ -79,3 +79,11 @@ export const getNewsType = () => { method: 'get' }) } + +//获取某省各市区的数据 +export const getMapData = () => { + return request({ + url: '/api/jobslink-api/jkworksreport/getMapData1', + method: 'get' + }) +} diff --git a/src/views/workstation/workbench/index.vue b/src/views/workstation/workbench/index.vue index 382da11..63b855f 100644 --- a/src/views/workstation/workbench/index.vue +++ b/src/views/workstation/workbench/index.vue @@ -24,11 +24,20 @@