From 7d208ee6892bb60422f1204fa6edb139dc104209 Mon Sep 17 00:00:00 2001
From: xieb <vip_xiaobin810@163.com>
Date: Mon, 04 Dec 2023 09:53:51 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/demo' into demo

---
 src/pages/page-web/projects/wayline.vue |   57 +++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 39 insertions(+), 18 deletions(-)

diff --git a/src/pages/page-web/projects/wayline.vue b/src/pages/page-web/projects/wayline.vue
index 8dad990..49fd1f3 100644
--- a/src/pages/page-web/projects/wayline.vue
+++ b/src/pages/page-web/projects/wayline.vue
@@ -110,7 +110,12 @@
           </div>
           <div class="graph-right">
             <div v-for="(event, index) in item.eventList" :key="index" class="s-event-icon">
-              <img :src="event.icon" alt="icon" />
+              <a-tooltip placement="top">
+                <template #title>
+                  {{ event.name }}
+                </template>
+                <img :src="event.icon" alt="icon" />
+              </a-tooltip>
             </div>
           </div>
         </li>
@@ -177,12 +182,12 @@
 const isPointListOpen = ref<boolean>(false)
 const tragetPointArr = ref<{
   position: Cesium.Cartesian3,
-  eventList: string[]
+  eventList: any[]
 }[]>([])
 const selectedPoint = ref<number | null>(null)
 
 // 对应事件
-const eventList: any = reactive<{
+const eventList = reactive<{
   key: string,
   name: string,
   icon?: string
@@ -203,8 +208,14 @@
     icon: getResource('waylinetool/camera-off.png'),
   },
   {
-    key: 'focus',
-    name: '对焦'
+    key: 'time',
+    name: '开始等时间隔拍照',
+    icon: getResource('waylinetool/shoot1.png'),
+  },
+  {
+    key: 'distance',
+    name: '开始等距间隔拍照',
+    icon: getResource('waylinetool/shoot2.png'),
   },
   {
     key: 'zoom',
@@ -218,24 +229,18 @@
   },
   {
     key: 'gimbalRotate',
-    name: '旋转云台'
+    name: '旋转云台',
+    icon: getResource('waylinetool/holderyaw.png'),
   },
   {
     key: 'rotateYaw',
-    name: '飞行器偏航'
+    name: '飞行器偏航',
+    icon: getResource('waylinetool/droneyaw.png'),
   },
   {
     key: 'hover',
     name: '悬停等待',
     icon: getResource('waylinetool/xt.png'),
-  },
-  {
-    key: 'gimbalEvenlyRotate',
-    name: '航段间均匀转动云台pitch角'
-  },
-  {
-    key: 'orientedShoot',
-    name: '精准复拍动作'
   }
 ])
 
@@ -255,6 +260,7 @@
   }, 1000)
   console.log(workspaceId.value)
 })
+
 onUnmounted(() => {
   if (kmlDataSource) {
     global.$viewer.dataSources.remove(kmlDataSource)
@@ -263,7 +269,8 @@
   removeById('clickBox')
   store.commit('SET_WAYLINE_INFO', {
     isShow: false,
-    wayline: {}
+    wayline: {},
+    position: null,
   })
 })
 
@@ -332,7 +339,8 @@
   // 清除选中点柱形和隐藏按钮
   store.commit('SET_WAYLINE_INFO', {
     isShow: false,
-    wayline: {}
+    wayline: {},
+    position: null
   })
   removeById('clickBox')
   isPointListOpen.value = !isPointListOpen.value
@@ -407,7 +415,8 @@
   selectedPoint.value = index
   store.commit('SET_WAYLINE_INFO', {
     isShow: true,
-    wayline: currentWayLine
+    wayline: currentWayLine,
+    position: index
   })
   if (getEntityById('clickBox')) {
     removeById('clickBox')
@@ -430,6 +439,7 @@
       heightReference: true
     }
   }
+
   const boxEntity = global.$viewer.entities.add(entity)
   global.$viewer.flyTo(boxEntity, {
     duration: 3,
@@ -550,6 +560,8 @@
       const actionGroupReg = /<wpml:actionGroup>([\s\S]*?)<\/wpml:actionGroup>/g
       // 查找单个事件reg
       const actionRegx = /<wpml:action>([\s\S]*?)<\/wpml:action>/g
+      // 获取shootType
+      const shootTypeRegx = /<wpml:shootType>([\s\S]*?)<\/wpml:shootType>/g
       // 当前kmz文件航点
       const kmlPoints = kml.match(regx)
       kmlPoints?.forEach((point: string, index: number) => {
@@ -566,6 +578,15 @@
           })
           tragetPointArr.value[index].eventList = eventArr
         }
+        // 获取当前是否存在拍照模式
+        const pointShootTypeKML = point.match(shootTypeRegx)
+        if (pointShootTypeKML) {
+          pointShootTypeKML.forEach((type: string) => {
+            eventList.forEach((item: any) => {
+              type.includes(item.key) && eventArr.push(item)
+            })
+          })
+        }
       })
     })
 }

--
Gitblit v1.9.3