From 53af48a650f54ab5640cb29810ad3792d17fa993 Mon Sep 17 00:00:00 2001 From: zhufu <17863654727@163.com> Date: Sat, 12 Jul 2025 09:04:53 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=92=8C=E9=A3=9E=E8=A1=8C=E4=BD=9C=E4=B8=9A=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/demo/workmanagement/workplan/components/map.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/views/demo/workmanagement/workplan/components/map.vue b/src/views/demo/workmanagement/workplan/components/map.vue index 92c3c4d..3c9f61e 100644 --- a/src/views/demo/workmanagement/workplan/components/map.vue +++ b/src/views/demo/workmanagement/workplan/components/map.vue @@ -1546,6 +1546,9 @@ const loadChangGuangLayer = ()=>{ // 设置机场位置 const setAirportPosition = async () => { + if(!graphicLayer){ + return + } let point = graphicLayer.getGraphicById('set-airport'); // // 创建点的经纬度信息 let position = [props.airPort.longitude, props.airPort.latitude, 70]; From 23ab56e1620d174f2e8f9b3aab1f575265ea8657 Mon Sep 17 00:00:00 2001 From: shichao <17568097882@163.com> Date: Sat, 12 Jul 2025 15:02:59 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=95=BF=E6=8C=89=E7=82=B9=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workmanagement/flightoperation/index.vue | 2 +- .../flightoperation/src/FlightControl.vue | 901 +++++++++--------- .../flightoperation/src/LoadControl.vue | 5 +- 3 files changed, 466 insertions(+), 442 deletions(-) diff --git a/src/views/demo/workmanagement/flightoperation/index.vue b/src/views/demo/workmanagement/flightoperation/index.vue index 1fb2f53..f7123b4 100644 --- a/src/views/demo/workmanagement/flightoperation/index.vue +++ b/src/views/demo/workmanagement/flightoperation/index.vue @@ -158,7 +158,7 @@ setTimeout(() => { uavLive.value = true; livePreviewVisible.value = true; - }, 2000); + }, 5000); } }; const loadLiveStreaming = () => { diff --git a/src/views/demo/workmanagement/flightoperation/src/FlightControl.vue b/src/views/demo/workmanagement/flightoperation/src/FlightControl.vue index de324a0..e3cf58f 100644 --- a/src/views/demo/workmanagement/flightoperation/src/FlightControl.vue +++ b/src/views/demo/workmanagement/flightoperation/src/FlightControl.vue @@ -1,13 +1,6 @@ diff --git a/src/views/demo/workmanagement/flightoperation/src/LoadControl.vue b/src/views/demo/workmanagement/flightoperation/src/LoadControl.vue index b2e11cd..d459d9f 100644 --- a/src/views/demo/workmanagement/flightoperation/src/LoadControl.vue +++ b/src/views/demo/workmanagement/flightoperation/src/LoadControl.vue @@ -300,14 +300,15 @@ let data = { payload_index: uav.camera_index, locked: true, - pitch_speed: 8, - yaw_speed: 8, + pitch_speed: 0, + yaw_speed: 0, }; if (val == 'up') { data[type] = 8; } else { data[type] = -8; } + console.log('data', data); // 画面拖动控制 servicesTopicReize({ bid: buildGUID(), From ffc56b708bf94b7cc3ddb3708a196aabd45cff21 Mon Sep 17 00:00:00 2001 From: zhufu <17863654727@163.com> Date: Sat, 12 Jul 2025 15:46:59 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E6=9C=BA=E5=9C=BA=E4=BD=8D=E7=BD=AE=EF=BC=8C=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=9C=BA=E5=9C=BA=E5=9B=BE=E6=A0=87=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E5=88=B0=E9=A3=9E=E8=A1=8C=E4=BD=9C=E4=B8=9A=E7=94=BB=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flightoperation/src/SelectComponent.vue | 7 ++- .../projecthome/ProjectList/index.vue | 25 ++++++++-- .../demo/workmanagement/projecthome/index.vue | 46 ++++++++++++++++--- .../workplan/components/map.vue | 16 +++++-- 4 files changed, 78 insertions(+), 16 deletions(-) diff --git a/src/views/demo/workmanagement/flightoperation/src/SelectComponent.vue b/src/views/demo/workmanagement/flightoperation/src/SelectComponent.vue index 3ef41bf..984980e 100644 --- a/src/views/demo/workmanagement/flightoperation/src/SelectComponent.vue +++ b/src/views/demo/workmanagement/flightoperation/src/SelectComponent.vue @@ -67,7 +67,12 @@ value: item.Id, }; }); - selectVal.project = optionsArr.projectOptions[0].value; + if(sessionStorage.getItem('homeToFlightId')){ + selectVal.project = sessionStorage.getItem('homeToFlightId'); + sessionStorage.removeItem('homeToFlightId') + } else { + selectVal.project = optionsArr.projectOptions[0].value; + } getAirPort(selectVal.project); } else { optionsArr.projectOptions = []; diff --git a/src/views/demo/workmanagement/projecthome/ProjectList/index.vue b/src/views/demo/workmanagement/projecthome/ProjectList/index.vue index 58b743b..9719dc7 100644 --- a/src/views/demo/workmanagement/projecthome/ProjectList/index.vue +++ b/src/views/demo/workmanagement/projecthome/ProjectList/index.vue @@ -10,7 +10,7 @@
-
+
{{ item.WorkspaceName }}
@@ -36,23 +36,40 @@ import { ref, defineProps, onMounted, createVNode } from "vue" import { GetWorkspaceList, GetWorkSpaceById, DeleteWorkspace } from '@/api/demo/projecthome' import { message, Modal } from 'ant-design-vue' import { ExclamationCircleOutlined } from '@ant-design/icons-vue' +import { getClient, createConnection, clientSubscribe, destroyConnection } from '@/utils/mqtt'; onMounted(() => { getProjectList() }) -const props = defineProps(['map']) +const props = defineProps(['map', 'activeProject', 'airPort']) +const emits = defineEmits(['update:activeProject']) const addModal = ref(false) const modalType = ref('') const projectList = ref([]) -const activeProject = ref('') const updateProject = ref({}) +const lastSubscriptUrl = ref('') const addProject = () => { modalType.value = 'insert' addModal.value = true } const selectProject = (item) => { - activeProject.value = item.Id + if(props.activeProject != item.Id){ + props.airPort.latitude = null + props.airPort.longitude = null + getClient().unsubscribe(lastSubscriptUrl.value,(error, res) => {}) + } + emits('update:activeProject',item.Id) + let params = { + id: item.Id + } + GetWorkSpaceById(params).then(res => { + res.lasaDronePort.forEach(item => { + const topicUrl = 'thing/product/' + item.sn + '/osd'; + lastSubscriptUrl.value = topicUrl + clientSubscribe(topicUrl, { qos: 0 }); + }) + }) } const getProjectList = () => { GetWorkspaceList().then(res => { diff --git a/src/views/demo/workmanagement/projecthome/index.vue b/src/views/demo/workmanagement/projecthome/index.vue index e262095..6c9d254 100644 --- a/src/views/demo/workmanagement/projecthome/index.vue +++ b/src/views/demo/workmanagement/projecthome/index.vue @@ -1,11 +1,11 @@ diff --git a/src/views/demo/workmanagement/workplan/components/map.vue b/src/views/demo/workmanagement/workplan/components/map.vue index 3c9f61e..399b8b9 100644 --- a/src/views/demo/workmanagement/workplan/components/map.vue +++ b/src/views/demo/workmanagement/workplan/components/map.vue @@ -148,7 +148,7 @@ const generatePreviewPoint = (placemark)=>{ } }; - const emits = defineEmits(['exitDraw', 'flyToThere']); + const emits = defineEmits(['exitDraw', 'flyToThere', 'mapOnLoad', 'clickAirPort']); const airPoints = ref([]); const currentAirPoint = ref({}); @@ -199,6 +199,9 @@ const generatePreviewPoint = (placemark)=>{ // 航点连接线 let lineGroundPointLayer: mars3d.layer.GraphicLayer; + // 机场位置 + let startGraphic; + let graphic = null; const exitDraw = () => { @@ -457,6 +460,7 @@ const generatePreviewPoint = (placemark)=>{ } // 加载长光高清影像 loadChangGuangLayer(); + emits('mapOnLoad',map) }); }; @@ -1553,7 +1557,8 @@ const loadChangGuangLayer = ()=>{ // // 创建点的经纬度信息 let position = [props.airPort.longitude, props.airPort.latitude, 70]; // 更新航点 - if (point) { + if (startGraphic) { + startGraphic.position = position // point.setOptions({ // id: 'set-airport', // name: '机场位置', @@ -1576,7 +1581,7 @@ const loadChangGuangLayer = ()=>{ // }, // }); } else { - let startGraphic = new mars3d.graphic.BillboardEntity({ + startGraphic = new mars3d.graphic.BillboardEntity({ id: 'set-airport', position: position, style: { @@ -1596,8 +1601,11 @@ const loadChangGuangLayer = ()=>{ }, }, }); + startGraphic.on(mars3d.EventType.click, function (event) { + emits('clickAirPort') + }); graphicLayer.addGraphic(startGraphic); - } + } }; // 设置无人机轨迹 From 2a98edf563d05409f55456f1445a006ff42b32ab Mon Sep 17 00:00:00 2001 From: zhufu <17863654727@163.com> Date: Sat, 12 Jul 2025 16:01:57 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=9C=BA=E5=9C=BA=E7=9B=B4=E6=92=AD?= =?UTF-8?q?=E5=92=8C=E6=97=A0=E4=BA=BA=E6=9C=BA=E7=9B=B4=E6=92=AD=E5=BF=AB?= =?UTF-8?q?=E9=80=9F=E5=BC=80=E5=90=AF=E5=92=8C=E5=85=B3=E9=97=AD=E6=97=B6?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/workmanagement/flightoperation/src/AirportLive.vue | 6 ++++-- .../demo/workmanagement/flightoperation/src/LivePreview.vue | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/views/demo/workmanagement/flightoperation/src/AirportLive.vue b/src/views/demo/workmanagement/flightoperation/src/AirportLive.vue index 7621364..1f515c1 100644 --- a/src/views/demo/workmanagement/flightoperation/src/AirportLive.vue +++ b/src/views/demo/workmanagement/flightoperation/src/AirportLive.vue @@ -154,8 +154,10 @@ }; // 销毁视频控件 onBeforeUnmount(() => { - player.dispose(); - player = null; + if(player){ + player.dispose(); + player = null; + } });