diff --git a/src/layout/components/notice/index.vue b/src/layout/components/notice/index.vue index b447ff3..dd93a7e 100644 --- a/src/layout/components/notice/index.vue +++ b/src/layout/components/notice/index.vue @@ -53,6 +53,7 @@ import { initHls, destroyHls } from '@/utils/video'; import { onBeforeRouteLeave } from 'vue-router'; import { useWarningListStore } from '@/store/modules/warnningList'; import type { WarningListResult } from '@/api/WarningList/types'; +import { addDemo } from '@/api/video/index'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; @@ -109,7 +110,9 @@ const parseNoticeItem = (notice: any) => { }; //查看画面 +const currentDeviceId = ref(); const handleSee = async (row: any) => { + currentDeviceId.value = row?.deviceId; const videoId = row?.deviceId; console.log('查看画面', row, 'deviceId', videoId); if (!videoId) { @@ -127,6 +130,13 @@ const handleSee = async (row: any) => { }; const handleMonitorDialogClose = async (done: () => void) => { + try { + addDemo(currentDeviceId.value as string).then(() => { + console.log('关闭视频111111'); + }); + } catch (error) { + console.log('关闭视频22222222', error); + } // 卸载 Hls 与清理 video destroyHls(monitorVideoRef); done(); diff --git a/src/views/equipmentList/list.vue b/src/views/equipmentList/list.vue index e7a8597..fe643e1 100644 --- a/src/views/equipmentList/list.vue +++ b/src/views/equipmentList/list.vue @@ -604,8 +604,6 @@ const cleanupVisibilityChange = () => { }; const handleMonitorDialogClose = (done: () => void) => { - console.log('idddddddddddd', form.value.id); - try { addDemo(form.value.id).then(() => { console.log('关闭视频111111');