浏览代码

修改通视产生的问题

lkk 11 月之前
父节点
当前提交
4535c25d01
共有 1 个文件被更改,包括 13 次插入4 次删除
  1. 13 4
      src/components/3DAnalysis/SightLine/SightLine.vue

+ 13 - 4
src/components/3DAnalysis/SightLine/SightLine.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <div v-show="sightlineComb">
+  <div v-if="sightlineComb">
     <div class="sm-function-module-content">
     <div class="sm-function-module-content">
       <div class="sm-point"></div>
       <div class="sm-point"></div>
       <label class="sm-function-module-sub-section-setting">{{
       <label class="sm-function-module-sub-section-setting">{{
@@ -86,6 +86,7 @@ export default {
   name: "Sm3dSightline",
   name: "Sm3dSightline",
   data() {
   data() {
     return {
     return {
+      inited: false,
       sharedState: store.state,
       sharedState: store.state,
       viewPosition: [],
       viewPosition: [],
       HandlerFlag: true,
       HandlerFlag: true,
@@ -101,6 +102,7 @@ export default {
       highlightBarrierColor: "rgba(255, 186, 1, 1)",
       highlightBarrierColor: "rgba(255, 186, 1, 1)",
       highlightBarrier: false,
       highlightBarrier: false,
       isDestroyFlag: true,
       isDestroyFlag: true,
+      inited: false,
     };
     };
   },
   },
   computed: {
   computed: {
@@ -124,9 +126,9 @@ export default {
     }
     }
   },
   },
   mounted() {
   mounted() {
-    if (this.analysisShow && this.sightlineComb) {
-      this.init();
-    }
+    // if (this.sightlineComb && this.analysisShow) {
+    //   this.init();
+    // }
   },
   },
   methods: {
   methods: {
     init() {
     init() {
@@ -279,6 +281,13 @@ export default {
         this.init();
         this.init();
       }
       }
     },
     },
+    analysisShow(val) {
+      if (!this.inited) {
+        this.inited = !this.inited;
+        this.init()
+      }
+
+    },
     visibleColor: function (newValue) {
     visibleColor: function (newValue) {
       if (this.flag) {
       if (this.flag) {
         let color = Cesium.Color.fromCssColorString(newValue);
         let color = Cesium.Color.fromCssColorString(newValue);