diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json index 2ca3adf..d979925 100644 --- a/.eslintrc-auto-import.json +++ b/.eslintrc-auto-import.json @@ -5,6 +5,10 @@ "ComputedRef": true, "DirectiveBinding": true, "EffectScope": true, + "ElLoading": true, + "ElMessage": true, + "ElMessageBox": true, + "ElNotification": true, "ExtractDefaultPropTypes": true, "ExtractPropTypes": true, "ExtractPublicPropTypes": true, diff --git a/src/api/WarningList/types.ts b/src/api/WarningList/types.ts index c77aaed..3559442 100644 --- a/src/api/WarningList/types.ts +++ b/src/api/WarningList/types.ts @@ -24,3 +24,9 @@ export interface DemoQuery extends PageQuery { beginTime?: string; endTime?: string; } + +/** 告警列表响应结构 */ +export interface WarningListResult { + rows: DemoVO[]; + total: number; +} diff --git a/src/layout/components/notice/index.vue b/src/layout/components/notice/index.vue index 6a0141f..21f246f 100644 --- a/src/layout/components/notice/index.vue +++ b/src/layout/components/notice/index.vue @@ -52,6 +52,7 @@ import { listNotice } from '@/api/system/notice'; import { initHls, destroyHls } from '@/utils/video'; import { onBeforeRouteLeave } from 'vue-router'; import { useWarningListStore } from '@/store/modules/warnningList'; +import type { WarningListResult } from '@/api/WarningList/types'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; @@ -61,13 +62,13 @@ const videosStore = useVideosStore(); const warningListStore = useWarningListStore(); const noticeStore = useNoticeStore(); +const { getWarningList, hanldeAction } = warningListStore; +const { warningListTotal, warningList } = storeToRefs(warningListStore); -const props = defineProps<{ - warningList: any; -}>(); -const { warningList } = toRefs(props); +// const props = defineProps<{ +// warningList?: WarningListResult; +// }>(); const warningListRows = computed(() => warningList.value?.rows || []); -// console.log('666666666666666666_warningListRows', warningListRows.value); const { readAll } = useNoticeStore(); const monitorVideoRef = ref(); @@ -96,8 +97,8 @@ const parseNoticeItem = (notice: any) => { //查看画面 const handleSee = async (row: any) => { - const videoId = row?.videoId; - console.log('查看画面', row, 'videoId', videoId); + const videoId = row?.deviceId; + console.log('查看画面', row, 'deviceId', videoId); if (!videoId) { proxy?.$modal.msgError('视频ID不存在'); return; @@ -107,9 +108,10 @@ const handleSee = async (row: any) => { dialog.visible = true; await nextTick(); initHls(monitorVideoUrl, monitorVideoRef); + await hanldeAction(row.id); }; -const handleMonitorDialogClose = (done: () => void) => { +const handleMonitorDialogClose = async (done: () => void) => { // 卸载 Hls 与清理 video destroyHls(monitorVideoRef); done(); @@ -194,9 +196,10 @@ onBeforeRouteLeave(() => { dialog.visible = false; monitorVideoUrl.value = ''; }); -// onMounted(() => { -// warningListStore.getWarningList(); -// }); +onMounted(() => { + getWarningList(); + console.log('111111111111111111111_warningList.value', warningList.value); +});