二级页面接口对接
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
//var baseUrl = 'http://cgsu81beft.51xd.pub';
|
//var baseUrl = 'http://cgsu81beft.51xd.pub';
|
||||||
var baseUrl = "http://39.101.167.152:8088/shekecaiji";
|
var baseUrl = "http://39.101.167.152:8088/shekecaiji";
|
||||||
|
var testUrl = "http://39.98.184.58:8000/jobslink-api/jkworksreport"
|
||||||
|
|
||||||
var href = window.location.href.split("=");
|
var href = window.location.href.split("=");
|
||||||
var shengFen = unescape(href[1].split("&")[0]);
|
var shengFen = unescape(href[1].split("&")[0]);
|
||||||
var pyName = href[2].split("&")[0];
|
var pyName = href[2].split("&")[0];
|
||||||
@@ -7,6 +9,19 @@ var shortName = unescape(href[3]).split("&")[0];
|
|||||||
$("#name").text(shengFen + "劳动力需求大数据平台");
|
$("#name").text(shengFen + "劳动力需求大数据平台");
|
||||||
$("#center_map_name").text(shengFen + "劳动力需求热力图")
|
$("#center_map_name").text(shengFen + "劳动力需求热力图")
|
||||||
|
|
||||||
|
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");
|
||||||
|
|
||||||
//头部数据--------------------------------------
|
//头部数据--------------------------------------
|
||||||
//获取当前时间
|
//获取当前时间
|
||||||
var formattedDateTime;
|
var formattedDateTime;
|
||||||
@@ -112,12 +127,16 @@ function quanGuo(data) {
|
|||||||
function getData5() {
|
function getData5() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: baseUrl + "/dataNew/getData5",
|
url: testUrl + "/getData5",
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json', // 指定请求体为JSON格式
|
||||||
|
'Jobslink-Auth': `bearer ${token}`
|
||||||
|
},
|
||||||
async: true,
|
async: true,
|
||||||
data: { date: formattedDateTime },
|
data: { date: '2023-10', province: '四川省' },
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
//console.log(res);
|
//console.log(res);
|
||||||
if (res.code == "0") {
|
if (res.code == "200") {
|
||||||
var myChart = echarts.init(document.getElementById("echart5"));
|
var myChart = echarts.init(document.getElementById("echart5"));
|
||||||
var option = {
|
var option = {
|
||||||
title: {
|
title: {
|
||||||
@@ -218,12 +237,17 @@ function getData5() {
|
|||||||
function getData7() {
|
function getData7() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: baseUrl + "/dataNew/getData7",
|
url: testUrl + "/getData7",
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json', // 指定请求体为JSON格式
|
||||||
|
'Jobslink-Auth': `bearer ${token}`
|
||||||
|
},
|
||||||
async: true,
|
async: true,
|
||||||
data: { date: formattedDateTime },
|
// data: { date: '2023-10', province: '四川省', city: shengFen }, // 市级暂时没数据
|
||||||
|
data: { date: '2023-10', province: '四川省' },
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
//console.log(res);
|
//console.log(res);
|
||||||
if (res.code == "0") {
|
if (res.code == "200") {
|
||||||
var arr = [];
|
var arr = [];
|
||||||
for (var i = 0; i < res.data.name.length; i++) {
|
for (var i = 0; i < res.data.name.length; i++) {
|
||||||
var obj = {};
|
var obj = {};
|
||||||
@@ -256,16 +280,7 @@ function getData7() {
|
|||||||
itemStyle: {
|
itemStyle: {
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
},
|
},
|
||||||
data: [
|
data: arr,
|
||||||
{ value: 40, name: "rose 1" },
|
|
||||||
{ value: 38, name: "rose 2" },
|
|
||||||
{ value: 32, name: "rose 3" },
|
|
||||||
{ value: 30, name: "rose 4" },
|
|
||||||
{ value: 28, name: "rose 5" },
|
|
||||||
{ value: 26, name: "rose 6" },
|
|
||||||
{ value: 22, name: "rose 7" },
|
|
||||||
{ value: 18, name: "rose 8" },
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
@@ -480,20 +495,24 @@ function getData2() {
|
|||||||
function getData4() {
|
function getData4() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: baseUrl + "/dataNew/getData4",
|
url: testUrl + "/getData6",
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json', // 指定请求体为JSON格式
|
||||||
|
'Jobslink-Auth': `bearer ${token}`
|
||||||
|
},
|
||||||
async: true,
|
async: true,
|
||||||
data: { date: formattedDateTime },
|
data: { date: '2023-10', province: '四川省' },
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
//console.log(res);
|
//console.log(res);
|
||||||
if (res.code == "0") {
|
if (res.code == "200") {
|
||||||
var name = [];
|
// var name = [];
|
||||||
var xq = [];
|
// var xq = [];
|
||||||
var qz = [];
|
// var qz = [];
|
||||||
for (var i = 0; i < res.data.length; i++) {
|
// for (var i = 0; i < res.data.length; i++) {
|
||||||
name.push(res.data[i].name);
|
// name.push(res.data[i].name);
|
||||||
xq.push(res.data[i].xq);
|
// xq.push(res.data[i].xq);
|
||||||
qz.push(res.data[i].qz);
|
// qz.push(res.data[i].qz);
|
||||||
}
|
// }
|
||||||
var myChart = echarts.init(document.getElementById("echart4"));
|
var myChart = echarts.init(document.getElementById("echart4"));
|
||||||
var option = {
|
var option = {
|
||||||
title: {
|
title: {
|
||||||
@@ -519,7 +538,7 @@ function getData4() {
|
|||||||
nameLocation: "end",
|
nameLocation: "end",
|
||||||
nameGap: 7,
|
nameGap: 7,
|
||||||
type: "category",
|
type: "category",
|
||||||
data: name,
|
data: res.data.name,
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
@@ -571,7 +590,7 @@ function getData4() {
|
|||||||
]),
|
]),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data: xq,
|
data: res.data.data1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
@@ -1008,12 +1027,16 @@ function getData11() {
|
|||||||
function getData6() {
|
function getData6() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: baseUrl + "/dataNew/getData6",
|
url: testUrl + "/getData4",
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json', // 指定请求体为JSON格式
|
||||||
|
'Jobslink-Auth': `bearer ${token}`
|
||||||
|
},
|
||||||
async: true,
|
async: true,
|
||||||
data: { date: formattedDateTime },
|
data: { date: '2023-10', province: '四川省' },
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
if (res.code == "0") {
|
if (res.code == "200") {
|
||||||
var myChart = echarts.init(document.getElementById("echart6"));
|
var myChart = echarts.init(document.getElementById("echart6"));
|
||||||
var option = {
|
var option = {
|
||||||
title: {
|
title: {
|
||||||
@@ -1104,12 +1127,16 @@ function getData6() {
|
|||||||
function getData18() {
|
function getData18() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: baseUrl + "/dataNew/getData6",
|
url: testUrl + "/getData3",
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json', // 指定请求体为JSON格式
|
||||||
|
'Jobslink-Auth': `bearer ${token}`
|
||||||
|
},
|
||||||
async: true,
|
async: true,
|
||||||
data: { date: formattedDateTime },
|
data: { date: '2023-10', province: '四川省' },
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
if (res.code == "0") {
|
if (res.code == "200") {
|
||||||
var myChart = echarts.init(document.getElementById("echart8"));
|
var myChart = echarts.init(document.getElementById("echart8"));
|
||||||
var option = {
|
var option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
@@ -1147,7 +1174,7 @@ function getData18() {
|
|||||||
yAxis: {
|
yAxis: {
|
||||||
type: "category",
|
type: "category",
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
data: ["15K以上", "10K-15K", "8K-10K", "5K-8K", "3K-5K", "3K以下"],
|
data: res.data.name,
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
show: true,
|
show: true,
|
||||||
textStyle: { color: "#0072FF", fontSize: "12" },
|
textStyle: { color: "#0072FF", fontSize: "12" },
|
||||||
@@ -1176,7 +1203,7 @@ function getData18() {
|
|||||||
]),
|
]),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data: [0, 20, 40, 60, 80, 100],
|
data: res.data.data1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user