From d0c8efdff8736672a2e0c841f852e657736741cc Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sat, 5 Jul 2025 10:54:43 +0800 Subject: [PATCH] =?UTF-8?q?perf=EF=BC=9A=E3=80=90IoT=20=E7=89=A9=E8=81=94?= =?UTF-8?q?=E7=BD=91=E3=80=91=E5=9C=BA=E6=99=AF=E8=81=94=E5=8A=A8=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E6=89=A7=E8=A1=8C=E5=99=A8=E6=97=A0=E9=9C=80=E9=A2=9D?= =?UTF-8?q?=E5=A4=96=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/action/ActionExecutor.vue | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/src/views/iot/rule/scene/components/action/ActionExecutor.vue b/src/views/iot/rule/scene/components/action/ActionExecutor.vue index e3b26a833..d945e9938 100644 --- a/src/views/iot/rule/scene/components/action/ActionExecutor.vue +++ b/src/views/iot/rule/scene/components/action/ActionExecutor.vue @@ -49,13 +49,13 @@ @update:model-value="(val) => (actionConfig.deviceControl = val)" /> - - + +
+ + + {{ getAlertActionDescription(actionConfig.type) }} + +
@@ -76,11 +76,9 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import ProductTableSelect from '@/views/iot/product/product/components/ProductTableSelect.vue' import DeviceTableSelect from '@/views/iot/device/device/components/DeviceTableSelect.vue' import DeviceControlAction from './DeviceControlAction.vue' -import AlertAction from './AlertAction.vue' import { ProductApi, ProductVO } from '@/api/iot/product/product' import { DeviceApi, DeviceVO } from '@/api/iot/device/device' import { - ActionAlert, ActionConfig, ActionDeviceControl, IotDeviceMessageIdentifierEnum, @@ -113,6 +111,18 @@ const isAlertAction = computed(() => { ].includes(actionConfig.value.type as any) }) +/** 获取告警执行器描述文本 */ +const getAlertActionDescription = (actionType: number) => { + switch (actionType) { + case IotRuleSceneActionTypeEnum.ALERT_TRIGGER: + return '触发告警通知,系统将自动发送告警信息' + case IotRuleSceneActionTypeEnum.ALERT_RECOVER: + return '恢复告警状态,系统将自动发送恢复通知' + default: + return '告警相关操作,无需额外配置' + } +} + /** 初始化执行器结构 */ const initActionConfig = () => { if (!actionConfig.value) { @@ -136,9 +146,9 @@ const initActionConfig = () => { } as ActionDeviceControl } - // 告警执行器初始化 - if (isAlertAction.value && !actionConfig.value.alert) { - actionConfig.value.alert = {} as ActionAlert + // 告警执行器初始化 - 无需额外配置,清空 alert 配置 + if (isAlertAction.value) { + actionConfig.value.alert = undefined } }