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); })