Browse Source

修改飞入方法,与区域管理关联

master
DIAMOND 1 year ago
parent
commit
724cae0b56
  1. 56
      src/views/earthMap/edit/EarthComp.vue
  2. 2
      src/views/earthMap/show/EarthComp.vue
  3. 4
      src/views/military/modules/ai/monitorArea/DtMonitorAreaList.vue
  4. 12
      src/views/military/modules/ai/monitorArea/components/DtMonitorAreaForm.vue
  5. 117
      src/views/military/modules/ai/monitorArea/components/VCEarthViewer.vue

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

@ -813,14 +813,19 @@
// this.createRealTimeObj(earthUI)
//
this.listenMouseHandler(earthUI);
//
await this.getSceneInfo();
// //
// await this.getSceneInfo();
//
await this.newfly();
//线
await this.createBBHLine(earthUI);
//
await this.fly();
// //
// await this.fly();
//
// console.log("earthUI",earthUI);
@ -841,6 +846,40 @@
});
}
// 20231222
async newfly(){
let position, rotation, viewDistance, duration;
const sceneId = this.userStore.userInfo?.sceneId;
await defHttp.get({
url: '/military/msMapScene/list',
params: {
pageNo: 1,
pageSize: 999,
sceneCode: sceneId + "*",
column: 'sceneCode',
order: 'asc',
}
}, { isTransformResponse: false }).then((response) => {
console.log("newfly",response);
// 屿
this.sceneInfo = response.result.records;
return response.result.records;
}).then((res)=>{
//
position = [res[0].cameraLon, res[0].cameraLat, res[0].cameraAltitude];
rotation = [res[0].rotationX, res[0].rotationY, res[0].rotationZ];
viewDistance = res[0].viewDistance;
duration = res[0].duration;
this._earth.camera.flyTo(position, viewDistance, rotation, duration);
//
window.$flyTo = this.flyTo = () => {
this._earth.camera.flyTo(position, viewDistance, rotation, duration);
};
})
}
//
async fly() {
let position, rotation, viewDistance, duration;
//
@ -935,6 +974,7 @@
};
}
//
async getSceneInfo() {
//
// const orgCode = Vue.ls.get(USER_INFO).orgCode;
@ -956,7 +996,7 @@
order: 'asc',
}
}, { isTransformResponse: false }).then((response) => {
// console.log("response",response);
console.log("总部",response);
const records = response.result.records
// 屿
@ -965,7 +1005,7 @@
});
} else {
await defHttp.get({ url: '/military/msMapScene/queryByOrgCode', params: { orgCode: orgCode } }, { isTransformResponse: false }).then((response) => {
console.log("岛屿",response);
const data = response.result;
// 屿Object
this.sceneInfo = data;
@ -1014,7 +1054,7 @@
models = {
ref: 'main',
expand: true,
title: '岛礁',
title: this.sceneInfo[0].sceneName,
children: [],
};
for (let record of this.sceneInfo) {
@ -1029,7 +1069,7 @@
});
}
}
// console.log('models',models);
console.log('models',models);
//
// console.log("");

2
src/views/earthMap/show/EarthComp.vue

@ -993,7 +993,7 @@
});
}
}
// console.log('models',models);
console.log('models1',models);
//
// console.log("");

4
src/views/military/modules/ai/monitorArea/DtMonitorAreaList.vue

@ -102,7 +102,8 @@
import { defHttp } from '/@/utils/http/axios';
import DtMonitorDeviceList from './areaDevice/DtMonitorDeviceList.vue';
import MonitorAreaLinkageList from './linkageDevice/MonitorAreaLinkageList.vue';
import { useUserStore } from '/@/store/modules/user';
const userStore = useUserStore();
const deviceInfo = ref(); //
//
const AreaDeviceShow = ref(false);
@ -131,6 +132,7 @@
fixed: 'right',
},
beforeFetch: (params) => {
// params.sceneId = userStore.userInfo?.sceneId + '*';
return Object.assign(params, queryParam);
},
},

12
src/views/military/modules/ai/monitorArea/components/DtMonitorAreaForm.vue

