|
@@ -4,7 +4,9 @@
|
|
|
<el-date-picker v-model="year" type="year" placeholder="选择年">
|
|
|
</el-date-picker>
|
|
|
<el-button type="primary" style="margin-left: 4px">导出</el-button>
|
|
|
- <el-button @click="back" type="text">返回></el-button>
|
|
|
+ <el-button @click="back" type="text" v-if="currentMap != '衡阳市'"
|
|
|
+ >返回></el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
<div style="display: flex; justify-content: space-between; height: 100%">
|
|
|
<div id="hy-map" style="width: 65%; height: 97%"></div>
|
|
@@ -42,13 +44,15 @@ export default {
|
|
|
year: "2024",
|
|
|
loading: true,
|
|
|
itemData: [{}, {}, {}, {}],
|
|
|
+ currentMap: "",
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.initCharts();
|
|
|
+ this.back();
|
|
|
},
|
|
|
methods: {
|
|
|
back() {
|
|
|
+ this.currentMap = "衡阳市";
|
|
|
this.initCharts();
|
|
|
},
|
|
|
initCharts(json = require("./衡阳市.json")) {
|
|
@@ -141,7 +145,7 @@ export default {
|
|
|
emphasis: {
|
|
|
show: true,
|
|
|
textStyle: {
|
|
|
- color: "#000",
|
|
|
+ color: "#fff", // 悬浮文字颜色
|
|
|
},
|
|
|
},
|
|
|
},
|
|
@@ -165,7 +169,7 @@ export default {
|
|
|
color: "#fff",
|
|
|
},
|
|
|
itemStyle: {
|
|
|
- areaColor: "rgba(11,42,96,0.8)",
|
|
|
+ areaColor: "#5a6fc0", // 选中的区域颜色
|
|
|
},
|
|
|
},
|
|
|
data: [],
|
|
@@ -173,8 +177,11 @@ export default {
|
|
|
],
|
|
|
};
|
|
|
myChart.setOption(option);
|
|
|
+ window.addEventListener("resize", () => {
|
|
|
+ myChart.resize();
|
|
|
+ });
|
|
|
myChart.on("click", (params) => {
|
|
|
- console.log(params, "params");
|
|
|
+ this.currentMap = params.name;
|
|
|
this.initCharts(mapEnum[params.name]);
|
|
|
});
|
|
|
},
|