From 32fe6e21781de5ff3218ffe71454a023c56ef50e Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Fri, 28 Feb 2025 12:44:19 +0800
Subject: [PATCH] 航线和视频 飞完立即清除

---
 src/views/hooks/droneFly.ts |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/views/hooks/droneFly.ts b/src/views/hooks/droneFly.ts
index f75d3b7..fd03248 100644
--- a/src/views/hooks/droneFly.ts
+++ b/src/views/hooks/droneFly.ts
@@ -7,7 +7,7 @@
 import { useMyStore } from '@/store'
 import { getTwoPointInfo } from '@/api/manage'
 
-const { getEntityById, removeById, globalCesium, addLeftClickEvent, removeLeftClickEvent, flyTo } = cesiumOperation()
+const { getEntityById, removeById, globalCesium, removeAllPoint, addLeftClickEvent, removeLeftClickEvent, flyTo } = cesiumOperation()
 // 无人机实体
 let droneEntity = null
 
@@ -63,7 +63,7 @@
       // 当飞机模型存在
       if (droneEntity) {
         //  且在空中飞行时,实时更新飞机模型的位置
-        if (deviceInfo.mode_code && [3, 4, 5, 9, 10, 16].includes(deviceInfo.mode_code)) {
+        if (deviceInfo.mode_code && [3, 4, 5, 9, 10, 16, 17].includes(deviceInfo.mode_code)) {
           if (store.currentAngle == 3) {
             viewInfoFrustum?.clear()
           } else {
@@ -96,6 +96,9 @@
         } else {
           removeById('drone_fly')
           droneEntity = null
+
+          removeById('me_dw')
+          myAppEntity = null
   
           lastTime = null
           viewInfoFrustum?.clear()
@@ -103,9 +106,10 @@
   
           window.cesiumViewer.camera.lookAtTransform(globalCesium.Matrix4.IDENTITY)
           store.commit('SET_CURRENTANGLE', 1)
+          removeAllPoint()
         }
       } else {
-        if (deviceInfo.mode_code && [3, 4, 5, 9, 10].includes(deviceInfo.mode_code)) {
+        if (deviceInfo.mode_code && [3, 4, 5, 9, 10, 17].includes(deviceInfo.mode_code)) {
           // 暂时把视锥代码注释掉
           initCreateFrustum(deviceInfo, viewDroneInfo)
           addFlyGltf(
@@ -146,7 +150,7 @@
         })
       }
       
-      if (data.deviceInfo[data.currentSn].mode_code && [3, 4, 5, 9, 10].includes(deviceInfo.mode_code)) {
+      if (data.deviceInfo[data.currentSn].mode_code && [3, 4, 5, 9, 10, 17].includes(deviceInfo.mode_code)) {
         if (switchSaving) return (switchSaving = false)
         const newPositions = globalCesium.Cartesian3.fromDegrees(
           data.deviceInfo[data.currentSn].longitude,

--
Gitblit v1.9.3