|
@@ -5,22 +5,26 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getRiskTrendData } from "./api";
|
|
|
+import { getAreaData } from "./api";
|
|
|
import bazhong from "./baZhongMap.json";
|
|
|
import { store } from "@/store";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ year: 2024,
|
|
|
xData: [],
|
|
|
yData: [],
|
|
|
mapList: ["南江县", "通江县", "平昌县", "巴州区", "恩阳区"],
|
|
|
curIndex: 0,
|
|
|
+ curArea: {},
|
|
|
intervalId: null,
|
|
|
time: 3000,
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- // this.getChartData();
|
|
|
+ const { curArea } = store.getters;
|
|
|
+ this.curArea = curArea;
|
|
|
+ this.getChartData();
|
|
|
this.initChart();
|
|
|
},
|
|
|
unmounted() {
|
|
@@ -28,14 +32,21 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
getChartData() {
|
|
|
- getRiskTrendData.getList().then((res) => {
|
|
|
- const { code, result } = res.data;
|
|
|
- if (code === 200) {
|
|
|
- this.xData = result.xaxisData;
|
|
|
- this.yData = result.yaxisData;
|
|
|
- this.initChart();
|
|
|
- }
|
|
|
- console.log(res, "data");
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
initChart() {
|
|
@@ -47,7 +58,8 @@ export default {
|
|
|
trigger: "item",
|
|
|
formatter(param) {
|
|
|
console.log("param.data.name", param);
|
|
|
- return `${param.data.name}<br>受理量:${param.data.value}<br>交办量:${param.data.value}`;
|
|
|
+ // return `${param.data.name}<br>受理量:${param.data.name}<br>交办量:${param.data.name}`;
|
|
|
+ return `${param.data.name}`;
|
|
|
},
|
|
|
},
|
|
|
series: [
|
|
@@ -184,6 +196,8 @@ export default {
|
|
|
this.curIndex++;
|
|
|
this.curIndex = this.curIndex % this.mapList.length;
|
|
|
|
|
|
+ store.dispatch("SetCurArea", this.mapList[this.curIndex]);
|
|
|
+
|
|
|
if (this.curIndex == 0) {
|
|
|
this.cancelHighlightRegion(this.mapList.lengt - 1);
|
|
|
} else {
|