【7.2.3】修复权限分配联动问题

pull/30/head
fengshuonan 2022-06-24 19:27:37 +08:00
parent 472339883c
commit ca0a8663c0
3 changed files with 18 additions and 12 deletions

View File

@ -212,15 +212,21 @@ public class AntdMenusFactory {
}
}
// 遍历一遍后,当前菜单没按钮,则直接略过
if (ObjectUtil.isEmpty(menuButtonList)) {
menuAndButtonTreeResponse.setButtons(menuButtonList);
continue;
}
long checkedButtonsNumber = menuButtonList.stream().filter(MenuAndButtonTreeResponse::getChecked).count();
// 统计选中的数量
if (checkedButtonsNumber == menuButtonList.size()) {
menuAndButtonTreeResponse.setChecked(true);
menuAndButtonTreeResponse.setIndeterminate(false);
} else if (checkedButtonsNumber == 0) {
if (checkedButtonsNumber == 0) {
menuAndButtonTreeResponse.setChecked(false);
menuAndButtonTreeResponse.setIndeterminate(false);
} else if (checkedButtonsNumber == menuButtonList.size()) {
menuAndButtonTreeResponse.setChecked(true);
menuAndButtonTreeResponse.setIndeterminate(false);
} else {
menuAndButtonTreeResponse.setChecked(false);
menuAndButtonTreeResponse.setIndeterminate(true);

View File

@ -58,12 +58,12 @@ public class IndeterminateFactory {
int childrenSize = children.size();
// 统计选中的数量
if (selectedCount == childrenSize) {
menuAndButtonTreeRespons.setChecked(true);
menuAndButtonTreeRespons.setIndeterminate(false);
} else if (selectedCount == 0) {
if (selectedCount == 0) {
menuAndButtonTreeRespons.setChecked(false);
menuAndButtonTreeRespons.setIndeterminate(false);
} else if (selectedCount == childrenSize) {
menuAndButtonTreeRespons.setChecked(true);
menuAndButtonTreeRespons.setIndeterminate(false);
} else {
menuAndButtonTreeRespons.setChecked(false);
menuAndButtonTreeRespons.setIndeterminate(true);

View File

@ -197,12 +197,12 @@ public class SysResourceServiceImpl extends ServiceImpl<SysResourceMapper, SysRe
}
// 统计选中的数量
if (checkedNumber == entry.getValue().size()) {
item.setChecked(true);
item.setIndeterminate(false);
} else if (checkedNumber == 0) {
if (checkedNumber == 0) {
item.setChecked(false);
item.setIndeterminate(false);
} else if (checkedNumber == entry.getValue().size()) {
item.setChecked(true);
item.setIndeterminate(false);
} else {
item.setChecked(false);
item.setIndeterminate(true);