第二次改版

This commit is contained in:
WORK\64751 2025-08-23 16:52:01 +08:00
parent e16b2c2ef0
commit dfb1928d62
2 changed files with 101 additions and 29 deletions

View File

@ -2,7 +2,8 @@
import { ref, defineAsyncComponent, onMounted, watch, toRaw, defineProps, reactive } from 'vue' import { ref, defineAsyncComponent, onMounted, watch, toRaw, defineProps, reactive } from 'vue'
import { useAirPortSocketStore } from '@/stores/airportSocket.js' import { useAirPortSocketStore } from '@/stores/airportSocket.js'
//- //-
const LivePlayer = defineAsyncComponent(() => import('@/components/video/index.vue')) // const LivePlayer = defineAsyncComponent(() => import('@/components/video/index.vue'))
const screenComp = defineAsyncComponent(() => import('@/views/carbin/toolComp/screen.vue'))
//1- //1-
const leftPlaneLiveVideo = defineAsyncComponent( const leftPlaneLiveVideo = defineAsyncComponent(
@ -30,19 +31,21 @@ let leftPlaneWidth = ref('25%')
let rightPlaneWidth = ref('75%') let rightPlaneWidth = ref('75%')
let rightPlaneHeight = ref('100%') let rightPlaneHeight = ref('100%')
let rightPlaneBottom = ref('0') let rightPlaneBottom = ref('0')
// // //
let out_showLive = ref(false) // let out_showLive = ref(false)
// // //
let in_showLive = ref(false) // let in_showLive = ref(false)
// // //
let plane_showLive = ref(false) // let plane_showLive = ref(false)
//gismap // //gismap
let showIframeMap = ref(false) // let showIframeMap = ref(false)
let outVideo_teleport = ref('#out_small_video_area') // let outVideo_teleport = ref('#out_small_video_area')
let inVideo_teleport = ref('#in_small_video_area') // let inVideo_teleport = ref('#in_small_video_area')
let planeVideo_teleport = ref('#plane_small_video_area') // let planeVideo_teleport = ref('#plane_small_video_area')
let map_teleport = ref('#big_area') // let map_teleport = ref('#big_area')
let big_area_showType = ref('map')
let switchType = null let switchType = null
//socket //socket
@ -138,7 +141,7 @@ const queryAirLine_AirPort = async () => {
statusList[currentAirPortStatus.value], statusList[currentAirPortStatus.value],
) )
//teleport //teleport
resetTeleportTo(currentAirPortStatus.value) // resetTeleportTo(currentAirPortStatus.value)
} }
//socket //socket
@ -192,7 +195,7 @@ const queryAirPort = async () => {
LiveOptions_in.videoUrl = currentAirPortInfo.value.internal_monitor_url LiveOptions_in.videoUrl = currentAirPortInfo.value.internal_monitor_url
LiveOptions_plane.videoUrl = currentAirPortInfo.value.camera_url LiveOptions_plane.videoUrl = currentAirPortInfo.value.camera_url
currentAirPortInfo.value.status = 2 // currentAirPortInfo.value.status = 2
// //
if (currentAirPortStatus.value != Number(currentAirPortInfo.value.status)) { if (currentAirPortStatus.value != Number(currentAirPortInfo.value.status)) {
@ -203,7 +206,7 @@ const queryAirPort = async () => {
statusList[currentAirPortStatus.value], statusList[currentAirPortStatus.value],
) )
//teleport //teleport
resetTeleportTo(currentAirPortStatus.value) // resetTeleportTo(currentAirPortStatus.value)
} }
} }
// //
@ -275,12 +278,12 @@ const socketFn = (workParams) => {
} }
//iframe map //iframe map
const iframeLoaded = () => { const iframeLoaded = (iframeContent) => {
let iframeItem = virturalDrive_iframe_full.value // let iframeItem = virturalDrive_iframe_full.value
let iframeContent = iframeItem.contentWindow // let iframeContent = iframeItem.contentWindow
let data = JSON.stringify(iframeData) let data = JSON.stringify(iframeData)
console.log(data) // console.log(data)
setTimeout(() => { setTimeout(() => {
iframeContent.postMessage(data, '*') iframeContent.postMessage(data, '*')
@ -455,7 +458,13 @@ onMounted(() => {
<!-- <div class="w-full h-10 absolute right-0 bottom-[20px]"> <!-- <div class="w-full h-10 absolute right-0 bottom-[20px]">
<planeControl class="absolute left-0 right-0 top-0 bottom-0 m-auto" /> <planeControl class="absolute left-0 right-0 top-0 bottom-0 m-auto" />
</div> --> </div> -->
<div id="big_area" class="relative w-full h-full overflow-hidden"></div> <div id="big_area" class="relative w-full h-full overflow-hidden">
<screenComp
:showType="big_area_showType"
:row="currentAirPortSocket"
@iframeLoaded="iframeLoaded"
/>
</div>
<!-- <div id="big_area" class="w-full h-full overflow-hidden"></div> --> <!-- <div id="big_area" class="w-full h-full overflow-hidden"></div> -->
</div> </div>
@ -473,34 +482,34 @@ onMounted(() => {
<!-- 直播播放器 --> <!-- 直播播放器 -->
<!-- 舱外视频 --> <!-- 舱外视频 -->
<teleport :to="outVideo_teleport" v-if="out_showLive"> <!-- <teleport :to="outVideo_teleport" v-if="out_showLive">
<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="out_showLive && LiveOptions_out.videoUrl?.includes('.flv')" v-show="out_showLive && LiveOptions_out.videoUrl?.includes('.flv')"
ref="OutlivePlayerRef" ref="OutlivePlayerRef"
:options="LiveOptions_out" :options="LiveOptions_out"
/> />
</teleport> </teleport> -->
<!-- 舱内视频 --> <!-- 舱内视频 -->
<teleport :to="inVideo_teleport" v-if="in_showLive"> <!-- <teleport :to="inVideo_teleport" v-if="in_showLive">
<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="in_showLive && LiveOptions_in.videoUrl?.includes('.flv')" v-show="in_showLive && LiveOptions_in.videoUrl?.includes('.flv')"
ref="inlivePlayerRef" ref="inlivePlayerRef"
:options="LiveOptions_in" :options="LiveOptions_in"
/> />
</teleport> </teleport> -->
<!-- 无人机视角 --> <!-- 无人机视角 -->
<teleport :to="planeVideo_teleport" v-if="plane_showLive"> <!-- <teleport :to="planeVideo_teleport" v-if="plane_showLive">
<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="plane_showLive && LiveOptions_plane.videoUrl?.includes('.flv')" v-show="plane_showLive && LiveOptions_plane.videoUrl?.includes('.flv')"
ref="planelivePlayerRef" ref="planelivePlayerRef"
:options="LiveOptions_plane" :options="LiveOptions_plane"
/> />
</teleport> </teleport> -->
<!-- map --> <!-- map -->
<teleport v-if="showIframeMap" :to="map_teleport"> <!-- <teleport v-if="showIframeMap" :to="map_teleport">
<iframe <iframe
v-if="showIframeMap" v-if="showIframeMap"
id="virturalDrive_iframe_full" id="virturalDrive_iframe_full"
@ -508,7 +517,7 @@ onMounted(() => {
src="https://gisdata.t-aaron.com/virturalDrive/VirturalDrive.html" src="https://gisdata.t-aaron.com/virturalDrive/VirturalDrive.html"
@load="iframeLoaded" @load="iframeLoaded"
></iframe> ></iframe>
</teleport> </teleport> -->
</template> </template>
<style lang="scss"> <style lang="scss">

View File

@ -0,0 +1,63 @@
<script setup>
import { ref, defineAsyncComponent, onMounted, watch, toRaw, defineProps, reactive } from 'vue'
//-
const LivePlayer = defineAsyncComponent(() => import('@/components/video/index.vue'))
const props = defineProps({
showType: String, // video/map
row: Object, //
})
const emit = defineEmits(['iframeLoaded'])
let virturalDrive_iframe = ref(null)
const LiveOptions = reactive({
videoUrl: null,
// videoTitle: null,
// live: true,
// hideFullscreenButton: true,
// stretch: true
})
let showType = ref('') //videio / map
//iframe
const iframeLoaded = () => {
let iframeItem = virturalDrive_iframe.value
let iframeContent = iframeItem.contentWindow
emit('iframeLoaded', iframeContent)
}
watch(
() => props.row,
(val) => {
// console.log('')
console.log(val)
showType.value = props.showType
// LiveOptions_out.videoUrl = val.external_monitor_url
// LiveOptions_in.videoUrl = val.internal_monitor_url
},
{ deep: true },
)
</script>
<template>
<div class="w-full h-full">
<LivePlayer
class="h-full absolute left-0 right-0 top-0 right-0 m-auto"
v-show="showType == 'video' && LiveOptions.videoUrl?.includes('.flv')"
ref="OutlivePlayerRef"
:options="LiveOptions_out"
/>
<iframe
v-if="showType == 'map'"
id="virturalDrive_iframe_full"
ref="virturalDrive_iframe"
src="https://gisdata.t-aaron.com/virturalDrive/VirturalDrive.html"
class="w-full h-full"
@load="iframeLoaded"
></iframe>
</div>
</template>
<style lang="scss" scoped></style>