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