Browse Source

xzqh开关

zpf 1 year ago
parent
commit
3cacf591e1

+ 17 - 2
src/components/Combinations/toolBar/toolBar.vue

@@ -1,7 +1,7 @@
 <template>
   <!-- 暂时隐藏工具栏 -->
   <!-- <div v-show="ToolBarShow"> -->
-    <div v-if="true">
+  <div v-if="true">
 
     <!-- <div class="resourceTree" @click="choose(0)"></div> -->
     <div class="toolBar">
@@ -46,6 +46,9 @@
       <li class="sm-btn sm-tool-btn" :title="Resource.sceneOptions" @click="choose(3)">
         <i class="el-icon-setting"></i>
       </li>
+      <li class="sm-btn sm-tool-btn" title="行政区划开关" @click="choose(11)">
+        <i class="el-icon-map-location"></i>
+      </li>
       <!-- </ul> -->
       <div style="display: none" class="sm-tool-btn" @click="toggleVisibility" :class="{ 'sm-tool-btn-only': !show }">
         <span class="iconfont" :class="!show
@@ -82,6 +85,8 @@
 import clickQuery from "../../Query/clickQuery/clickQuery.vue";
 import { GetXzqhTree, GetXzqhGeom } from "@/api/map";
 import Bookmark from "../../Bookmark/Bookmark.vue";
+import * as cockpit from "@/common/js/cockpit.js";
+
 export default {
   components: { clickQuery, Bookmark },
   name: "ToolBar",
@@ -245,7 +250,17 @@ export default {
       this.show = !this.show;
     },
     choose(i) {
-      store.setToolBarAction(i);
+      console.log('i: ', i);
+      if (i == 11) {
+        store.state.xzqh_flag = !store.state.xzqh_flag
+        // 隐藏行政区划console.log();
+        cockpit.hidden_xzqh(!store.state.xzqh_flag);
+        // 隐藏墙体
+        cockpit.hidden_wall(!store.state.xzqh_flag);
+      } else {
+        store.setToolBarAction(i);
+
+      }
     },
   },
   watch: {

+ 1 - 0
src/store/store.js

@@ -41,6 +41,7 @@ var store2 = {
         flattenNames: [],//存储压平的名称数组
         cockpit_date: null,
         viewer_flag: true,
+        xzqh_flag: true,
         cockpit_wpjg: {
             title: {},
             echart: {}

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

@@ -39,6 +39,7 @@
 
 <script>
 //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+import * as cockpit from "@/common/js/cockpit.js";
 
 export default {
     components: {},
@@ -84,7 +85,8 @@ export default {
     methods: {
         draw_vector() {
             this.icon_switch = !this.icon_switch
-            this.$emit('draw_vector',this.icon_switch)
+            this.$emit('draw_vector', this.icon_switch)
+
         },
         init_dial_watch(echart_data) {
             var myChart = echarts.init(this.$refs.dial_watch_scjg);

+ 4 - 4
src/views/viewer.vue

@@ -82,10 +82,10 @@ export default {
             store.setToolBarShow(!store.state.viewer_flag);
             // store.setToolBarShow(true);
 
-            // 隐藏行政区划
-            cockpit.hidden_xzqh(store.state.viewer_flag);
-            // 隐藏墙体
-            cockpit.hidden_wall(store.state.viewer_flag);
+            // // 隐藏行政区划
+            // cockpit.hidden_xzqh(store.state.viewer_flag);
+            // // 隐藏墙体
+            // cockpit.hidden_wall(store.state.viewer_flag);
         },
         switch() {
             this.flag = !this.flag;