diff --git a/src/views/dataBoard/overview/index.vue b/src/views/dataBoard/overview/index.vue index 5d1c9e26d..a9062cf76 100644 --- a/src/views/dataBoard/overview/index.vue +++ b/src/views/dataBoard/overview/index.vue @@ -23,7 +23,7 @@
- +
@@ -163,6 +163,8 @@ export default { orgData: { children: [], }, //当前组织对象 + showMap:false, + orgId: "", orgLevel: "", currentLevel: "", @@ -227,7 +229,21 @@ export default { this.changeCustomerName(); this.getMapData(); }, + beforeRouteEnter(to, from, next) { + next(vm => { + // 设置 showMap 为 true,表示要显示地图 + vm.showMap = true; + console.log(vm); + console.log(vm.showMap); + }); + }, + beforeRouteLeave(to, from, next) { + // 离开当前路由时,重置 showMap 为 false,表示要隐藏地图 + this.showMap = false; + console.log(this.showMap); + next(); + }, watch: { "$store.state.chooseArea.chooseName"(val) { if (val.orgId) {