| | |
| | | url: '/api/blade-user/getUserTypeCount', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | export const getMapData = () => { |
| | | return request({ |
| | | url: '/api/blade-user/getUserDistrictTypeCount', |
| | | method: 'get' |
| | | }) |
| | | } |
| | |
| | | import * as echarts from "echarts"; |
| | | |
| | | import geojson from "@/geojson/nanchang.json"; |
| | | import { getList, getSevenDaty, getLeftUp } from "@/api/home/home"; |
| | | import { getList, getSevenDaty, getLeftUp, getMapData } from "@/api/home/home"; |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | // this.onTwoEcharts(); |
| | | this.createechart1(); //建立图表1 |
| | | this.onSixEcharts(); //图表1数据 |
| | | this.createMapJson(); |
| | | // this.createMapJson(); |
| | | this.getLeftUp(); // 左上角数据 |
| | | this.getMapDataMethod(); // 左上角数据 |
| | | }, |
| | | methods: { |
| | | getMapDataMethod() { |
| | | getMapData().then((res) => { |
| | | this.createMapJson(res.data.data); |
| | | }); |
| | | }, |
| | | getLeftUp() { |
| | | (this.leftUp = []), (this.OurNumLeftUp = 0); |
| | | getLeftUp().then((res) => { |
| | |
| | | value: item.num, |
| | | }); |
| | | }); |
| | | // console.log(this.leftUp); |
| | | console.log(d); |
| | | }); |
| | | }, |
| | | getDataSevenDaty() { |
| | |
| | | data.push(d[k].num); |
| | | datax.push(d[k].region); |
| | | } |
| | | // console.log(res, 243423); |
| | | console.log(res, 243423); |
| | | |
| | | var option = { |
| | | tooltip: { |
| | |
| | | }, |
| | | }, |
| | | legend: { |
| | | data: ["注册量", "在线率"], |
| | | // data: ["注册量", "在线率"], |
| | | data: ["注册量"], |
| | | align: "right", |
| | | right: 10, |
| | | textStyle: { |
| | |
| | | }, |
| | | }, |
| | | }, |
| | | { |
| | | type: "value", |
| | | name: "", |
| | | // min: 0, |
| | | // max: 250, |
| | | // interval: 50, |
| | | axisLabel: { |
| | | formatter: "{value} %", |
| | | }, |
| | | position: "right", |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | axisLine: { |
| | | show: false, |
| | | lineStyle: { |
| | | color: "#00c7ff", |
| | | width: 1, |
| | | type: "solid", |
| | | }, |
| | | }, |
| | | max: 100, |
| | | min: 0, |
| | | splitLine: { |
| | | lineStyle: { |
| | | color: "#063374", |
| | | }, |
| | | }, |
| | | }, |
| | | // , |
| | | // { |
| | | // type: "value", |
| | | // name: "", |
| | | // // min: 0, |
| | | // // max: 250, |
| | | // // interval: 50, |
| | | // axisLabel: { |
| | | // formatter: "{value} %", |
| | | // }, |
| | | // position: "right", |
| | | // axisTick: { |
| | | // show: false, |
| | | // }, |
| | | // axisLine: { |
| | | // show: false, |
| | | // lineStyle: { |
| | | // color: "#00c7ff", |
| | | // width: 1, |
| | | // type: "solid", |
| | | // }, |
| | | // }, |
| | | // max: 100, |
| | | // min: 0, |
| | | // splitLine: { |
| | | // lineStyle: { |
| | | // color: "#063374", |
| | | // }, |
| | | // }, |
| | | // }, |
| | | ], |
| | | series: [ |
| | | { |
| | | name: "注册量", |
| | | type: "bar", |
| | | data: [44, 46, 48, 56, 50, 66, 52, 43, 45], |
| | | // data: data, |
| | | // data: [44, 46, 48, 56, 50, 66, 52, 43, 45], |
| | | data: data, |
| | | barWidth: 6, //柱子宽度 |
| | | barGap: 0.4, //柱子之间间距 |
| | | itemStyle: { |
| | |
| | | }, |
| | | }, |
| | | }, |
| | | { |
| | | name: "在线率", |
| | | type: "line", |
| | | data: [50, 54, 58, 55, 65, 72, 44, 55, 58], |
| | | // barWidth: 6, |
| | | // barGap: 0.4, |
| | | yAxisIndex: 1, |
| | | itemStyle: { |
| | | normal: { |
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ |
| | | { |
| | | offset: 0, |
| | | color: "#c4e300", |
| | | }, |
| | | { |
| | | offset: 1, |
| | | color: "#728400", |
| | | }, |
| | | ]), |
| | | opacity: 1, |
| | | }, |
| | | }, |
| | | }, |
| | | // , |
| | | // { |
| | | // name: "在线率", |
| | | // type: "line", |
| | | // // data: [50, 54, 58, 55, 65, 72, 44, 55, 58], |
| | | // // barWidth: 6, |
| | | // // barGap: 0.4, |
| | | // yAxisIndex: 1, |
| | | // itemStyle: { |
| | | // normal: { |
| | | // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ |
| | | // { |
| | | // offset: 0, |
| | | // color: "#c4e300", |
| | | // }, |
| | | // { |
| | | // offset: 1, |
| | | // color: "#728400", |
| | | // }, |
| | | // ]), |
| | | // opacity: 1, |
| | | // }, |
| | | // }, |
| | | // }, |
| | | ], |
| | | }; |
| | | that.echarts1.setOption(option); |
| | | }); |
| | | }, |
| | | |
| | | createMapJson() { |
| | | createMapJson(data2) { |
| | | console.log(data2); |
| | | var ds = { |
| | | 东湖区: {}, |
| | | 西湖区: {}, |
| | | 青云谱区: {}, |
| | | 青山湖区: {}, |
| | | 新建区: {}, |
| | | 红谷滩区: {}, |
| | | 南昌县: {}, |
| | | 安义县: {}, |
| | | 进贤县: {}, |
| | | }; |
| | | var d2 = { |
| | | 东湖区: "", |
| | | 西湖区: "", |
| | | 青云谱区: "", |
| | | 青山湖区: "", |
| | | 新建区: "", |
| | | 红谷滩区: "", |
| | | 南昌县: "", |
| | | 安义县: "", |
| | | 进贤县: "", |
| | | }; |
| | | for (var k in data2) { |
| | | for (var n in ds) { |
| | | if (data2[k].region == n) { |
| | | ds[n] = { |
| | | ...data2[k], |
| | | }; |
| | | d2[n] = data2[k].num; |
| | | } |
| | | } |
| | | } |
| | | console.log(ds); |
| | | var myChart = echarts.init(document.getElementById("draw_yjy")); |
| | | |
| | | //geoCoordMap把所有可能出现的城市加到数组里面 |
| | |
| | | }; |
| | | |
| | | //2014年数据 |
| | | var d2 = { |
| | | 东湖区: 44, |
| | | 西湖区: 46, |
| | | 青云谱区: 48, |
| | | 青山湖区: 56, |
| | | 新建区: 50, |
| | | 红谷滩区: 66, |
| | | 南昌县: 52, |
| | | 安义县: 43, |
| | | 进贤县: 45, |
| | | }; |
| | | |
| | | var colors = [ |
| | | [ |
| | |
| | | let txtCon = |
| | | "<div style='text-align:left;' >" + |
| | | p.name + |
| | | ":<br />用户数:" + |
| | | "<br />用户数:" + |
| | | d2[p.name] + |
| | | "<br />治保会队伍:" + |
| | | ds[p.name].zbh + |
| | | "<br />内保干部队伍:" + |
| | | ds[p.name].nbgb + |
| | | "<br />治安巡防队伍:" + |
| | | ds[p.name].zaxf + |
| | | "<br />信息员队伍:" + |
| | | ds[p.name].xxy + |
| | | "<br />保安员队伍:" + |
| | | ds[p.name].bay + |
| | | "<br />警务辅助队伍:" + |
| | | ds[p.name].jwfz + |
| | | "</div>"; |
| | | return txtCon; |
| | | }, |