Browse Source

告警改动后测试1版

pull/1/head
ljlong_2630 1 year ago
parent
commit
2350fbebc7
  1. 5
      src/assets/styles/self-defined.scss
  2. 53
      src/views/model/alert/deviceparamalert.vue

5
src/assets/styles/self-defined.scss

@ -180,3 +180,8 @@
display: block; display: block;
} }
.elFormItem {
div{
margin-left: 0px !important;
}
}

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

@ -223,7 +223,14 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" v-show="policyModelVisiable"> <el-col :span="24" v-show="policyModelVisiable">
<el-form-item label="告警算法" prop="policyModel"> <el-row style="margin-bottom: 10px;">
<el-col>
<H3>告警逻辑</H3>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item class="elFormItem" prop="policyModel">
<el-table ref="policyTable" v-loading="loading" :data="modelList" :row-key="getRowKey" @selection-change="handleSelectionChange"> <el-table ref="policyTable" v-loading="loading" :data="modelList" :row-key="getRowKey" @selection-change="handleSelectionChange">
<el-table-column type="selection" reserve-selection="true" width="55" align="center" /> <el-table-column type="selection" reserve-selection="true" width="55" align="center" />
<el-table-column label="名称" align="center" prop="name"> <el-table-column label="名称" align="center" prop="name">
@ -285,6 +292,9 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-col>
</el-row>
</el-form> </el-form>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
@ -692,7 +702,7 @@ function getModelListSwitch(row){
if(response.data && response.data.length>0){ if(response.data && response.data.length>0){
formPolicy.value.statusValue = response.data[0].statusValue; formPolicy.value.statusValue = response.data[0].statusValue;
formPolicy.value.statusType = response.data[0].statusType; formPolicy.value.statusType = response.data[0].statusType;
formPolicy.value.methodIds = response.data[0].methodIds.split(',').map(Number); formPolicy.value.methodIds = response.data[0].methodIds?.split(',').map(Number);
formPolicy.value.boolValue = response.data[0].boolValue; formPolicy.value.boolValue = response.data[0].boolValue;
formPolicy.value.alertId = row.id; formPolicy.value.alertId = row.id;
formPolicy.value.deviceId = row.deviceUuid; formPolicy.value.deviceId = row.deviceUuid;
@ -716,16 +726,18 @@ function getModelList(row){
formPolicy.value.deviceId = row.deviceUuid; formPolicy.value.deviceId = row.deviceUuid;
proxy.$refs.policyTable.clearSelection(); proxy.$refs.policyTable.clearSelection();
console.log(queryPolicy.value); console.log(queryPolicy.value);
listPolicyInfo(queryPolicy.value).then(response=>{ listPolicyInfo(queryPolicy.value).then(responsePolicy=>{
// //
if(response.data && response.data.length>0){ if(responsePolicy.data && responsePolicy.data.length>0){
console.log(response.data); console.log(responsePolicy.data);
oldPolicyRows.value = response.data; oldPolicyRows.value = responsePolicy.data;
formPolicy.value.alertId = response.data[0].alertId; formPolicy.value.alertId = responsePolicy.data[0].alertId;
formPolicy.value.deviceId = response.data[0].deviceId; formPolicy.value.deviceId = responsePolicy.data[0].deviceId;
formPolicy.value.id = response.data[0].id; formPolicy.value.id = responsePolicy.data[0].id;
console.log('modle');
modelList.value.map(element=>{ modelList.value.map(element=>{
response.data.forEach(item=>{ console.log('response');
responsePolicy.data.forEach(item=>{
if(item.alertModelId == element.id){ if(item.alertModelId == element.id){
policyDeviceUuid.value = item.deviceId; policyDeviceUuid.value = item.deviceId;
policyAlertId.value = item.alertId; policyAlertId.value = item.alertId;
@ -738,12 +750,15 @@ function getModelList(row){
} }
element.level = item.level; element.level = item.level;
element.name = item.name; element.name = item.name;
element.id = item.id; console.log('item.id');
console.log(item.id);
element.policyId = item.id;
element.statusValue = item.statusValue; element.statusValue = item.statusValue;
element.statusType = item.statusType; element.statusType = item.statusType;
element.methodIds = item.methodIds.split(',').map(Number); element.methodIds = item.methodIds?.split(',').map(Number);
element.operator = item.operator; element.operator = item.operator;
element.sort = item.sortId; element.sort = item.sortId;
element.id = item.alertModelId;
proxy.$refs.policyTable.toggleRowSelection(element,true); proxy.$refs.policyTable.toggleRowSelection(element,true);
return element; return element;
} }
@ -775,7 +790,7 @@ function mapFormTable(){
policyParam.name = item.name; policyParam.name = item.name;
policyParam.statusValue = item.statusValue; policyParam.statusValue = item.statusValue;
policyParam.statusType = item.statusType; policyParam.statusType = item.statusType;
policyParam.methodIds = item.methodIds.join(','); policyParam.methodIds = item.methodIds?.join(',');
policyParam.operator = item.operator; policyParam.operator = item.operator;
policyParam.sortId = item.sort; policyParam.sortId = item.sort;
policyParams.value.push(policyParam); policyParams.value.push(policyParam);
@ -788,7 +803,7 @@ function mapFormTableUpdate(){
policyParams.value=[]; policyParams.value=[];
policyTableRows.forEach(item=>{ policyTableRows.forEach(item=>{
let policyParam = {}; let policyParam = {};
policyParam.id = item.id; policyParam.id = item.policyId;
policyParam.deviceId = policyDeviceUuid.value; policyParam.deviceId = policyDeviceUuid.value;
policyParam.alertId = item.alertId; policyParam.alertId = item.alertId;
if(paramTypeValue.value == '3'){ if(paramTypeValue.value == '3'){
@ -799,11 +814,11 @@ function mapFormTableUpdate(){
policyParam.intValue = item.value; policyParam.intValue = item.value;
} }
policyParam.level = item.level; policyParam.level = item.level;
policyParam.alertModelId = item.alertModelId; policyParam.alertModelId = item.id;
policyParam.name = item.name; policyParam.name = item.name;
policyParam.statusValue = item.statusValue; policyParam.statusValue = item.statusValue;
policyParam.statusType = item.statusType; policyParam.statusType = item.statusType;
policyParam.methodIds = item.methodIds.join(','); policyParam.methodIds = item.methodIds?.join(',');
policyParam.operator = item.operator; policyParam.operator = item.operator;
policyParam.sortId = item.sort; policyParam.sortId = item.sort;
policyParams.value.push(policyParam); policyParams.value.push(policyParam);
@ -849,7 +864,6 @@ function computeAddPolicy() {
return item.id !== element.id; return item.id !== element.id;
}) })
//id //id
delete item.id;
let policyParam = {}; let policyParam = {};
policyParam.deviceId = policyDeviceUuid.value; policyParam.deviceId = policyDeviceUuid.value;
policyParam.alertId = policyAlertId.value; policyParam.alertId = policyAlertId.value;
@ -865,7 +879,7 @@ function computeAddPolicy() {
policyParam.name = item.name; policyParam.name = item.name;
policyParam.statusValue = item.statusValue; policyParam.statusValue = item.statusValue;
policyParam.statusType = item.statusType; policyParam.statusType = item.statusType;
policyParam.methodIds = item.methodIds.join(','); policyParam.methodIds = item.methodIds?.join(',');
policyParam.operator = item.operator; policyParam.operator = item.operator;
policyParam.sortId = item.sort; policyParam.sortId = item.sort;
addPolicyRows.value.push(policyParam); addPolicyRows.value.push(policyParam);
@ -940,9 +954,6 @@ function handleValueChangeSub(row){
return flag; return flag;
} }
function methodIdsChange(){
proxy.$forceUpdate();
}
getList(); getList();

Loading…
Cancel
Save