From 18446a1e8ef2e1e58992571a4d8c52eef40d85fb Mon Sep 17 00:00:00 2001 From: qinoy Date: Tue, 21 Jan 2025 14:42:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=8F=E7=BB=84=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E6=9D=83=E9=99=90=E4=BF=AE=E6=94=B9=E6=97=B6=EF=BC=8C=E7=88=B6?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E5=8B=BE=E9=80=89=E6=97=B6=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E5=AD=98=E5=9C=A8=E5=A4=9A=E4=B8=AA=E5=AD=90=E8=8A=82?= =?UTF-8?q?=E7=82=B9=EF=BC=8C=E8=8A=82=E7=82=B9=E5=8B=BE=E9=80=89=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E4=BC=9A=E8=A7=A6=E5=8F=91=E5=90=8C=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E8=BF=9B=E8=80=8C=E5=8F=91=E8=B5=B7?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA=E7=9B=B8=E5=90=8C=E8=AF=B7=E6=B1=82=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E9=A1=B5=E9=9D=A2=E9=97=AA=E7=83=81=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/role/RoleUpdate.vue | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/com.actionsoft.apps.coe.pal.cooperation/src/views/role/RoleUpdate.vue b/com.actionsoft.apps.coe.pal.cooperation/src/views/role/RoleUpdate.vue index 19ca234..d57b72f 100644 --- a/com.actionsoft.apps.coe.pal.cooperation/src/views/role/RoleUpdate.vue +++ b/com.actionsoft.apps.coe.pal.cooperation/src/views/role/RoleUpdate.vue @@ -211,7 +211,10 @@ checkAllUpdate: false, checkAllDelete: false, checkAllVersion: false, - refreshTree: false + refreshTree: false, + + isParentChecking: false, // 标志变量,用于标记是否正在进行父节点的勾选操作 + isAllDataPermChecking: false, // 标志变量,用于标记是否正在进行全选操作 } }, mounted() { @@ -459,6 +462,10 @@ checkedNode(data, checked, subChecked) {// 节点选中事件 // 获取所有子节点 const that = this; + if (that.isParentChecking || that.isAllDataPermChecking){ + return; // 如果正在进行父节点勾选操作或者全选操作,直接返回,避免子节点触发额外请求 + } + that.isParentChecking = true; // 标记开始父节点勾选操作 that.loading = true; const params = { url:'jd', @@ -553,6 +560,9 @@ that.checkAllProcess = num == that.teamPermFileSize; that.loading = false; console.log('计算全选按钮', that.teamPermFileSize, '实际勾选', num); + that.$nextTick(()=>{ + that.isParentChecking = false; + }) }).catch(error=>{ console.log(error); }) @@ -648,8 +658,9 @@ checkAllProcessChange(value){ const that = this; - that.loading = true; if (value){//选中 + that.loading = true; + that.isAllDataPermChecking = value; // 标记开始全选勾选操作 const params = { url:'jd', data:{ @@ -672,6 +683,9 @@ that.$refs.tree.setCheckedKeys(checkedVerIds); that.loading = false; + that.$nextTick(() => { + that.isAllDataPermChecking = false; + }) }).catch(error=>{ console.log(error); })