|
@@ -9,7 +9,7 @@
|
|
|
|
|
|
<div class="flex-1 relative mb-4">
|
|
|
<Transition name="emerge-left">
|
|
|
- <el-form ref="formRef" v-show="currentStep === 0" :model="form" :rules="rules" label-position="left"
|
|
|
+ <el-form ref="formRef" v-show="currentStep === 0" :model="form" :rules="rules" label-position="left"
|
|
|
size="large" class="p-form p-main">
|
|
|
<el-form-item label="名称" prop="name">
|
|
|
<el-input v-model="form.name" clearable></el-input>
|
|
@@ -153,7 +153,7 @@
|
|
|
|
|
|
|
|
|
<div class="text-center">
|
|
|
- <el-button v-if="currentStep === 0" class="btn-main" @click="toNext">下一步</el-button>
|
|
|
+ <el-button v-if="currentStep === 0" :disabled="!hasDraw" class="btn-main" @click="toNext">下一步</el-button>
|
|
|
<template v-if="currentStep === 1">
|
|
|
<el-button class="btn-main" @click="toPrev">上一步</el-button>
|
|
|
<el-button class="btn-main" @click="handlePreview">计划预演</el-button>
|
|
@@ -165,7 +165,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import {ref, onMounted, watch, onBeforeUnmount} from 'vue';
|
|
|
+import {ref, onMounted, watch, onBeforeUnmount, computed} from 'vue';
|
|
|
import {routePlanAll, saveRoute, searchQJCList} from "@/service/panelHxhs.js";
|
|
|
import {geometryMeshEffect, getPathCube, showAndRedrawPath} from "@/utils/map/addTool.js";
|
|
|
import useLayoutStore from '@/store/layout'
|
|
@@ -188,9 +188,9 @@ const form = ref({
|
|
|
|
|
|
const portOptions = []
|
|
|
|
|
|
-const rules = [
|
|
|
-
|
|
|
-]
|
|
|
+const rules = {
|
|
|
+ name: [{ required: true, message: '请输入空域名称', trigger: 'none' }]
|
|
|
+}
|
|
|
|
|
|
const formRef = ref(null)
|
|
|
|
|
@@ -240,6 +240,13 @@ let plans = ref([
|
|
|
{ id: '3',name:'shortestPath', feature: '距离最短',color:'#FFA5FF', distance: '', risk: '50' },
|
|
|
])
|
|
|
|
|
|
+const isSafe = computed(() => {
|
|
|
+ return results.value.every(i => i.level === 1)
|
|
|
+})
|
|
|
+
|
|
|
+const hasDraw = ref(false)
|
|
|
+
|
|
|
+
|
|
|
function handlePickPlan(plan) {
|
|
|
currentPlan.value = plan.id;
|
|
|
showAllPathByType()
|
|
@@ -261,6 +268,7 @@ function toPrev() {
|
|
|
getPathCube({
|
|
|
status:"hide",
|
|
|
})
|
|
|
+ hasDraw.value = false;
|
|
|
showAndRedrawPath({
|
|
|
status:"hide",
|
|
|
});
|
|
@@ -350,6 +358,7 @@ function showOriginPath(){
|
|
|
[toPoint.x, toPoint.y,(form.value.height1 * 1 + form.value.height2 * 1)/2],
|
|
|
[toPoint.x, toPoint.y,toPoint.z]
|
|
|
]
|
|
|
+ hasDraw.value = true;
|
|
|
showAndRedrawPath({
|
|
|
status:"show",
|
|
|
path:currentPath
|
|
@@ -508,6 +517,7 @@ function getDrawGeometry(){
|
|
|
flyPathArr.push([item[0],item[1],(form.value.height1*1 + form.value.height2*1)/2 ]);
|
|
|
});
|
|
|
flyPathArr.push([path[path.length-1][0],path[path.length-1][1],0]);
|
|
|
+ hasDraw.value = true;
|
|
|
showAndRedrawPath({
|
|
|
status:"show",
|
|
|
path:flyPathArr
|
|
@@ -530,6 +540,7 @@ function getDrawGeometry(){
|
|
|
function changeDataType(){
|
|
|
if(form.value.dataType == '01'){ //手动
|
|
|
autoHeight = true;
|
|
|
+ hasDraw.value = true;
|
|
|
showAndRedrawPath({
|
|
|
status:"show",
|
|
|
radius:form.value.radius
|
|
@@ -544,11 +555,13 @@ function changeDataType(){
|
|
|
})
|
|
|
}else if(form.value.dataType == "02"){ //自动
|
|
|
autoHeight = false;
|
|
|
+ hasDraw.value = false;
|
|
|
showAndRedrawPath({
|
|
|
status:"hide"
|
|
|
});
|
|
|
}else if(form.value.dataType == "03"){ //导入航线
|
|
|
autoHeight = false;
|
|
|
+ hasDraw.value = false;
|
|
|
showAndRedrawPath({
|
|
|
status:"hide"
|
|
|
});
|