fix: 小组角色权限修改时,父节点勾选时,如果存在多个子节点,节点勾选事件会触发同一个方法,进而发起多个相同请求,导致页面闪烁的问题修改。

This commit is contained in:
qinoy 2025-01-21 14:42:40 +08:00
parent 9e333c318a
commit 18446a1e8e

View File

@ -211,7 +211,10 @@
checkAllUpdate: false, checkAllUpdate: false,
checkAllDelete: false, checkAllDelete: false,
checkAllVersion: false, checkAllVersion: false,
refreshTree: false refreshTree: false,
isParentChecking: false, //
isAllDataPermChecking: false, //
} }
}, },
mounted() { mounted() {
@ -459,6 +462,10 @@
checkedNode(data, checked, subChecked) {// checkedNode(data, checked, subChecked) {//
// //
const that = this; const that = this;
if (that.isParentChecking || that.isAllDataPermChecking){
return; //
}
that.isParentChecking = true; //
that.loading = true; that.loading = true;
const params = { const params = {
url:'jd', url:'jd',
@ -553,6 +560,9 @@
that.checkAllProcess = num == that.teamPermFileSize; that.checkAllProcess = num == that.teamPermFileSize;
that.loading = false; that.loading = false;
console.log('计算全选按钮', that.teamPermFileSize, '实际勾选', num); console.log('计算全选按钮', that.teamPermFileSize, '实际勾选', num);
that.$nextTick(()=>{
that.isParentChecking = false;
})
}).catch(error=>{ }).catch(error=>{
console.log(error); console.log(error);
}) })
@ -648,8 +658,9 @@
checkAllProcessChange(value){ checkAllProcessChange(value){
const that = this; const that = this;
that.loading = true;
if (value){// if (value){//
that.loading = true;
that.isAllDataPermChecking = value; //
const params = { const params = {
url:'jd', url:'jd',
data:{ data:{
@ -672,6 +683,9 @@
that.$refs.tree.setCheckedKeys(checkedVerIds); that.$refs.tree.setCheckedKeys(checkedVerIds);
that.loading = false; that.loading = false;
that.$nextTick(() => {
that.isAllDataPermChecking = false;
})
}).catch(error=>{ }).catch(error=>{
console.log(error); console.log(error);
}) })