diff --git a/src/components/alarm/setAlarmMock.vue b/src/components/alarm/setAlarmMock.vue index ec980e6..37aa262 100644 --- a/src/components/alarm/setAlarmMock.vue +++ b/src/components/alarm/setAlarmMock.vue @@ -159,8 +159,10 @@ watch( selectGraphic.push(...deviceFilter); } selectGraphic = Array.from(new Set(selectGraphic)); - lineStore.getLineApp().updateSelected(...selectGraphic); setAlartTextData.value.deviceCodes = selectGraphic.map((g) => g.code); + selectGraphic.forEach((g) => { + g.updateSelected(true); + }); } } ); @@ -203,9 +205,9 @@ function removeSelect(code: string) { const removeIndex = setAlartTextData.value.deviceCodes.findIndex( (item) => item == code ); + selectGraphic[removeIndex].updateSelected(false); selectGraphic.splice(removeIndex, 1); setAlartTextData.value.deviceCodes.splice(removeIndex, 1); - lineStore.getLineApp().updateSelected(...selectGraphic); } function clearSelect() { @@ -220,5 +222,6 @@ function onReset() { alertType: '', deviceCodes: [], }; + selectGraphic = []; } diff --git a/src/components/alarm/setAlarmText.vue b/src/components/alarm/setAlarmText.vue index 05cd595..a9f58b7 100644 --- a/src/components/alarm/setAlarmText.vue +++ b/src/components/alarm/setAlarmText.vue @@ -174,9 +174,9 @@ watch( selectGraphic = [deviceFilter[0]]; } selectGraphic = Array.from(new Set(selectGraphic)); - lineStore.getLineApp().updateSelected(...selectGraphic); setAlartTextData.value.deviceInfos = []; selectGraphic.forEach((g) => { + g.updateSelected(true); setAlartTextData.value.deviceInfos.push({ deviceName: g.code, deviceType: (DeviceType as never)[g.type + ''], @@ -227,9 +227,9 @@ function removeSelect(code: { deviceName: string; deviceType: string }) { const removeIndex = setAlartTextData.value.deviceInfos.findIndex( (item) => item == code ); + selectGraphic[removeIndex].updateSelected(false); selectGraphic.splice(removeIndex, 1); setAlartTextData.value.deviceInfos.splice(removeIndex, 1); - lineStore.getLineApp().updateSelected(...selectGraphic); } function clearSelect() { @@ -247,5 +247,6 @@ function onReset() { status: '', groupId: '', }; + selectGraphic = []; }