西海岸:视频播放 离线(status不是1)提示当前视频离线

This commit is contained in:
guoyue 2022-09-26 16:29:32 +08:00
parent eab0eb374a
commit 076d84bd0a
1 changed files with 23 additions and 12 deletions

View File

@ -315,7 +315,7 @@
openVideo( openVideo(
record.channelCode || record.channelCode ||
record.channelId || record.channelId ||
record.channelCode.channelId record.channelCode.channelId, record
) )
"> ">
预览 预览
@ -389,9 +389,9 @@
destroyOnClose @cancel="videoClean"> destroyOnClose @cancel="videoClean">
<template #footer></template> <template #footer></template>
<div class="batch-video"> <div class="batch-video">
<div v-for="item in videoList" :key="item.id" style="width: 100%; height: 100%;position:relative"> <div v-for="(item, index) in videoList" :key="item.id" style="width: 100%; height: 100%;position:relative">
<!-- 批量预览视频--遮罩 --> <!-- 批量预览视频--遮罩 -->
<div class="batch-video-cover" @click="videoShowMsg"></div> <div class="batch-video-cover" @click="videoShowMsg(index)"></div>
<p></p> <p></p>
<vue3VideoPlay v-bind="item.options" /> <vue3VideoPlay v-bind="item.options" />
</div> </div>
@ -465,7 +465,7 @@ const current = ref(1)
const videoTotal = ref(0) const videoTotal = ref(0)
const router = useRouter() const router = useRouter()
const whoShow1 = ref(whoShow) const whoShow1 = ref(whoShow)
const isXiHaiAn = whoShow1.value.itShowXiHaiAn; const isXiHaiAn = whoShow1.value.itShowXiHaiAn || true;
const options = reactive({ const options = reactive({
width: '912px', // width: '912px', //
height: '513px', // height: '513px', //
@ -688,8 +688,11 @@ if (whoShow1.value.itShowXiHaiAn) {
tabList.value[0].content.push('无人机') tabList.value[0].content.push('无人机')
tabList.value[0].content.push('单兵设备') tabList.value[0].content.push('单兵设备')
} }
const rowClickData = ref(null)
// //
const openVideo = (id) => { const openVideo = (id, record) => {
rowClickData.value = record;
console.log('打开视频', id) console.log('打开视频', id)
const param = { const param = {
key: id, key: id,
@ -1271,8 +1274,6 @@ const getSoldierData = (indexFather, name) => {
return message.error(res.data.msg) return message.error(res.data.msg)
} }
let { list = [], total = 0 } = res.data.data; let { list = [], total = 0 } = res.data.data;
console.log('total------------>', total);
pagination.value.total = total pagination.value.total = total
if (name == '无人机') { if (name == '无人机') {
list.map((wrj) => { list.map((wrj) => {
@ -1285,6 +1286,7 @@ const getSoldierData = (indexFather, name) => {
}) })
}) })
} }
if (name == '单兵设备') { if (name == '单兵设备') {
list.map((db) => { list.map((db) => {
dataSource2.value.push({ dataSource2.value.push({
@ -1348,7 +1350,7 @@ const batchPreview = async function (page) {
}, },
} }
await getStreamByChannelCode(param).then((res) => { await getStreamByChannelCode(param).then((res) => {
// // -
// ob.options.src = 'http://playertest.longtailvideo.com/adaptive/bipbop/gear4/prog_index.m3u8' // ob.options.src = 'http://playertest.longtailvideo.com/adaptive/bipbop/gear4/prog_index.m3u8'
ob.options.src = res.data.data ob.options.src = res.data.data
console.log('监测ob的变化', ob) console.log('监测ob的变化', ob)
@ -1489,7 +1491,6 @@ const getCamera = (flag, str) => {
longitude: mapSearchParam.value.gpsX || '', longitude: mapSearchParam.value.gpsX || '',
latitude: mapSearchParam.value.gpsY || '', latitude: mapSearchParam.value.gpsY || '',
radius: mapSearchParam.value.radius || '', radius: mapSearchParam.value.radius || '',
status: 1,
name: mapSearchParam.value.cameraName name: mapSearchParam.value.cameraName
} }
// todo- // todo-
@ -1658,8 +1659,19 @@ const handleTableChange = (val) => {
} }
} }
const videoShowMsg = () => { //
message.warning('请申请后在我的申请中预览视频!') const videoShowMsg = (index) => {
let itemData = null;
if (index) {
itemData = selectedList.value[index]
}
let msg = '请申请后在我的申请中预览视频!'
if ((itemData && itemData.status !== 1) || (rowClickData.value && rowClickData.value.status !== 1)) {
msg = '当前视频离线不可预览!'
} else {
msg = '请申请后在我的申请中预览视频!'
}
message.warning(msg)
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@ -2103,5 +2115,4 @@ video::-webkit-media-controls {
margin-top: 14px; margin-top: 14px;
cursor: pointer; cursor: pointer;
} }
</style> </style>