|
|
@ -196,7 +196,7 @@ |
|
|
|
<el-row> |
|
|
|
<el-col :span="12" v-show="boolValueVisiable"> |
|
|
|
<el-form-item label="告警值" prop="boolValue"> |
|
|
|
<el-select v-model="formPolicy.boolValue" placeholder="请选择是否告警"> |
|
|
|
<el-select v-model="formPolicy.boolValue" placeholder="请选择告警值" filterable> |
|
|
|
<el-option |
|
|
|
v-for="item in alert_value" |
|
|
|
:key="item.value" |
|
|
@ -208,7 +208,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" v-show="methodIdsVisiable"> |
|
|
|
<el-form-item label="告警方式" prop="methodIds"> |
|
|
|
<el-select v-model="formPolicy.methodIds" multiple placeholder="请选择告警方式"> |
|
|
|
<el-select v-model="formPolicy.methodIds" multiple placeholder="请选择告警方式" filterable> |
|
|
|
<el-option |
|
|
|
v-for="item in methodList" |
|
|
|
:key="item.id" |
|
|
@ -220,7 +220,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" v-show="levelVisiable"> |
|
|
|
<el-form-item label="级别" prop="level"> |
|
|
|
<el-select v-model="formPolicy.level" placeholder="请选择告警级别" @change="levelChange"> |
|
|
|
<el-select v-model="formPolicy.level" placeholder="请选择告警级别" @change="levelChange" filterable> |
|
|
|
<el-option |
|
|
|
v-for="dict in dc_alert_level" |
|
|
|
:key="parseInt(dict.value)" |
|
|
@ -424,11 +424,11 @@ const data = reactive({ |
|
|
|
], |
|
|
|
}, |
|
|
|
rulesPolicy: { |
|
|
|
deviceUuid: [ |
|
|
|
{ required: true, message: "中台设备编码不能为空", trigger: "blur" } |
|
|
|
boolValue: [ |
|
|
|
{ required: true, message: "告警值不能为空", trigger: "blur" } |
|
|
|
], |
|
|
|
paramCode: [ |
|
|
|
{ required: true, message: "参数编码不能为空", trigger: "blur" } |
|
|
|
level: [ |
|
|
|
{ required: true, message: "告警级别不能为空", trigger: "blur" } |
|
|
|
], |
|
|
|
}, |
|
|
|
|
|
|
@ -769,7 +769,6 @@ function getMethodList(){ |
|
|
|
//提交到策略信息表 |
|
|
|
function submitFormPolicy() { |
|
|
|
proxy.$refs["policyRef"].validate(valid => { |
|
|
|
if (valid) { |
|
|
|
//根据标志值来判断是否是修改操作 |
|
|
|
if (formPolicy.value.id != null) { |
|
|
|
//根据参数类型区分 |
|
|
@ -790,12 +789,19 @@ function submitFormPolicy() { |
|
|
|
getList(); |
|
|
|
}); |
|
|
|
}else if(logicCode.value == 'A'){ |
|
|
|
formPolicy.value.methodIds = formPolicy.value.methodIds?.join(','); |
|
|
|
updatePolicy(formPolicy.value).then(response => { |
|
|
|
proxy.$modal.msgSuccess("新增成功"); |
|
|
|
openPolicy.value = false; |
|
|
|
getList(); |
|
|
|
}); |
|
|
|
if (valid) { |
|
|
|
formPolicy.value.methodIds = formPolicy.value.methodIds?.join(','); |
|
|
|
updatePolicy(formPolicy.value).then(response => { |
|
|
|
proxy.$modal.msgSuccess("新增成功"); |
|
|
|
openPolicy.value = false; |
|
|
|
getList(); |
|
|
|
}); |
|
|
|
}else{ |
|
|
|
ElMessageBox.alert('请选检查告警配置', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
center: true, |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
//根据参数类型区分 |
|
|
@ -822,15 +828,22 @@ function submitFormPolicy() { |
|
|
|
getList(); |
|
|
|
}); |
|
|
|
}else if(logicCode.value == 'A'){ |
|
|
|
formPolicy.value.methodIds = formPolicy.value.methodIds?.join(','); |
|
|
|
addPolicy(formPolicy.value).then(response => { |
|
|
|
proxy.$modal.msgSuccess("新增成功"); |
|
|
|
openPolicy.value = false; |
|
|
|
getList(); |
|
|
|
}); |
|
|
|
if (valid) { |
|
|
|
formPolicy.value.methodIds = formPolicy.value.methodIds?.join(','); |
|
|
|
addPolicy(formPolicy.value).then(response => { |
|
|
|
proxy.$modal.msgSuccess("修改成功"); |
|
|
|
openPolicy.value = false; |
|
|
|
getList(); |
|
|
|
}); |
|
|
|
}else{ |
|
|
|
ElMessageBox.alert('请选检查告警配置', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
center: true, |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|