提交: 场景控制 增加 触发器 防抖(间隔) 设置操作,修复bug
This commit is contained in:
parent
60b3d4766b
commit
30293db4da
|
@ -3,7 +3,7 @@
|
|||
<div class="content">
|
||||
<div class="left">
|
||||
<Tabs size="small" v-model="curtab">
|
||||
<TabPane label="秒" name="second" :disabled="true" v-if="!hideSecond"><second-ui v-model="second" :disabled="true"></second-ui></TabPane>
|
||||
<TabPane label="秒" name="second" :disabled="disabledSecond" v-if="!hideSecond"><second-ui v-model="second" :disable="disabledSecond"></second-ui></TabPane>
|
||||
<TabPane label="分" name="minute"><minute-ui v-model="minute" :disabled="disabled"></minute-ui></TabPane>
|
||||
<TabPane label="时" name="hour"><hour-ui v-model="hour" :disabled="disabled"></hour-ui></TabPane>
|
||||
<TabPane label="日" name="day"><day-ui v-model="day" :week="week" :disabled="disabled"></day-ui></TabPane>
|
||||
|
@ -52,6 +52,10 @@ export default {
|
|||
event: 'change'
|
||||
},
|
||||
props: {
|
||||
disabledSecond: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
cronValue: {
|
||||
type: String,
|
||||
default: ''
|
||||
|
|
|
@ -71,10 +71,7 @@ export default {
|
|||
let notifierObj = {
|
||||
msgType: 'SMS',
|
||||
"msgServer": "电信",
|
||||
"msgTemplate": "报警模板",
|
||||
"actionId": null,
|
||||
"sceneId": null,
|
||||
"recordStatus": 0,
|
||||
"msgTemplate": "",
|
||||
contactsRelList: []
|
||||
}
|
||||
this.dataItem.sceneActionNotifierContacts = [notifierObj];
|
||||
|
@ -180,6 +177,7 @@ export default {
|
|||
: null}
|
||||
|
||||
{ (dataItem.actionType === "NOTIFIER") ? <div class="action-contacts-transfer">
|
||||
<el-input placeholder="推送消息内容" type="textarea" rows={2} v-model={dataItem.sceneActionNotifierContacts[0]['msgTemplate']} style="margin-bottom: 10px; width: 445px;"></el-input>
|
||||
<el-transfer
|
||||
titles={['待选', '已选']}
|
||||
filterable
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<div>
|
||||
<easy-cron
|
||||
:hideSecond="false"
|
||||
:disabledSecond="false"
|
||||
:disabled="false"
|
||||
style="width: 100%;"
|
||||
v-model="stateValue"
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
<template>
|
||||
<div class="e-interval">
|
||||
<div style="width: 100%; display: flex;">
|
||||
<el-input
|
||||
v-model="value"
|
||||
size="small"
|
||||
width="120px;"
|
||||
placeholder="间隔时间"
|
||||
onkeyup="value=value.replace(/[^\d]/g,0)"
|
||||
@input="handleInput"
|
||||
/>
|
||||
<el-select
|
||||
v-model="unit"
|
||||
size="small"
|
||||
style="width: 120px; margin-left: 10px;"
|
||||
placeholder="单位"
|
||||
@change="handleChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="(keys, value) in intervalOption"
|
||||
:key="keys"
|
||||
:label="keys"
|
||||
:value="value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
const intervalOption = {
|
||||
SECONDS: "秒",
|
||||
MINUTES: "分钟",
|
||||
HOURS: "小时",
|
||||
DAYS: "天"
|
||||
};
|
||||
export default {
|
||||
name: 'EInterval',
|
||||
props: {
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: '0'
|
||||
},
|
||||
unit: {
|
||||
type: [String, Number],
|
||||
default: 'SECONDS'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
intervalOption,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleInput(e) {
|
||||
this.$emit('input', e);
|
||||
},
|
||||
handleChange(e) {
|
||||
this.$emit('change', e);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -4,6 +4,7 @@ import selectMethod from './ESelect'
|
|||
import ESelectDevice from './ESelectDevice'
|
||||
import EConditionTemp from './EConditionTemp'
|
||||
import ECronForm from './ECronForm'
|
||||
import EInterval from './EInterval'
|
||||
|
||||
|
||||
export default {
|
||||
|
@ -21,18 +22,20 @@ export default {
|
|||
require: true,
|
||||
},
|
||||
},
|
||||
components: { selectMethod, ESelectDevice, EConditionTemp, ECronForm },
|
||||
components: { selectMethod, ESelectDevice, EConditionTemp, ECronForm, EInterval },
|
||||
data() {
|
||||
return {
|
||||
method: 'DEVICE',
|
||||
exeStartTime: "",
|
||||
open: false
|
||||
open: false,
|
||||
isAntiShake: false,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.$refs.eCondition && this.dataItem.sceneTriggerDevices[0]['deviceId']) {
|
||||
this.$refs.eCondition.getcomdlist(this.dataItem.sceneTriggerDevices[0]['deviceId']);
|
||||
};
|
||||
this.isAntiShake = Number(this.dataItem.intervalVal) >= 1 ? true : false;
|
||||
this.exeStartTime = this.parseTime(new Date(), "{y}-{m}-{d} {h}:{i}:{s}");
|
||||
},
|
||||
methods: {
|
||||
|
@ -79,6 +82,13 @@ export default {
|
|||
this.open = false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isAntiShake() {
|
||||
if(this.isAntiShake === false) {
|
||||
this.dataItem['intervalVal'] = 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
render() {
|
||||
const { dataItem, inputWidth, sourceId } = this;
|
||||
return (
|
||||
|
@ -90,6 +100,28 @@ export default {
|
|||
<div class="e-trigger-title">
|
||||
{defaultConfig.title || '--'}: { dataItem.orderBy }
|
||||
<el-button type="text" class="e-button-del" onClick={this.handleDelTrigger}>刪除</el-button>
|
||||
<el-switch
|
||||
size="mini"
|
||||
v-model={this.isAntiShake}
|
||||
active-text="开启防抖"
|
||||
inactive-text="关闭防抖"
|
||||
active-value={true}
|
||||
inactive-value={false}
|
||||
active-color="#13ce66"
|
||||
inactive-color="#dcdfe6"
|
||||
class="e-scene-trigger-anti-switch"
|
||||
>
|
||||
</el-switch>
|
||||
{
|
||||
this.isAntiShake ? <e-interval
|
||||
value={dataItem['intervalVal']}
|
||||
unit={dataItem['intervalUnit']}
|
||||
onInput={(e) => { dataItem['intervalVal'] = e }}
|
||||
onChange={(e) => { dataItem['intervalUnit'] = e }}
|
||||
></e-interval>
|
||||
: null
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="b-method">
|
||||
|
|
|
@ -58,3 +58,43 @@
|
|||
font-size: 12px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.e-trigger-title {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
.e-scene-trigger-anti-switch {
|
||||
margin: 0 10px;
|
||||
}
|
||||
.e-scene-trigger-anti-switch .el-switch__label {
|
||||
position: absolute;
|
||||
display: none;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.e-scene-trigger-anti-switch .el-switch__label--right {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.e-scene-trigger-anti-switch .el-switch__label--right span{
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
.e-scene-trigger-anti-switch .el-switch__label--left {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.e-scene-trigger-anti-switch .el-switch__label--left span{
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.e-scene-trigger-anti-switch .el-switch__label.is-active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.e-scene-trigger-anti-switch.el-switch .el-switch__core,
|
||||
.el-switch .el-switch__label {
|
||||
width: 100px !important;
|
||||
margin: 0;
|
||||
}
|
||||
|
|
|
@ -195,7 +195,7 @@ export default {
|
|||
email: [
|
||||
{
|
||||
type: "email",
|
||||
message: "'请输入正确的邮箱地址",
|
||||
message: "请输入正确的邮箱地址",
|
||||
trigger: ["blur", "change"]
|
||||
}
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue