Browse Source

使用store存储XbsjEarthUI

master
DIAMOND 9 months ago
parent
commit
42c9f118ff
  1. 1
      src/store/modules/earthMap.ts
  2. 2608
      src/views/earthMap/edit/EarthComp copy.vue
  3. 22
      src/views/earthMap/edit/EarthComp.vue
  4. 1904
      src/views/earthMap/edit/EarthCompTest.vue
  5. 23
      src/views/military/modules/earthMap/scene/model/sceneInfo/SenceInfo.vue

1
src/store/modules/earthMap.ts

@ -20,6 +20,7 @@ export const useEarthMapStore = defineStore({
shapeShowList: <any>[], //绘画存储(临时)
keyAreaPos: <number[][]>[], //记录创建防区的点位,重点管控区域
shipDataList: <any>[], //船只数据列表
xbsjEarthUI: <any>null, //XbsjEarthUI
}),
getters: {
getCustomPrimitiveList(): any {

2608
src/views/earthMap/edit/EarthComp copy.vue

File diff suppressed because it is too large

22
src/views/earthMap/edit/EarthComp.vue

@ -116,6 +116,7 @@
import circleDot1 from '@/assets/earthMap/circleDot1.png';
import circleDot3 from '@/assets/earthMap/circleDot3.png';
import ship from '@/assets/images/ship.png';
import { onBeforeUnmount } from 'vue';
class HandleNodeType {
#sn;
@ -528,6 +529,8 @@
createEarth() {
let that = this;
//使storeXbsjEarthUI
this.store.xbsjEarthUI = XbsjEarthUI;
XbsjEarthUI.create('earthContainer').then(async (earthUI: any) => {
//
window.$uia = earthUI;
@ -4188,6 +4191,8 @@
//
beforeDestroy() {
// vue
console.log("vue程序销毁");
this._earth = this._earth && this._earth.destroy();
this.websocketclose();
//
@ -4195,6 +4200,23 @@
clearInterval(this.timer2);
clearInterval(this.alarmTrackClearTimer);
}
//
destroy(){
// vue
console.log("vue程序销毁",this._earth);
// this.websocketclose();
//
clearInterval(this.timer);
clearInterval(this.timer2);
clearInterval(this.alarmTrackClearTimer);
// window.$uia.tools.sceneTree.destroy()
// this._earth = this._earth && this._earth.destroy();
//store.xbsjEarthUI window.XbsjEarthUI
window.XbsjEarthUI = this.store.xbsjEarthUI
this._earth = undefined;
}
}
</script>

1904
src/views/earthMap/edit/EarthCompTest.vue

File diff suppressed because it is too large

23
src/views/military/modules/earthMap/scene/model/sceneInfo/SenceInfo.vue

@ -119,13 +119,13 @@
title="拾取中心坐标和相机数据"
:visible="mapVisible"
@ok="handleOk"
@cancel="()=> mapVisible = false"
@cancel="destroyed"
width="60vw"
:destroyOnClose="true"
destroyOnClose
wrapClassName="EarthMap">
<a-row>
<a-row style="height: 60vh;">
<a-col :span="24">
<EarthComp />
<EarthComp ref="earth"/>
</a-col>
</a-row>
@ -135,13 +135,26 @@
</div>
</template>
<script setup>
import { toRefs, ref, watch, computed, onMounted } from 'vue';
import { toRefs, ref, watch, computed, onMounted, nextTick } from 'vue';
import locationPng from '@/assets/images/getLocation.png';
import EarthMapModal from '../MapModel/EarthMapModal.vue';
import { defHttp } from '@/utils/http/axios';
import { message } from 'ant-design-vue';
import { EditOutlined } from '@ant-design/icons-vue';
import EarthComp from '@/views/earthMap/edit/EarthComp.vue';
// import EarthComp from '@/views/earthMap/edit/EarthCompTest.vue';
const earth = ref()
function destroyed() {
console.log("earth",earth.value);
earth.value.destroy();
nextTick(()=>{
mapVisible.value = false
})
}
//
const addScene = (params) => {

Loading…
Cancel
Save