弹5个bug修复

This commit is contained in:
joylink_zhaoerwei 2023-11-01 15:56:35 +08:00
parent 463620a75b
commit 7aec94a34c
2 changed files with 11 additions and 3 deletions

View File

@ -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) {

View File

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