【功能新增】IoT: 场景联动增加定时触发配置
parent
aed4ff0718
commit
0961df37dd
|
|
@ -44,8 +44,9 @@
|
|||
<Icon icon="ep:delete" />
|
||||
</el-button>
|
||||
</device-listener>
|
||||
<!-- TODO @puhui999:可以使用 el-button,然后选个合适的样式哇 -->
|
||||
<el-text class="ml-10px!" type="primary" @click="addTrigger">添加触发器</el-text>
|
||||
<el-button class="ml-10px!" type="primary" size="small" @click="addTrigger">
|
||||
添加触发器
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-divider content-position="left">执行动作配置</el-divider>
|
||||
|
|
|
|||
|
|
@ -17,13 +17,19 @@
|
|||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="flex items-center mr-60px">
|
||||
<div
|
||||
v-if="triggerConfig.type === IotRuleSceneTriggerTypeEnum.DEVICE"
|
||||
class="flex items-center mr-60px"
|
||||
>
|
||||
<span class="mr-10px">产品</span>
|
||||
<el-button type="primary" @click="productTableSelectRef?.open()" size="small" plain>
|
||||
{{ product ? product.name : '选择产品' }}
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="flex items-center mr-60px">
|
||||
<div
|
||||
v-if="triggerConfig.type === IotRuleSceneTriggerTypeEnum.DEVICE"
|
||||
class="flex items-center mr-60px"
|
||||
>
|
||||
<span class="mr-10px">设备</span>
|
||||
<el-button type="primary" @click="openDeviceSelect" size="small" plain>
|
||||
{{ isEmpty(deviceList) ? '选择设备' : triggerConfig.deviceNames.join(',') }}
|
||||
|
|
@ -36,7 +42,8 @@
|
|||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 触发器条件 -->
|
||||
<!-- 设备触发器条件 -->
|
||||
<template v-if="triggerConfig.type === IotRuleSceneTriggerTypeEnum.DEVICE">
|
||||
<div
|
||||
class="bg-[#dbe5f6] flex p-10px"
|
||||
v-for="(condition, index) in triggerConfig.conditions"
|
||||
|
|
@ -100,7 +107,24 @@
|
|||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<el-text class="ml-10px!" type="primary" @click="addCondition">添加触发条件</el-text>
|
||||
</template>
|
||||
<!-- 定时触发 -->
|
||||
<div
|
||||
v-if="triggerConfig.type === IotRuleSceneTriggerTypeEnum.TIMER"
|
||||
class="bg-[#dbe5f6] flex items-center justify-between p-10px"
|
||||
>
|
||||
<span class="w-120px">CRON 表达式</span>
|
||||
<crontab v-model="triggerConfig.cronExpression" />
|
||||
</div>
|
||||
<!-- 设备触发才可以设置多个触发条件 -->
|
||||
<el-text
|
||||
v-if="triggerConfig.type === IotRuleSceneTriggerTypeEnum.DEVICE"
|
||||
class="ml-10px!"
|
||||
type="primary"
|
||||
@click="addCondition"
|
||||
>
|
||||
添加触发条件
|
||||
</el-text>
|
||||
</div>
|
||||
|
||||
<!-- 产品、设备的选择 -->
|
||||
|
|
@ -126,6 +150,7 @@ import { ThingModelApi } from '@/api/iot/thingmodel'
|
|||
import {
|
||||
IotDeviceMessageIdentifierEnum,
|
||||
IotDeviceMessageTypeEnum,
|
||||
IotRuleSceneTriggerTypeEnum,
|
||||
TriggerCondition,
|
||||
TriggerConditionParameter,
|
||||
TriggerConfig
|
||||
|
|
|
|||
Loading…
Reference in New Issue