|
|
@@ -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
|
|
|
}
|
|
|
}
|