jiejie 1 year ago
parent
commit
29bbeea458
  1. 58
      src/views/earthMap/edit/EarthComp.vue
  2. 2
      src/views/earthMap/show/EarthComp.vue
  3. 12
      src/views/military/modules/ai/aiMonitorArea/DtAiMonitorArea.data.ts
  4. 6
      src/views/military/modules/ai/aiMonitorArea/checkCom/CheckCom.vue
  5. 99
      src/views/military/modules/ai/aiMonitorArea/components/DtAiMonitorAreaForm.vue
  6. 2
      src/views/military/modules/ai/aiMonitorArea/selectCom/SelectCom.vue
  7. 4
      src/views/military/modules/ai/monitorArea/DtMonitorAreaList.vue
  8. 12
      src/views/military/modules/ai/monitorArea/components/DtMonitorAreaForm.vue
  9. 121
      src/views/military/modules/ai/monitorArea/components/VCEarthViewer.vue

58
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;
@ -998,7 +1038,7 @@
}
}
/* 使用async/await 处理异步方法顺序执行。成功的操作放到try里,失败的放在catch里 */
async createBBHLine(earthUI =null) {
async createBBHLine(earthUI= null) {
let models: any = null;
let type = 0;
if (!(this.sceneInfo instanceof Array)) {
@ -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("");

12
src/views/military/modules/ai/aiMonitorArea/DtAiMonitorArea.data.ts

@ -18,7 +18,7 @@ export const columns: BasicColumn[] = [
title: '监控相机',
align: 'center',
dataIndex: 'cameraId_dictText',
width: 150,
width: 200,
},
{
title: '监控模型',
@ -36,6 +36,11 @@ export const columns: BasicColumn[] = [
align: 'center',
dataIndex: 'drawdata',
},
{
title: '所属场景',
align: 'center',
dataIndex: 'sceneId_dictText',
},
// ,
// {
// title: '备注',
@ -43,11 +48,6 @@ export const columns: BasicColumn[] = [
// dataIndex: 'remark',
// },
// {
// title: '备用2',
// align: "center",
// dataIndex: 'field2'
// },
// {
// title: '备用3',
// align: "center",
// dataIndex: 'field3'

6
src/views/military/modules/ai/aiMonitorArea/checkCom/CheckCom.vue

@ -1,3 +1,9 @@
<!--
查看监控
目录位置AI智能化区域监控 -> 视频智能监控范围 -> 查看监控
功能概述rtsp视频流播放
-->
<template>
<a-modal :visible="visible" :title="title" width="1080px" @cancel="handleCancel" destroyOnClose>
<a-row>

99
src/views/military/modules/ai/aiMonitorArea/components/DtAiMonitorAreaForm.vue

@ -1,9 +1,9 @@
<template>
<a-spin :spinning="confirmLoading">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" :rules="rules" :model="formData">
<a-row>
<a-col :span="24">
<a-form-item label="监控相机" v-bind="validateInfos.cameraId">
<a-form-item label="监控相机" v-bind="validateInfos.cameraId" name="cameraId">
<a-tree-select
ref="cameraTree"
v-model:value="formData.cameraId"
@ -60,17 +60,22 @@
<a-textarea v-model:value="formData.drawdata" :rows="4" placeholder="请输入画图数据" :disabled="disabled"></a-textarea>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="所属场景" v-bind="validateInfos.sceneId" name="sceneId">
<!-- <a-input v-model:value="formData.sceneId" placeholder="请输入所属场景" :disabled="disabled"></a-input> -->
<a-select v-model:value="formData.sceneId" placeholder="请选择所属场景" :disabled="disabled">
<template :key="code.sceneCode" v-for="code in sceneCodeList">
<a-select-option :value="code.sceneCode">{{ code.sceneName }}</a-select-option>
</template>
</a-select>
</a-form-item>
</a-col>
<!-- <a-col :span="24">
<a-form-item label="备注" v-bind="validateInfos.remark">
<a-input v-model:value="formData.remark" placeholder="请输入备注" :disabled="disabled"></a-input>
</a-form-item>
</a-col> -->
<!--
<a-col :span="24">
<a-form-item label="备用2" v-bind="validateInfos.field2">
<a-input v-model:value="formData.field2" placeholder="请输入备用2" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="备用3" v-bind="validateInfos.field3">
<a-input v-model:value="formData.field3" placeholder="请输入备用3" :disabled="disabled"></a-input>
@ -100,6 +105,7 @@
import { saveOrUpdate } from '../DtAiMonitorArea.api';
import { Form } from 'ant-design-vue';
import locationPng from '@/assets/images/getLocation.png';
import type { Rule } from 'ant-design-vue/es/form';
//
import SelectCom from '../selectCom/SelectCom.vue';
@ -123,6 +129,15 @@
const getmodelCodeList = () => {
return defHttp.get({ url: '/military/dtAiModel/list' }, { isTransformResponse: false });
};
//
const sceneCodeList: any = ref([]);
//
const getsceneCodeList = () => {
defHttp.get({ url: '/military/msMapScene/list' }, { isTransformResponse: false }).then((res) => {
sceneCodeList.value = res.result.records;
});
};
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => {} },
@ -137,10 +152,10 @@
modelName: '',
areaData: '',
drawdata: '',
sceneId: '',
// rtspUrl: '',
cameraId: undefined,
remark: '',
field2: '',
field3: '',
sysAreaCode: '',
sysUnitCode: '',
@ -151,11 +166,18 @@
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {};
const rules: Record<string, Rule[]> = {
cameraId: [{ required: true, message: '请选择监控相机!' }],
modelCode: [{ required: true, message: '请输入监控模型!' }],
sceneId: [{ required: true, message: '请选择所属场景!' }],
};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
onMounted(() => {
//
getCameraList();
//
getsceneCodeList();
//
getmodelCodeList().then((response) => {
if (response.success) {
@ -286,37 +308,40 @@
*/
async function submitForm() {
//
await validate();
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
// await validate();
formRef.value.validate().then(async () => {
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
})
.finally(() => {
confirmLoading.value = false;
});
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
});
}
defineExpose({

2
src/views/military/modules/ai/aiMonitorArea/selectCom/SelectCom.vue

@ -58,7 +58,7 @@
</a-modal>
</template>
<script lang="ts" setup>
import { ref, getCurrentInstance, onMounted, onBeforeUnmount, nextTick, watch } from 'vue';
import { ref, getCurrentInstance, onMounted, onBeforeUnmount, nextTick } from 'vue';
import { ApiOutlined, FormatPainterOutlined, AimOutlined, LinkOutlined } from '@ant-design/icons-vue';
const { proxy }: any = getCurrentInstance();
const props = defineProps({

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
});
}
/**

121
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,112 +442,52 @@ 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) {
//
await defHttp.get({
url: '/military/msMapScene/list',
params: {
pageNo: 1,
pageSize: 999,
sceneCode: "00001-00001*",
column: 'sysOrgCode',
order: 'asc',
}
}, { 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;
/**
*
* @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;
//
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);
await defHttp.get({
url: '/military/msMapScene/list',
params: {
sceneCode: sceneId,
}
}, { isTransformResponse: false }).then((response) => {
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;
if (e.finished) {

Loading…
Cancel
Save