From 723786772672ac70eccd72ba3accf8c052b1e2d1 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Fri, 3 Nov 2023 11:42:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E5=BC=80=E5=85=B3=E9=87=8F?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/model/alert/deviceparamalert.vue | 55 +++++++++++++--------- src/views/model/params/index.vue | 5 +- 2 files changed, 37 insertions(+), 23 deletions(-) diff --git a/src/views/model/alert/deviceparamalert.vue b/src/views/model/alert/deviceparamalert.vue index 19894a9..c6875ca 100644 --- a/src/views/model/alert/deviceparamalert.vue +++ b/src/views/model/alert/deviceparamalert.vue @@ -196,7 +196,7 @@ - + - + - + { - if (valid) { //根据标志值来判断是否是修改操作 if (formPolicy.value.id != null) { //根据参数类型区分 @@ -790,12 +789,19 @@ function submitFormPolicy() { getList(); }); }else if(logicCode.value == 'A'){ - formPolicy.value.methodIds = formPolicy.value.methodIds?.join(','); - updatePolicy(formPolicy.value).then(response => { - proxy.$modal.msgSuccess("新增成功"); - openPolicy.value = false; - getList(); - }); + if (valid) { + formPolicy.value.methodIds = formPolicy.value.methodIds?.join(','); + updatePolicy(formPolicy.value).then(response => { + proxy.$modal.msgSuccess("新增成功"); + openPolicy.value = false; + getList(); + }); + }else{ + ElMessageBox.alert('请选检查告警配置', '提示', { + confirmButtonText: '确定', + center: true, + }); + } } } else { //根据参数类型区分 @@ -822,15 +828,22 @@ function submitFormPolicy() { getList(); }); }else if(logicCode.value == 'A'){ - formPolicy.value.methodIds = formPolicy.value.methodIds?.join(','); - addPolicy(formPolicy.value).then(response => { - proxy.$modal.msgSuccess("新增成功"); - openPolicy.value = false; - getList(); - }); + if (valid) { + formPolicy.value.methodIds = formPolicy.value.methodIds?.join(','); + addPolicy(formPolicy.value).then(response => { + proxy.$modal.msgSuccess("修改成功"); + openPolicy.value = false; + getList(); + }); + }else{ + ElMessageBox.alert('请选检查告警配置', '提示', { + confirmButtonText: '确定', + center: true, + }); + } } } - } + }); } diff --git a/src/views/model/params/index.vue b/src/views/model/params/index.vue index 6eb40c0..1be4708 100644 --- a/src/views/model/params/index.vue +++ b/src/views/model/params/index.vue @@ -533,6 +533,7 @@ function getList() { function cancel() { open.value = false; reset(); + getList(); } // 表单重置 @@ -642,7 +643,7 @@ function submitForm() { if (form.value.id != null) { listWithFilterColumn(param).then(response => { const result = response.data.tableData.rows; - const newArray = result.filter(item => item.id !== form.value.id); + const newArray = result.filter(item => item.paramCode !== form.value.paramCode); if (newArray?.length > 0) { ElMessageBox.alert('该参数编号已存在,请重新输入', '提示', { confirmButtonText: '确定', @@ -659,7 +660,7 @@ function submitForm() { } else { listWithFilterColumn(param).then(response => { const result = response.data.tableData.rows; - const newArray = result.filter(item => item.id !== form.value.id); + const newArray = result.filter(item => item.paramCode !== form.value.paramCode); if (newArray?.length > 0) { ElMessageBox.alert('该参数编号已存在,请重新输入', '提示', { confirmButtonText: '确定',