From ff8a4f1c071eef6b4f83186907440b5076532a47 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Fri, 22 Sep 2023 09:44:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E7=BD=AE=E6=95=85?= =?UTF-8?q?=E9=9A=9C=E6=B5=8B=E8=AF=95=E6=A1=86=E9=80=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/alarm/setAlarmMock.vue | 7 +++++-- src/components/alarm/setAlarmText.vue | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) 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 = []; }