zpf 1 年間 前
コミット
e5d98a32de

+ 3 - 1
src/components/Combinations/toolBar/toolBar.vue

@@ -251,7 +251,9 @@ export default {
     },
     choose(i) {
       if (i == 12) {
-        store.state.xzqh_flag = !store.state.xzqh_flag
+        
+        store.setXzqh_flag(!store.state.xzqh_flag);
+
         // 隐藏行政区划console.log();
         cockpit.hidden_xzqh(store.state.xzqh_flag);
         // 隐藏墙体

+ 5 - 1
src/store/store.js

@@ -42,7 +42,7 @@ var store2 = {
         cockpit_date: null,
         viewer_flag: true,
         xzqh_flag: true,
-        query_pick_pane:[],
+        query_pick_pane: [],
         query_pick_last_pane: null,
 
         cockpit_wpjg: {
@@ -261,6 +261,10 @@ var store2 = {
     setIsNightSwitch(newValue) {
         this.state.isNightSwitch = newValue;
     },
+
+    setXzqh_flag(newValue) {
+        this.state.xzqh_flag = newValue;
+    },
 }
 
 

+ 3 - 0
src/views/cockpit/common/DialWatch.vue

@@ -87,6 +87,9 @@ export default {
             this.icon_switch = !this.icon_switch
             this.$emit('draw_vector', this.icon_switch)
 
+            store.setViewerFlagb(false);
+            store.setToolBarShow(false);
+            store.setXzqh_flag(false);
         },
         init_dial_watch(echart_data) {
             var myChart = echarts.init(this.$refs.dial_watch_scjg);

+ 1 - 0
src/views/cockpit/wpjg.vue

@@ -59,6 +59,7 @@ export default {
     switch_xzqh(value) {
       if (value.id == '4602') {
         this.xzqh_flag = true
+        
       } else {
         this.xzqh_flag = false
       }

+ 20 - 2
src/views/viewer.vue

@@ -72,9 +72,27 @@ export default {
         };
     },
     //监听属性 类似于data概念
-    computed: {},
+    computed: {
+        isViewer_flag() {
+            return store.state.viewer_flag;  //需要监听的数据
+        },
+        isxzqh_flag() {
+            return store.state.xzqh_flag;  //需要监听的数据
+        },
+    },
     //监控data中的数据变化
-    watch: {},
+    watch: {
+
+        isViewer_flag(newVal, oldVal) { console.log(newVal, oldVal); },
+
+        isxzqh_flag(newVal, oldVal) {
+            
+            cockpit.hidden_xzqh(newVal);
+            cockpit.hidden_wall(newVal);
+
+        }
+
+    },
     //方法集合
     methods: {
         bigViewerChange() {