阶段性代码提交

This commit is contained in:
WORK\64751 2025-08-25 14:27:41 +08:00
parent d503311198
commit 4b3804fce8
3 changed files with 33 additions and 30 deletions

View File

@ -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"
>
<!-- 视频播放区域 -->
<div id="plane_small_video_area" class="w-full h-full absolute left-0 top-0"></div>
<div id="plane_small_video_area" class="w-full h-full absolute left-0 top-0">
<ScreenComp :showType="small_area_showType" />
</div>
<div class="px-2 absolute left-0 w-full flex flex-row justify-around items-center">
<div class="w-full flex flex-row">
<div

View File

@ -2,8 +2,7 @@
import { ref, defineAsyncComponent, onMounted, watch, toRaw, defineProps, reactive } from 'vue'
import { useAirPortSocketStore } from '@/stores/airportSocket.js'
//-
// const LivePlayer = defineAsyncComponent(() => 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(() => {
<leftPlaneCheck v-if="currentAirPortStatus == 3" :row="currentAirPortInfo" />
<!-- 飞行中 地图 -->
<div id="left_flying_map" class="leftPlane-area w-full"></div>
<div id="left_flying_map" class="leftPlane-area w-full">
<ScreenComp :showType="left_flying_area_showType" @iframeLoaded="iframeLoaded" />
</div>
</div>
<!-- 右侧面板 -->
<div class="rightPlane absolute right-0 h-full bg-[#ffffff] z-1">
<!-- 切换视频按钮 -->
<rightSwitchVideo
v-if="currentAirPortStatus == 2 || currentAirPortStatus == 3"
v-if="currentAirPortStatus == 3"
class="absolute right-3 top-3 z-10"
@switchVideo="switchRightVideoFn"
/>
@ -357,14 +361,8 @@ onMounted(() => {
<planeControl class="absolute left-0 right-0 top-0 bottom-0 m-auto" />
</div> -->
<div id="big_area" class="relative w-full h-full overflow-hidden">
<screenComp
:showType="big_area_showType"
:row="currentAirPortSocket"
@iframeLoaded="iframeLoaded"
/>
<ScreenComp :showType="big_area_showType" @iframeLoaded="iframeLoaded" />
</div>
<!-- <div id="big_area" class="w-full h-full overflow-hidden"></div> -->
</div>
</div>

View File

@ -29,7 +29,7 @@ const LiveOptions = reactive({
// stretch: true
})
let showType = ref('') //videio / map
let showType = ref('video_out') //video / map
//iframe
const iframeLoaded = () => {