Browse Source

告警开关量功能细节优化

develop
ljlong_2630 1 year ago
parent
commit
7237867726
  1. 55
      src/views/model/alert/deviceparamalert.vue
  2. 5
      src/views/model/params/index.vue

55
src/views/model/alert/deviceparamalert.vue

@ -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,
});
}
}
}
}
});
}

5
src/views/model/params/index.vue

@ -533,6 +533,7 @@ function getList() {
function cancel() {
open.value = false;
reset();
getList();
}
//
@ -642,7 +643,7 @@ function submitForm() {
if (form.value.id != null) {
listWithFilterColumn(param).then(response => {
const result = response.data.tableData.rows;
const newArray = result.filter(item => item.id !== form.value.id);
const newArray = result.filter(item => item.paramCode !== form.value.paramCode);
if (newArray?.length > 0) {
ElMessageBox.alert('该参数编号已存在,请重新输入', '提示', {
confirmButtonText: '确定',
@ -659,7 +660,7 @@ function submitForm() {
} else {
listWithFilterColumn(param).then(response => {
const result = response.data.tableData.rows;
const newArray = result.filter(item => item.id !== form.value.id);
const newArray = result.filter(item => item.paramCode !== form.value.paramCode);
if (newArray?.length > 0) {
ElMessageBox.alert('该参数编号已存在,请重新输入', '提示', {
confirmButtonText: '确定',

Loading…
Cancel
Save