【更新】移动端授权错误修改,按钮未显示问题待修复

pull/84/head
小诺 2023-02-04 01:33:28 +08:00
parent ba0ed7978f
commit 0c67454008
2 changed files with 18 additions and 14 deletions

View File

@ -109,15 +109,20 @@
//
spinningLoading.value = true
const res = await roleApi.roleMobileMenuTreeSelector()
const param = {
id: resultDataModel.id
if (res && res.length > 0) {
const param = {
id: resultDataModel.id
}
//
const resEcho = await roleApi.roleOwnMobileMenu(param)
spinningLoading.value = false
echoDatalist.value = echoModuleData(res, resEcho)
moduleId.value = res[0].id
loadDatas.value = echoDatalist.value[0].menu
} else {
spinningLoading.value = false
loadDatas.value = []
}
//
const resEcho = await roleApi.roleOwnMobileMenu(param)
spinningLoading.value = false
echoDatalist.value = echoModuleData(res, resEcho)
moduleId.value = res[0].id
loadDatas.value = echoDatalist.value[0].menu
}
}
const checkFieldKeys = ['button']

View File

@ -211,21 +211,20 @@ public class MobileMenuServiceImpl extends ServiceImpl<MobileMenuMapper, MobileM
List<MobileMenu> mobileModuleList = CollectionUtil.newArrayList();
List<MobileMenu> mobileMenuList = CollectionUtil.newArrayList();
List<MobileMenu> mobileButtonList = CollectionUtil.newArrayList();
if (ObjectUtil.isEmpty(allModuleAndMenuList)) {
// 返回空列表
return CollectionUtil.newArrayList();
}
allModuleAndMenuList.forEach(mobileMenu -> {
if (mobileMenu.getCategory().equals(MobileResourceCategoryEnum.MODULE.getValue())) mobileModuleList.add(mobileMenu);
if (mobileMenu.getCategory().equals(MobileResourceCategoryEnum.MENU.getValue())) mobileMenuList.add(mobileMenu);
if (mobileMenu.getCategory().equals(MobileResourceCategoryEnum.BUTTON.getValue())) mobileMenuList.add(mobileMenu);
});
List<JSONObject> leafMenuList = CollectionUtil.newArrayList();
MobileMenu rootMobileMenu = new MobileMenu();
rootMobileMenu.setId("0");
rootMobileMenu.setParentId("-1");
rootMobileMenu.setSortCode(-1);
mobileMenuList.add(rootMobileMenu);
List<TreeNode<String>> treeNodeList = mobileMenuList.stream().map(mobileMenu ->
new TreeNode<>(mobileMenu.getId(), mobileMenu.getParentId(),
mobileMenu.getTitle(), mobileMenu.getSortCode())).collect(Collectors.toList());
List<Tree<String>> treeList = TreeUtil.build(treeNodeList, "-1");
List<Tree<String>> treeList = TreeUtil.build(treeNodeList, "0");
mobileMenuList.forEach(mobileMenu -> {
boolean isLeafMenu = this.getChildListById(mobileMenuList, mobileMenu.getId(), false).size() == 0;
if(isLeafMenu) {