Commit 4fb562f7 by naan1993

增加三级菜单

parent b57f9f00
package com.stylefeng.guns.common.node; package com.stylefeng.guns.common.node;
import com.stylefeng.guns.common.constant.Const; import com.stylefeng.guns.common.constant.Const;
import com.stylefeng.guns.common.constant.state.IsMenu;
import com.stylefeng.guns.config.properties.GunsProperties; import com.stylefeng.guns.config.properties.GunsProperties;
import com.stylefeng.guns.core.util.SpringContextHolder; import com.stylefeng.guns.core.util.SpringContextHolder;
...@@ -257,7 +258,7 @@ public class MenuNode implements Comparable { ...@@ -257,7 +258,7 @@ public class MenuNode implements Comparable {
public static List<MenuNode> clearBtn(List<MenuNode> nodes) { public static List<MenuNode> clearBtn(List<MenuNode> nodes) {
ArrayList<MenuNode> noBtns = new ArrayList<MenuNode>(); ArrayList<MenuNode> noBtns = new ArrayList<MenuNode>();
for (MenuNode node : nodes) { for (MenuNode node : nodes) {
if (node.getLevels() < 3) { if(node.getIsmenu() == IsMenu.YES.getCode()){
noBtns.add(node); noBtns.add(node);
} }
} }
...@@ -286,8 +287,11 @@ public class MenuNode implements Comparable { ...@@ -286,8 +287,11 @@ public class MenuNode implements Comparable {
* @date 2017年2月19日 下午11:18:19 * @date 2017年2月19日 下午11:18:19
*/ */
public static List<MenuNode> buildTitle(List<MenuNode> nodes) { public static List<MenuNode> buildTitle(List<MenuNode> nodes) {
List<MenuNode> clearBtn = clearBtn(nodes); List<MenuNode> clearBtn = clearBtn(nodes);
new MenuNode().buildNodeTree(clearBtn); new MenuNode().buildNodeTree(clearBtn);
List<MenuNode> menuNodes = clearLevelTwo(clearBtn); List<MenuNode> menuNodes = clearLevelTwo(clearBtn);
//对菜单排序 //对菜单排序
......
...@@ -47,9 +47,22 @@ ...@@ -47,9 +47,22 @@
</a> </a>
<ul class="nav nav-second-level"> <ul class="nav nav-second-level">
@for(subTitle in title.children){ @for(subTitle in title.children){
@if(tool.isEmpty(subTitle.children)){
<li> <li>
<a class="J_menuItem" href="${ctxPath}${subTitle.url}">${subTitle.name}</a> <a class="J_menuItem" href="${ctxPath}${subTitle.url}">${subTitle.name}</a>
</li> </li>
@}else{
<li>
<a href="#">${subTitle.name} <span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
@for(thirdTitle in subTitle.children){
<li>
<a class="J_menuItem" href="${ctxPath}${thirdTitle.url}">${thirdTitle.name}</a>
</li>
@}
</ul>
</li>
@}
@} @}
</ul> </ul>
</li> </li>
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
function initZtree() { function initZtree() {
var setting = { var setting = {
check: { check: {
enable: true enable: true,
chkboxType: { "Y": "", "N": "" }
}, },
data: { data: {
simpleData: { simpleData: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment