| | |
| | | class="filter-tree" |
| | | :data="treeData" |
| | | :props="defaultProps" |
| | | draggable |
| | | default-expand-all |
| | | ref="tree"> |
| | | </el-tree> |
| | |
| | | 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: { |
| | |
| | | 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); // 朝东南方向 |
| | |
| | | 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' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |