This commit is contained in:
joylink_zhaoerwei 2023-11-01 09:07:11 +08:00
parent 3a2324b274
commit 50af8c6c52

View File

@ -41,7 +41,7 @@ watch(
alarm(alarmType, val[0].id); alarm(alarmType, val[0].id);
playAlarmMusic(alarmType); playAlarmMusic(alarmType);
} else { } 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) { if (dialogInstance[i].id == id) {
dialogInstance[i].hasHandle = true; dialogInstance[i].hasHandle = true;
if (close !== undefined) { if (close !== undefined) {
alarmWaitDialog();
dialogInstance[i].show = false; dialogInstance[i].show = false;
} }
break; break;
@ -147,11 +148,7 @@ function alarm(alarmType: number, id: string) {
}, },
}) })
.onCancel(() => { .onCancel(() => {
if (countHasShowFiveDialog() && waitShowDialog.length) { alarmWaitDialog();
alarm(alarmType, waitShowDialog[0].id);
playAlarmMusic(waitShowDialog[0].alert_type);
waitShowDialog.shift();
}
const index = dialogInstance.findIndex( const index = dialogInstance.findIndex(
(item) => item.dialog == dialogInstanceItem (item) => item.dialog == dialogInstanceItem
); );
@ -169,6 +166,14 @@ function alarm(alarmType: number, id: string) {
timingPlayAlarmMusic(dialogInstanceItem); 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() { function closeAllDialog() {
if (dialogInstance.length) { if (dialogInstance.length) {
dialogInstance.forEach((item) => { dialogInstance.forEach((item) => {