From 7aec94a34cf4b31666e914177293a145c52325cb Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Wed, 1 Nov 2023 15:56:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=B95=E4=B8=AAbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/alarm/alarmInfoDialog.vue | 5 ++++- src/components/alarm/commonAlarm.vue | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/alarm/alarmInfoDialog.vue b/src/components/alarm/alarmInfoDialog.vue index 6f49c44..2b44acd 100644 --- a/src/components/alarm/alarmInfoDialog.vue +++ b/src/components/alarm/alarmInfoDialog.vue @@ -97,6 +97,7 @@ import { queryAlarmInfoById } from 'src/api/DecisionInfo'; const props = defineProps<{ alarmMeaasge?: AlarmInfo; + waitAlarmMeaasge?: AlarmInfo; onHandle: (id?: string, close?: boolean) => void; }>(); @@ -132,8 +133,10 @@ const showDialog = ref(true); const showDecisionmessage = ref(true); onMounted(() => { - if (props.alarmMeaasge == undefined) { + if (props.alarmMeaasge == undefined && props.waitAlarmMeaasge == undefined) { messageUse = lineNetStore.alarmInfo[0] as AlarmInfo; + } else if (props.waitAlarmMeaasge) { + messageUse = props.waitAlarmMeaasge as AlarmInfo; } else { messageUse = props.alarmMeaasge as AlarmInfo; if (messageUse.alarmStatus == 1) { diff --git a/src/components/alarm/commonAlarm.vue b/src/components/alarm/commonAlarm.vue index 6ea7033..1cb4267 100644 --- a/src/components/alarm/commonAlarm.vue +++ b/src/components/alarm/commonAlarm.vue @@ -128,11 +128,12 @@ function countHasShowFiveDialog(): boolean { return hasShow > 4 ? true : false; } -function alarm(alarmType: number, id: string) { +function alarm(alarmType: number, id: string, waitAlarmMeaasge?: AlarmInfo) { const dialogInstanceItem = $q .dialog({ component: alarmInfoDialog, componentProps: { + waitAlarmMeaasge: waitAlarmMeaasge, onHandle: (id: string, close?: boolean) => { for (let i = 0; i < dialogInstance.length; i++) { if (dialogInstance[i].id == id) { @@ -168,7 +169,11 @@ function alarm(alarmType: number, id: string) { function alarmWaitDialog() { if (countHasShowFiveDialog() && waitShowDialog.length) { - alarm(waitShowDialog[0].alert_type, waitShowDialog[0].id); + alarm( + waitShowDialog[0].alert_type, + waitShowDialog[0].id, + waitShowDialog[0] + ); playAlarmMusic(waitShowDialog[0].alert_type); waitShowDialog.shift(); }