jihongshun
8 天以前 1330e34042e89d5b0062a185ead01a7f66323be5
创建项目 生成航线
已修改3个文件
48 ■■■■■ 文件已修改
src/api/system/template.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/components/cesium-map.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/project/components/addPorjectDialog.vue 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/system/template.js
@@ -32,3 +32,11 @@
    method: 'get'
  });
}
export function buildKmz(data) {
  return request({
    url: '/buildKmz',
    method: 'post',
    data: data
  });
}
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);
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'
            })
        }
      })
    }
  }
}