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(); }