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);