Browse Source

地图修改

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

128
src/views/Brand.vue

@ -210,8 +210,44 @@ export default {
mounted() {
this.nowTimes();
this.getEchart();
this.ajax2();
},
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() {
this.clear();
let dayjs = this.dayjs()
@ -376,49 +412,49 @@ export default {
["北京", this.YCData]
].forEach((item, i) => {
series.push(
{
name: item[0] + " Top3",
type: "lines",
zlevel: 1,
effect: {
show: true,
period: 6,
trailLength: 0.7,
color: "red", //arrow
symbolSize: 3
},
// {
// name: item[0] + " Top3",
// type: "lines",
// zlevel: 1,
// effect: {
// show: true,
// period: 6,
// trailLength: 0.7,
// color: "red", //arrow
// symbolSize: 3
// },
// // lineStyle: {
// // normal: {
// // color: color[i],
// // width: 0,
// // curveness: 0.2
// // }
// // },
// data: this.convertData(item[1])
// },
// {
// name: item[0] + " Top3",
// type: "lines",
// zlevel: 2,
// symbol: ["none", "arrow"],
// symbolSize: 10,
// effect: {
// show: true,
// period: 6,
// trailLength: 0,
// symbol: planePath,
// symbolSize: 15
// },
// lineStyle: {
// normal: {
// color: color[i],
// width: 0,
// width: 1,
// opacity: 0.6,
// curveness: 0.2
// }
// },
data: this.convertData(item[1])
},
{
name: item[0] + " Top3",
type: "lines",
zlevel: 2,
symbol: ["none", "arrow"],
symbolSize: 10,
effect: {
show: true,
period: 6,
trailLength: 0,
symbol: planePath,
symbolSize: 15
},
lineStyle: {
normal: {
color: color[i],
width: 1,
opacity: 0.6,
curveness: 0.2
}
},
data: this.convertData(item[1])
},
// data: this.convertData(item[1])
// },
{
name: item[0] + " Top3",
type: "effectScatter",
@ -502,10 +538,26 @@ export default {
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", () => {
myChart.resize();
});
}
},
clickGoNext() {
},
},
beforeDestroy() {
this.clear();

20
vue.config.js

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

Loading…
Cancel
Save