From c3db14b7043581195c0204767ebf2caebb33841e Mon Sep 17 00:00:00 2001
From: husq <931347610@qq.com>
Date: Mon, 30 Oct 2023 21:42:40 +0800
Subject: [PATCH] 实时轨迹逻辑修改待测试

---
 src/pages/page-web/projects/routeLine.vue |    9 +++++----
 src/pages/page-web/projects/tsa.vue       |    2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/pages/page-web/projects/routeLine.vue b/src/pages/page-web/projects/routeLine.vue
index 4b8f2df..d4d852f 100644
--- a/src/pages/page-web/projects/routeLine.vue
+++ b/src/pages/page-web/projects/routeLine.vue
@@ -60,14 +60,11 @@
   total: -1,
   page_size: 10
 }
-const waylinesData = reactive({
-  data: []
-})
 const routeLine = ref([])
 const workspaceId = computed(() => store.state.common.projectId || localStorage.getItem(ELocalStorageKey.WorkspaceId))
 const canRefresh = ref(true)
 const height = ref()
-const { removeById, addPolyline, getEntityById, flyTo } = cesiumOperation()
+const { removeById, addPolyline, getEntityById, flyTo, removeAllPoint } = cesiumOperation()
 
 onMounted(() => {
   const parent = document.getElementsByClassName('scrollbar').item(0)?.parentNode as HTMLDivElement
@@ -135,6 +132,10 @@
     getHistoryWay()
   }
 }
+onUnmounted(() => {
+  // removeById('drone_route_history')
+  removeAllPoint()
+})
 
 </script>
 
diff --git a/src/pages/page-web/projects/tsa.vue b/src/pages/page-web/projects/tsa.vue
index 745208b..1206a08 100644
--- a/src/pages/page-web/projects/tsa.vue
+++ b/src/pages/page-web/projects/tsa.vue
@@ -340,7 +340,6 @@
 const cesium = cesiumOperation()
 // 添加机场标注
 watch(() => store.state.deviceState, (data, oldData) => {
-  console.log(data, 'data')
   // cesium.removeAllPoint()
   if (data.currentType === EDeviceTypeName.Aircraft && data.deviceInfo[data.currentSn]) {
     // cesium.removeById('drone_fly')
@@ -354,6 +353,7 @@
       cesium.updateEntityPosition(data.deviceInfo[data.currentSn].longitude, data.deviceInfo[data.currentSn].latitude, 'drone_fly', orientation)
       // 根据机场状态码判断是否实时更新轨迹航线
       if (data.dockInfo[data.currentSn] && (data.dockInfo[data.currentSn].basic_osd.mode_code === 3 || data.dockInfo[data.currentSn].basic_osd.mode_code === 4 || data.dockInfo[data.currentSn].basic_osd.mode_code === 5)) {
+        console.log(data, '======', data.dockInfo[data.currentSn], '==========')
         // 生成新的位置数组
         const newPositions = Cesium.Cartesian3.fromDegreesArray([oldData.deviceInfo[data.currentSn].longitude, oldData.deviceInfo[data.currentSn].latitude, data.deviceInfo[data.currentSn].longitude, data.deviceInfo[data.currentSn].latitude])
         previousPositions.value = previousPositions.value.concat(newPositions)

--
Gitblit v1.9.3