Pārlūkot izejas kodu

修改通视产生的问题

lkk 11 mēneši atpakaļ
vecāks
revīzija
4535c25d01
1 mainītis faili ar 13 papildinājumiem un 4 dzēšanām
  1. 13 4
      src/components/3DAnalysis/SightLine/SightLine.vue

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

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