perf:【IoT 物联网】场景联动优化
parent
18758628f1
commit
8343faa027
|
|
@ -1,17 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="bg-[#dbe5f6] flex p-10px">
|
<div class="bg-[#dbe5f6] flex p-10px">
|
||||||
<div class="flex flex-col items-center justify-center mr-10px h-a">
|
|
||||||
<el-select
|
|
||||||
v-model="deviceControlConfig.type"
|
|
||||||
disabled
|
|
||||||
class="!w-160px"
|
|
||||||
clearable
|
|
||||||
placeholder=""
|
|
||||||
>
|
|
||||||
<el-option label="属性" :value="IotDeviceMessageTypeEnum.PROPERTY" />
|
|
||||||
<el-option label="服务" :value="IotDeviceMessageTypeEnum.SERVICE" />
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
<div class="">
|
<div class="">
|
||||||
<div
|
<div
|
||||||
class="flex items-center justify-around mb-10px last:mb-0"
|
class="flex items-center justify-around mb-10px last:mb-0"
|
||||||
|
|
|
||||||
|
|
@ -54,32 +54,6 @@
|
||||||
v-for="(condition, index) in triggerConfig.conditions"
|
v-for="(condition, index) in triggerConfig.conditions"
|
||||||
:key="index"
|
:key="index"
|
||||||
>
|
>
|
||||||
<div class="flex flex-col items-center justify-center mr-10px h-a">
|
|
||||||
<el-select
|
|
||||||
v-model="condition.type"
|
|
||||||
@change="condition.parameters = []"
|
|
||||||
class="!w-160px"
|
|
||||||
clearable
|
|
||||||
placeholder=""
|
|
||||||
:disabled="isConditionTypeFixed"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-if="triggerConfig.type === IotRuleSceneTriggerTypeEnum.DEVICE_PROPERTY_POST"
|
|
||||||
label="属性"
|
|
||||||
:value="IotDeviceMessageTypeEnum.PROPERTY"
|
|
||||||
/>
|
|
||||||
<el-option
|
|
||||||
v-if="triggerConfig.type === IotRuleSceneTriggerTypeEnum.DEVICE_EVENT_POST"
|
|
||||||
label="事件"
|
|
||||||
:value="IotDeviceMessageTypeEnum.EVENT"
|
|
||||||
/>
|
|
||||||
<el-option
|
|
||||||
v-if="triggerConfig.type === IotRuleSceneTriggerTypeEnum.DEVICE_SERVICE_INVOKE"
|
|
||||||
label="服务"
|
|
||||||
:value="IotDeviceMessageTypeEnum.SERVICE"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
<div class="w-70%">
|
<div class="w-70%">
|
||||||
<DeviceListenerCondition
|
<DeviceListenerCondition
|
||||||
v-for="(parameter, index2) in condition.parameters"
|
v-for="(parameter, index2) in condition.parameters"
|
||||||
|
|
@ -198,11 +172,6 @@ const isDeviceTrigger = computed(() => {
|
||||||
].includes(triggerConfig.value.type as any)
|
].includes(triggerConfig.value.type as any)
|
||||||
})
|
})
|
||||||
|
|
||||||
/** 计算属性:判断条件类型是否固定(根据触发类型自动确定) */
|
|
||||||
const isConditionTypeFixed = computed(() => {
|
|
||||||
return triggerConfig.value.type !== IotRuleSceneTriggerTypeEnum.DEVICE_SERVICE_INVOKE
|
|
||||||
})
|
|
||||||
|
|
||||||
/** 添加触发条件 */
|
/** 添加触发条件 */
|
||||||
const addCondition = () => {
|
const addCondition = () => {
|
||||||
// 根据触发类型设置默认的条件类型
|
// 根据触发类型设置默认的条件类型
|
||||||
|
|
@ -237,6 +206,10 @@ const addConditionParameter = (conditionParameters: TriggerConditionParameter[])
|
||||||
message.warning('请先选择一个产品')
|
message.warning('请先选择一个产品')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (conditionParameters.length >= 1) {
|
||||||
|
message.warning('只允许添加一个参数')
|
||||||
|
return
|
||||||
|
}
|
||||||
conditionParameters.push({} as TriggerConditionParameter)
|
conditionParameters.push({} as TriggerConditionParameter)
|
||||||
}
|
}
|
||||||
/** 移除参数 */
|
/** 移除参数 */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue