|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
创建人:Zhaipeixiu
|
|
|
|
|
-->
|
|
|
|
|
<script setup>
|
|
|
|
|
import {ChevronBack,ChevronForward, CreateOutline, DuplicateSharp, EyeSharp, Layers, Settings} from '@vicons/ionicons5'
|
|
|
|
|
import {ChevronBack,ChevronForward, CreateOutline, DuplicateSharp, EyeSharp, Layers, Settings,ReloadSharp} from '@vicons/ionicons5'
|
|
|
|
|
import {RulerAlt} from '@vicons/carbon'
|
|
|
|
|
import {TerrainSharp} from '@vicons/material'
|
|
|
|
|
import {DrawPolygon} from '@vicons/fa'
|
|
|
|
@ -201,7 +201,7 @@ async function connectWebSocket() {
|
|
|
|
|
hasPlane.value = true;
|
|
|
|
|
}
|
|
|
|
|
// 加载和更新碰撞检测图(50帧更新一次) (只在联网模式下启用)
|
|
|
|
|
if(frameCount>50 && lStore.openDetect && window.navigator.onLine){
|
|
|
|
|
if(frameCount>50 && lStore.openDetect && !store.networkStatus.offlineMode){
|
|
|
|
|
emit('resizeMap', detectDivHeight.value)
|
|
|
|
|
showDetection.value = true
|
|
|
|
|
frameCount = 0
|
|
|
|
@ -271,6 +271,9 @@ function closeWS(){
|
|
|
|
|
function manageLayer(){
|
|
|
|
|
layerManager.value?.open_closeSidebar()
|
|
|
|
|
}
|
|
|
|
|
function refreshPage(){
|
|
|
|
|
window.location.reload()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 绘制航线,目前只绘制任务航线
|
|
|
|
@ -284,19 +287,19 @@ function startDrawRoute(routeParams) {
|
|
|
|
|
drawLine.start().then(result => {
|
|
|
|
|
// result是经纬度坐标数组,需转换为 AirlinePoint数组
|
|
|
|
|
let AirlinePoints = []
|
|
|
|
|
result.forEach((pt,index) => {
|
|
|
|
|
result[0].forEach((pt,index) => {
|
|
|
|
|
let AirlinePoint = {lon:pt.lon, lat:pt.lat, alt:pt.alt, ch1:routeParams.isClose? 0:2, ch2:0x03, speed:0, nPt:index+1}
|
|
|
|
|
AirlinePoints.push(AirlinePoint)
|
|
|
|
|
})
|
|
|
|
|
AirlinePoints.at(-1).ch2 = 0x01;
|
|
|
|
|
// 航线加入store
|
|
|
|
|
let aRoute = {
|
|
|
|
|
code: routeParams.code, PtNum: result.length, isClose: routeParams.isClose, unicode: getUnicode(),
|
|
|
|
|
code: routeParams.code, PtNum: result[0].length, isClose: routeParams.isClose, unicode: getUnicode(),
|
|
|
|
|
name: routeParams.name, points: AirlinePoints, totalDistance: 0
|
|
|
|
|
}
|
|
|
|
|
useRouteStore().addRoute(aRoute)
|
|
|
|
|
console.log(useRouteStore().flyRoute)
|
|
|
|
|
// fixme: 航线加入图层管理
|
|
|
|
|
// 航线加入图层管理
|
|
|
|
|
lStore.addLayer(aRoute.name,undefined,undefined, result[1],true)
|
|
|
|
|
|
|
|
|
|
}).catch(reject => {
|
|
|
|
|
message.error(reject)
|
|
|
|
@ -374,6 +377,16 @@ function startDrawRoute(routeParams) {
|
|
|
|
|
</template>
|
|
|
|
|
</n-button>
|
|
|
|
|
</n-popselect>
|
|
|
|
|
<n-tooltip placement="bottom" trigger="hover">
|
|
|
|
|
<template #trigger>
|
|
|
|
|
<n-button tertiary type="warning" @click="refreshPage">
|
|
|
|
|
<template #icon>
|
|
|
|
|
<n-icon><ReloadSharp/></n-icon>
|
|
|
|
|
</template>
|
|
|
|
|
</n-button>
|
|
|
|
|
</template>
|
|
|
|
|
<span> 刷新页面 </span>
|
|
|
|
|
</n-tooltip>
|
|
|
|
|
<n-button tertiary circle type="warning" @click="openCloseBar">
|
|
|
|
|
<template #icon>
|
|
|
|
|
<n-icon v-if="barIsOpen"><ChevronBack/></n-icon>
|
|
|
|
|