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 } }