|
@@ -37,13 +37,13 @@
|
|
|
</div>
|
|
|
<template v-if="form.dataType === '起降场规划'">
|
|
|
<el-form-item label="起飞场" prop="fromPort">
|
|
|
- <el-select v-model="form.fromPort" @click="showFromPart()" placeholder="">
|
|
|
+ <el-select v-model="form.fromPort" @change="showPort('fromPort')" placeholder="">
|
|
|
<el-option v-for="item in portOptions" :key="item.value" :label="item.label" :value="item.value"
|
|
|
:disabled="item.value === form.toPort" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="降落场" prop="toPort">
|
|
|
- <el-select v-model="form.toPort" @click="showToPart()" placeholder="">
|
|
|
+ <el-select v-model="form.toPort" @change="showPort('toPort')" placeholder="">
|
|
|
<el-option v-for="item in portOptions" :key="item.value" :label="item.label" :value="item.value"
|
|
|
:disabled="item.value === form.fromPort" />
|
|
|
</el-select>
|
|
@@ -149,13 +149,16 @@
|
|
|
<script setup>
|
|
|
import { ref,onMounted } from 'vue';
|
|
|
import {routePlanAll, searchQJCList} from "@/service/panelHxhs.js";
|
|
|
+import {geometryMeshEffect, getPathCube, showAndRedrawPath} from "@/utils/map/addTool.js";
|
|
|
|
|
|
const currentStep = ref(0)
|
|
|
-
|
|
|
+let currentPath = []; // 当前规划路径
|
|
|
const form = ref({
|
|
|
taskType: '短途运输',
|
|
|
uavType: '微型无人机',
|
|
|
dataType: '起降场规划',
|
|
|
+ height1: 60,
|
|
|
+ height2: 80
|
|
|
})
|
|
|
|
|
|
const portOptions = []
|
|
@@ -247,27 +250,77 @@ function getQJCList(){
|
|
|
portOptions.push({
|
|
|
label: item.name,
|
|
|
value: item.id,
|
|
|
- shape: item.shape
|
|
|
+ shape: item.shape,
|
|
|
+ geoType: item.geoType
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-function showFromPart(){
|
|
|
-
|
|
|
+function showPort(id){
|
|
|
+ geometryMeshEffect({
|
|
|
+ id: id,
|
|
|
+ status:"show",
|
|
|
+ data: [{
|
|
|
+ type: portOptions.find((item)=>item.value ==form.value[id]).geoType,
|
|
|
+ shape: {
|
|
|
+ ...JSON.parse(portOptions.find((item)=>item.value ==form.value[id]).shape),
|
|
|
+ color: [0,255,0,0.7]
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ })
|
|
|
+ showOriginPath()
|
|
|
}
|
|
|
|
|
|
+//起降场选择完成生成原始直线
|
|
|
+function showOriginPath(){
|
|
|
+ debugger
|
|
|
+ if(form.value.fromPort && form.value.toPort){
|
|
|
+ let formPoint = JSON.parse(portOptions.find((item)=>item.value ==form.value.fromPort).shape).point;
|
|
|
+ let toPoint = JSON.parse(portOptions.find((item)=>item.value ==form.value.toPort).shape).point;
|
|
|
+ currentPath = [
|
|
|
+ [formPoint.x, formPoint.y,formPoint.z],
|
|
|
+ [formPoint.x, formPoint.y,(form.value.height1 * 1 + form.value.height2 * 1)/2],
|
|
|
+ [toPoint.x, toPoint.y,(form.value.height1 * 1 + form.value.height2 * 1)/2],
|
|
|
+ [toPoint.x, toPoint.y,toPoint.z]
|
|
|
+ ]
|
|
|
+ showAndRedrawPath({
|
|
|
+ status:"show",
|
|
|
+ path:currentPath
|
|
|
+ });
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
|
|
|
-function getAutoPath(){
|
|
|
- if(form.value.dataType == "起降场规划"){
|
|
|
- let point1 = JSON.parse(portOptions.find((item)=>item.value ==form.value.fromPort).shape);
|
|
|
- let point2 = JSON.parse(portOptions.find((item)=>item.value ==form.value.toPort).shape);
|
|
|
-
|
|
|
+//查询网格
|
|
|
+function queryCube(){
|
|
|
+ getPathCube({
|
|
|
+ status:"show",
|
|
|
+ paths:[currentPath]
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
|
|
|
- routePlanAll()
|
|
|
|
|
|
+//辅助规划
|
|
|
+function getAutoPath(){
|
|
|
+ if(form.value.dataType == "起降场规划"){
|
|
|
+ let paramsPaths = [];
|
|
|
+ currentPath.forEach((item) =>{
|
|
|
+ paramsPaths.push({
|
|
|
+ x:item[0],
|
|
|
+ y:item[1],
|
|
|
+ z:item[2]
|
|
|
+ })
|
|
|
+ })
|
|
|
+ routePlanAll({
|
|
|
+ height1: form.value.height1,
|
|
|
+ height2: form.value.height2,
|
|
|
+ paths:paramsPaths
|
|
|
+ }).then(res=>{
|
|
|
+ let data = res.data.data;
|
|
|
+
|
|
|
+ });
|
|
|
}else if(form.value.dataType == "航线规划"){
|
|
|
|
|
|
}else if(form.value.dataType == "导入航线"){
|