|
|
@ -115,13 +115,13 @@ |
|
|
|
<template #default="scope"> |
|
|
|
<el-button |
|
|
|
type="text" |
|
|
|
icon="Delete" |
|
|
|
icon="Edit" |
|
|
|
@click="handlePolicy(scope.row)" |
|
|
|
>维护告警策略</el-button> |
|
|
|
<el-button |
|
|
|
type="text" |
|
|
|
icon="Delete" |
|
|
|
@click="handleDeleteByRow(scope.row)" |
|
|
|
@click="handleDelete(scope.row)" |
|
|
|
>删除</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
@ -196,7 +196,6 @@ |
|
|
|
<el-row> |
|
|
|
<el-col :span="12" v-show="boolValueVisiable"> |
|
|
|
<el-form-item label="告警值" prop="boolValue"> |
|
|
|
<!-- <el-input v-model="formPolicy.boolValue" placeholder="请输入开始值" /> --> |
|
|
|
<el-select v-model="formPolicy.boolValue" placeholder="请选择是否告警"> |
|
|
|
<el-option |
|
|
|
v-for="item in alert_value" |
|
|
@ -376,6 +375,7 @@ const paramTip = ref("请先选择设备"); |
|
|
|
const paramDisabled = ref(false); |
|
|
|
const partionDisabled = ref(false); |
|
|
|
const submitDisabled = ref(true); |
|
|
|
const names = ref([]); |
|
|
|
const alert_value = ref([ |
|
|
|
{label: '1', value: true, elTagType: 'default', elTagClass: null}, |
|
|
|
{label: '0', value: false, elTagType: 'default', elTagClass: null} |
|
|
@ -415,7 +415,7 @@ const data = reactive({ |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
deviceUuid: [ |
|
|
|
{ required: true, message: "中台设备UUID不能为空", trigger: "blur" } |
|
|
|
{ required: true, message: "中台设备编码不能为空", trigger: "blur" } |
|
|
|
], |
|
|
|
paramCode: [ |
|
|
|
{ required: true, message: "参数编码不能为空", trigger: "blur" } |
|
|
@ -426,7 +426,7 @@ const data = reactive({ |
|
|
|
}, |
|
|
|
rulesPolicy: { |
|
|
|
deviceUuid: [ |
|
|
|
{ required: true, message: "中台设备UUID不能为空", trigger: "blur" } |
|
|
|
{ required: true, message: "中台设备编码不能为空", trigger: "blur" } |
|
|
|
], |
|
|
|
paramCode: [ |
|
|
|
{ required: true, message: "参数编码不能为空", trigger: "blur" } |
|
|
@ -527,6 +527,8 @@ function resetQuery() { |
|
|
|
|
|
|
|
// 多选框选中数据 |
|
|
|
function handleSelectionChange(selection) { |
|
|
|
ids.value = selection.map(item => item.id); |
|
|
|
names.value = selection.map(item => item.deviceName + "-" + item.paramName); |
|
|
|
selection.forEach(item=>{ |
|
|
|
if(!rowPolicySelected.value.includes(item)){ |
|
|
|
handleValueChange(item); |
|
|
@ -628,57 +630,66 @@ function submitForm() { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
/** 删除按钮操作 */ |
|
|
|
function handleDelete() { |
|
|
|
const rows = proxy.$refs.deviceParamsTable.getSelectionRows(); |
|
|
|
let names = ""; |
|
|
|
let _ids = []; |
|
|
|
rows.forEach(item=>{ |
|
|
|
_ids.push(item.id); |
|
|
|
if(names == ""){ |
|
|
|
names = item.deviceName + item.paramName; |
|
|
|
}else{ |
|
|
|
names = names + "," + item.deviceName + item.paramName; |
|
|
|
} |
|
|
|
}) |
|
|
|
proxy.$modal.confirm('是否确认删除设备参数名称为"' + names + '"的数据项?').then(function() { |
|
|
|
return delAlert(_ids); |
|
|
|
}).then(() => { |
|
|
|
getList(); |
|
|
|
proxy.$modal.msgSuccess("删除成功"); |
|
|
|
}).catch(() => {}); |
|
|
|
} |
|
|
|
// /** 删除按钮操作 */ |
|
|
|
// function handleDelete() { |
|
|
|
// const rows = proxy.$refs.deviceParamsTable.getSelectionRows(); |
|
|
|
// let names = ""; |
|
|
|
// let _ids = []; |
|
|
|
// rows.forEach(item=>{ |
|
|
|
// _ids.push(item.id); |
|
|
|
// if(names == ""){ |
|
|
|
// names = item.deviceName + item.paramName; |
|
|
|
// }else{ |
|
|
|
// names = names + "," + item.deviceName + item.paramName; |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// proxy.$modal.confirm('是否确认删除设备参数名称为"' + names + '"的数据项?').then(function() { |
|
|
|
// return delAlert(_ids); |
|
|
|
// }).then(() => { |
|
|
|
// getList(); |
|
|
|
// proxy.$modal.msgSuccess("删除成功"); |
|
|
|
// }).catch(() => {}); |
|
|
|
// } |
|
|
|
|
|
|
|
function handleDeleteByRow(row) { |
|
|
|
let rows = []; |
|
|
|
let names = ""; |
|
|
|
let _ids = []; |
|
|
|
rows.push(row); |
|
|
|
rows.forEach(item=>{ |
|
|
|
_ids.push(item.id); |
|
|
|
if(names == ""){ |
|
|
|
names = item.deviceName + item.paramName; |
|
|
|
}else{ |
|
|
|
names = names + "," + item.deviceName + item.paramName; |
|
|
|
} |
|
|
|
}) |
|
|
|
proxy.$modal.confirm('是否确认删除设备参数名称为"' + names + '"的数据项?').then(function() { |
|
|
|
return delAlert(_ids); |
|
|
|
}).then(() => { |
|
|
|
getList(); |
|
|
|
proxy.$modal.msgSuccess("删除成功"); |
|
|
|
}).catch(() => {}); |
|
|
|
} |
|
|
|
// function handleDeleteByRow(row) { |
|
|
|
// let rows = []; |
|
|
|
// let names = ""; |
|
|
|
// let _ids = []; |
|
|
|
// rows.push(row); |
|
|
|
// rows.forEach(item=>{ |
|
|
|
// _ids.push(item.id); |
|
|
|
// if(names == ""){ |
|
|
|
// names = item.deviceName + item.paramName; |
|
|
|
// }else{ |
|
|
|
// names = names + "," + item.deviceName + item.paramName; |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// proxy.$modal.confirm('是否确认删除设备参数名称为"' + names + '"的数据项?').then(function() { |
|
|
|
// return delAlert(_ids); |
|
|
|
// }).then(() => { |
|
|
|
// getList(); |
|
|
|
// proxy.$modal.msgSuccess("删除成功"); |
|
|
|
// }).catch(() => {}); |
|
|
|
// } |
|
|
|
|
|
|
|
/** 删除按钮操作 */ |
|
|
|
function handleDeleteRow(row) { |
|
|
|
function handleDelete(row) { |
|
|
|
const _ids = row.id || ids.value; |
|
|
|
proxy.$modal.confirm('是否确认删除设备告警编号为"' + _ids + '"的数据项?').then(function() { |
|
|
|
return delAlert(_ids); |
|
|
|
if(_ids.length == 0){ |
|
|
|
ElMessageBox.alert('请先选择需要删除的记录', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
center: true, |
|
|
|
}) |
|
|
|
return; |
|
|
|
} |
|
|
|
const _names = row.deviceName?row.deviceName + "-" + row.paramName : names.value; |
|
|
|
proxy.$modal.confirm('是否确认删除"' + _names + '"的告警策略?').then(function() { |
|
|
|
return delLogicconfig(_ids); |
|
|
|
}).then(() => { |
|
|
|
getList(); |
|
|
|
proxy.$modal.msgSuccess("删除成功"); |
|
|
|
}).catch(() => {}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
@ -698,6 +709,7 @@ function getDeviceList(){ |
|
|
|
|
|
|
|
function getParamsListDevice(deviceUuid){ |
|
|
|
loading.value = true; |
|
|
|
form.value.partion = null; |
|
|
|
queryParamsParam.value.deviceUuid = deviceUuid; |
|
|
|
if(queryParamsParam.value.partion == null){ |
|
|
|
partionDisabled.value = true; |
|
|
@ -713,6 +725,7 @@ function getParamsListDevice(deviceUuid){ |
|
|
|
} |
|
|
|
function getParamsListPartion(partion){ |
|
|
|
loading.value = true; |
|
|
|
form.value.paramCode = null; |
|
|
|
queryParamsParam.value.partion = partion; |
|
|
|
if(queryParamsParam.value.deviceUuid == null){ |
|
|
|
paramTip.value = "请先选择设备"; |
|
|
@ -1018,7 +1031,16 @@ function setParamsType(val){ |
|
|
|
//判断限值后一项值要比前一项小 |
|
|
|
function handleValueChange(row){ |
|
|
|
let flag = true; |
|
|
|
let needJudgeFlag = false; |
|
|
|
const selectedRowsNow = proxy.$refs.policyTable.getSelectionRows(); |
|
|
|
selectedRowsNow.forEach(item=>{ |
|
|
|
if(item.id == row.id){ |
|
|
|
needJudgeFlag = true |
|
|
|
} |
|
|
|
}) |
|
|
|
if(!needJudgeFlag){ |
|
|
|
return; |
|
|
|
} |
|
|
|
if(selectedRowsNow.length>0){ |
|
|
|
selectedRowsNow.forEach(item=>{ |
|
|
|
if(item.sort < row.sort){ |
|
|
@ -1052,9 +1074,9 @@ function judgeIfRightValue(){ |
|
|
|
if(!handleValueChangeSub(item)){ |
|
|
|
flag = false; |
|
|
|
}; |
|
|
|
// if(item.value === '' || item.methodIds == null || item.methodIds.length === 0){ |
|
|
|
// flag = false; |
|
|
|
// } |
|
|
|
if(item.value === ''){ |
|
|
|
flag = false; |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
return flag; |
|
|
|