Browse Source

地图修改

master
j1ack 3 years ago
parent
commit
ea9c640eca
  1. 140
      src/views/Brand.vue
  2. 20
      vue.config.js

140
src/views/Brand.vue

@ -210,8 +210,44 @@ export default {
mounted() { mounted() {
this.nowTimes(); this.nowTimes();
this.getEchart(); this.getEchart();
this.ajax2();
}, },
methods: { methods: {
ajax2() {
//jquery get
$.ajax({
type:"GET",
url:"http://192.168.31.128:8866/pk/openup/OpenStatisticsController/parkingRanking",
data:{"authCode":"712110694681677824"},
async:true,
cache:true,
dataType:"text",
success:function (backdata,status,xmlHttpRequest) {
console.log(backdata)
},
error:function (msg) {
console.log(msg)
}
});
//jquery get
$.ajax({
type:"GET",
url:"http://192.168.31.128:8866/pk/openup/OpenStatisticsController/todayTrafficStatistics",
data:{"authCode":"712110694681677824"},
async:true,
cache:true,
dataType:"text",
success:function (backdata,status,xmlHttpRequest) {
console.log(backdata)
},
error:function (msg) {
console.log(msg)
}
});
},
nowTimes() { nowTimes() {
this.clear(); this.clear();
let dayjs = this.dayjs() let dayjs = this.dayjs()
@ -376,49 +412,49 @@ export default {
["北京", this.YCData] ["北京", this.YCData]
].forEach((item, i) => { ].forEach((item, i) => {
series.push( series.push(
{ // {
name: item[0] + " Top3", // name: item[0] + " Top3",
type: "lines", // type: "lines",
zlevel: 1, // zlevel: 1,
effect: { // effect: {
show: true, // show: true,
period: 6, // period: 6,
trailLength: 0.7, // trailLength: 0.7,
color: "red", //arrow // color: "red", //arrow
symbolSize: 3 // symbolSize: 3
}, // },
// lineStyle: { // // lineStyle: {
// normal: { // // normal: {
// color: color[i], // // color: color[i],
// width: 0, // // width: 0,
// curveness: 0.2 // // curveness: 0.2
// } // // }
// }, // // },
data: this.convertData(item[1]) // data: this.convertData(item[1])
}, // },
{ // {
name: item[0] + " Top3", // name: item[0] + " Top3",
type: "lines", // type: "lines",
zlevel: 2, // zlevel: 2,
symbol: ["none", "arrow"], // symbol: ["none", "arrow"],
symbolSize: 10, // symbolSize: 10,
effect: { // effect: {
show: true, // show: true,
period: 6, // period: 6,
trailLength: 0, // trailLength: 0,
symbol: planePath, // symbol: planePath,
symbolSize: 15 // symbolSize: 15
}, // },
lineStyle: { // lineStyle: {
normal: { // normal: {
color: color[i], // color: color[i],
width: 1, // width: 1,
opacity: 0.6, // opacity: 0.6,
curveness: 0.2 // curveness: 0.2
} // }
}, // },
data: this.convertData(item[1]) // data: this.convertData(item[1])
}, // },
{ {
name: item[0] + " Top3", name: item[0] + " Top3",
type: "effectScatter", type: "effectScatter",
@ -502,10 +538,26 @@ export default {
myChart.setOption(option, true); myChart.setOption(option, true);
var that = this;
var dataList = echarts.getMap("china").geoJson.features;
// console.log("dataList:", dataList);
//
myChart.on("click", function (res) {
console.log("click city:", res.name);
dataList.forEach((element) => {
if (element.properties.name == res.name) {
console.log("city code:", element.id);
}
});
});
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
myChart.resize(); myChart.resize();
}); });
} },
clickGoNext() {
},
}, },
beforeDestroy() { beforeDestroy() {
this.clear(); this.clear();

20
vue.config.js

@ -6,16 +6,16 @@ module.exports = {
devServer: { devServer: {
open: true, open: true,
port: 8081, port: 8081,
// proxy: { proxy: {
// "/api": { "/api": {
// target: "https://api.github.com", target: "https://api.github.com",
// changeOrigin: true, changeOrigin: true,
// ws: false, ws: false,
// pathRewrite: { pathRewrite: {
// "^/api": "" "^/api": ""
// } }
// } }
// } }
}, },
configureWebpack: { configureWebpack: {
// 把原本需要写在webpack.config.js中的配置代码 写在这里 会自动合并 // 把原本需要写在webpack.config.js中的配置代码 写在这里 会自动合并

Loading…
Cancel
Save