Commit 7e4d63a2 by fsn

菜单页面新增是否是菜单字段

parent 00cfc22b
package com.stylefeng.guns.common.constant.state;
/**
* 是否是菜单的枚举
*
* @author fengshuonan
* @date 2017年6月1日22:50:11
*/
public enum IsMenu {
YES(1, "是"),
NO(0, "不是");//不是菜单的是按钮
int code;
String message;
IsMenu(int code, String message) {
this.code = code;
this.message = message;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public static String valueOf(Integer status) {
if (status == null) {
return "";
} else {
for (IsMenu s : IsMenu.values()) {
if (s.getCode() == status) {
return s.getMessage();
}
}
return "";
}
}
}
package com.stylefeng.guns.modular.system.warpper;
import com.stylefeng.guns.common.constant.factory.ConstantFactory;
import com.stylefeng.guns.common.constant.state.IsMenu;
import com.stylefeng.guns.common.warpper.BaseControllerWarpper;
import java.util.List;
......@@ -21,6 +22,7 @@ public class MenuWarpper extends BaseControllerWarpper {
@Override
public void warpTheMap(Map<String, Object> map) {
map.put("statusName", ConstantFactory.me().getMenuStatusName((Integer) map.get("status")));
map.put("isMenuName", IsMenu.valueOf((Integer) map.get("ismenu")));
}
}
......@@ -14,6 +14,10 @@
clickFun="MenuInfoDlg.showMenuSelectTree(); return false;"
style="background-color: #ffffff !important;"
selectFlag="true" selectId="pcodeTreeDiv" selectTreeId="pcodeTree" selectStyle="width:244px !important;"/>
<#select id="ismenu" name="是否是菜单">
<option value="1"></option>
<option value="0">不是</option>
</#select>
</div>
<div class="col-sm-6">
<#input id="url" name="请求地址" underline="true" />
......
......@@ -4,6 +4,7 @@
<div class="form-horizontal">
<input type="hidden" id="id" value="${menu.id}">
<input type="hidden" id="ismenuValue" value="${menu.ismenu}">
<div class="row">
<div class="col-sm-6 b-r">
......@@ -14,6 +15,11 @@
clickFun="MenuInfoDlg.showMenuSelectTree(); return false;"
style="background-color: #ffffff !important;"
selectFlag="true" selectId="pcodeTreeDiv" selectTreeId="pcodeTree" selectStyle="width:244px !important;"/>
<#select id="ismenu" name="是否是菜单">
<option value="1"></option>
<option value="0">不是</option>
</#select>
</div>
<div class="col-sm-6">
<#input id="url" name="请求地址" value="${menu.url}" underline="true" />
......
......@@ -21,6 +21,7 @@ Menu.initColumn = function () {
{title: '请求地址', field: 'url', align: 'center', valign: 'middle', sortable: true},
{title: '排序', field: 'num', align: 'center', valign: 'middle', sortable: true},
{title: '层级', field: 'levels', align: 'center', valign: 'middle', sortable: true},
{title: '是否是菜单', field: 'isMenuName', align: 'center', valign: 'middle', sortable: true},
{title: '状态', field: 'statusName', align: 'center', valign: 'middle', sortable: true}]
return columns;
};
......
......@@ -45,7 +45,7 @@ MenuInfoDlg.close = function () {
* 收集数据
*/
MenuInfoDlg.collectData = function () {
this.set('id').set('name').set('code').set('pcode').set('url').set('num').set('levels').set('icon');
this.set('id').set('name').set('code').set('pcode').set('url').set('num').set('levels').set('icon').set("ismenu");
}
/**
......@@ -109,4 +109,7 @@ $(function () {
ztree.bindOnClick(MenuInfoDlg.onClickDept);
ztree.init();
MenuInfoDlg.ztreeInstance = ztree;
//初始化是否是菜单
$("#ismenu").val($("#ismenuValue").val());
});
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