From bbd3b80bcaf52cb4330c0708acb5b20f94ba38a9 Mon Sep 17 00:00:00 2001 From: zxy <353513737@qq.com> Date: Sat, 10 Feb 2024 23:49:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/chengdu/js/index.js | 73 +++++++++----------------------------- 1 file changed, 17 insertions(+), 56 deletions(-) diff --git a/public/chengdu/js/index.js b/public/chengdu/js/index.js index 7c69baa..36608bb 100644 --- a/public/chengdu/js/index.js +++ b/public/chengdu/js/index.js @@ -442,12 +442,16 @@ function getData5() { function getData7() { $.ajax({ type: "GET", - url: baseUrl + "/dataNew/getData7", + url: testUrl + "/getData7", + headers: { + 'Content-Type': 'application/json', // 指定请求体为JSON格式 + 'Jobslink-Auth': `bearer ${token}` + }, async: true, - data: { date: formattedDateTime }, + data: { date: '2023-10', province: '四川省' }, success: function (res) { //console.log(res); - if (res.code == "0") { + if (res.code == "200") { var arr = []; for (var i = 0; i < res.data.name.length; i++) { var obj = {}; @@ -456,44 +460,6 @@ function getData7() { arr.push(obj); } var myChart = echarts.init(document.getElementById("echart7")); - // var option = { - // title: { - // text: "分产业招聘需求", - // subtext: "", - // left: "center", - // textStyle: { fontSize: 13, color: "#fff", fontWeight: 400 }, - // }, - // legend: { - // orient: "vertical", - // left: "left", - // textStyle: { color: "#fff", fontSize: 10 }, - // }, - // series: [ - // { - // name: "", - // type: "pie", - // color: [ - // "#45C2E0", - // "#C1EBDD", - // "#FFC851", - // "#DA5476", - // "#1869A0", - // "#FF9393", - // ], - // radius: "50%", - // data: arr, - // label: { normal: { show: true, formatter: "{b}:{c}万人" } }, - // center: ["50%", "60%"], - // emphasis: { - // itemStyle: { - // shadowBlur: 10, - // shadowOffsetX: 0, - // shadowColor: "rgba(0, 0, 0, 0.5)", - // }, - // }, - // }, - // ], - // }; var option = { legend: { top: "bottom", @@ -518,16 +484,7 @@ function getData7() { itemStyle: { borderRadius: 8, }, - data: [ - { 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" }, - ], + data: arr, }, ], }; @@ -1548,12 +1505,16 @@ function getData6() { function getData18() { $.ajax({ type: "GET", - url: baseUrl + "/dataNew/getData6", + url: testUrl + "/getData3", + headers: { + 'Content-Type': 'application/json', // 指定请求体为JSON格式 + 'Jobslink-Auth': `bearer ${token}` + }, async: true, - data: { date: formattedDateTime }, + data: { date: '2023-10', province: '四川省' }, success: function (res) { console.log(res); - if (res.code == "0") { + if (res.code == "200") { var myChart = echarts.init(document.getElementById("echart8")); var option = { tooltip: { @@ -1591,7 +1552,7 @@ function getData18() { yAxis: { type: "category", axisTick: { show: false }, - data: ["15K以上", "10K-15K", "8K-10K", "5K-8K", "3K-5K", "3K以下"], + data: res.data.name, axisLabel: { show: true, textStyle: { color: "#0072FF", fontSize: "12" }, @@ -1620,7 +1581,7 @@ function getData18() { ]), }, }, - data: [0, 20, 40, 60, 80, 100], + data: res.data.data1, }, ], };