From d63e1aaf1d33925b534e5fc9a708160cd13c0874 Mon Sep 17 00:00:00 2001
From: GuLiMmo <2820890765@qq.com>
Date: Fri, 01 Dec 2023 14:34:37 +0800
Subject: [PATCH] 航线点位事件编辑修改

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

diff --git a/src/pages/page-web/projects/wayline.vue b/src/pages/page-web/projects/wayline.vue
index c6e07ed..49fd1f3 100644
--- a/src/pages/page-web/projects/wayline.vue
+++ b/src/pages/page-web/projects/wayline.vue
@@ -187,7 +187,7 @@
 const selectedPoint = ref<number | null>(null)
 
 // 对应事件
-const eventList: any = reactive<{
+const eventList = reactive<{
   key: string,
   name: string,
   icon?: string
@@ -206,6 +206,16 @@
     key: 'stopRecord',
     name: '结束录像',
     icon: getResource('waylinetool/camera-off.png'),
+  },
+  {
+    key: 'time',
+    name: '开始等时间隔拍照',
+    icon: getResource('waylinetool/shoot1.png'),
+  },
+  {
+    key: 'distance',
+    name: '开始等距间隔拍照',
+    icon: getResource('waylinetool/shoot2.png'),
   },
   {
     key: 'zoom',
@@ -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