review:【IoT 物联网】场景联动

pull/793/MERGE
YunaiV 2025-07-06 10:45:12 +08:00
parent c427031e5a
commit 1718135f24
4 changed files with 6582 additions and 5330 deletions

File diff suppressed because it is too large Load Diff

View File

@ -238,6 +238,7 @@ export enum DICT_TYPE {
IOT_THING_MODEL_TYPE = 'iot_thing_model_type', // IOT 产品功能类型
IOT_THING_MODEL_UNIT = 'iot_thing_model_unit', // IOT 物模型单位
IOT_RW_TYPE = 'iot_rw_type', // IOT 读写类型
// TODO @芋艿:貌似这几个多了 _enum 后缀
IOT_DATA_SINK_TYPE_ENUM = 'iot_data_sink_type_enum', // IoT 数据流转目的类型
IOT_RULE_SCENE_TRIGGER_TYPE_ENUM = 'iot_rule_scene_trigger_type_enum', // IoT 场景流转的触发类型枚举
IOT_RULE_SCENE_ACTION_TYPE_ENUM = 'iot_rule_scene_action_type_enum', // IoT 规则场景的触发类型枚举

View File

@ -25,6 +25,7 @@
{{ product ? product.name : '选择产品' }}
</el-button>
</div>
<!-- TODO @puhui999单选设备 -->
<div v-if="isDeviceAction" class="flex items-center mr-60px">
<span class="mr-10px">设备</span>
<el-button type="primary" @click="handleSelectDevice" size="small" plain>
@ -40,6 +41,7 @@
</div>
<!-- 设备控制执行器 -->
<!-- TODO @puhui999服务调用时选择好某个物模型剩余直接填写一个 JSON 不用逐个添加~可以试试设备详情-设备调试有服务调用的模拟 -->
<DeviceControlAction
v-if="isDeviceAction"
:action-type="actionConfig.type"
@ -64,10 +66,11 @@
<div v-else-if="actionConfig.type === IotRuleSceneActionTypeEnum.ALERT_RECOVER">
<div class="bg-[#dbe5f6] flex items-center justify-center p-10px mb-10px">
<el-icon class="mr-5px text-blue-500"><Icon icon="ep:info-filled" /></el-icon>
<!-- TODO @puhui999这种类型的提示感觉放在 SELECT 后面有个所有的提示会不会更好呀因为可以少占用行呢 -->
<span class="text-gray-600">恢复指定的告警配置状态</span>
</div>
<div class="p-10px">
<el-form-item label="选择告警配置" required>
<el-form-item label="选择告警配置" required label-width="110">
<el-select
v-model="actionConfig.alertConfigId"
class="!w-240px"

View File

@ -24,6 +24,7 @@
{{ product ? product.name : '选择产品' }}
</el-button>
</div>
<!-- TODO @puhui999只允许选择一个或者全部设备 -->
<div v-if="isDeviceTrigger" class="flex items-center mr-60px">
<span class="mr-10px">设备</span>
<el-button type="primary" @click="openDeviceSelect" size="small" plain>
@ -110,6 +111,7 @@
<crontab v-model="triggerConfig.cronExpression" />
</div>
<!-- 除了设备上下线变更其他设备触发类型都可以设置多个触发条件 -->
<!-- TODO @puhui999触发有点不太对可以在用下阿里云的呢~ -->
<el-text
v-if="
isDeviceTrigger && triggerConfig.type !== IotRuleSceneTriggerTypeEnum.DEVICE_STATE_UPDATE
@ -176,7 +178,6 @@ const isDeviceTrigger = computed(() => {
const addCondition = () => {
//
let defaultConditionType: string = IotDeviceMessageTypeEnum.PROPERTY
switch (triggerConfig.value.type) {
case IotRuleSceneTriggerTypeEnum.DEVICE_PROPERTY_POST:
defaultConditionType = IotDeviceMessageTypeEnum.PROPERTY
@ -189,6 +190,7 @@ const addCondition = () => {
break
}
//
triggerConfig.value.conditions?.push({
type: defaultConditionType,
identifier: IotDeviceMessageIdentifierEnum.PROPERTY_SET,