Browse Source

1.增加DtMonitorAreaForm限制

master
DIAMOND 1 year ago
parent
commit
0e7f88fe51
  1. 9
      src/views/military/modules/ai/monitorArea/components/DtMonitorAreaForm.vue
  2. 3
      src/views/military/modules/earthMap/scene/SceneManage.vue
  3. 215
      src/views/military/modules/earthMap/scene/model/mapModel/EarthMapModal.vue

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

@ -32,12 +32,12 @@
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="监控范围数据" v-bind="validateInfos.areaData"> <a-form-item label="监控范围数据" v-bind="validateInfos.areaData">
<a-textarea v-model:value="formData.areaData" :rows="4" placeholder="请输入监控范围数据" :disabled="disabled" /> <a-textarea v-model:value="formData.areaData" :rows="4" placeholder="请输入监控范围数据" :disabled="true" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="画图数据" v-bind="validateInfos.drawData"> <a-form-item label="画图数据" v-bind="validateInfos.drawData">
<a-textarea v-model:value="formData.drawData" :rows="4" placeholder="请输入画图数据" :disabled="disabled" /> <a-textarea v-model:value="formData.drawData" :rows="4" placeholder="请输入画图数据" :disabled="true" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
@ -75,9 +75,6 @@
</a-spin> </a-spin>
<!-- <Area v-if="mapVisible" v-model:areaData="formData.areaData" v-model:drawData="formData.drawData" ></Area> --> <!-- <Area v-if="mapVisible" v-model:areaData="formData.areaData" v-model:drawData="formData.drawData" ></Area> -->
<!-- <AreaByXbsjEarthUI :visible="mapVisible" v-model:areaData="formData.areaData" v-model:drawData="formData.drawData"></AreaByXbsjEarthUI> --> <!-- <AreaByXbsjEarthUI :visible="mapVisible" v-model:areaData="formData.areaData" v-model:drawData="formData.drawData"></AreaByXbsjEarthUI> -->
<!-- <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" v-model:areaData="formData.areaData" v-model:drawData="formData.drawData"> </VCEarthViewer>
</template> </template>
@ -94,7 +91,7 @@
import VCEarthViewer from './VCEarthViewer.vue'; import VCEarthViewer from './VCEarthViewer.vue';
import Area from '@/views/military/modules/ai/MonitorArea/components/Area.vue'; import Area from '@/views/military/modules/ai/MonitorArea/components/Area.vue';
import AreaByXbsjEarthUI from '@/views/military/modules/ai/MonitorArea/components/AreaByXbsjEarthUI.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 locationPng from '@/assets/images/getLocation.png';
import { FormatPainterOutlined } from '@ant-design/icons-vue'; import { FormatPainterOutlined } from '@ant-design/icons-vue';

3
src/views/military/modules/earthMap/scene/SceneManage.vue

