我的申请-已申请:新增基础设施-视频预览

This commit is contained in:
guoyue 2022-09-20 19:07:59 +08:00
parent 8cb2f83fb5
commit 8b9e11b0a0
1 changed files with 92 additions and 1 deletions

View File

@ -168,7 +168,6 @@
<a-button <a-button
v-if="item.approveStatus === '通过'" v-if="item.approveStatus === '通过'"
@click.stop="switchFunction(item)" @click.stop="switchFunction(item)"
class="DownloadAttachment2"
> >
查看详情 查看详情
</a-button> </a-button>
@ -186,6 +185,14 @@
<span class="channelName">{{ val.channelName }}</span> <span class="channelName">{{ val.channelName }}</span>
<span class="type">基础设施</span> <span class="type">基础设施</span>
</div> </div>
<a-button
type="primary"
v-if="item.approveStatus === '通过' && whoShow1.itShowXiHaiAn"
@click.stop="openVideo(val)"
>
视频预览
</a-button>
</div> </div>
<div class="ability-bottom"> <div class="ability-bottom">
<div class="dec2">位置{{ val.nodeName }}</div> <div class="dec2">位置{{ val.nodeName }}</div>
@ -208,6 +215,23 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 单个预览弹窗 -->
<a-modal
wrapClassName="single-preview-modal"
v-model:visible="visible"
title="视频预览"
:width="960"
destroyOnClose
>
<template #footer></template>
<div style="width: 100%; display: flex; justify-content: center">
<div style="width: 100%; height: 100%">
<vue3VideoPlay v-bind="options"/>
</div>
</div>
</a-modal>
</div> </div>
</template> </template>
<script setup> <script setup>
@ -216,11 +240,44 @@
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import { endProcess, getApplyForm } from '@/api/personalCenter.js' import { endProcess, getApplyForm } from '@/api/personalCenter.js'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import {
getStreamByChannelCode,
} from '@/api/videoSurveillance'
const router = useRouter() const router = useRouter()
const backUrl = ref(window.SITE_CONFIG.apiURL + '/') const backUrl = ref(window.SITE_CONFIG.apiURL + '/')
const props = defineProps({ const props = defineProps({
refObj: { type: Object, default: null }, refObj: { type: Object, default: null },
}) })
const whoShow1 = ref(whoShow)
let visible = ref(false)
const options = reactive({
width: '912px', //
height: '513px', //
color: '#409eff', //
title: '', //
src: '', //
type: 'm3u8', //
muted: false, //
webFullScreen: false,
speedRate: ['0.75', '1.0', '1.25', '1.5', '2.0'], //
autoPlay: true, //
loop: false, //
mirror: false, //
ligthOff: false, //
volume: 0.3, //
control: true, //
controlBtns: [
'audioTrack',
'quality',
'speedRate',
'volume',
'setting',
'pip',
'pageFullScreen',
'fullScreen',
], //,
})
const dept = reactive({}) const dept = reactive({})
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
if (infrastructure) { if (infrastructure) {
@ -379,6 +436,25 @@
} }
} }
} }
//
const openVideo = (item) => {
console.log('打开视频', item)
const param = {
key: item.cameraId,
}
getStreamByChannelCode(param).then((res) => {
console.log('视频预览------------>', res);
console.log(res)
visible.value = true
options.src = res.data.data || ''
}).catch(err => {
message.error(err)
})
// --
// visible.value = true
// options.src = 'http://playertest.longtailvideo.com/adaptive/bipbop/gear4/prog_index.m3u8'
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.title { .title {
@ -576,4 +652,19 @@
} }
} }
} }
.single-preview-modal {
.ant-modal-header {
background: url(~@/assets/home/video-background.png) no-repeat;
background-size: cover;
}
.ant-modal-title {
font-size: 0.16rem;
font-weight: 500;
color: #ffffff;
}
.anticon {
color: #ffffff;
}
}
</style> </style>