修复虚拟座舱的样式

This commit is contained in:
WORK\64751 2025-09-02 20:39:46 +08:00
parent 4a42f2afec
commit 7c4bc8157e
5 changed files with 71 additions and 20 deletions

View File

@ -12,15 +12,21 @@ VITE_APP_CLIENT_SECRET = 'NjHifmmB41rH6bJTd4A7RA=='
#程璐 #程璐
#VITE_APP_API_BASE_URL=http://192.168.12.117:9060/airport/ #VITE_APP_API_BASE_URL=http://192.168.12.117:9060/airport/
VITE_APP_API_BASE_URL=https://airport-test.t-aaron.com/ VITE_APP_API_BASE_URL=https://airport-test.t-aaron.com/
#VITE_APP_API_BASE_URL=https://airport-develop.t-aaron.com:3443
# VUE_APP_API_BASE_URL=https://airport.t-aaron.com/airport/ # VUE_APP_API_BASE_URL=https://airport.t-aaron.com/airport/
# VUE_APP_API_BASE_URL=https://airportdev.t-aaron.com/airport/ # VUE_APP_API_BASE_URL=https://airportdev.t-aaron.com/airport/
# VUE_APP_AUTHORITY = 'http://192.168.11.11:8090' # VUE_APP_AUTHORITY = 'http://192.168.11.11:8090'
#测试环境 #测试环境
VITE_APP_AUTHORITY =https://login-test.t-aaron.com VITE_APP_AUTHORITY =https://login-test.t-aaron.com
#VUE_APP_AUTHORITY = 'https://oidc-develop.t-aaron.com:3443'
#线上环境 (配合开发环境使用) #线上环境 (配合开发环境使用)
#VUE_APP_AUTHORITY = 'https://oidc.t-aaron.com' #VUE_APP_AUTHORITY = 'https://oidc.t-aaron.com'
#令牌
#VUE_APP_OUT_AUTHORITY = 'https://oidc-develop.t-aaron.com:3443'
# 机场大屏跳转地址 # 机场大屏跳转地址
VITE_APP_ASURL = 'https://airport-screen-test.t-aaron.com' VITE_APP_ASURL = 'https://airport-screen-test.t-aaron.com'

View File

