|
@ -13,7 +13,12 @@ |
|
|
</div> |
|
|
</div> |
|
|
<a-form ref="formRef" :model="infoObject" :rules="rules"> |
|
|
<a-form ref="formRef" :model="infoObject" :rules="rules"> |
|
|
<a-form-item name="alarmTitle" label="告警标题"> |
|
|
<a-form-item name="alarmTitle" label="告警标题"> |
|
|
<ns-input allowClear v-model:value="infoObject.alarmTitle" placeholder="请输入告警标题" /> |
|
|
<ns-input |
|
|
|
|
|
:maxlength="20" |
|
|
|
|
|
allowClear |
|
|
|
|
|
v-model:value="infoObject.alarmTitle" |
|
|
|
|
|
@keydown="handleKeyDown" |
|
|
|
|
|
placeholder="请输入告警标题" /> |
|
|
</a-form-item> |
|
|
</a-form-item> |
|
|
<a-form-item label="告警频率" name="alarmFrequency"> |
|
|
<a-form-item label="告警频率" name="alarmFrequency"> |
|
|
<a-select |
|
|
<a-select |
|
@ -27,7 +32,7 @@ |
|
|
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数"> |
|
|
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数"> |
|
|
<ns-input-number |
|
|
<ns-input-number |
|
|
v-model:value="infoObject.repetitions" |
|
|
v-model:value="infoObject.repetitions" |
|
|
:min="0" |
|
|
:min="1" |
|
|
:max="99" |
|
|
:max="99" |
|
|
placeholder="请输入重复次数" /> |
|
|
placeholder="请输入重复次数" /> |
|
|
</a-form-item> |
|
|
</a-form-item> |
|
@ -38,8 +43,9 @@ |
|
|
<ns-input-number |
|
|
<ns-input-number |
|
|
style="width: 100%" |
|
|
style="width: 100%" |
|
|
v-model:value="infoObject.intervalDuration" |
|
|
v-model:value="infoObject.intervalDuration" |
|
|
:min="0" |
|
|
:min="1" |
|
|
:max="99" |
|
|
:max="99" |
|
|
|
|
|
@keydown="handleKeyDown" |
|
|
placeholder="请输入间隔时长"> |
|
|
placeholder="请输入间隔时长"> |
|
|
<template #addonAfter> |
|
|
<template #addonAfter> |
|
|
<a-select |
|
|
<a-select |
|
@ -55,7 +61,7 @@ |
|
|
<ns-input-number |
|
|
<ns-input-number |
|
|
allowClear |
|
|
allowClear |
|
|
style="width: 100%" |
|
|
style="width: 100%" |
|
|
:min="0" |
|
|
:min="1" |
|
|
:max="999" |
|
|
:max="999" |
|
|
v-model:value="infoObject.monitorTime" |
|
|
v-model:value="infoObject.monitorTime" |
|
|
placeholder="请输入监测时长"> |
|
|
placeholder="请输入监测时长"> |
|
@ -258,6 +264,13 @@ |
|
|
priority: [{ required: true, message: '请选择优先级', trigger: 'change' }], |
|
|
priority: [{ required: true, message: '请选择优先级', trigger: 'change' }], |
|
|
// monitorTimeUnit: [{ required: true, message: '请选择监测时长单位', trigger: 'change' }], |
|
|
// monitorTimeUnit: [{ required: true, message: '请选择监测时长单位', trigger: 'change' }], |
|
|
}; |
|
|
}; |
|
|
|
|
|
//空格校验 |
|
|
|
|
|
const handleKeyDown = (event: KeyboardEvent) => { |
|
|
|
|
|
// Check if the pressed key is a space |
|
|
|
|
|
if (event.code === 'Space') { |
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
//开关 |
|
|
//开关 |
|
|
const changeSwitch = () => { |
|
|
const changeSwitch = () => { |
|
|
switch (infoObject.value.enableRules) { |
|
|
switch (infoObject.value.enableRules) { |
|
|