Browse Source

处理EarthComp代码 新增控制

master
DIAMOND 12 months ago
parent
commit
8695c28b5c
  1. 120
      src/views/earthMap/edit/EarthComp.vue
  2. 2
      src/views/earthMap/edit/ElectronicMap.vue

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

@ -5,7 +5,7 @@
<template> <template>
<div> <div>
<div id="earthContainer" ref="earthContainer" style="width: 100%; height: 100%; top: 300px"></div> <div id="earthContainer" ref="earthContainer" style="width: 100%; height: 100%; top: 300px"></div>
<div class="earthUI_header"> <div class="earthUI_header" v-if="PropsEarthHeaderShow">
<header> <header>
<p>{{ earthTitle }}</p> <p>{{ earthTitle }}</p>
<p>{{ realTime }}</p> <p>{{ realTime }}</p>
@ -140,6 +140,7 @@
setClassEl1.className = 'xbsj-checkbox-wrapper xbsj-checkbox-wrapper-checked xbsj-checkbox-default'; setClassEl1.className = 'xbsj-checkbox-wrapper xbsj-checkbox-wrapper-checked xbsj-checkbox-default';
setClassEl2.className = 'xbsj-checkbox xbsj-checkbox-checked'; setClassEl2.className = 'xbsj-checkbox xbsj-checkbox-checked';
} }
}
function setClassNoChecked(setClassEl1, setClassEl2) { function setClassNoChecked(setClassEl1, setClassEl2) {
// node.checkStatus = '' // node.checkStatus = ''
@ -202,7 +203,73 @@
AISInfoDetail, AISInfoDetail,
AISInfoWindow, AISInfoWindow,
}, },
props: {}, props: {
//
all: {
type: Boolean,
default: false
},
//
earthHeaderShow: {
type: Boolean,
default: false
},
//
sceneTreeShow:{
type: Boolean,
default: false
},
//
statusBarShow:{
type: Boolean,
default: true
},
//
mainBar:{
type: Boolean,
default: false
},
//
listenMouseHandlerOpen:{
type: Boolean,
default: false
},
//mitt
listenMittHandlerOpen:{
type: Boolean,
default: false
},
//线
createBBHLineOpen:{
type: Boolean,
default: false
},
//
getLineInfoShow:{
type: Boolean,
default: false
},
//
getCameraInfoShow:{
type: Boolean,
default: false
},
//
getLabelInfoShow:{
type: Boolean,
default: false
},
//
drawInitShow:{
type: Boolean,
default: false
},
//
keyControlInitShow:{
type: Boolean,
default: false
},
},
}) })
export default class EarthComp extends Vue { export default class EarthComp extends Vue {
/** /**
@ -470,6 +537,19 @@
let that = this; let that = this;
//使storeXbsjEarthUI //使storeXbsjEarthUI
this.store.xbsjEarthUI = XbsjEarthUI; this.store.xbsjEarthUI = XbsjEarthUI;
//props
if(this.all){
this.PropsEarthHeaderShow = true
this.PropsSceneTreeShow = true
this.PropsListenMouseHandlerOpen = true
this.PropsListenMittHandlerOpen = true
this.PropsCreateBBHLineOpen = true
this.PropsGetLineInfoShow = true
this.PropsGetCameraInfoShow = true
this.PropsGetLabelInfoShow = true
this.PropsDrawInitShow = true
this.PropsKeyControlInitShow = true
}
XbsjEarthUI.create('earthContainer').then(async (earthUI: any) => { XbsjEarthUI.create('earthContainer').then(async (earthUI: any) => {
// //
window.$uia = earthUI; window.$uia = earthUI;
@ -575,18 +655,22 @@
this.cameraPositionChange(this); this.cameraPositionChange(this);
}); });
//线 //线
// this.createRealTimeObj(earthUI) // this.createRealTimeObj(earthUI)
//
//
if (this.PropsListenMouseHandlerOpen)
this.listenMouseHandler(earthUI); this.listenMouseHandler(earthUI);
//mitt //mitt
if (this.PropsListenMittHandlerOpen)
this.listenMittHandler(earthUI); this.listenMittHandler(earthUI);
// //
await this.fly(); await this.fly();
//线 //线
if (this.PropsCreateBBHLineOpen)
await this.createBBHLine(earthUI); await this.createBBHLine(earthUI);
// //
@ -695,6 +779,7 @@
/* 使用async/await 处理异步方法顺序执行。成功的操作放到try里,失败的放在catch里 */ /* 使用async/await 处理异步方法顺序执行。成功的操作放到try里,失败的放在catch里 */
async createBBHLine(earthUI = null) { async createBBHLine(earthUI = null) {
console.log('MyScene', this.userStore.userInfo?.sceneId); console.log('MyScene', this.userStore.userInfo?.sceneId);
let labelItems: any = undefined
let type = 1; //** let type = 1; //**
let models: any = { let models: any = {
@ -719,16 +804,25 @@
// //
// console.log(""); // console.log("");
await this.getLineInfo(models, type); if (this.PropsGetLineInfoShow)
await this.getLineInfo(models, type);
// //
// console.log(""); // console.log("");
await this.getCameraInfo(models, type); if (this.PropsGetCameraInfoShow)
await this.getCameraInfo(models, type);
// //
// console.log(""); // console.log("");
const labelItems: any = await this.getLabelInfo(models, type); if (this.PropsGetLabelInfoShow)
// labelItems = await this.getLabelInfo(models, type);
//
if (this.PropsDrawInitShow)
await drawInit(); await drawInit();
// //
if (this.PropsKeyControlInitShow)
await keyControlInit(); await keyControlInit();
// dom // dom

2
src/views/earthMap/edit/ElectronicMap.vue

@ -1,6 +1,6 @@
<template> <template>
<div style="width: 100%; height: 100%"> <div style="width: 100%; height: 100%">
<EarthComp/> <EarthComp :all="true"/>
</div> </div>
</template> </template>

Loading…
Cancel
Save