1.加入js及css
css 。。。
2.ztree入口
3.接口
4.递归
附:
//查询同级菜单
List<TreeNode> list=menuService.getMenuList(id);
List< Map<String, Object> > listMap=new ArrayList<Map<String, Object>>();
//组装
for(int i=0;i<list.size();i++){
Map<String, Object> map=new HashMap<String, Object>();
map.put("id", ((TreeNode) list.get(i)).getId());
map.put("pId", ((TreeNode) list.get(i)).getParent_id());
map.put("name", ((TreeNode) list.get(i)).getText());
//节点展开与关�?
if(list.get(i).getLevel_id()!=1){
map.put("isParent", "true");
}else{
map.put("isParent", "false");
}
listMap.add(map);
}
System.out.println(list.toString());
return listMap;
}