|
|
@@ -29,13 +29,13 @@ |
|
|
|
<div class="monitorList"> |
|
|
|
<div class="innerMonitor"> |
|
|
|
<div class="monitorName">机场内部监控</div> |
|
|
|
|
|
|
|
<easy-player :video-url="innerVideoSrc" live="true" stretch="true" /> |
|
|
|
<VideoPlayer id="video-inner" ref="innerVideoRef" /> |
|
|
|
<!-- <easy-player :video-url="innerVideoSrc" live="true" stretch="true" /> --> |
|
|
|
</div> |
|
|
|
<div class="innerMonitor"> |
|
|
|
<div class="monitorName">机场外部监控</div> |
|
|
|
|
|
|
|
<easy-player :video-url="outVideoSrc" live="true" stretch="true" /> |
|
|
|
<VideoPlayer id="video-outer" ref="outVideoRef" /> |
|
|
|
<!-- <easy-player :video-url="outVideoSrc" live="true" stretch="true" /> --> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
@@ -43,12 +43,13 @@ |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
|
|
|
|
import { reactive, toRefs, watch } from 'vue' |
|
|
|
import { ref, reactive, toRefs, watch } from 'vue' |
|
|
|
import { getAirportInfo } from '@/api/dashboard/index.js' |
|
|
|
import VideoPlayer from '@/components/VideoPlayer/index.vue' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'OneMap', |
|
|
|
components: { }, |
|
|
|
components: { VideoPlayer }, |
|
|
|
props: { |
|
|
|
data: { |
|
|
|
type: Object, |
|
|
@@ -56,6 +57,8 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
setup(props) { |
|
|
|
const innerVideoRef = ref() |
|
|
|
const outVideoRef = ref() |
|
|
|
const data = reactive({ |
|
|
|
detail: props.data, |
|
|
|
indicatorList: [ |
|
|
@@ -71,8 +74,6 @@ export default { |
|
|
|
'video-url': '' |
|
|
|
|
|
|
|
}, |
|
|
|
innerVideoSrc: '', |
|
|
|
outVideoSrc: '', |
|
|
|
status: null, |
|
|
|
mountedName: null, |
|
|
|
outsideMonitorOptions: { |
|
|
@@ -89,14 +90,30 @@ export default { |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
const initPlayer = (innerUrl, outerUrl) => { |
|
|
|
const inner = { |
|
|
|
width: '256px', |
|
|
|
height: '198px', |
|
|
|
source: innerUrl, |
|
|
|
isLive: true |
|
|
|
} |
|
|
|
const outer = { |
|
|
|
width: '256px', |
|
|
|
height: '198px', |
|
|
|
source: outerUrl, |
|
|
|
isLive: true |
|
|
|
} |
|
|
|
innerVideoRef.value?.init(inner) |
|
|
|
outVideoRef.value?.init(outer) |
|
|
|
} |
|
|
|
|
|
|
|
watch(() => props.data, (value) => { |
|
|
|
if (JSON.stringify(value) !== '{}') { |
|
|
|
// console.log(props.data) |
|
|
|
data.detail = props.data |
|
|
|
// data.innerMonitorOptions.video-url = data.detail.internalMonitorUrl |
|
|
|
data.innerVideoSrc = data.detail.internalMonitorUrl |
|
|
|
data.outVideoSrc = data.detail.externalMonitorUrl |
|
|
|
|
|
|
|
innerVideoRef.value?.disposeVideo() |
|
|
|
outVideoRef.value?.disposeVideo() |
|
|
|
initPlayer(data.detail.internalMonitorUrl, data.detail.externalMonitorUrl) |
|
|
|
getAirportInfo({ |
|
|
|
airportId: data.detail.id |
|
|
|
}) |
|
|
@@ -136,7 +153,9 @@ export default { |
|
|
|
}) |
|
|
|
|
|
|
|
return { |
|
|
|
...toRefs(data) |
|
|
|
...toRefs(data), |
|
|
|
innerVideoRef, |
|
|
|
outVideoRef |
|
|
|
|
|
|
|
} |
|
|
|
} |