|
@@ -16,16 +16,13 @@ export default {
|
|
|
yData: [],
|
|
|
mapList: ["南江县", "通江县", "平昌县", "巴州区", "恩阳区"],
|
|
|
curIndex: 0,
|
|
|
- curArea: {},
|
|
|
intervalId: null,
|
|
|
time: 3000,
|
|
|
+ areaDataList: [],
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- const { curArea } = store.getters;
|
|
|
- this.curArea = curArea;
|
|
|
this.getChartData();
|
|
|
- this.initChart();
|
|
|
},
|
|
|
unmounted() {
|
|
|
clearInterval(this.intervalId);
|
|
@@ -34,20 +31,25 @@ export default {
|
|
|
getChartData() {
|
|
|
const now = new Date();
|
|
|
this.year = now.getFullYear();
|
|
|
- this.mapList.forEach((item) => {
|
|
|
- getAreaData
|
|
|
- .getList({
|
|
|
- districtName: item,
|
|
|
- year: this.year,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- const { code, result } = res.data;
|
|
|
- if (code === 200) {
|
|
|
- console.log(result, "data");
|
|
|
- store.dispatch("SetAreaDataList", result);
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
+ getAreaData
|
|
|
+ .getList({
|
|
|
+ year: this.year,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ const { code, result } = res.data;
|
|
|
+ if (code === 200) {
|
|
|
+ this.areaDataList = result.map((item) => {
|
|
|
+ return {
|
|
|
+ name: item.districtName,
|
|
|
+ value: this.mapList.indexOf(item.districtName),
|
|
|
+ acceptCount: item.acceptCount,
|
|
|
+ processCount: item.processCount,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.areaDataList.push({ name: "市本级", value: 5 });
|
|
|
+ this.initChart();
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
initChart() {
|
|
|
this.myChart = this.$echarts.init(document.getElementById("map"));
|
|
@@ -58,8 +60,8 @@ export default {
|
|
|
trigger: "item",
|
|
|
formatter(param) {
|
|
|
console.log("param.data.name", param);
|
|
|
- // return `${param.data.name}<br>受理量:${param.data.name}<br>交办量:${param.data.name}`;
|
|
|
- return `${param.data.name}`;
|
|
|
+ return `${param.data.name}<br>受理量:${param.data.acceptCount}<br>交办量:${param.data.processCount}`;
|
|
|
+ // return `${param.data.name}`;
|
|
|
},
|
|
|
},
|
|
|
series: [
|
|
@@ -98,14 +100,7 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
- data: [
|
|
|
- { name: "南江县", value: 0 },
|
|
|
- { name: "通江县", value: 1 },
|
|
|
- { name: "平昌县", value: 2 },
|
|
|
- { name: "巴州区", value: 3 },
|
|
|
- { name: "恩阳区", value: 4 },
|
|
|
- { name: "市本级", value: 5 },
|
|
|
- ],
|
|
|
+ data: this.areaDataList,
|
|
|
label: {
|
|
|
// 高亮效果(hover)
|
|
|
emphasis: {
|
|
@@ -196,7 +191,7 @@ export default {
|
|
|
this.curIndex++;
|
|
|
this.curIndex = this.curIndex % this.mapList.length;
|
|
|
|
|
|
- store.dispatch("SetCurArea", this.mapList[this.curIndex]);
|
|
|
+ store.dispatch("SetCurArea", this.curIndex);
|
|
|
|
|
|
if (this.curIndex == 0) {
|
|
|
this.cancelHighlightRegion(this.mapList.lengt - 1);
|
|
@@ -205,13 +200,8 @@ export default {
|
|
|
}
|
|
|
|
|
|
this.highlightRegion(this.curIndex);
|
|
|
-
|
|
|
- this.refreshData();
|
|
|
}, this.time);
|
|
|
},
|
|
|
- refreshData() {
|
|
|
- store.dispatch("SetNewData");
|
|
|
- },
|
|
|
},
|
|
|
};
|
|
|
</script>
|