@ -78,7 +78,7 @@
<!-- <EarthMapModal v-model:areaData="formData.areaData" v-model:drawData="formData.drawData" :visible="mapVisible"
:enableTile="false" :enablePointer="true" @closeWin="() => { mapVisible = false }" @clearAreaData="clearAreaData">
</EarthMapModal> -->
<VCEarthViewer v-if="mapVisible" v-model:areaData="formData.areaData" v-model:drawData="formData.drawData"> </VCEarthViewer>
<VCEarthViewer v-if="mapVisible" :sceneId="formData.sceneId" v-model:areaData="formData.areaData" v-model:drawData="formData.drawData"> </VCEarthViewer>
</template>
<script lang="ts" setup>
@ -90,15 +90,14 @@
import { Form, notification } from 'ant-design-vue';
import { message } from 'ant-design-vue';
import type { Rule } from 'ant-design-vue/es/form';
import { useUserStore } from '/@/store/modules/user';
import VCEarthViewer from './VCEarthViewer.vue';
import Area from '@/views/military/modules/ai/MonitorArea/components/Area.vue';
import AreaByXbsjEarthUI from '@/views/military/modules/ai/MonitorArea/components/AreaByXbsjEarthUI.vue';
import EarthMapModal from '/@/views/military/modules/earthMap/scene/model/mapModel/EarthMapModal.vue';
import locationPng from '@/assets/images/getLocation.png';
import { FormatPainterOutlined } from '@ant-design/icons-vue';
const userStore = useUserStore();
//
const modelCodeList: any = ref([]);
//
@ -125,6 +124,7 @@
field3: '',
sysAreaCode: '',
sysUnitCode: '',
sceneId:'',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
@ -173,7 +173,9 @@
* 新增
*/
function add() {
edit({});
edit({
sceneId: userStore.userInfo?.sceneId
});
}
/**

117
src/views/military/modules/ai/monitorArea/components/VCEarthViewer.vue

@ -65,6 +65,11 @@ const props = defineProps({
type: String,
default: '',
},
//
sceneId: {
type: String,
default: '',
},
});
//
const mapURL = import.meta.env.VITE_GLOB_EARTHMAP_URL + import.meta.env.VITE_GLOB_SATELLITE_URL
@ -424,6 +429,8 @@ watch(
);
onMounted(async () => {
// console.log("pops",props);
await loadingData();
});
@ -435,111 +442,51 @@ function handleCancel() {
}
async function drawingsReadyDefault(e) {
let viewer = e.viewer
console.log("viewer", viewer);
console.log("e", e);
// console.log("viewer", viewer);
// console.log("e", e);
$viewer.value = viewer;
//
$viewer.value.cesiumWidget.screenSpaceEventHandler.removeInputAction(window.Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
//
await getSceneInfo();
//
await fly(viewer);
}
//
async function getSceneInfo() {
//
const orgCode: any = userStore.userInfo?.orgCode;
// this.orgCode = orgCode;
// console.log("orgCode",orgCode);
// 3屿
if (orgCode.length == 3) {
//
/**
*
* @description 飞入
* 新建则飞入用户所属场景
* 编辑则飞入区域所属场景
*
**/
async function fly(viewer: any = null) {
//sceneId
// const sceneId: any = props.sceneId == '' ? userStore.userInfo?.sceneId : props.sceneId;
const sceneId: any = props.sceneId;
//
let ellipsoid = viewer.scene.globe.ellipsoid;
await defHttp.get({
url: '/military/msMapScene/list',
params: {
pageNo: 1,
pageSize: 999,
sceneCode: "00001-00001*",
column: 'sysOrgCode',
order: 'asc',
sceneCode: sceneId,
}
}, { isTransformResponse: false }).then((response) => {
// console.log("response",response);
const records = response.result.records
// 屿
sceneInfo.value = records;
return records;
});
} else {
await defHttp.get({
url: '/military/msMapScene/queryByOrgCode',
params: { orgCode: orgCode }
}, { isTransformResponse: false })
.then((response) => {
const data = response.result;
// 屿Object
sceneInfo.value = data;
return data;
});
}
}
//
function fly(viewer: any = null) {
let position, rotation, viewDistance, duration;
//
let ellipsoid = viewer.scene.globe.ellipsoid;
//
let parentData =
sceneInfo.value instanceof Array
? sceneInfo.value.filter((item, index) => {
return item.sceneCode == "00001-00001";
})
: sceneInfo.value;
//
let data = sceneInfo.value instanceof Array ?
sceneInfo.value.filter((item, index) => {
return item.sceneCode.length > 3;
})
: sceneInfo.value;
// console.log("data",data);
// console.log("this.sceneInfo",this.sceneInfo);
if (data) {
if (!(data instanceof Array)) {
// debugger;
//
position = [data.lon, data.lat, data.altitude];
rotation = [data.rotationX, data.rotationY, data.rotationZ];
viewDistance = data.viewDistance;
duration = data.duration ? data.duration : 0;
// viewer.camera.flyTo(position, viewDistance, rotation, duration);
// console.log("data", position, viewDistance, rotation, duration);
} else {
//
position = [parentData[0].lon, parentData[0].lat, parentData[0].altitude];
rotation = [parentData[0].rotationX, parentData[0].rotationY, parentData[0].rotationZ];
viewDistance = parentData[0].viewDistance;
duration = parentData[0].duration;
// console.log("data", position, viewDistance, rotation, duration);
}
let res = response.result.records[0]
//
let CartesianPosition = ellipsoid.cartographicToCartesian({
longitude: position[0],
latitude: position[1],
height: position[2]
longitude: res.cameraLon,
latitude: res.cameraLat,
height: res.cameraAltitude,
});
// console.log("CartesianPosition", CartesianPosition);
// console.log("response", response);
viewer.camera.position = CartesianPosition
});
}
else {
//
}
}
function drawEvt(e, viewer) {
const restoreCursor = getComputedStyle(viewer.canvas).cursor;

Loading…
Cancel
Save