xieqy 3 tahun lalu
induk
melakukan
da13aac30c

+ 7 - 6
src/views/groupPage/components/ComMapBox.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="widget-ComMapBox" ref="widget-ComMapBox">
+  <div class="widget-ComMapBox" :class="`widget-ComMapBox-${id}`" :ref="`widget-ComMapBox-${id}`">
     <slot />
   </div>
 </template>
@@ -10,22 +10,23 @@ const Cesium = (window as any).Cesium
 //公共弹窗载体
 @Component({ name: 'ComMapBox' })
 export default class ComMapBox extends Vue {
+  @Prop({ type: String }) id!: string
   viewer
   _renderCallback = null
   isExist = null
   mounted() {
     this.viewer = (window as any).viewer
-    this.initBox()
+    // this.initBox()
   }
   get boxTarget() {
-    return this.$refs['widget-ComMapBox'] as any
+    return this.$refs[`widget-ComMapBox-${this.id}`] as any
   }
   get mapContainerId() {
     return this.$store.state.bigScreen.mapContainerId
   }
   //初始化
   initBox() {
-    this.remove()
+    // this.remove()
     this.isExist = document.querySelector('#' + this.mapContainerId).appendChild(this.boxTarget)
   }
   //设置位置
@@ -46,8 +47,8 @@ export default class ComMapBox extends Vue {
       this._renderCallback()
       this._renderCallback = null
     }
-    if (document.querySelector('.widget-ComMapBox')) {
-      document.querySelector('.widget-ComMapBox').remove()
+    if (document.querySelector(`.widget-ComMapBox-${this.id}`)) {
+      document.querySelector(`.widget-ComMapBox-${this.id}`).remove()
       this.isExist = null
     }
   }

+ 1 - 0
src/views/groupPage/districtPageModules/commonModules/SearchBox.vue

@@ -430,6 +430,7 @@ export default class SearchBox extends Vue {
     const searchInfoConstructor = Vue.extend(SearchInfo)
     let searinfoModule = new searchInfoConstructor({
       data: {
+        id: options.name.replaceAll('.', ''),
         options
       },
       store: this.$store

+ 1 - 1
src/views/groupPage/districtPageModules/customTools/infoComponents/projectInfo.vue

@@ -1,5 +1,5 @@
 <template>
-  <ComMapBox ref="ComMapBox">
+  <ComMapBox ref="ComMapBox" :id="'projectInfo'">
     <ComCardBox @close="close()" :styleData="cardStyle">
       <div class="widget-projectInfo">
         <div class="header">

+ 2 - 1
src/views/groupPage/districtPageModules/customTools/infoComponents/serachInfo.vue

@@ -1,5 +1,5 @@
 <template>
-  <ComMapBox ref="ComMapBox">
+  <ComMapBox ref="ComMapBox" :id="id">
     <div class="widget-serachInfo">
       <div class="header">
         <div class="name">{{ roadName }}</div>
@@ -33,6 +33,7 @@ export default class serachInfo extends Vue {
   roadName = null
   percent = null
   options = null
+  id = null
   mounted() {
     this.viewer = (window as any).viewer
     // this.close() //初始不显示