use of com.cdeledu.common.plugs.easyui.TreeNode in project wechat by dllwh.
the class SysMenuServiceImpl method getMenuEasyUITreeByParentId.
private List<TreeNode> getMenuEasyUITreeByParentId(int parentId) {
List<TreeNode> results = Lists.newArrayList();
try {
List<SysMenu> rootMenuList = getMenuByParentCode(parentId);
TreeNode treeNode = null;
for (SysMenu sysMenu : rootMenuList) {
int treeId = sysMenu.getId();
treeNode = new TreeNode();
treeNode.setId(treeId);
treeNode.setText(sysMenu.getMenuName());
if (hasChildren(treeId) && sysMenu.getType() == SysMenuType.CATALOG.getValue()) {
treeNode.setState("closed");
treeNode.setChildren(getMenuEasyUITreeByParentId(treeId));
} else {
treeNode.setIconCls("fa fa-leaf");
treeNode.setState("open");
}
results.add(treeNode);
}
} catch (Exception e) {
e.printStackTrace();
}
return results;
}