diff --git a/src/api/model/alertmodel.js b/src/api/model/alertmodel.js index f3a0872..121e040 100644 --- a/src/api/model/alertmodel.js +++ b/src/api/model/alertmodel.js @@ -50,4 +50,14 @@ export function exportModel(query) { method: 'get', params: query }) +} + + +// 查询告警模版列表 +export function listModelEnabledNoPage(query) { + return request({ + url: '/model/dcBusiAlertModel/listEnabledNoPage', + method: 'get', + params: query + }) } \ No newline at end of file diff --git a/src/assets/styles/self-defined.scss b/src/assets/styles/self-defined.scss index ad1eea6..ad26f99 100644 --- a/src/assets/styles/self-defined.scss +++ b/src/assets/styles/self-defined.scss @@ -34,7 +34,7 @@ } .textaligncenter{ - text-align:center; + text-align: center!important; } .textalignleft{ text-align:left; @@ -195,4 +195,5 @@ .el-input__wrapper { box-shadow: 0 0 0 1px var(--el-color-danger) inset; } -} \ No newline at end of file +} + diff --git a/src/views/model/alert/deviceparamalert.vue b/src/views/model/alert/deviceparamalert.vue index 6456d04..524c5c5 100644 --- a/src/views/model/alert/deviceparamalert.vue +++ b/src/views/model/alert/deviceparamalert.vue @@ -185,7 +185,7 @@ - + + + + + + + + + + + + + @@ -224,6 +241,7 @@ + @@ -252,7 +270,7 @@ - + { proxy.$modal.msgSuccess("新增成功"); openPolicy.value = false; @@ -694,6 +719,7 @@ 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; @@ -713,20 +739,32 @@ function cancelPolicy() { //开关量初始化策略表单 function getModelListSwitch(row){ queryPolicy.value.alertId = row.id; + queryModel.value.logicCode = row.logicCode; + queryModel.value.paramType = row.paramType; listPolicyInfo(queryPolicy.value).then(response=>{ //修改界面初始化 if(response.data && response.data.length>0){ formPolicy.value.statusValue = response.data[0].statusValue; formPolicy.value.statusType = response.data[0].statusType; - formPolicy.value.methodIds = response.data[0].methodIds?.split(',').map(Number); + formPolicy.value.methodIds = response.data[0].methodIds==null||response.data[0].methodIds==''?null:response.data[0].methodIds.split(',').map(Number); formPolicy.value.boolValue = response.data[0].boolValue; + formPolicy.value.level = response.data[0].level; + formPolicy.value.name = response.data[0].name; formPolicy.value.alertId = row.id; formPolicy.value.deviceId = row.deviceUuid; + formPolicy.value.alertModelId = response.data[0].alertModelId; formPolicy.value.id = response.data[0].id; //新增界面初始化 }else{ formPolicy.value.alertId = row.id; formPolicy.value.deviceId = row.deviceUuid; + listModelEnabledNoPage(queryModel.value).then(response => { + if(response.data && response.data.length>0){ + formPolicy.value.level = response.data[0].level; + formPolicy.value.name = response.data[0].name; + formPolicy.value.alertModelId = response.data[0].id; + } + }); } }); } @@ -736,8 +774,10 @@ function getModelListSwitch(row){ function getModelList(row){ queryPolicy.value.alertId = row.id; queryPolicy.value.flagEnabled = true; - listModel().then(response => { - modelList.value = response.rows; + queryModel.value.logicCode = row.logicCode; + queryModel.value.paramType = row.paramType; + listModelEnabledNoPage(queryModel.value).then(response => { + modelList.value = response.data; formPolicy.value.alertId = row.id; formPolicy.value.deviceId = row.deviceUuid; proxy.$refs.policyTable.clearSelection(); @@ -765,7 +805,7 @@ function getModelList(row){ element.policyId = item.id; element.statusValue = item.statusValue; element.statusType = item.statusType; - element.methodIds = item.methodIds?.split(',').map(Number); + element.methodIds = item.methodIds==null||item.methodIds==''?null:item.methodIds.split(',').map(Number); element.operator = item.operator; element.sort = item.sortId; element.id = item.alertModelId; @@ -942,9 +982,9 @@ function judgeIfRightValue(){ if(!handleValueChangeSub(item)){ flag = false; }; - if(item.value === '' || item.methodIds.length === 0){ - flag = false; - } + // if(item.value === '' || item.methodIds == null || item.methodIds.length === 0){ + // flag = false; + // } }) } return flag; @@ -984,9 +1024,9 @@ const validateCell = (data) => { } else if (typeof data.value === 'boolean') { return data.value !== undefined && data.value !== null; } else if (Array.isArray(data.value)) { - return data.value !== []; + return data.value.lenght == 0; } else if (typeof data.value === 'object') { - return data.value !== {}; + return data.value.lenght == 0; } else { return data.value !== undefined && data.value !== null; } @@ -1030,6 +1070,17 @@ function changeEnabled(row){ updateAlert(param); } +function levelChange(value){ + if(logicCode.value == 'A'){ + dc_alert_level.value.forEach(item=>{ + if(item.value == String(value)){ + formPolicy.value.name = item.label + } + }) + } + +} + getList(); diff --git a/src/views/model/alert/model.vue b/src/views/model/alert/model.vue index bd39ada..880d5b6 100644 --- a/src/views/model/alert/model.vue +++ b/src/views/model/alert/model.vue @@ -1,8 +1,8 @@ - - + + - + + + @@ -104,7 +106,7 @@ - + @@ -115,7 +117,11 @@ - + + + + + @@ -150,11 +156,11 @@ - + - - + + - + - + + + - - - + + + - + - + - + + + + + + + + @@ -228,10 +253,10 @@ @import "@/assets/styles/self-defined.scss"; diff --git a/src/views/model/alert/policy.vue b/src/views/model/alert/policy.vue index 8b61cfd..a45a946 100644 --- a/src/views/model/alert/policy.vue +++ b/src/views/model/alert/policy.vue @@ -1,88 +1,104 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 搜索 - 重置 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 搜索 + 重置 + + + @@ -219,6 +235,9 @@ +