地图点击下钻详情页面

This commit is contained in:
zxy
2024-02-09 14:31:27 +08:00
parent 6d6875a63c
commit 297902393e
4 changed files with 237 additions and 64 deletions

View File

@@ -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();