diff --git a/src/components/alarm/commonAlarm.vue b/src/components/alarm/commonAlarm.vue index 97ace73..b5a2fc7 100644 --- a/src/components/alarm/commonAlarm.vue +++ b/src/components/alarm/commonAlarm.vue @@ -41,7 +41,7 @@ watch( alarm(alarmType, val[0].id); playAlarmMusic(alarmType); } else { - waitShowDialog.unshift(markRaw(lineNetStore.alarmInfo[0])); + waitShowDialog.push(markRaw(lineNetStore.alarmInfo[0])); } } } @@ -138,6 +138,7 @@ function alarm(alarmType: number, id: string) { if (dialogInstance[i].id == id) { dialogInstance[i].hasHandle = true; if (close !== undefined) { + alarmWaitDialog(); dialogInstance[i].show = false; } break; @@ -147,11 +148,7 @@ function alarm(alarmType: number, id: string) { }, }) .onCancel(() => { - if (countHasShowFiveDialog() && waitShowDialog.length) { - alarm(alarmType, waitShowDialog[0].id); - playAlarmMusic(waitShowDialog[0].alert_type); - waitShowDialog.shift(); - } + alarmWaitDialog(); const index = dialogInstance.findIndex( (item) => item.dialog == dialogInstanceItem ); @@ -169,6 +166,14 @@ function alarm(alarmType: number, id: string) { timingPlayAlarmMusic(dialogInstanceItem); } +function alarmWaitDialog() { + if (countHasShowFiveDialog() && waitShowDialog.length) { + alarm(waitShowDialog[0].alert_type, waitShowDialog[0].id); + playAlarmMusic(waitShowDialog[0].alert_type); + waitShowDialog.shift(); + } +} + function closeAllDialog() { if (dialogInstance.length) { dialogInstance.forEach((item) => {