diff --git a/src/views/components/showmap.vue b/src/views/components/showmap.vue index db7cf1d..45fc687 100644 --- a/src/views/components/showmap.vue +++ b/src/views/components/showmap.vue @@ -8,6 +8,9 @@ import prefecture from "@/assets/json/prefecture.json"; // import 'echarts/map/js/province/guangdong.js' /*因为echarts 只内置了世界、中国、中国省的地图文件,如果你要使用市级的地图要去找相关的json或者js文件然后在渲染*/ export default { + props:{ + mapData:Array + }, data() { return { //下面是经纬度,用哪个地方的就填哪个地方的就可以 @@ -142,33 +145,11 @@ export default { }, watch: {}, mounted() { + console.log(this.mapData) this.createCharts1(); }, methods: { createCharts1() { - // const convertData = (data) => { - // const res = []; - // for (let i = 0; i < data.length; i++) { - // const dataItem = data[i]; - // const fromCoord = this.geoCoordMap[dataItem[1].name]; // 迁出点 - // const toCoord = this.geoCoordMap[dataItem[0].name]; // 迁入点 - // if (fromCoord && toCoord) { - // // console.log(dataItem) - // res.push([ - // { - // coord: fromCoord, - // value: dataItem[0].value, - // name: dataItem[0].name, - // }, - // { - // coord: toCoord, - // }, - // ]); - // } - // } - - // return res; - // }; var convertData = (data) => { var res = []; for (var i = 0; i < data.length; i++) { @@ -198,9 +179,9 @@ export default { }; var yMax = 0; - for (var j = 0; j < this.chardata1.length; j++) { - if (yMax < this.chardata1[j].value) { - yMax = this.chardata1[j].value; + for (var j = 0; j < this.mapData.length; j++) { + if (yMax < this.mapData[j].value) { + yMax = this.mapData[j].value; } } const series = []; @@ -317,7 +298,7 @@ export default { }, }, }, - data: this.chardata1, + data: this.mapData, } ); }); @@ -331,9 +312,9 @@ export default { // this.myCharts1.resize(); }); var yMax = 0; - for (var j = 0; j < this.chardata1.length; j++) { - if (yMax < this.chardata1[j].value) { - yMax = this.chardata1[j].value; + for (var j = 0; j < this.mapData.length; j++) { + if (yMax < this.mapData[j].value) { + yMax = this.mapData[j].value; } } this.myChart1.hideLoading(); diff --git a/src/views/dashboard/homepage.vue b/src/views/dashboard/homepage.vue index aded199..3599bb4 100644 --- a/src/views/dashboard/homepage.vue +++ b/src/views/dashboard/homepage.vue @@ -102,7 +102,8 @@
- + +
@@ -129,7 +130,6 @@
-
@@ -148,6 +148,7 @@