@ -57,6 +57,47 @@ export async function getAirWayPointsToJson(url) {
arr.pop() arr.pop()
// console.log(arr) // console.log(arr)
arr = arr.map((text) => {
return text.split(/\s+/)
})
// 删除前两个起飞点(不使用)
arr.splice(0, 2)
// 删除最后一个降落点(不删除)
arr.pop()
// 航线节点
for (let i = 0; i < arr.length; i++) {
const stop = arr[i]
if (stop[3] == 16) {
// 地图点,用于绘制
mapPointList.push({
// id
id: mapPointList.length + 1,
// 经纬度
lngLat: [parseFloat(stop[9]), parseFloat(stop[8])],
alt: parseInt(stop[10]), // 高度
// type: Number(stop[3]), //航点类型gis需要
})
}
}
// console.log(mapPointList)
return mapPointList
}
}
export async function getAirWayPointsToJson2(url) {
// console.log(url)
let res = await axios.get(url)
if (res.status === 200) {
const text = res.data
let mapPointList = []
let arr = text.split('\r\n')
if (arr.length <= 1) {
arr = text.split('\n')
}
arr.shift()
arr.pop()
console.log(arr)
arr = arr.map((text) => { arr = arr.map((text) => {
return text.split(/\s+/) return text.split(/\s+/)
}) })
@ -69,8 +110,7 @@ export async function getAirWayPointsToJson(url) {
// 航线节点 // 航线节点
for (let i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
const stop = arr[i] const stop = arr[i]
if (parseInt(stop[3]) == 16 || parseInt(stop[3]) == 20 || parseInt(stop[3]) == 22) {
if (true) {
// 地图点,用于绘制 // 地图点,用于绘制
mapPointList.push({ mapPointList.push({
// id // id

View File

@ -188,14 +188,14 @@ const checkFn = async (row) => {
} }
// //
checkFn({ // checkFn({
id: 1, // id: 1,
task: [ // task: [
{ // {
taskId: 2, // taskId: 2,
}, // },
], // ],
}) // })
// //
watch( watch(

View File

@ -29,6 +29,7 @@ import {
queryAirportApi, queryAirportApi,
queryAirLineApi, queryAirLineApi,
getAirWayPointsToJson, getAirWayPointsToJson,
getAirWayPointsToJson2,
getweatherApi, getweatherApi,
} from '@/apis/common' } from '@/apis/common'
import { checkAirportRunStatusApi, droneCommandExecuteApi } from '@/apis/droneCommand.js' import { checkAirportRunStatusApi, droneCommandExecuteApi } from '@/apis/droneCommand.js'
@ -68,7 +69,7 @@ const statusList = reactive({
3: '飞行准备中', 3: '飞行准备中',
}) })
let iframeData = null let iframeData = {}
// //
const modifPlaneWidthFn = (num) => { const modifPlaneWidthFn = (num) => {
@ -125,7 +126,7 @@ const queryAirLine_AirPort = async () => {
// //
if (Number(currentAirPortInfo.value.status) == 2) { if (Number(currentAirPortInfo.value.status) == 2) {
// 线 // 线
queryAirLine(currentAirPortInfo.value.task[0].fileUrl) queryAirLine(currentAirPortInfo.value.fileUrl)
} else { } else {
// //
iframeData = { iframeData = {
@ -154,11 +155,12 @@ const queryAirLine_AirPort = async () => {
} }
} }
//
// if (res[1].value.code == 0) { // if (res[1].value.code == 0) {
// //线 // //线
// let airLineInfo = res[1].value.data[0] // let airLineInfo = res[1].value.data[0]
// //线 // //线
// let resultWayPoint = await getAirWayPointsToJson(airLineInfo.fileUrl) // let resultWayPoint = await getAirWayPointsToJson2(airLineInfo.fileUrl)
// // // //
// iframeData = { // iframeData = {
@ -171,6 +173,7 @@ const queryAirLine_AirPort = async () => {
// coverage: currentAirPortInfo.value.coverage, // coverage: currentAirPortInfo.value.coverage,
// } // }
// } // }
//end
//6 //6
setTimeout(() => { setTimeout(() => {
@ -189,7 +192,7 @@ const queryAirPort = async () => {
airPortSocketStore.ceurrentAirPortData = currentAirPortInfo.value airPortSocketStore.ceurrentAirPortData = currentAirPortInfo.value
// console.log(currentAirPortInfo.value) // console.log(currentAirPortInfo.value)
currentAirPortInfo.value.status = 2 // currentAirPortInfo.value.status = 2
if (currentAirPortStatus.value != Number(currentAirPortInfo.value.status)) { if (currentAirPortStatus.value != Number(currentAirPortInfo.value.status)) {
currentAirPortStatus.value = Number(currentAirPortInfo.value.status) currentAirPortStatus.value = Number(currentAirPortInfo.value.status)
@ -202,7 +205,7 @@ const queryAirPort = async () => {
// //
if (Number(currentAirPortInfo.value.status) == 2) { if (Number(currentAirPortInfo.value.status) == 2) {
// 线 // 线
queryAirLine(currentAirPortInfo.value.task[0].fileUrl) queryAirLine(currentAirPortInfo.value.fileUrl)
} }
resetScreen() resetScreen()
@ -217,8 +220,8 @@ const queryAirPort = async () => {
//线 //线
const queryAirLine = async (fileUrl) => { const queryAirLine = async (fileUrl) => {
//线 //线
let resultWayPoint = await getAirWayPointsToJson(fileUrl) let resultWayPoint = await getAirWayPointsToJson2(fileUrl)
console.log(resultWayPoint)
// //
iframeData = { iframeData = {
airportName: currentAirPortInfo.value.name, airportName: currentAirPortInfo.value.name,
@ -305,7 +308,8 @@ const iframeLoaded = (iframeContent) => {
if (iframeData) { if (iframeData) {
clearInterval(tempTime) clearInterval(tempTime)
let data = JSON.stringify(iframeData) let data = JSON.stringify(iframeData)
console.log(iframeContent) console.log('向gis发送数据....................................')
console.log(data)
iframeContent.postMessage(data, '*') iframeContent.postMessage(data, '*')
} }
}, 50) }, 50)

View File

@ -70,7 +70,7 @@ watch(
</script> </script>
<template> <template>
<div class="w-full h-full bg-black"> <div class="w-full h-full">
<LivePlayer <LivePlayer
class="h-full absolute left-0 right-0 top-0 right-0 m-auto" class="h-full absolute left-0 right-0 top-0 right-0 m-auto"
v-show=" v-show="
@ -80,11 +80,12 @@ watch(
ref="OutlivePlayerRef" ref="OutlivePlayerRef"
:options="LiveOptions" :options="LiveOptions"
/> />
<iframe <iframe
v-if="showType == 'map'" v-if="showType == 'map'"
id="virturalDrive_iframe_full" id="virturalDrive_iframe_full"
ref="virturalDrive_iframe" ref="virturalDrive_iframe"
src="https://gisdata.t-aaron.com/virturalDrive/VirturalDrive.html" src="https://gisdata.t-aaron.com/virturalDrive/test/VirturalDrive.html"
class="w-full h-full" class="w-full h-full"
@load="iframeLoaded" @load="iframeLoaded"
></iframe> ></iframe>