|
@@ -74,6 +74,22 @@
|
74
|
74
|
</div>
|
75
|
75
|
</div>
|
76
|
76
|
</div>
|
|
77
|
+ <!-- 预警间隔 -->
|
|
78
|
+ <div class="form-item">
|
|
79
|
+ <span class="lable required">预警间隔:</span>
|
|
80
|
+ <!-- -->
|
|
81
|
+ <div class="interval-wrap">
|
|
82
|
+ <el-input
|
|
83
|
+ v-model.trim="form.time_interval"
|
|
84
|
+ size="mini"
|
|
85
|
+ placeholder="请输入"
|
|
86
|
+ clearable
|
|
87
|
+ @input="onInputTimeInterval"
|
|
88
|
+ @change="onChangeTimeInterval"
|
|
89
|
+ />
|
|
90
|
+ <span class="text">分钟</span>
|
|
91
|
+ </div>
|
|
92
|
+ </div>
|
77
|
93
|
</div>
|
78
|
94
|
<div slot="footer" class="dialog-footer">
|
79
|
95
|
<el-button size="mini" @click="handleCancel" :disabled="loading">取 消</el-button>
|
|
@@ -124,7 +140,8 @@ export default {
|
124
|
140
|
check_type: 1,
|
125
|
141
|
num: '',
|
126
|
142
|
}
|
127
|
|
- ]
|
|
143
|
+ ],
|
|
144
|
+ time_interval: '', // 预警间隔
|
128
|
145
|
}
|
129
|
146
|
}
|
130
|
147
|
},
|
|
@@ -220,7 +237,7 @@ export default {
|
220
|
237
|
// 执行表单校验
|
221
|
238
|
handleFormValidate() {
|
222
|
239
|
return new Promise((resolve, reject) => {
|
223
|
|
- const { monitor_user_list, notice_type, warnUserList, warnGroup, rules } = this.form
|
|
240
|
+ const { monitor_user_list, notice_type, warnUserList, warnGroup, rules, time_interval } = this.form
|
224
|
241
|
const isHasNullRules = rules.some(rule => !rule.minute || rule.num === '')
|
225
|
242
|
|
226
|
243
|
if (!monitor_user_list || !monitor_user_list.length) {
|
|
@@ -235,6 +252,12 @@ export default {
|
235
|
252
|
} else if (isHasNullRules) {
|
236
|
253
|
this.$message.warning('请完善"预警规则"')
|
237
|
254
|
reject('表单校验未通过')
|
|
255
|
+ } else if (time_interval !== '' && Number(time_interval) === 0) {
|
|
256
|
+ this.$message.warning('预警间隔时间不能为0')
|
|
257
|
+ reject('表单校验未通过')
|
|
258
|
+ } else if (!time_interval) {
|
|
259
|
+ this.$message.warning('请输入预警间隔时间')
|
|
260
|
+ reject('表单校验未通过')
|
238
|
261
|
} else {
|
239
|
262
|
resolve('表单校验通过')
|
240
|
263
|
}
|
|
@@ -247,6 +270,7 @@ export default {
|
247
|
270
|
notice_type: this.form.notice_type,
|
248
|
271
|
sys_group_id: this.sys_group_id,
|
249
|
272
|
content: JSON.stringify(this.form.rules),
|
|
273
|
+ time_interval: Number(this.form.time_interval),
|
250
|
274
|
conf_id: this.isEdit ? this.confId : '',
|
251
|
275
|
}
|
252
|
276
|
|
|
@@ -291,6 +315,7 @@ export default {
|
291
|
315
|
}
|
292
|
316
|
|
293
|
317
|
this.form.rules = [...detailInfo.content]
|
|
318
|
+ this.form.time_interval = detailInfo.time_interval
|
294
|
319
|
} else if (res.errno != 4002) {
|
295
|
320
|
this.$message.warning(res.err || '操作失败')
|
296
|
321
|
}
|
|
@@ -314,6 +339,7 @@ export default {
|
314
|
339
|
num: '',
|
315
|
340
|
}
|
316
|
341
|
]
|
|
342
|
+ this.form.time_interval = ''
|
317
|
343
|
},
|
318
|
344
|
// 监听输入"规则 - 分钟"
|
319
|
345
|
onInputMinute(inputVal, idx) {
|
|
@@ -354,6 +380,16 @@ export default {
|
354
|
380
|
corpid: item.corpid,
|
355
|
381
|
}))
|
356
|
382
|
},
|
|
383
|
+ // 监听输入“预警间隔”
|
|
384
|
+ onInputTimeInterval(inputVal) {
|
|
385
|
+ this.form.time_interval = getIntegerNumber(inputVal)
|
|
386
|
+ },
|
|
387
|
+ onChangeTimeInterval(inputVal) {
|
|
388
|
+ if (inputVal !== '' && Number(inputVal) === 0) {
|
|
389
|
+ this.form.time_interval = ''
|
|
390
|
+ this.$message.warning('预警间隔时间不能为0')
|
|
391
|
+ }
|
|
392
|
+ },
|
357
|
393
|
},
|
358
|
394
|
};
|
359
|
395
|
</script>
|
|
@@ -439,6 +475,20 @@ export default {
|
439
|
475
|
}
|
440
|
476
|
}
|
441
|
477
|
}
|
|
478
|
+ .interval-wrap {
|
|
479
|
+ display: flex;
|
|
480
|
+ align-items: center;
|
|
481
|
+ .el-input {
|
|
482
|
+ width: 90px;
|
|
483
|
+ /deep/ .el-input__inner {
|
|
484
|
+ padding: 0 24px 0 8px;
|
|
485
|
+ }
|
|
486
|
+ }
|
|
487
|
+ .text {
|
|
488
|
+ margin-left: 6px;
|
|
489
|
+ font-size: 13px;
|
|
490
|
+ }
|
|
491
|
+ }
|
442
|
492
|
}
|
443
|
493
|
}
|
444
|
494
|
.dialog-footer {
|