From 1b179a0ac410e77b7ec3d187f7ca5fb4af23a997 Mon Sep 17 00:00:00 2001
From: jihongshun <1151753686@qq.com>
Date: 星期三, 24 九月 2025 11:51:57 +0800
Subject: [PATCH] 解决读取kmz问题

---
 src/views/system/project/components/addPorjectDialog.vue |   25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/src/views/system/project/components/addPorjectDialog.vue b/src/views/system/project/components/addPorjectDialog.vue
index a5a9a23..9ad2e80 100644
--- a/src/views/system/project/components/addPorjectDialog.vue
+++ b/src/views/system/project/components/addPorjectDialog.vue
@@ -444,7 +444,8 @@
                   newChild.height += (device.ardTowerModel?.modelHeight  - newChild.height +  20) ;
                   console.log('push11111111111111')
                   // 娣诲姞鍒癱hildren鏁扮粍鏈熬
-                  device.children.push(newChild);
+                  console.log(newChild)
+                  device.children.push(newChild); 
                 }
             }
           }
@@ -456,7 +457,7 @@
                 const newChild = JSON.parse(JSON.stringify(lastChild));
                 if(newChild.label.includes('鍔犻珮')) {
                 }else {
-                  newChild.label = newChild.label + '-鍔犻珮绗竴涓偣'
+                  newChild.label = newChild.label + '-鍔犻珮'
                   newChild.height += (device.ardTowerModel?.modelHeight  - newChild.height +  20) ;
                   // 娣诲姞鍒癱hildren鏁扮粍鏈熬
                   device.children.unshift(newChild);
@@ -711,22 +712,34 @@
       console.log(this.ruleForm)
 
       const routePointList = [];
-
+      this.treeData.forEach(item => {
+        // 閬嶅巻姣忎釜璁惧涓殑 children
+        item.children.forEach(child => {
+          // 鍒ゆ柇 label 鏄惁鍖呭惈 '鍔犻珮'
+          if (child.label.includes( '鍔犻珮')) {
+            // 鍒犻櫎 children 涓殑鎵�鏈夊湴闈㈢偣
+            // child.children = child.children.filter(subChild => !subChild.label.includes("鍦伴潰鐐�"));
+            child.children = []
+          }
+        });
+      })
+      console.log(this.treeData)
       this.treeData.forEach(device => {
         device.children.forEach((airPoint, index) => {
+          console.log(airPoint)
           routePointList.push({
             routePointIndex: routePointList.length,
             longitude: airPoint.longitude,
             latitude: airPoint.latitude,
             height: airPoint.height,
             isStartAndEndPoint: false,
-            actions:airPoint.children[0].actions || [],
+            actions:airPoint.children?.length !=0 ? airPoint.children[0]?.actions || [] : [],
             waypointName: airPoint.label,
-            coordinatePointReq: {
+            coordinatePointReq: airPoint.children?.length !=0 ? {
                 height: airPoint.children[0].height,
                 latitude:airPoint.children[0].latitude,
                 longitude: airPoint.children[0].longitude
-              }
+              } : null
           });
         });
       });

--
Gitblit v1.9.3