|
@ -783,16 +783,45 @@ function submitFormPolicy() { |
|
|
mapFormTableUpdate(); |
|
|
mapFormTableUpdate(); |
|
|
computeDelPolicy(); |
|
|
computeDelPolicy(); |
|
|
computeAddPolicy(); |
|
|
computeAddPolicy(); |
|
|
|
|
|
if(deletePolicyRows.value?.length>0){ |
|
|
|
|
|
const policyTableRows = proxy.$refs.policyTable.getSelectionRows(); |
|
|
|
|
|
if(policyTableRows===undefined||policyTableRows==null||policyTableRows.length==0){ |
|
|
|
|
|
ElMessageBox.confirm('确定删除所有告警配置?', '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning', |
|
|
|
|
|
center: true, |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
// 删除所有告警配置 |
|
|
|
|
|
updatePolicyBatch(policyParams.value,deletePolicyRows.value,addPolicyRows.value,policyDeviceUuid.value).then(response => { |
|
|
|
|
|
proxy.$modal.msgSuccess("修改成功"); |
|
|
|
|
|
openPolicy.value = false; |
|
|
|
|
|
getList(); |
|
|
|
|
|
}); |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
// 取消删除告警配置 |
|
|
|
|
|
return; |
|
|
|
|
|
}); |
|
|
|
|
|
}else{ |
|
|
updatePolicyBatch(policyParams.value,deletePolicyRows.value,addPolicyRows.value,policyDeviceUuid.value).then(response => { |
|
|
updatePolicyBatch(policyParams.value,deletePolicyRows.value,addPolicyRows.value,policyDeviceUuid.value).then(response => { |
|
|
proxy.$modal.msgSuccess("修改成功"); |
|
|
proxy.$modal.msgSuccess("修改成功"); |
|
|
openPolicy.value = false; |
|
|
openPolicy.value = false; |
|
|
getList(); |
|
|
getList(); |
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
updatePolicyBatch(policyParams.value,deletePolicyRows.value,addPolicyRows.value,policyDeviceUuid.value).then(response => { |
|
|
|
|
|
proxy.$modal.msgSuccess("修改成功"); |
|
|
|
|
|
openPolicy.value = false; |
|
|
|
|
|
getList(); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}else if(logicCode.value == 'A'){ |
|
|
}else if(logicCode.value == 'A'){ |
|
|
if (valid) { |
|
|
if (valid) { |
|
|
formPolicy.value.methodIds = formPolicy.value.methodIds?.join(','); |
|
|
formPolicy.value.methodIds = formPolicy.value.methodIds?.join(','); |
|
|
updatePolicy(formPolicy.value).then(response => { |
|
|
updatePolicy(formPolicy.value).then(response => { |
|
|
proxy.$modal.msgSuccess("新增成功"); |
|
|
proxy.$modal.msgSuccess("修改成功"); |
|
|
openPolicy.value = false; |
|
|
openPolicy.value = false; |
|
|
getList(); |
|
|
getList(); |
|
|
}); |
|
|
}); |
|
@ -831,7 +860,7 @@ function submitFormPolicy() { |
|
|
if (valid) { |
|
|
if (valid) { |
|
|
formPolicy.value.methodIds = formPolicy.value.methodIds?.join(','); |
|
|
formPolicy.value.methodIds = formPolicy.value.methodIds?.join(','); |
|
|
addPolicy(formPolicy.value).then(response => { |
|
|
addPolicy(formPolicy.value).then(response => { |
|
|
proxy.$modal.msgSuccess("修改成功"); |
|
|
proxy.$modal.msgSuccess("新增成功"); |
|
|
openPolicy.value = false; |
|
|
openPolicy.value = false; |
|
|
getList(); |
|
|
getList(); |
|
|
}); |
|
|
}); |
|
@ -1032,7 +1061,7 @@ function computeDelPolicy() { |
|
|
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; |
|
|
policyParam.operator = item.operator; |
|
|
policyParam.operator = item.operator; |
|
|
policyParam.sortId = item.sort; |
|
|
policyParam.sortId = item.sort; |
|
|
deletePolicyRows.value.push(policyParam); |
|
|
deletePolicyRows.value.push(policyParam); |
|
|