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 | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 40 insertions(+), 3 deletions(-) diff --git a/src/views/system/project/components/addPorjectDialog.vue b/src/views/system/project/components/addPorjectDialog.vue index bed4cfe..d7fdb06 100644 --- a/src/views/system/project/components/addPorjectDialog.vue +++ b/src/views/system/project/components/addPorjectDialog.vue @@ -47,7 +47,6 @@ class="filter-tree" :data="treeData" :props="defaultProps" - draggable default-expand-all ref="tree"> </el-tree> @@ -71,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: { @@ -97,10 +96,11 @@ methods:{ handleClose(){ this.dialogVisible = false + this.$emit('close') }, 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); // 鏈濅笢鍗楁柟鍚� @@ -400,6 +400,43 @@ const rotatedZ = localStartPoint.z; //聽Z杞村潗鏍囦繚鎸佷笉鍙� //聽灏嗘棆杞悗鐨勫眬閮ㄥ潗鏍囪浆鎹㈠洖涓栫晫鍧愭爣绯� 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