|
|
@ -3,10 +3,10 @@ |
|
|
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="90px" class="my-custom-form"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="中台设备ID" prop="deviceUuid"> |
|
|
|
<el-form-item label="设备编号" prop="deviceUuid"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.deviceUuid" |
|
|
|
placeholder="请输入中台设备ID" |
|
|
|
placeholder="请输入设备编号" |
|
|
|
clearable |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
/> |
|
|
@ -86,10 +86,10 @@ |
|
|
|
<el-table ref="deviceParamsTable" v-loading="loading" :data="alertList" @selection-change="handleSelectionChange" :max-height="tableHeight" :border="true" :column-width-draggable="true"> |
|
|
|
<el-table-column type="selection" width="55" align="center" fixed="left" /> |
|
|
|
<!-- <el-table-column label="主键" align="center" prop="id" /> --> |
|
|
|
<el-table-column label="中台设备ID" align="center" prop="deviceUuid" :fixed="fixedColumns?'left':false"> |
|
|
|
<el-table-column label="设备编号" align="center" prop="deviceUuid" :fixed="fixedColumns?'left':false"> |
|
|
|
<template #header> |
|
|
|
<div class="fixed-column-header" style="text-align: center;display: block;" @dblclick="toggleFixedColumns"> |
|
|
|
<span style="text-align: center;display: block;">中台设备ID<img style="width:10px;margin-left:5px" v-show="fixedColumns" :src="lock" alt="Image"/></span> |
|
|
|
<span style="text-align: center;display: block;">设备编号<img style="width:10px;margin-left:5px" v-show="fixedColumns" :src="lock" alt="Image"/></span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
@ -273,7 +273,7 @@ |
|
|
|
</el-row> |
|
|
|
<el-row v-show="tableVisiable"> |
|
|
|
<el-col> |
|
|
|
<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" > |
|
|
|
<el-table-column type="selection" reserve-selection="true" width="55" align="center" fixed="left" /> |
|
|
|
<el-table-column label="名称" align="center" prop="name"/> |
|
|
|
<el-table-column label="符号" align="center" prop="code" :width="120"/> |
|
|
@ -305,7 +305,6 @@ |
|
|
|
</el-form-item> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -612,18 +611,41 @@ function handlePolicy(row) { |
|
|
|
function submitForm() { |
|
|
|
proxy.$refs["alertRef"].validate(valid => { |
|
|
|
if (valid) { |
|
|
|
let param = {"deviceUuid":form.value.deviceUuid,"paramCode":form.value.paramCode}; |
|
|
|
if (form.value.id != null) { |
|
|
|
updateAlert(form.value).then(response => { |
|
|
|
proxy.$modal.msgSuccess("修改成功"); |
|
|
|
open.value = false; |
|
|
|
getList(); |
|
|
|
getDeviceParamsAlertInfo(param).then(response => { |
|
|
|
const result = response.rows; |
|
|
|
const newArray = result.filter(item => item.id !== form.value.id); |
|
|
|
if (newArray?.length > 0) { |
|
|
|
ElMessageBox.alert('该告警方式名称重复', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
center: true, |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
updateAlert(form.value).then(response => { |
|
|
|
proxy.$modal.msgSuccess("修改成功"); |
|
|
|
open.value = false; |
|
|
|
getList(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
addAlert(form.value).then(response => { |
|
|
|
proxy.$modal.msgSuccess("新增成功"); |
|
|
|
open.value = false; |
|
|
|
getList(); |
|
|
|
handlePolicy(response.data); |
|
|
|
getDeviceParamsAlertInfo(param).then(response => { |
|
|
|
const result = response.rows; |
|
|
|
const newArray = result.filter(item => item.id !== form.value.id); |
|
|
|
if (newArray?.length > 0) { |
|
|
|
ElMessageBox.alert('该告警方式名称重复', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
center: true, |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
addAlert(form.value).then(response => { |
|
|
|
proxy.$modal.msgSuccess("新增成功"); |
|
|
|
open.value = false; |
|
|
|
getList(); |
|
|
|
handlePolicy(response.data); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -684,12 +706,11 @@ function handleDelete(row) { |
|
|
|
} |
|
|
|
const _names = row.deviceName?row.deviceName + "-" + row.paramName : names.value; |
|
|
|
proxy.$modal.confirm('是否确认删除"' + _names + '"的告警策略?').then(function() { |
|
|
|
return delLogicconfig(_ids); |
|
|
|
return delAlert(_ids); |
|
|
|
}).then(() => { |
|
|
|
getList(); |
|
|
|
proxy.$modal.msgSuccess("删除成功"); |
|
|
|
}).catch(() => {}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
@ -859,11 +880,13 @@ function getModelList(row){ |
|
|
|
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(); |
|
|
|
listPolicyInfo(queryPolicy.value).then(responsePolicy=>{ |
|
|
|
|
|
|
|
//修改界面初始化 |
|
|
|
if(responsePolicy.data && responsePolicy.data.length>0){ |
|
|
|
oldPolicyRows.value = responsePolicy.data; |
|
|
@ -872,6 +895,7 @@ function getModelList(row){ |
|
|
|
formPolicy.value.id = responsePolicy.data[0].id; |
|
|
|
modelList.value.map(element=>{ |
|
|
|
responsePolicy.data.forEach(item=>{ |
|
|
|
|
|
|
|
if(item.alertModelId == element.id){ |
|
|
|
// policyDeviceUuid.value = item.deviceId; |
|
|
|
// policyAlertId.value = item.alertId; |
|
|
@ -893,8 +917,6 @@ function getModelList(row){ |
|
|
|
element.id = item.alertModelId; |
|
|
|
proxy.$refs.policyTable.toggleRowSelection(element,true); |
|
|
|
return element; |
|
|
|
}else{ |
|
|
|
element.id = null; |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
@ -919,6 +941,7 @@ function mapFormTable(){ |
|
|
|
}else if(paramTypeValue.value == '1'){ |
|
|
|
policyParam.intValue = item.value; |
|
|
|
} |
|
|
|
|
|
|
|
policyParam.level = item.level; |
|
|
|
policyParam.alertModelId = item.id; |
|
|
|
policyParam.name = item.name; |
|
|
@ -947,6 +970,7 @@ function mapFormTableUpdate(){ |
|
|
|
}else if(paramTypeValue.value == '1'){ |
|
|
|
policyParam.intValue = item.value; |
|
|
|
} |
|
|
|
|
|
|
|
policyParam.level = item.level; |
|
|
|
policyParam.alertModelId = item.id; |
|
|
|
policyParam.name = item.name; |
|
|
@ -1195,7 +1219,6 @@ function levelChange(value){ |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function toggleFixedColumns() { |
|
|
|