|
|
@ -17,6 +17,8 @@ import {query_surface_forecast, query_upper_forecast, requireWeatherLevel} from
|
|
|
|
import {setChartOptions} from "@/assets/js/weatherCharts.ts";
|
|
|
|
import {setChartOptions} from "@/assets/js/weatherCharts.ts";
|
|
|
|
import type { NotificationType } from 'naive-ui'
|
|
|
|
import type { NotificationType } from 'naive-ui'
|
|
|
|
import { useNotification } from 'naive-ui'
|
|
|
|
import { useNotification } from 'naive-ui'
|
|
|
|
|
|
|
|
import {useStaticStore} from "@/store/staticOptions";
|
|
|
|
|
|
|
|
import {useRouter} from "vue-router";
|
|
|
|
|
|
|
|
|
|
|
|
let myChart: EChartsType = undefined
|
|
|
|
let myChart: EChartsType = undefined
|
|
|
|
let weatherChart: EChartsType = undefined
|
|
|
|
let weatherChart: EChartsType = undefined
|
|
|
@ -25,7 +27,7 @@ let selectedRouteCode = ref(null)
|
|
|
|
let selectedLevel = ref(null)
|
|
|
|
let selectedLevel = ref(null)
|
|
|
|
let showPtList = ref(true)
|
|
|
|
let showPtList = ref(true)
|
|
|
|
let selectedRoute = ref<Airline>(newAirline())
|
|
|
|
let selectedRoute = ref<Airline>(newAirline())
|
|
|
|
let routesInstore = ref<{ value: string|number; label: string}[]>(null)
|
|
|
|
let routesListRef = ref<{ value: string|number; label: string}[]>(null)
|
|
|
|
let routeViewer = null
|
|
|
|
let routeViewer = null
|
|
|
|
let routePtNumber = ref(1)
|
|
|
|
let routePtNumber = ref(1)
|
|
|
|
let uiMsg = useMessage()
|
|
|
|
let uiMsg = useMessage()
|
|
|
@ -54,6 +56,9 @@ let routeCode = [
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
let levelOptions = ref<any[]>()
|
|
|
|
let levelOptions = ref<any[]>()
|
|
|
|
|
|
|
|
let sStore = useStaticStore();
|
|
|
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
|
|
|
|
|
|
|
const notification = useNotification()
|
|
|
|
const notification = useNotification()
|
|
|
|
const notify = (type: NotificationType, title: string, detail: string) =>{
|
|
|
|
const notify = (type: NotificationType, title: string, detail: string) =>{
|
|
|
|
notification[type]({
|
|
|
|
notification[type]({
|
|
|
@ -78,7 +83,7 @@ onMounted(()=>{
|
|
|
|
routeStore.addRoute(route2)
|
|
|
|
routeStore.addRoute(route2)
|
|
|
|
routeStore.addRoute(route3)
|
|
|
|
routeStore.addRoute(route3)
|
|
|
|
|
|
|
|
|
|
|
|
routesInstore.value = routeStore.flyRoute.map((route)=> {
|
|
|
|
routesListRef.value = routeStore.flyRoute.map((route)=> {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
value: route.unicode,
|
|
|
|
value: route.unicode,
|
|
|
|
label: route.name
|
|
|
|
label: route.name
|
|
|
@ -139,7 +144,7 @@ function checkRoute(key:number|string){
|
|
|
|
hArr.push(selectedRoute.value.points[index].alt)
|
|
|
|
hArr.push(selectedRoute.value.points[index].alt)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
console.log(orderArr,hArr)
|
|
|
|
console.log(orderArr,hArr)
|
|
|
|
// 弹出图表窗口
|
|
|
|
// 弹出地形图表
|
|
|
|
drawEcharts_RouteDetection(myChart, res.distanceArray, res.elevationArray, orderArr, hArr)
|
|
|
|
drawEcharts_RouteDetection(myChart, res.distanceArray, res.elevationArray, orderArr, hArr)
|
|
|
|
|
|
|
|
|
|
|
|
}).catch((err)=>{
|
|
|
|
}).catch((err)=>{
|
|
|
@ -241,11 +246,15 @@ function queryWeather(lon:number,lat:number,level?: number) {
|
|
|
|
let i = item.indexOf('T')
|
|
|
|
let i = item.indexOf('T')
|
|
|
|
return item.slice(i+1,i+3) + '时'
|
|
|
|
return item.slice(i+1,i+3) + '时'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
if(!Reflect.has(weatherData,'precip')){
|
|
|
|
if(!Reflect.has(weatherData,'precip')){ //高空数据无precip(降水)属性,需添加数组并补0
|
|
|
|
weatherData.precip = Array.from({length:timeArr.length},(v,k)=>0)
|
|
|
|
weatherData.precip = Array.from({length:timeArr.length},()=>0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
setChartOptions(weatherChart, timeArr.slice(0,8),weatherData.temp.slice(0,8),weatherData.windSpeed.slice(0,8),
|
|
|
|
setChartOptions(weatherChart, timeArr.slice(0,8),weatherData.temp.slice(0,8),weatherData.windSpeed.slice(0,8),
|
|
|
|
weatherData.wind360.slice(0,8), weatherData.precip.slice(0,8),weatherData.humidity.slice(0,8))
|
|
|
|
weatherData.wind360.slice(0,8), weatherData.precip.slice(0,8),weatherData.humidity.slice(0,8))
|
|
|
|
|
|
|
|
}).catch(e=>{
|
|
|
|
|
|
|
|
console.log()
|
|
|
|
|
|
|
|
uiMsg.error('气象信息查询失败:' + e.message,{duration:3000, keepAliveOnHover: true})
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -257,6 +266,31 @@ function levelChanged(key: string | number) {
|
|
|
|
queryWeather(lon,lat, Number(key))
|
|
|
|
queryWeather(lon,lat, Number(key))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 将航线信息发送给QT端(每次发送一条航线)
|
|
|
|
|
|
|
|
* @param routeUnicode 航线唯一码
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
function sendRouteToQT(routeUnicode: string|number){
|
|
|
|
|
|
|
|
let selectedRoute = routeStore.flyRoute.filter(element => element.unicode === String(routeUnicode))[0]
|
|
|
|
|
|
|
|
if(selectedRoute){
|
|
|
|
|
|
|
|
if(sStore.webskt.ws?.readyState == WebSocket.OPEN){
|
|
|
|
|
|
|
|
sStore.webskt.ws.send(JSON.stringify(selectedRoute))
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
uiMsg.info('请先开启WebSocket')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else
|
|
|
|
|
|
|
|
uiMsg.warning('未找到相应的航线')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function delRoute(routeUnicode: string|number){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function backToHomePage(){
|
|
|
|
|
|
|
|
router.push({name: 'Home'})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
@ -267,7 +301,7 @@ function levelChanged(key: string | number) {
|
|
|
|
<n-layout-header :bordered="true">
|
|
|
|
<n-layout-header :bordered="true">
|
|
|
|
<n-popover trigger="hover">
|
|
|
|
<n-popover trigger="hover">
|
|
|
|
<template #trigger>
|
|
|
|
<template #trigger>
|
|
|
|
<n-button quaternary type="success" size="large">
|
|
|
|
<n-button quaternary type="success" size="large" @click="backToHomePage">
|
|
|
|
<template #icon>
|
|
|
|
<template #icon>
|
|
|
|
<n-icon><ArrowBackOutline/></n-icon>
|
|
|
|
<n-icon><ArrowBackOutline/></n-icon>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
@ -292,15 +326,14 @@ function levelChanged(key: string | number) {
|
|
|
|
<n-radio-group v-model:value="selectedRouteCode" name="radiogroup" @update:value="checkRoute">
|
|
|
|
<n-radio-group v-model:value="selectedRouteCode" name="radiogroup" @update:value="checkRoute">
|
|
|
|
<n-scrollbar style="height: 20vh">
|
|
|
|
<n-scrollbar style="height: 20vh">
|
|
|
|
<n-space vertical>
|
|
|
|
<n-space vertical>
|
|
|
|
<n-space v-for="r in routesInstore" justify="space-between"
|
|
|
|
<n-space v-for="r in routesListRef" justify="space-between"
|
|
|
|
style="margin-right: 2rem; border-bottom: #383737 1px solid">
|
|
|
|
style="margin-right: 2rem; border-bottom: #383737 1px solid">
|
|
|
|
<n-radio :key="r.value" :value="r.value">
|
|
|
|
<n-radio :key="r.value" :value="r.value">
|
|
|
|
{{ r.label }}
|
|
|
|
{{ r.label }}
|
|
|
|
</n-radio>
|
|
|
|
</n-radio>
|
|
|
|
<n-button-group>
|
|
|
|
<n-button-group>
|
|
|
|
<!-- TODO: 下发、删除功能实现-->
|
|
|
|
<n-button secondary size="small" type="info" style="height: 1.3rem" @click="sendRouteToQT(r.value)">下发</n-button>
|
|
|
|
<n-button secondary size="small" type="info" style="height: 1.3rem; margin: 0 3px 4px 0">下发</n-button>
|
|
|
|
<n-button secondary size="small" type="error" style="height: 1.3rem; margin-bottom: 4px" @click="delRoute(r.value)">删除</n-button>
|
|
|
|
<n-button secondary size="small" type="error" style="height: 1.3rem; margin-bottom: 4px">删除</n-button>
|
|
|
|
|
|
|
|
</n-button-group>
|
|
|
|
</n-button-group>
|
|
|
|
</n-space>
|
|
|
|
</n-space>
|
|
|
|
|
|
|
|
|
|
|
@ -309,17 +342,13 @@ function levelChanged(key: string | number) {
|
|
|
|
</n-radio-group>
|
|
|
|
</n-radio-group>
|
|
|
|
|
|
|
|
|
|
|
|
<n-divider style="margin: .2rem -.5rem"></n-divider>
|
|
|
|
<n-divider style="margin: .2rem -.5rem"></n-divider>
|
|
|
|
<n-space vertical>
|
|
|
|
<n-space vertical style="margin: .2rem 1rem">
|
|
|
|
<n-space>
|
|
|
|
<n-space>
|
|
|
|
<n-space>
|
|
|
|
<n-space>
|
|
|
|
<n-ellipsis>开闭</n-ellipsis>
|
|
|
|
<n-ellipsis>开闭</n-ellipsis>
|
|
|
|
<n-switch v-model:value="selectedRoute.isClose" size="small">
|
|
|
|
<n-switch v-model:value="selectedRoute.isClose" size="small">
|
|
|
|
<template #checked>
|
|
|
|
<template #checked>闭</template>
|
|
|
|
闭
|
|
|
|
<template #unchecked>开</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<template #unchecked>
|
|
|
|
|
|
|
|
开
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</n-switch>
|
|
|
|
</n-switch>
|
|
|
|
</n-space>
|
|
|
|
</n-space>
|
|
|
|
<n-space style="margin-left: .5rem">
|
|
|
|
<n-space style="margin-left: .5rem">
|
|
|
@ -340,10 +369,10 @@ function levelChanged(key: string | number) {
|
|
|
|
|
|
|
|
|
|
|
|
<n-divider style="margin: .2rem -.5rem"></n-divider>
|
|
|
|
<n-divider style="margin: .2rem -.5rem"></n-divider>
|
|
|
|
<n-ellipsis><h3>地形剖面图</h3></n-ellipsis>
|
|
|
|
<n-ellipsis><h3>地形剖面图</h3></n-ellipsis>
|
|
|
|
<n-space justify="start">
|
|
|
|
<n-space justify="space-evenly">
|
|
|
|
<n-ellipsis>采样间隔</n-ellipsis>
|
|
|
|
<n-ellipsis>采样间隔</n-ellipsis>
|
|
|
|
<n-input-number size="tiny" placeholder="默认1000米"
|
|
|
|
<n-input-number size="tiny" placeholder="默认1000米"
|
|
|
|
style="width:8vw" :min="100" :step="100">
|
|
|
|
style="width:8vw;" :min="100" :step="100">
|
|
|
|
</n-input-number>
|
|
|
|
</n-input-number>
|
|
|
|
<n-button type="success" size="tiny">重新绘图</n-button>
|
|
|
|
<n-button type="success" size="tiny">重新绘图</n-button>
|
|
|
|
</n-space>
|
|
|
|
</n-space>
|
|
|
@ -447,11 +476,11 @@ function levelChanged(key: string | number) {
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
<style scoped>
|
|
|
|
#left{
|
|
|
|
#left{
|
|
|
|
width: 20vw;
|
|
|
|
width: 22vw;
|
|
|
|
height: 100vh;
|
|
|
|
height: 100vh;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#map2 {
|
|
|
|
#map2 {
|
|
|
|
width: 57vw;
|
|
|
|
width: 55vw;
|
|
|
|
height: 100vh;
|
|
|
|
height: 100vh;
|
|
|
|
position: relative;
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
}
|
|
|
|