点击机场图标的播放按钮播放直播

main
zhufu 2025-07-18 11:08:36 +08:00
parent bdd8aef058
commit f823dc2552
2 changed files with 29 additions and 2 deletions

View File

@ -1,7 +1,7 @@
<template>
<div class="home-page">
<div style="width: 100%;height: calc(100vh - 80px);">
<Map :airRoute="airRoute" @mapOnLoad="mapOnLoad" :homeAirport="airPort" @clickAirPort="clickAirPort"/>
<Map :airRoute="airRoute" @mapOnLoad="mapOnLoad" :homeAirport="airPort" @clickAirPort="clickAirPort" @changeAirportLive="changeAirportLive" @changeUAVLive="changeUAVLive"/>
</div>
<div ref="leftComponentRef" style="position: absolute;top: 0px;left: 0px;">
<!-- 项目列表 -->
@ -15,6 +15,17 @@
<!-- 成果动态 -->
<Result />
</div>
<AirportLive
:msgData="msgData"
v-if="airportLiveVisible"
@changeAirportLive="airportLiveVisible = false"
/>
<LivePreview
v-if="livePreviewVisible"
:msgData="msgData"
:airportLiveVisible="airportLiveVisible"
@loadLiveStreaming="livePreviewVisible = false"
/>
</div>
</template>
@ -28,6 +39,7 @@ import Result from './Result/index.vue'
import { ref, onMounted, onBeforeUnmount, } from "vue"
import { getClient, createConnection, clientSubscribe, destroyConnection } from '@/utils/mqtt';
import { useRouter } from 'vue-router';
import { AirportLive, LivePreview } from '@/views/demo/workmanagement/flightoperation/index'
const router = useRouter();
const airRoute = ref({
@ -48,6 +60,9 @@ const leftComponentRef = ref<HTMLElement | null>(null)
const rightComponentRef = ref<HTMLElement | null>(null)
const map = ref()
const connect = ref(false)
const msgData = ref({});
const airportLiveVisible = ref(false);
const livePreviewVisible = ref(false);
const clickAirPort = () => {
sessionStorage.setItem('homeToFlightId', activeProject.value);
@ -94,6 +109,12 @@ onBeforeUnmount(() => {
const mapOnLoad = (value) => {
map.value = value
}
const changeAirportLive = (type) => {
airportLiveVisible.value = type
}
const changeUAVLive = (type) => {
livePreviewVisible.value = type
}
</script>
<style lang="scss" scoped>

View File

@ -154,7 +154,7 @@ const generatePreviewPoint = (placemark)=>{
}
};
const emits = defineEmits(['exitDraw', 'flyToThere', 'mapOnLoad', 'clickAirPort']);
const emits = defineEmits(['exitDraw', 'flyToThere', 'mapOnLoad', 'clickAirPort', 'changeAirportLive', 'changeUAVLive']);
const airPoints = ref([]);
const currentAirPoint = ref({});
@ -1934,6 +1934,12 @@ const homeSetAirportPosition = () => {
homeStartGraphic.on(mars3d.EventType.click, function (event) {
emits('clickAirPort')
});
homeStartGraphicLive.on(mars3d.EventType.click, function (event) {
emits('changeAirportLive', true)
if(props.homeAirport.mode_code == 4){
emits('changeUAVLive', true)
}
});
graphicLayer.addGraphic(homeStartGraphic);
graphicLayer.addGraphic(homeStartGraphicLive);
}