review:【IoT 物联网】场景联动
parent
c427031e5a
commit
1718135f24
11902
pnpm-lock.yaml
11902
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -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 规则场景的触发类型枚举
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue