import('@/components/video/index.vue'))
-const screenComp = defineAsyncComponent(() => import('@/views/carbin/toolComp/screen.vue'))
+const ScreenComp = defineAsyncComponent(() => import('@/views/carbin/toolComp/screen.vue'))
//1左侧面板-机场视频
const leftPlaneLiveVideo = defineAsyncComponent(
@@ -32,7 +31,9 @@ let rightPlaneWidth = ref('75%')
let rightPlaneHeight = ref('100%')
let rightPlaneBottom = ref('0')
+let map_iframeContent = null
let big_area_showType = ref('map')
+let left_flying_area_showType = ref('map')
let switchType = null
//实时socket机场数据
@@ -51,7 +52,7 @@ const statusList = reactive({
2: '飞行中',
3: '准备中',
})
-let virturalDrive_iframe_full = ref(null)
+
let iframeData = null
//修改左侧面板尺寸
@@ -148,7 +149,7 @@ const queryAirPort = async () => {
currentAirPortInfo.value = res.data[0]
airPortSocketStore.ceurrentAirPortData = currentAirPortInfo.value
- currentAirPortInfo.value.status = 3
+ // currentAirPortInfo.value.status = 2
//机场当前状态
if (currentAirPortStatus.value != Number(currentAirPortInfo.value.status)) {
@@ -185,13 +186,9 @@ const socketFn = (workParams) => {
//iframe map加载完成
const iframeLoaded = (iframeContent) => {
- // let iframeItem = virturalDrive_iframe_full.value
- // let iframeContent = iframeItem.contentWindow
- console.log(iframeContent)
- let data = JSON.stringify(iframeData)
- // console.log(data)
-
setTimeout(() => {
+ let data = JSON.stringify(iframeData)
+ console.log(iframeContent)
iframeContent.postMessage(data, '*')
}, 0)
@@ -227,11 +224,9 @@ const sendPosToPlane = () => {
currentPos_height: pathArr[startCount].alt,
}
- let iframeItem = virturalDrive_iframe_full.value
- let iframeContent = iframeItem.contentWindow
let data = JSON.stringify(t)
// console.log(data)
- iframeContent.postMessage(data, '*')
+ map_iframeContent.postMessage(data, '*')
startCount++
setTimeout(() => {
@@ -242,19 +237,26 @@ const sendPosToPlane = () => {
}
//给gis发送消息
const sendGisMessage = (params) => {
- //params必须是个对象
- let iframeItem = virturalDrive_iframe_full.value
- let iframeContent = iframeItem.contentWindow
let data = JSON.stringify(params)
console.log(data)
- iframeContent.postMessage(data, '*')
+ map_iframeContent.postMessage(data, '*')
}
//重置screen
const resetScreen = () => {
- if (currentAirPortStatus.value == 3) {
- //准备中
+ if (currentAirPortStatus.value == 3 || currentAirPortStatus.value == 2) {
+ //准备中 飞行中
big_area_showType.value = 'video_out'
+
+ //飞行中
+ if (currentAirPortStatus.value == 2) {
+ rightPlaneHeight.value = 'calc(100% - 150px)'
+ rightPlaneBottom.value = '150px'
+ left_flying_area_showType.value = 'map'
+
+ //飞前是舱外 飞中是无人机视角
+ big_area_showType.value = 'video_out'
+ }
}
}
//右侧面板切换视频
@@ -341,13 +343,15 @@ onMounted(() => {
-
+
+
+