|
@@ -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>
|
|
@@ -36,19 +36,19 @@
|
|
|
<el-radio label="导入航线" value="03" />
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- <div v-if="form.dataType === '01'" @click="changeDataType()" class="msg-draw">
|
|
|
+ <div v-if="form.dataType === '01'" @click="changeDataType()" class="msg-draw">
|
|
|
<img src="../../../assets/images/page/icon-draw.png" alt="">
|
|
|
<span>重新绘制</span>
|
|
|
</div>
|
|
|
<template v-if="form.dataType === '02'">
|
|
|
<el-form-item label="起飞场" prop="fromPort">
|
|
|
- <el-select v-model="form.fromPort" @change="showPort('fromPort')" 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" @change="showPort('toPort')" 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>
|
|
@@ -94,13 +94,13 @@
|
|
|
end="23:45" class="flex-1" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="网格查询">
|
|
|
-<!-- <el-checkbox v-model="form.grade">评分</el-checkbox>-->
|
|
|
+ <!-- <el-checkbox v-model="form.grade">评分</el-checkbox>-->
|
|
|
<el-button class="btn-secondary ml-4" @click="queryCube()">查询网格</el-button>
|
|
|
<el-button class="btn-secondary ml-4" @click="closeCube()">关闭网格</el-button>
|
|
|
</el-form-item>
|
|
|
-<!-- <el-form-item label="辅助规划">-->
|
|
|
-<!-- <el-button class="btn-secondary" @click="getAutoPath()" >辅助规划</el-button>-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
+ <!-- <el-form-item label="辅助规划">-->
|
|
|
+ <!-- <el-button class="btn-secondary" @click="getAutoPath()" >辅助规划</el-button>-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
</el-form>
|
|
|
</Transition>
|
|
|
<Transition name="emerge-right">
|
|
@@ -108,7 +108,9 @@
|
|
|
<ul class="list-plans flex justify-evenly mb-4">
|
|
|
<li v-for="item in plans" class="pt-7 cursor-pointer hover:brightness-125"
|
|
|
:class="{ 'active': item.id === currentPlan }" @click="handlePickPlan(item)">
|
|
|
- <div class="text-base"><span class="tuli" :style="{backgroundColor:item.color}"></span>{{ item.feature }}</div>
|
|
|
+ <div class="text-base"><span class="tuli" :style="{ backgroundColor: item.color }"></span>{{ item.feature
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
<div class="text-sm py-1">距离 <span class="num">{{ item.distance }}</span> 公里</div>
|
|
|
<div class="text-sm">风险度:<span class="num">{{ item.risk }}</span></div>
|
|
|
</li>
|
|
@@ -121,39 +123,44 @@
|
|
|
|
|
|
<div v-if="isSafe" class="msg-safe mb-2">当前计划无冲突!</div>
|
|
|
|
|
|
- <div v-for="item in results" :key="item.title" class="mb-3">
|
|
|
- <div class="title-sub">
|
|
|
- {{ item.title }}
|
|
|
- <div class="flex-1 flex justify-between items-center pl-2">
|
|
|
- <span class="risk-label" :class="item.level === '低风险' ? 'green' : 'orange'">{{ item.level
|
|
|
- }}</span>
|
|
|
- <span class="btn-inline">重新评估</span>
|
|
|
+ <template v-else>
|
|
|
+ <div v-for="item in results" :key="item.title" class="mb-3">
|
|
|
+ <div class="title-sub">
|
|
|
+ {{ item.title }}
|
|
|
+ <div class="flex-1 flex justify-between items-center pl-2">
|
|
|
+ <span v-if="item.level" class="risk-label"
|
|
|
+ :class="riskTypes.find(i => i.value === item.level).color">{{
|
|
|
+ riskTypes.find(i => i.value === item.level).label
|
|
|
+ }}</span>
|
|
|
+ <i v-else></i>
|
|
|
+ <span class="btn-inline" @click="handleReInspect">重新评估</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <table class="table-default stripe mt-2">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th v-for="th in item.cols">{{ th }}</th>
|
|
|
+ <th class="w-20">地图显示</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <tr v-for="row in item.details">
|
|
|
+ <td v-for="key in Object.keys(item.cols)">{{ row[key] }}</td>
|
|
|
+ <td class="w-20">
|
|
|
+ <el-checkbox size="large" v-model="row.display"></el-checkbox>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
</div>
|
|
|
- <table class="table-default stripe mt-2">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th v-for="th in item.cols">{{ th }}</th>
|
|
|
- <th class="w-20">地图显示</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- <tr v-for="row in item.details">
|
|
|
- <td v-for="key in Object.keys(item.cols)">{{ row[key] }}</td>
|
|
|
- <td class="w-20">
|
|
|
- <el-checkbox size="large" v-model="row.display"></el-checkbox>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</Transition>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<div class="text-center">
|
|
|
- <el-button v-if="currentStep === 0" :disabled="!hasDraw" 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,12 +172,13 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-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 { 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'
|
|
|
-import {useMapStore} from "@/store/map.js";
|
|
|
-import {ElMessage} from "element-plus";
|
|
|
+import { useMapStore } from "@/store/map.js";
|
|
|
+import { riskTypes } from '@/utils/options';
|
|
|
+
|
|
|
const currentStep = ref(0)
|
|
|
let currentPath = []; // 当前规划路径
|
|
|
let allPathArr = []; // 所有路径
|
|
@@ -183,7 +191,7 @@ const form = ref({
|
|
|
dataType: '02',
|
|
|
height1: 60,
|
|
|
height2: 80,
|
|
|
- radius:5
|
|
|
+ radius: 5
|
|
|
})
|
|
|
|
|
|
const portOptions = []
|
|
@@ -197,47 +205,42 @@ const formRef = ref(null)
|
|
|
const results = ref([
|
|
|
{
|
|
|
title: '空域评估',
|
|
|
- level: '低风险',
|
|
|
- cols: { areaName: '冲突空域', height: '冲突高度' },
|
|
|
- details: [
|
|
|
- { areaName: '虹桥机场净空区', height: '112-120', display: false },
|
|
|
- { areaName: '虹桥机场净空区', height: '112-120', display: false },
|
|
|
- ]
|
|
|
+ level: null,
|
|
|
+ cols: { areaName: '冲突空域', time: '冲突时段', height: '冲突高度' },
|
|
|
+ details: []
|
|
|
},
|
|
|
{
|
|
|
title: '计划冲突',
|
|
|
- level: '低风险',
|
|
|
- cols: { areaName: '冲突空域', height: '冲突高度' },
|
|
|
- details: [
|
|
|
- { areaName: '合生汇-黄兴公园美团飞行计划', height: '112-120', display: false },
|
|
|
- { areaName: '合生汇-黄兴公园美团飞行计划', height: '112-120', display: false },
|
|
|
- ]
|
|
|
+ level: null,
|
|
|
+ cols: { areaName: '冲突空域', time: '冲突时段', height: '冲突高度' },
|
|
|
+ details: []
|
|
|
},
|
|
|
{
|
|
|
title: '障碍物分析',
|
|
|
- level: '高风险',
|
|
|
+ level: null,
|
|
|
cols: { object: '冲突空域', height: '冲突高度' },
|
|
|
- details: [
|
|
|
- { object: '建筑物', height: '112-120', display: false },
|
|
|
- { object: '建筑物', height: '112-120', display: false },
|
|
|
- ]
|
|
|
+ details: []
|
|
|
},
|
|
|
{
|
|
|
title: '地面安全评估',
|
|
|
- level: '高风险',
|
|
|
+ level: null,
|
|
|
cols: { element: '要素', coverage: '覆盖率' },
|
|
|
- details: [
|
|
|
- { element: '路面', coverage: '40%', display: false },
|
|
|
- { element: '道路', coverage: '20%', display: false },
|
|
|
- { element: '综合占比', coverage: '60%', display: false },
|
|
|
- ]
|
|
|
+ details: []
|
|
|
}
|
|
|
])
|
|
|
|
|
|
+function handleReInspect() {
|
|
|
+ layoutStore.toggleGlobalLoading(true)
|
|
|
+ closeCube()
|
|
|
+ setTimeout(() => {
|
|
|
+ queryCube()
|
|
|
+ }, 500);
|
|
|
+}
|
|
|
+
|
|
|
let plans = ref([
|
|
|
- { id: '1',name:'originalPath', feature: '接近原方案',color:'#FFA500', distance: '', risk: '50' },
|
|
|
- { id: '2',name:'safePath', feature: '地面风险较低',color:'#00FF00', distance: '', risk: '10' },
|
|
|
- { id: '3',name:'shortestPath', feature: '距离最短',color:'#FFA5FF', distance: '', risk: '50' },
|
|
|
+ { id: '1', name: 'originalPath', feature: '接近原方案', color: '#FFA500', distance: '', risk: '50' },
|
|
|
+ { id: '2', name: 'safePath', feature: '地面风险较低', color: '#00FF00', distance: '', risk: '10' },
|
|
|
+ { id: '3', name: 'shortestPath', feature: '距离最短', color: '#FFA5FF', distance: '', risk: '50' },
|
|
|
])
|
|
|
|
|
|
const isSafe = computed(() => {
|
|
@@ -246,10 +249,56 @@ const isSafe = computed(() => {
|
|
|
|
|
|
const hasDraw = ref(false)
|
|
|
|
|
|
+function formatResult(res) {
|
|
|
+ console.log('formatResult:', res)
|
|
|
+ const { groundSafety, lineConflictArray, obstacle, spaceConflictArray, spaceRisk, lineRisk } = res
|
|
|
+
|
|
|
+ results.value[0].level = spaceRisk
|
|
|
+ results.value[1].level = lineRisk
|
|
|
+ results.value[2].level = obstacle.risk
|
|
|
+ results.value[3].level = groundSafety.risk
|
|
|
+
|
|
|
+ results.value[0].details = spaceConflictArray.map(i => ({
|
|
|
+ areaName: i.gridName,
|
|
|
+ height: i.heightRange,
|
|
|
+ time: i.conflictTime,
|
|
|
+ display: false
|
|
|
+ }))
|
|
|
+
|
|
|
+ results.value[1].details = lineConflictArray.map(i => ({
|
|
|
+ areaName: i.gridName,
|
|
|
+ height: i.heightRange,
|
|
|
+ time: i.conflictTime,
|
|
|
+ display: false
|
|
|
+ }))
|
|
|
+
|
|
|
+ results.value[2].details = [
|
|
|
+ { time: '01-249:00-01-25 10-00', object: '建筑物', height: obstacle.buildingConflictHeight, display: false },
|
|
|
+ { time: '01-249:00-01-25 10-00', object: '建筑物缓冲区', height: obstacle.buildingBufferConflictHeight, display: false },
|
|
|
+ ]
|
|
|
+
|
|
|
+ const toPercent = (num) => {
|
|
|
+ return Math.round(num * 100) + '%'
|
|
|
+ }
|
|
|
+
|
|
|
+ results.value[3].details = [
|
|
|
+ { element: '道路', coverage: toPercent(groundSafety.road), display: false },
|
|
|
+ { element: '河流', coverage: toPercent(groundSafety.river), display: false },
|
|
|
+ { element: '绿化', coverage: toPercent(groundSafety.green), display: false },
|
|
|
+ { element: '综合占比', coverage: toPercent(groundSafety.road + groundSafety.river + groundSafety.green), display: false },
|
|
|
+ ]
|
|
|
+
|
|
|
+ layoutStore.toggleGlobalLoading(false)
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
function handlePickPlan(plan) {
|
|
|
currentPlan.value = plan.id;
|
|
|
showAllPathByType()
|
|
|
+
|
|
|
+ const conflicts = allPathArr[plan.name]?.conflicts
|
|
|
+ if (!conflicts) return
|
|
|
+ formatResult(conflicts.gridConflict)
|
|
|
}
|
|
|
|
|
|
const currentPlan = ref('1');
|
|
@@ -266,19 +315,19 @@ function toNext() {
|
|
|
function toPrev() {
|
|
|
currentStep.value = 0
|
|
|
getPathCube({
|
|
|
- status:"hide",
|
|
|
+ status: "hide",
|
|
|
})
|
|
|
hasDraw.value = false;
|
|
|
showAndRedrawPath({
|
|
|
- status:"hide",
|
|
|
+ status: "hide",
|
|
|
});
|
|
|
geometryMeshEffect({
|
|
|
id: "fromPort",
|
|
|
- status:"hide"
|
|
|
+ status: "hide"
|
|
|
})
|
|
|
geometryMeshEffect({
|
|
|
id: "toPort",
|
|
|
- status:"hide"
|
|
|
+ status: "hide"
|
|
|
})
|
|
|
geometryMeshEffect({
|
|
|
"status": "hide",
|
|
@@ -290,20 +339,20 @@ function toPrev() {
|
|
|
function handleSave() {
|
|
|
saveRoute({
|
|
|
...form.value,
|
|
|
- shape: JSON.stringify({paths:[currentPath]})
|
|
|
- }).then(res =>{
|
|
|
- if(res.data.code == 200 && res.data.msg == "success"){
|
|
|
+ shape: JSON.stringify({ paths: [currentPath] })
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data.code == 200 && res.data.msg == "success") {
|
|
|
ElMessage({
|
|
|
type: 'success',
|
|
|
message: '保存成功'
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
ElMessage({
|
|
|
type: 'error',
|
|
|
message: '保存失败'
|
|
|
})
|
|
|
}
|
|
|
- }).catch(()=>{
|
|
|
+ }).catch(() => {
|
|
|
ElMessage({
|
|
|
type: 'error',
|
|
|
message: '保存失败'
|
|
@@ -316,10 +365,10 @@ function handlePreview() {
|
|
|
}
|
|
|
|
|
|
//获取起降数据
|
|
|
-function getQJCList(){
|
|
|
- searchQJCList().then(res=>{
|
|
|
+function getQJCList() {
|
|
|
+ searchQJCList().then(res => {
|
|
|
let data = res.data.data;
|
|
|
- data.forEach((item)=>{
|
|
|
+ data.forEach((item) => {
|
|
|
portOptions.push({
|
|
|
label: item.name,
|
|
|
value: item.id,
|
|
@@ -330,15 +379,15 @@ function getQJCList(){
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-function showPort(id){
|
|
|
+function showPort(id) {
|
|
|
geometryMeshEffect({
|
|
|
id: id,
|
|
|
- status:"show",
|
|
|
+ status: "show",
|
|
|
data: [{
|
|
|
- type: portOptions.find((item)=>item.value ==form.value[id]).geoType,
|
|
|
+ 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]
|
|
|
+ ...JSON.parse(portOptions.find((item) => item.value == form.value[id]).shape),
|
|
|
+ color: [0, 255, 0, 0.7]
|
|
|
}
|
|
|
}]
|
|
|
})
|
|
@@ -346,190 +395,191 @@ function showPort(id){
|
|
|
}
|
|
|
|
|
|
//起降场选择完成生成原始直线
|
|
|
-function showOriginPath(){
|
|
|
- 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;
|
|
|
+function showOriginPath() {
|
|
|
+ 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;
|
|
|
debugger
|
|
|
currentPath = [
|
|
|
- [formPoint.x, formPoint.y,formPoint.z],
|
|
|
- [formPoint.x, formPoint.y,(form.value.height1 * 1 + form.value.height2 * 1)/2],
|
|
|
- [(formPoint.x + toPoint.x)/2, (formPoint.y + toPoint.y)/2,(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]
|
|
|
+ [formPoint.x, formPoint.y, formPoint.z],
|
|
|
+ [formPoint.x, formPoint.y, (form.value.height1 * 1 + form.value.height2 * 1) / 2],
|
|
|
+ [(formPoint.x + toPoint.x) / 2, (formPoint.y + toPoint.y) / 2, (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]
|
|
|
]
|
|
|
hasDraw.value = true;
|
|
|
showAndRedrawPath({
|
|
|
- status:"show",
|
|
|
- path:currentPath
|
|
|
+ status: "show",
|
|
|
+ path: currentPath
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
//查询网格
|
|
|
-function queryCube(){
|
|
|
+function queryCube() {
|
|
|
getPathCube({
|
|
|
- status:"show",
|
|
|
- paths:[currentPath]
|
|
|
+ status: "show",
|
|
|
+ paths: [currentPath]
|
|
|
})
|
|
|
}
|
|
|
|
|
|
//关闭网格
|
|
|
-function closeCube(){
|
|
|
+function closeCube() {
|
|
|
getPathCube({
|
|
|
- status:"hide"
|
|
|
+ status: "hide"
|
|
|
})
|
|
|
}
|
|
|
|
|
|
|
|
|
//辅助规划
|
|
|
-function getAutoPath(){
|
|
|
- let paramsPaths = [];
|
|
|
- currentPath.forEach((item) =>{
|
|
|
- paramsPaths.push({
|
|
|
- x:item[0],
|
|
|
- y:item[1],
|
|
|
- z:item[2]
|
|
|
- })
|
|
|
+function getAutoPath() {
|
|
|
+ let paramsPaths = [];
|
|
|
+ currentPath.forEach((item) => {
|
|
|
+ paramsPaths.push({
|
|
|
+ x: item[0],
|
|
|
+ y: item[1],
|
|
|
+ z: item[2]
|
|
|
})
|
|
|
- layoutStore.toggleGlobalLoading(true)
|
|
|
- routePlanAll({
|
|
|
- height1: form.value.height1,
|
|
|
- height2: form.value.height2,
|
|
|
- paths:paramsPaths
|
|
|
- }).then(res=>{
|
|
|
- layoutStore.toggleGlobalLoading(false)
|
|
|
- debugger
|
|
|
- let data = res.data.data;
|
|
|
- allPathArr = data;
|
|
|
- plans.value.forEach((item)=>{
|
|
|
- item.distance = (data[item.name].length/1000).toFixed(2)
|
|
|
- });
|
|
|
- showAllPathByType();
|
|
|
+ })
|
|
|
+ layoutStore.toggleGlobalLoading(true)
|
|
|
+ routePlanAll({
|
|
|
+ height1: form.value.height1,
|
|
|
+ height2: form.value.height2,
|
|
|
+ paths: paramsPaths
|
|
|
+ }).then(res => {
|
|
|
+ debugger
|
|
|
+ let data = res.data.data;
|
|
|
+ allPathArr = data;
|
|
|
+ plans.value.forEach((item) => {
|
|
|
+ item.distance = (data[item.name].length / 1000).toFixed(2)
|
|
|
});
|
|
|
+ handlePickPlan(plans.value[0])
|
|
|
+ }).finally(() => {
|
|
|
+ layoutStore.toggleGlobalLoading(false)
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
|
|
|
-function showAllPathByType(){
|
|
|
+function showAllPathByType() {
|
|
|
let otherPathArr = [];
|
|
|
- if(currentPlan.value == 1){ //接近原路线
|
|
|
- if(allPathArr.safePath.path.length > 0){
|
|
|
+ if (currentPlan.value == 1) { //接近原路线
|
|
|
+ if (allPathArr.safePath.path.length > 0) {
|
|
|
otherPathArr.push({
|
|
|
"name": "安全路径",
|
|
|
"type": "polyline",
|
|
|
- "shape":{
|
|
|
+ "shape": {
|
|
|
"radius": 10,
|
|
|
"paths": allPathArr.safePath.path,
|
|
|
- "color": [0,255,0,0.3]
|
|
|
+ "color": [0, 255, 0, 0.3]
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- if(allPathArr.shortestPath.path.length > 0){
|
|
|
+ if (allPathArr.shortestPath.path.length > 0) {
|
|
|
otherPathArr.push({
|
|
|
"name": "贴合路径",
|
|
|
"type": "polyline",
|
|
|
- "shape":{
|
|
|
+ "shape": {
|
|
|
"radius": 10,
|
|
|
"paths": allPathArr.shortestPath.path,
|
|
|
- "color": [255,165,255,0.3]
|
|
|
+ "color": [255, 165, 255, 0.3]
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
showAndRedrawPath({
|
|
|
- status:"show",
|
|
|
- path:allPathArr.originalPath.path,
|
|
|
- color:[255,234,0,0.7]
|
|
|
+ status: "show",
|
|
|
+ path: allPathArr.originalPath.path,
|
|
|
+ color: [255, 234, 0, 0.7]
|
|
|
});
|
|
|
currentPath = allPathArr.shortestPath.path;
|
|
|
- }else if(currentPlan.value == 2){ //安全
|
|
|
- if(allPathArr.shortestPath.path.length > 0){
|
|
|
+ } else if (currentPlan.value == 2) { //安全
|
|
|
+ if (allPathArr.shortestPath.path.length > 0) {
|
|
|
otherPathArr.push({
|
|
|
"name": "最短路径",
|
|
|
"type": "polyline",
|
|
|
- "shape":{
|
|
|
+ "shape": {
|
|
|
"radius": 10,
|
|
|
"paths": allPathArr.shortestPath.path,
|
|
|
- "color": [255,165,255,0.3]
|
|
|
+ "color": [255, 165, 255, 0.3]
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- if(allPathArr.originalPath.path.length > 0){
|
|
|
+ if (allPathArr.originalPath.path.length > 0) {
|
|
|
otherPathArr.push({
|
|
|
"name": "贴合路径",
|
|
|
"type": "polyline",
|
|
|
- "shape":{
|
|
|
+ "shape": {
|
|
|
"radius": 10,
|
|
|
"paths": allPathArr.originalPath.path,
|
|
|
- "color": [255,234,0,0.3]
|
|
|
+ "color": [255, 234, 0, 0.3]
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
showAndRedrawPath({
|
|
|
- status:"show",
|
|
|
- path:allPathArr.safePath.path,
|
|
|
- color:[0,255,0,0.7]
|
|
|
+ status: "show",
|
|
|
+ path: allPathArr.safePath.path,
|
|
|
+ color: [0, 255, 0, 0.7]
|
|
|
});
|
|
|
currentPath = allPathArr.safePath.path;
|
|
|
- }else if(currentPlan.value == 3){ //最短
|
|
|
- if(allPathArr.safePath.path.length > 0){
|
|
|
+ } else if (currentPlan.value == 3) { //最短
|
|
|
+ if (allPathArr.safePath.path.length > 0) {
|
|
|
otherPathArr.push({
|
|
|
"name": "安全路径",
|
|
|
"type": "polyline",
|
|
|
- "shape":{
|
|
|
+ "shape": {
|
|
|
"radius": 10,
|
|
|
"paths": allPathArr.safePath.path,
|
|
|
- "color": [0,255,0,0.3]
|
|
|
+ "color": [0, 255, 0, 0.3]
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- if(allPathArr.originalPath.path.length > 0){
|
|
|
+ if (allPathArr.originalPath.path.length > 0) {
|
|
|
otherPathArr.push({
|
|
|
"name": "贴合路径",
|
|
|
"type": "polyline",
|
|
|
- "shape":{
|
|
|
+ "shape": {
|
|
|
"radius": 10,
|
|
|
"paths": allPathArr.originalPath.path,
|
|
|
- "color": [255,234,0,0.3]
|
|
|
+ "color": [255, 234, 0, 0.3]
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
showAndRedrawPath({
|
|
|
- status:"show",
|
|
|
- path:allPathArr.shortestPath.path,
|
|
|
- color:[ 225,165,255,0.7]
|
|
|
+ status: "show",
|
|
|
+ path: allPathArr.shortestPath.path,
|
|
|
+ color: [225, 165, 255, 0.7]
|
|
|
});
|
|
|
currentPath = allPathArr.shortestPath.path;
|
|
|
}
|
|
|
geometryMeshEffect({
|
|
|
"status": "show",
|
|
|
"id": "drawAllPathOne",
|
|
|
- "data":otherPathArr
|
|
|
+ "data": otherPathArr
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-function getDrawGeometry(){
|
|
|
- if(mapStore.draw_geometry){
|
|
|
- if(autoHeight){
|
|
|
+function getDrawGeometry() {
|
|
|
+ if (mapStore.draw_geometry) {
|
|
|
+ if (autoHeight) {
|
|
|
let path = mapStore.draw_geometry.paths[0];
|
|
|
let flyPathArr = [path[0]];
|
|
|
path.forEach((item) => {
|
|
|
- flyPathArr.push([item[0],item[1],(form.value.height1*1 + form.value.height2*1)/2 ]);
|
|
|
+ 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]);
|
|
|
+ flyPathArr.push([path[path.length - 1][0], path[path.length - 1][1], 0]);
|
|
|
hasDraw.value = true;
|
|
|
showAndRedrawPath({
|
|
|
- status:"show",
|
|
|
- path:flyPathArr
|
|
|
+ status: "show",
|
|
|
+ path: flyPathArr
|
|
|
});
|
|
|
autoHeight = false;
|
|
|
currentPath = flyPathArr;
|
|
|
- }else{
|
|
|
- if(currentPlan.value == 1){ //最接近原航线,替换原航线数据
|
|
|
+ } else {
|
|
|
+ if (currentPlan.value == 1) { //最接近原航线,替换原航线数据
|
|
|
allPathArr.originalPath.path = mapStore.draw_geometry.paths[0];
|
|
|
- }else if(currentPlan.value == 2){ //最安全
|
|
|
+ } else if (currentPlan.value == 2) { //最安全
|
|
|
allPathArr.safePath.path = mapStore.draw_geometry.paths[0];
|
|
|
- }else if(currentPlan.value == 3){ //最短
|
|
|
+ } else if (currentPlan.value == 3) { //最短
|
|
|
allPathArr.shortestPath.path = mapStore.draw_geometry.paths[0];
|
|
|
}
|
|
|
currentPath = mapStore.draw_geometry.paths[0];
|
|
@@ -537,41 +587,41 @@ function getDrawGeometry(){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function changeDataType(){
|
|
|
- if(form.value.dataType == '01'){ //手动
|
|
|
+function changeDataType() {
|
|
|
+ if (form.value.dataType == '01') { //手动
|
|
|
autoHeight = true;
|
|
|
hasDraw.value = true;
|
|
|
showAndRedrawPath({
|
|
|
- status:"show",
|
|
|
- radius:form.value.radius
|
|
|
+ status: "show",
|
|
|
+ radius: form.value.radius
|
|
|
});
|
|
|
geometryMeshEffect({
|
|
|
id: "fromPort",
|
|
|
- status:"hide"
|
|
|
+ status: "hide"
|
|
|
})
|
|
|
geometryMeshEffect({
|
|
|
id: "toPort",
|
|
|
- status:"hide"
|
|
|
+ status: "hide"
|
|
|
})
|
|
|
- }else if(form.value.dataType == "02"){ //自动
|
|
|
+ } else if (form.value.dataType == "02") { //自动
|
|
|
autoHeight = false;
|
|
|
hasDraw.value = false;
|
|
|
showAndRedrawPath({
|
|
|
- status:"hide"
|
|
|
+ status: "hide"
|
|
|
});
|
|
|
- }else if(form.value.dataType == "03"){ //导入航线
|
|
|
+ } else if (form.value.dataType == "03") { //导入航线
|
|
|
autoHeight = false;
|
|
|
hasDraw.value = false;
|
|
|
showAndRedrawPath({
|
|
|
- status:"hide"
|
|
|
+ status: "hide"
|
|
|
});
|
|
|
geometryMeshEffect({
|
|
|
id: "fromPort",
|
|
|
- status:"hide"
|
|
|
+ status: "hide"
|
|
|
})
|
|
|
geometryMeshEffect({
|
|
|
id: "toPort",
|
|
|
- status:"hide"
|
|
|
+ status: "hide"
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -580,7 +630,7 @@ function changeDataType(){
|
|
|
|
|
|
|
|
|
|
|
|
-onMounted(()=>{
|
|
|
+onMounted(() => {
|
|
|
getQJCList()
|
|
|
})
|
|
|
|
|
@@ -591,7 +641,8 @@ watch(() => mapStore.draw_geometry, (val) => {
|
|
|
})
|
|
|
|
|
|
watch(() => mapStore.cubeResult, (val) => {
|
|
|
- //showConflict()
|
|
|
+ formatResult(val)
|
|
|
+ layoutStore.toggleGlobalLoading(false)
|
|
|
}, { deep: true })
|
|
|
|
|
|
|
|
@@ -636,12 +687,14 @@ onBeforeUnmount(() => {
|
|
|
background: url('../../../assets/images/page/bg-plan.png');
|
|
|
background-size: 100% !important;
|
|
|
text-align: center;
|
|
|
- .tuli{
|
|
|
+
|
|
|
+ .tuli {
|
|
|
display: inline-block;
|
|
|
margin-right: 4px;
|
|
|
width: 10px;
|
|
|
height: 10px;
|
|
|
}
|
|
|
+
|
|
|
.num {
|
|
|
color: #8CBCFF;
|
|
|
}
|