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