From 4086d6f0dc2187c515b30b2237e162f88b650124 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Fri, 3 Nov 2023 16:23:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=B5=8B=E8=AF=95=E4=BF=AE?= =?UTF-8?q?=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/model/alert/deviceparamalert.vue | 45 ++++++++++++++++++---- src/views/model/alert/policy.vue | 1 + src/views/model/params/index.vue | 17 ++++++-- 3 files changed, 51 insertions(+), 12 deletions(-) diff --git a/src/views/model/alert/deviceparamalert.vue b/src/views/model/alert/deviceparamalert.vue index c6875ca..ee67983 100644 --- a/src/views/model/alert/deviceparamalert.vue +++ b/src/views/model/alert/deviceparamalert.vue @@ -783,16 +783,45 @@ function submitFormPolicy() { mapFormTableUpdate(); computeDelPolicy(); computeAddPolicy(); - updatePolicyBatch(policyParams.value,deletePolicyRows.value,addPolicyRows.value,policyDeviceUuid.value).then(response => { - proxy.$modal.msgSuccess("修改成功"); - openPolicy.value = false; - getList(); - }); + 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 => { + proxy.$modal.msgSuccess("修改成功"); + openPolicy.value = false; + 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'){ if (valid) { formPolicy.value.methodIds = formPolicy.value.methodIds?.join(','); updatePolicy(formPolicy.value).then(response => { - proxy.$modal.msgSuccess("新增成功"); + proxy.$modal.msgSuccess("修改成功"); openPolicy.value = false; getList(); }); @@ -831,7 +860,7 @@ function submitFormPolicy() { if (valid) { formPolicy.value.methodIds = formPolicy.value.methodIds?.join(','); addPolicy(formPolicy.value).then(response => { - proxy.$modal.msgSuccess("修改成功"); + proxy.$modal.msgSuccess("新增成功"); openPolicy.value = false; getList(); }); @@ -1032,7 +1061,7 @@ function computeDelPolicy() { policyParam.name = item.name; policyParam.statusValue = item.statusValue; policyParam.statusType = item.statusType; - policyParam.methodIds = item.methodIds?.join(','); + policyParam.methodIds = item.methodIds; policyParam.operator = item.operator; policyParam.sortId = item.sort; deletePolicyRows.value.push(policyParam); diff --git a/src/views/model/alert/policy.vue b/src/views/model/alert/policy.vue index 7886554..858b5d9 100644 --- a/src/views/model/alert/policy.vue +++ b/src/views/model/alert/policy.vue @@ -227,6 +227,7 @@ +