From ecc89fd2f61441ea03a264f6111a6089ce4ed2aa Mon Sep 17 00:00:00 2001 From: jihongshun <1151753686@qq.com> Date: 星期一, 28 七月 2025 10:58:53 +0800 Subject: [PATCH] 视锥体保存更新 --- src/views/system/project/components/addPorjectDialog.vue | 38 ++++++++++++++++++++++++++++++++++++-- 1 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/views/system/project/components/addPorjectDialog.vue b/src/views/system/project/components/addPorjectDialog.vue index 89e5cc5..d7fdb06 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: { @@ -100,7 +100,7 @@ }, flyToLocal(row){ console.log(row) - const position = Cesium.Cartesian3.fromDegrees(row.longitude,row.latitude, row.altitude); + const position = Cesium.Cartesian3.fromDegrees(row.longitude,row.latitude, row.deviceHeight); // 璁剧疆妯″瀷鏂瑰悜锛堝彲閫夛級 const heading = Cesium.Math.toRadians(row.face); // 鏈濅笢鍗楁柟鍚� @@ -402,7 +402,41 @@ 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, + height: airPoint.height, + 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