@ -17,7 +17,7 @@
<hr class="hrDivider" /> <hr class="hrDivider" />
<a-col :span="24" style="display: flex"> <a-col :span="24" style="display: flex">
<div class="tree-container"> <div class="tree-container">
<a-tree :tree-data="treeData" defaultExpandAll="true" v-model:selectedKeys="selectedKeys" @select="showDataSourceFilter"></a-tree> <a-tree :tree-data="treeData" :defaultExpandAll="true" v-model:selectedKeys="selectedKeys" @select="showDataSourceFilter"></a-tree>
</div> </div>
<div class="table-container"> <div class="table-container">
<a-tabs v-model:activeKey="activeKey"> <a-tabs v-model:activeKey="activeKey">
@ -572,6 +572,7 @@
// //
const addScene = function () { const addScene = function () {
//0 //0
console.log(treeData.value, selectedKeys.value);
if (treeData.value.length > 0 && selectedKeys.value.length == 0) { if (treeData.value.length > 0 && selectedKeys.value.length == 0) {
message.warn('请先选中场景,再进行新增!'); message.warn('请先选中场景,再进行新增!');
return; return;

215
src/views/military/modules/earthMap/scene/model/mapModel/EarthMapModal.vue

@ -14,17 +14,7 @@
<span :class="['mapModel', 'iconSpan']" @click="modelChange" title="地图维度切换"> <span :class="['mapModel', 'iconSpan']" @click="modelChange" title="地图维度切换">
{{ modelText == "2D" ? "3D" : "2D" }} {{ modelText == "2D" ? "3D" : "2D" }}
</span> </span>
<span :class="['selectIcon', 'iconSpan']" title="选取区域" @click="SelectArea">
<GatewayOutlined />
</span>
<!-- <span :class="['testIcon', 'iconSpan']" title="测试" @click="test">
<GatewayOutlined />
</span> -->
<a-popconfirm title="确认重置区域?" placement="right" ok-text="确认" cancel-text="取消" @confirm="clearArea">
<span :class="['clearIcon', 'iconSpan']" title="重置区域">
<FormatPainterOutlined />
</span>
</a-popconfirm>
<template v-if="editTileModel != undefined && modelText == '3D'"> <template v-if="editTileModel != undefined && modelText == '3D'">
<span class="buildManage iconSpan" @click="enableTileChange" title="建筑加载"> <span class="buildManage iconSpan" @click="enableTileChange" title="建筑加载">
<img src="../../../../../../../assets/images/build_close.png" class="iconSize" v-show="!enableTile" /> <img src="../../../../../../../assets/images/build_close.png" class="iconSize" v-show="!enableTile" />
@ -176,7 +166,7 @@
</template> </template>
</a-col> </a-col>
</a-row> </a-row>
<!-- <EarthMapManage :show="mapManageShow"></EarthMapManage> -->
</a-modal> </a-modal>
</template> </template>
<script setup> <script setup>
@ -195,13 +185,13 @@ const { proxy } = getCurrentInstance();
const getMapPage = (params) => defHttp.get({ url: "/military/msMapManage/list/page", params: params }, { isTransformResponse: false }); const getMapPage = (params) => defHttp.get({ url: "/military/msMapManage/list/page", params: params }, { isTransformResponse: false });
// //
const cursorCss = ref("grab"); const cursorCss = ref("grab");
const props = defineProps(['areaData', 'drawData', 'title', 'visible', 'hasMoveMethod', 'initModeType', 'editTileModel', 'enableTile', 'enablePointer']); const props = defineProps(['title', 'visible', 'hasMoveMethod', 'initModeType', 'editTileModel', 'enableTile', 'enablePointer']);
const { title, visible, hasMoveMethod, initModeType, editTileModel, enablePointer } = toRefs(props); const { title, visible, hasMoveMethod, initModeType, editTileModel, enablePointer } = toRefs(props);
// //
const enableTile = ref(props.enableTile); const enableTile = ref(props.enableTile);
const pointerXyz = ref([]); const pointerXyz = ref([]);
const defaultPinUrl = "../"; const defaultPinUrl = "../";
const emit = defineEmits(["closeWin", "checkPosition", "moveChinaPosition", 'update:areaData', 'update:drawData']) const emit = defineEmits(["closeWin", "checkPosition", "moveChinaPosition"])
// //
const handleOk = function () { const handleOk = function () {
let position = null; let position = null;
@ -222,14 +212,6 @@ const handleOk = function () {
} }
handleCancel(); handleCancel();
//
sceneTreeToAreaObjList()
//-
updateDraw()
//-
updateArea()
//退
handleCancel()
} }
const handleCancel = function () { const handleCancel = function () {
emit("closeWin"); emit("closeWin");
@ -256,7 +238,6 @@ watch(
addContainerClickListen(); addContainerClickListen();
await getDataSource(); await getDataSource();
moveChinaPosition(); moveChinaPosition();
await getDrawArea()
}); });
} else { } else {
@ -266,187 +247,6 @@ watch(
} }
) )
// ---------- ----------
//
const clearArea = function () {
if (window.earth.sceneTree.root.children.length > 1) {
window.earth.sceneTree.root.children.pop();
emit('clearAreaData')
// message.success('');
}
}
//
let areaObjList = ref([])
// -
const getDrawArea = function () {
if (props.areaData || props.drawData) {
areaObjList.value = JSON.parse(props.drawData)
// console.log("aa",areaObjList.value);
areaObjList.value.forEach((e) => {
//
let t = drawPolygonSave(e, 1)
t.name = '区域选取'
//store
store.shapeShowList.push(t.xbsjGuid)
//
let leaf = new window.XE.SceneTree.Leaf(t)
//
leaf.ref = t.guid
leaf.guid = t.guid;
//push
window.earth.sceneTree.root.children.push(leaf);
})
}
}
// -
// const getDrawAreaSmooth = function () {
// if (props.areaData || props.drawData) {
// areaObjList.value = JSON.parse(props.drawData)
// // console.log("aa",areaObjList.value);
// areaObjList.value.forEach((e) => {
// //
// let t = drawGeoSmoothPolygon(e, 1)
// t.name = ''
// //store
// store.shapeShowList.push(t.xbsjGuid)
// //
// let leaf = new window.XE.SceneTree.Leaf(t)
// //
// leaf.ref = t.guid
// leaf.guid = t.guid;
// //push
// window.earth.sceneTree.root.children.push(leaf);
// })
// }
// }
// -
const SelectArea = function () {
console.log(window.earth.sceneTree.root.children);
//
if (window.earth.sceneTree.root.children.length > 1) {
window.earth.sceneTree.root.children.pop();
}
// 使
let t = drawPolygonSave(null, 1)
t.creating = true
t.creatingWithoutHeight = true
t.ground = true
t.name = '区域选取'
//
let leaf = new window.XE.SceneTree.Leaf(t)
//
leaf.ref = t.guid
leaf.guid = t.guid;
//push
window.earth.sceneTree.root.children.push(leaf);
// areaObjList.value.push(t)
// return t
}
// -
// const SelectAreaSmooth = function () {
// if (window.earth.sceneTree.root.children.length > 1) {
// window.earth.sceneTree.root.children.pop();
// }
// let t2 = drawGeoSmoothPolygon(null, 1);
// console.log('t2', t2);
// t2.creating = true
// t2.creatingWithoutHeight = true
// t2.ground = true
// t2.name = ''
// let leaf = new window.XE.SceneTree.Leaf(t2)
// leaf.ref = t2.guid
// leaf.guid = t2.guid
// window.earth.sceneTree.root.children.push(leaf)
// }
//
//
const sceneTreeToAreaObjList = function () {
areaObjList.value = []
let sceneTree = window.earth.sceneTree.$refs
for (let element in sceneTree) {
if (sceneTree[element].title == "区域选取") {
areaObjList.value.push(sceneTree[element].czmObject)
}
}
}
//-
const updateDraw = function () {
let drawDataToString = JSON.stringify(areaObjList.value)
//-
if (drawDataToString == '[]') {
emit('update:drawData', '');
} else {
emit('update:drawData', drawDataToString);
}
}
// -
function updateArea() {
//
let areaData = []
let k = 1; //
areaObjList.value.forEach((e) => {
//
let positionToDegrees = []
e.positions.forEach((p) => {
positionToDegrees.push(window.Cesium.Math.toDegrees(p))
})
//
let result = []
for (let i = 0; i < positionToDegrees.length; i += 2) {
result.push({
lon: positionToDegrees[i], //
lat: positionToDegrees[i + 1], //
key: k //
});
k++;
}
areaData.push(result)
})
// console.log("areaData", areaData);
if (areaData.length == 0) {
emit('update:areaData', '');
} else {
emit('update:areaData', JSON.stringify(areaData));
}
}
// -
// function updateAreaSmooth() {
// //
// let areaData = []
// let k = 1
// areaObjList.value.forEach((e) => {
// //
// let positionToDegrees = []
// e.positions.forEach((i) => {
// let positionItem = []
// i.forEach(p => {
// positionItem.push(window.Cesium.Math.toDegrees(p))
// })
// positionToDegrees.push(positionItem)
// })
// //
// let result = []
// for (let i = 0; i < positionToDegrees.length; i++) {
// result.push({
// lon: positionToDegrees[i][0], //
// lat: positionToDegrees[i][1], //
// key: k //
// });
// k++;
// }
// areaData.push(result)
// console.log(result);
// })
// // emit('update:areaData', JSON.stringify(areaData));
// if (areaData.length == 0) {
// emit('update:areaData', '');
// } else {
// emit('update:areaData', JSON.stringify(areaData));
// }
// }
// const test = function () {
// _viewer.camera.moveLeft(100000)
// }
const mapManageShow = ref(false); const mapManageShow = ref(false);
const modelText = ref('2D'); const modelText = ref('2D');
@ -916,7 +716,6 @@ defineExpose(
); );
</script> </script>
<style scoped> <style scoped>
.container {}
.fill-9-row { .fill-9-row {
width: 90%; width: 90%;
@ -966,12 +765,6 @@ defineExpose(
left: 0; left: 0;
} }
.testIcon {
position: absolute;
top: 188px;
left: 0;
}
.clearIcon { .clearIcon {
position: absolute; position: absolute;
top: 144px; top: 144px;

Loading…
Cancel
Save