From 1330e34042e89d5b0062a185ead01a7f66323be5 Mon Sep 17 00:00:00 2001
From: jihongshun <1151753686@qq.com>
Date: 星期五, 18 七月 2025 08:43:10 +0800
Subject: [PATCH] 创建项目 生成航线

---
 src/api/system/template.js                               |    8 ++++++++
 src/utils/components/cesium-map.vue                      |    5 +++++
 src/views/system/project/components/addPorjectDialog.vue |   35 ++++++++++++++++++++++++++++++++++-
 3 files changed, 47 insertions(+), 1 deletions(-)

diff --git a/src/api/system/template.js b/src/api/system/template.js
index 9354c60..4f8b3d2 100644
--- a/src/api/system/template.js
+++ b/src/api/system/template.js
@@ -32,3 +32,11 @@
     method: 'get'
   });
 }
+
+export function buildKmz(data) {
+  return request({
+    url: '/buildKmz',
+    method: 'post',
+    data: data
+  });
+}
diff --git a/src/utils/components/cesium-map.vue b/src/utils/components/cesium-map.vue
index e8e7a1c..92c1e86 100644
--- a/src/utils/components/cesium-map.vue
+++ b/src/utils/components/cesium-map.vue
@@ -138,6 +138,11 @@
         timeline: false,
         fullscreenButton: false,
         vrButton: false,
+//         terrainProvider:聽new聽Cesium.CesiumTerrainProvider({
+// 聽聽聽聽聽聽聽聽聽聽聽聽url聽:聽Cesium.IonResource.fromAssetId(1),
+// 聽聽聽聽聽聽聽聽聽聽聽聽requestWaterMask:聽true,聽//聽璇锋眰姘翠綋鏁堟灉鎵�闇�瑕佺殑娴峰哺绾挎暟鎹�
+// 聽聽聽聽聽聽聽聽聽聽聽聽requestVertexNormals:聽true,聽//聽璇锋眰鍦板舰鐓ф槑鏁版嵁
+// 聽聽聽聽聽聽聽聽})
       });
       // viewer.imageryLayers.add(tdtannoimagery);
       viewer.imageryLayers.add(bdtvectoranoimagery);
diff --git a/src/views/system/project/components/addPorjectDialog.vue b/src/views/system/project/components/addPorjectDialog.vue
index 89e5cc5..b0fafb8 100644
--- a/src/views/system/project/components/addPorjectDialog.vue
+++ b/src/views/system/project/components/addPorjectDialog.vue
@@ -70,7 +70,7 @@
 import CesiumMap from "../../../../utils/components/cesium-map.vue";
 import chooseDeviceDialog from './chooseDeviceDialog.vue';
 import chooseModelDialog from './chooseModelDialog.vue';
-import { obtainRealData} from "@/api/system/template"
+import { obtainRealData ,buildKmz} from "@/api/system/template"
 
 export  default{
   components: {
@@ -402,7 +402,40 @@
      return Cesium.Matrix4.multiplyByPoint(transformationMatrix,聽new聽Cesium.Cartesian3(rotatedX,聽rotatedY,聽rotatedZ),聽new聽Cesium.Cartesian3());
     },
     submit(){
+      console.log(this.treeData)
+
+      const routePointList = [];
+
+      this.treeData.forEach(device => {
+        device.children.forEach((airPoint, index) => {
+          routePointList.push({
+            routePointIndex: routePointList.length,
+            longitude: airPoint.longitude,
+            latitude: airPoint.latitude,
+            isStartAndEndPoint: false,
+          });
+        });
+      });
+
+      // 鏍囪棣栧熬涓� true
+      if (routePointList.length > 0) {
+        routePointList[0].isStartAndEndPoint = true;
+        routePointList[routePointList.length - 1].isStartAndEndPoint = true;
+      }
+
+      console.log(routePointList);
+      let params  = {
+        routePointList:routePointList
+      }
       console.log('鐢熸垚鑸嚎')
+      buildKmz(params).then(res=>{
+        if(res.code == 200) {
+           this.$message({
+              message: '鐢熸垚鑸嚎鎴愬姛',
+              type: 'success'
+            })
+        }
+      })
     }
   }
 }

--
Gitblit v1.9.3