diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/MenuTree.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/MenuTree.java index 335e3050..c340f645 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/MenuTree.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/MenuTree.java @@ -107,6 +107,7 @@ public class MenuTree extends TreeNode implements Serializable { this.label = menuVo.getName(); this.sort = menuVo.getSort(); this.keepAlive = menuVo.getKeepAlive(); + this.hasChildren = false; } } diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/TreeNode.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/TreeNode.java index 1ea4fdeb..a1b21212 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/TreeNode.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/TreeNode.java @@ -41,6 +41,8 @@ public class TreeNode { protected List children = new ArrayList(); + protected Boolean hasChildren; + public void add(TreeNode node) { children.add(node); } diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/TreeUtil.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/TreeUtil.java index 5a7ca81e..b389333f 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/TreeUtil.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/TreeUtil.java @@ -59,6 +59,7 @@ public class TreeUtil { treeNode.setChildren(new ArrayList<>()); } treeNode.add(it); + treeNode.setHasChildren(true); } } } @@ -117,7 +118,7 @@ public class TreeUtil { node.setIcon(menu.getIcon()); node.setType(menu.getType()); node.setSort(menu.getSort()); - node.setHasChildren(true); + node.setHasChildren(false); node.setKeepAlive(menu.getKeepAlive()); trees.add(node); }