From 91d290abf10079c231b3f5b4e71c35dab8c41c67 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Wed, 27 Dec 2023 13:21:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/alarm/setAlarmText.vue | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/components/alarm/setAlarmText.vue b/src/components/alarm/setAlarmText.vue index 3917c2d..ca4192a 100644 --- a/src/components/alarm/setAlarmText.vue +++ b/src/components/alarm/setAlarmText.vue @@ -306,7 +306,13 @@ function toggleItem(index: number) { const select: JlGraphic[] = []; setAlartTextData.value.groupList[index].deviceInfos.forEach( (deviceInfo) => { - const g = lineApp.queryStore.queryById(deviceInfo.deviceName); + const deviceType = ( + Object.keys(DeviceType) as Array + ).find((key) => DeviceType[key] === deviceInfo.deviceType) as string; + const g = lineApp.queryStore.queryByCodeAndType( + deviceInfo.deviceName, + deviceType + ) as JlGraphic; select.push(g); } ); @@ -316,6 +322,21 @@ function toggleItem(index: number) { } } +function clickSelectCenter(index: number) { + const lineApp = lineStore.getLineApp(); + const clickTarget = setAlartTextData.value.groupList[clickIndex as number]; + const deviceType = ( + Object.keys(DeviceType) as Array + ).find( + (key) => DeviceType[key] === clickTarget.deviceInfos[index].deviceType + ) as string; + const clickGraphic = lineApp.queryStore.queryByCodeAndType( + clickTarget.deviceInfos[index].deviceName, + deviceType + ) as JlGraphic; + lineApp.makeGraphicCenterShow(clickGraphic); +} + function removeSelect(removeIndex: number) { const clickTarget = setAlartTextData.value.groupList[clickIndex as number]; selectGraphic.splice(removeIndex, 1);