From 4b3804fce88a0fed9f7f25a68ceb87caddda195f Mon Sep 17 00:00:00 2001 From: "WORK\\64751" <64751245@qq.com> Date: Mon, 25 Aug 2025 14:27:41 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B6=E6=AE=B5=E6=80=A7=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/carbin/components/flying.vue | 7 +++- src/views/carbin/index.vue | 54 +++++++++++++------------- src/views/carbin/toolComp/screen.vue | 2 +- 3 files changed, 33 insertions(+), 30 deletions(-) diff --git a/src/views/carbin/components/flying.vue b/src/views/carbin/components/flying.vue index 91273c2..921c8dc 100644 --- a/src/views/carbin/components/flying.vue +++ b/src/views/carbin/components/flying.vue @@ -12,6 +12,7 @@ import { reactive, } from 'vue' import { useAirPortSocketStore } from '@/stores/airportSocket.js' +const ScreenComp = defineAsyncComponent(() => import('@/views/carbin/toolComp/screen.vue')) const emits = defineEmits(['switchView']) @@ -94,6 +95,8 @@ let planeStateList = reactive({ }, }) let selectedAirPort = ref(1) +//飞前是舱内 飞中是舱外 +let small_area_showType = ref('video_in') //切换显示模式 const switchView = (viewtype) => { @@ -190,7 +193,9 @@ airPortSocketStore.$subscribe((mutate, state) => { class="w-[250px] aspect-video h-full bg-[#bdbdbd] ml-2.5 px-2 py-1 rounded relative overflow-hidden" > -
+
+ +
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(() => { -
+
+ +
@@ -357,14 +361,8 @@ onMounted(() => {
-->
- +
- -
diff --git a/src/views/carbin/toolComp/screen.vue b/src/views/carbin/toolComp/screen.vue index 44a60e1..d825a29 100644 --- a/src/views/carbin/toolComp/screen.vue +++ b/src/views/carbin/toolComp/screen.vue @@ -29,7 +29,7 @@ const LiveOptions = reactive({ // stretch: true }) -let showType = ref('') //videio / map +let showType = ref('video_out') //video / map //iframe加载完成 const iframeLoaded = () => {