diff --git a/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveMenuDao.java b/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveMenuDao.java index 6ac82b188c335f2fa05b1175662c0a992e0aabd1..34915289c15cb3f25a515f5f3683427784f91ad7 100644 --- a/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveMenuDao.java +++ b/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveMenuDao.java @@ -11,4 +11,14 @@ public interface SysEveMenuDao { public void insertSysMenuMation(Map map) throws Exception; + public Map querySysMenuMationToEditById(Map map) throws Exception; + + public List> querySysMenuMationBySimpleLevel(Map map) throws Exception; + + public void editSysMenuMationById(Map map) throws Exception; + + public void deleteSysMenuChildMationById(Map map) throws Exception; + + public void deleteSysMenuMationById(Map map) throws Exception; + } diff --git a/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveUserDao.java b/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveUserDao.java index f99f2313463e7f1bb0dd9d67479dcd9d00fa20f7..bafc63a4d36baf4443ed1def7f8576eb5759d12e 100644 --- a/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveUserDao.java +++ b/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveUserDao.java @@ -7,74 +7,16 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds; public interface SysEveUserDao { - /** - * - * @Title: querySysUserList - * @Description: 获取管理员用户列表 - * @param @param inputObject - * @param @param outputObject - * @param @throws Exception 参数 - * @return void 返回类型 - * @throws - */ public List> querySysUserList(Map map, PageBounds pageBounds) throws Exception; - - /** - * - * @Title: querySysUserLockStateById - * @Description: 根据用户账号ID获取用户的当前锁定状态 - * @param @param map - * @param @return - * @param @throws Exception 参数 - * @return Map 返回类型 - * @throws - */ + public Map querySysUserLockStateById(Map map) throws Exception; - /** - * - * @Title: editSysUserLockStateToLockById - * @Description: 锁定账号 - * @param @param map - * @param @throws Exception 参数 - * @return void 返回类型 - * @throws - */ public void editSysUserLockStateToLockById(Map map) throws Exception; - /** - * - * @Title: editSysUserLockStateToUnLockById - * @Description: 解锁账号 - * @param @param map - * @param @throws Exception 参数 - * @return void 返回类型 - * @throws - */ public void editSysUserLockStateToUnLockById(Map map) throws Exception; - /** - * - * @Title: querySysUserMationToEditById - * @Description: 编辑账号时获取账号信息 - * @param @param map - * @param @return - * @param @throws Exception 参数 - * @return Map 返回类型 - * @throws - */ public Map querySysUserMationToEditById(Map map) throws Exception; - /** - * - * @Title: editSysUserMationById - * @Description: 编辑账号 - * @param @param inputObject - * @param @param outputObject - * @param @throws Exception 参数 - * @return void 返回类型 - * @throws - */ public void editSysUserMationById(Map map) throws Exception; diff --git a/skyeye-service/src/main/java/com/skyeye/authority/service/SysEveMenuService.java b/skyeye-service/src/main/java/com/skyeye/authority/service/SysEveMenuService.java index 6d203a21417664b390f35494eeab43dbfd33a921..1b5a5fab5608187218732761532ba5b1e29986ed 100644 --- a/skyeye-service/src/main/java/com/skyeye/authority/service/SysEveMenuService.java +++ b/skyeye-service/src/main/java/com/skyeye/authority/service/SysEveMenuService.java @@ -9,4 +9,12 @@ public interface SysEveMenuService { public void insertSysMenuMation(InputObject inputObject, OutputObject outputObject) throws Exception; + public void querySysMenuMationToEditById(InputObject inputObject, OutputObject outputObject) throws Exception; + + public void querySysMenuMationBySimpleLevel(InputObject inputObject, OutputObject outputObject) throws Exception; + + public void editSysMenuMationById(InputObject inputObject, OutputObject outputObject) throws Exception; + + public void deleteSysMenuMationById(InputObject inputObject, OutputObject outputObject) throws Exception; + } diff --git a/skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveMenuServiceImpl.java b/skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveMenuServiceImpl.java index 684a6bf624e32cfe6568a748ed8d1ccd0daad3d9..98ef7b58e1f3ae853070785b6eb20774bec64c2e 100644 --- a/skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveMenuServiceImpl.java +++ b/skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveMenuServiceImpl.java @@ -68,7 +68,6 @@ public class SysEveMenuServiceImpl implements SysEveMenuService{ }else{ String[] str = map.get("parentId").toString().split(","); map.put("menuLevel", str.length); - map.put("parentId", str[str.length - 1]); } map.put("id", ToolUtil.getSurFaceId()); map.put("createTime", ToolUtil.getTimeAndToString()); @@ -76,6 +75,91 @@ public class SysEveMenuServiceImpl implements SysEveMenuService{ sysEveMenuDao.insertSysMenuMation(map); } - - + /** + * + * @Title: querySysMenuMationBySimpleLevel + * @Description: 查看同级菜单 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @Override + public void querySysMenuMationBySimpleLevel(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + List> beans = sysEveMenuDao.querySysMenuMationBySimpleLevel(map); + if(!beans.isEmpty()){ + outputObject.setBeans(beans); + outputObject.settotal(beans.size()); + } + } + + /** + * + * @Title: querySysMenuMationToEditById + * @Description: 编辑菜单时进行信息回显 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @Override + public void querySysMenuMationToEditById(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + Map bean = sysEveMenuDao.querySysMenuMationToEditById(map); + outputObject.setBean(bean); + outputObject.settotal(1); + } + + /** + * + * @Title: editSysMenuMationById + * @Description: 编辑菜单信息 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @Override + public void editSysMenuMationById(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + if(Constants.SYS_MENU_TYPE_IS_IFRAME.equals(map.get("menuType").toString())){//iframe + map.put("openType", Constants.SYS_MENU_OPEN_TYPE_IS_IFRAME);//1:打开iframe + }else if(Constants.SYS_MENU_TYPE_IS_HTML.equals(map.get("menuType").toString())){//html + map.put("openType", Constants.SYS_MENU_OPEN_TYPE_IS_HTML);//2:打开html + }else{ + outputObject.setreturnMessage("菜单类型错误。"); + return; + } + if("0".equals(map.get("parentId").toString())){ + map.put("menuLevel", 0); + }else{ + String[] str = map.get("parentId").toString().split(","); + map.put("menuLevel", str.length); + } + sysEveMenuDao.editSysMenuMationById(map); + } + + /** + * + * @Title: deleteSysMenuMationById + * @Description: 删除菜单信息 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @Override + public void deleteSysMenuMationById(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + //删除子菜单 + sysEveMenuDao.deleteSysMenuChildMationById(map); + //删除自身菜单 + sysEveMenuDao.deleteSysMenuMationById(map); + } + } diff --git a/skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveMenuController.java b/skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveMenuController.java index 36aa62c9456bfc4aa05db9972cf06415383416c5..c4dc5bb8c9038ff52edc6865d9758d5de5635017 100644 --- a/skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveMenuController.java +++ b/skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveMenuController.java @@ -47,4 +47,68 @@ public class SysEveMenuController { sysEveMenuService.insertSysMenuMation(inputObject, outputObject); } + /** + * + * @Title: querySysMenuMationBySimpleLevel + * @Description: 查看同级菜单 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/SysEveMenuController/querySysMenuMationBySimpleLevel") + @ResponseBody + public void querySysMenuMationBySimpleLevel(InputObject inputObject, OutputObject outputObject) throws Exception{ + sysEveMenuService.querySysMenuMationBySimpleLevel(inputObject, outputObject); + } + + /** + * + * @Title: querySysMenuMationToEditById + * @Description: 编辑菜单时进行信息回显 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/SysEveMenuController/querySysMenuMationToEditById") + @ResponseBody + public void querySysMenuMationToEditById(InputObject inputObject, OutputObject outputObject) throws Exception{ + sysEveMenuService.querySysMenuMationToEditById(inputObject, outputObject); + } + + /** + * + * @Title: editSysMenuMationById + * @Description: 编辑菜单信息 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/SysEveMenuController/editSysMenuMationById") + @ResponseBody + public void editSysMenuMationById(InputObject inputObject, OutputObject outputObject) throws Exception{ + sysEveMenuService.editSysMenuMationById(inputObject, outputObject); + } + + /** + * + * @Title: deleteSysMenuMationById + * @Description: 删除菜单信息 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/SysEveMenuController/deleteSysMenuMationById") + @ResponseBody + public void deleteSysMenuMationById(InputObject inputObject, OutputObject outputObject) throws Exception{ + sysEveMenuService.deleteSysMenuMationById(inputObject, outputObject); + } + } diff --git a/skyeye-web/src/main/resources/dbmapper/SysEveMenuMapper.xml b/skyeye-web/src/main/resources/dbmapper/SysEveMenuMapper.xml index 5e69c3606b74c8927417e96f0dd4966453d5dc5e..9d1c39f23a624e3ad4adbf86c04d68106875b445 100644 --- a/skyeye-web/src/main/resources/dbmapper/SysEveMenuMapper.xml +++ b/skyeye-web/src/main/resources/dbmapper/SysEveMenuMapper.xml @@ -13,10 +13,13 @@ a.menu_sys_type menuSysType, a.menu_parent_id parentId, a.menu_url menuUrl, - CONVERT(a.create_time, char) createTime + CONVERT(a.create_time, char) createTime, + b.user_name userName, + IFNULL(GROUP_CONCAT(c.menu_name separator '->'), '创世菜单') menuParentName FROM sys_eve_menu a - LEFT JOIN sys_eve_user b ON a.creater = a.id + LEFT JOIN sys_eve_user b ON a.creater = b.id + LEFT JOIN sys_eve_menu c ON INSTR(CONCAT(',', a.menu_parent_id, ','), CONCAT(',', c.id, ',')) WHERE 1=1 AND a.menu_name LIKE '%${menuName}%' @@ -24,6 +27,7 @@ AND a.menu_url LIKE '%${menuUrl}%' + GROUP BY a.id ORDER BY a.create_time DESC @@ -34,4 +38,87 @@ (#{id}, #{menuName}, #{titleName}, #{menuIcon}, #{menuUrl}, #{menuType}, #{menuSysType}, #{parentId}, #{menuLevel}, #{openType}, #{createId}, #{createTime}) + + + + + + UPDATE sys_eve_menu + + + menu_name = #{menuName}, + + + menu_icon = #{menuIcon}, + + + title_name = #{titleName}, + + + menu_level = #{menuLevel}, + + + menu_type = #{menuType}, + + + menu_sys_type = #{menuSysType}, + + + menu_parent_id = #{parentId}, + + + menu_url = #{menuUrl}, + + + open_type = #{openType}, + + + WHERE id = #{id} + + + + DELETE + FROM + sys_eve_menu + WHERE + INSTR(CONCAT(',', menu_parent_id, ','), CONCAT(',', #{id}, ',')) + + + + DELETE + FROM + sys_eve_menu + WHERE + id = #{id} + + \ No newline at end of file diff --git a/skyeye-web/src/main/resources/mapping/reqmapping.xml b/skyeye-web/src/main/resources/mapping/reqmapping.xml index a673b4ca5fd5de50dacf92ebb852a87fce1f6b02..b8e1a9114ad194b1490469817d09e120b1d76043 100644 --- a/skyeye-web/src/main/resources/mapping/reqmapping.xml +++ b/skyeye-web/src/main/resources/mapping/reqmapping.xml @@ -38,5 +38,24 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/skyeye-web/src/main/webapp/js/sysevemenu/sysevemenuadd.js b/skyeye-web/src/main/webapp/js/sysevemenu/sysevemenuadd.js index d7694cca9f2e1d03e854406e9cfd96a9338a7fe4..511d9c1fba8ab360484510f454fc83cac2d31680 100644 --- a/skyeye-web/src/main/webapp/js/sysevemenu/sysevemenuadd.js +++ b/skyeye-web/src/main/webapp/js/sysevemenu/sysevemenuadd.js @@ -6,6 +6,7 @@ layui.config({ layui.use(['form'], function (form) { var index = parent.layer.getFrameIndex(window.name); //获取窗口索引 var $ = layui.$; + var parentId = "0"; form.render(); //菜单级别变化事件 @@ -14,7 +15,10 @@ layui.config({ if(val == '1'){//创世菜单 $("#parentIdBox").addClass("layui-hide"); }else if(val == '2'){ + parentId = "0"; + $("#lockParentSel").html(""); $("#parentIdBox").removeClass("layui-hide"); + loadChildMenu(); }else{ top.winui.window.msg('状态值错误', {icon: 2,time: 2000}); } @@ -26,6 +30,23 @@ layui.config({ $(data.elem).val(data.elem.checked); }); + form.on('select(selectParent)', function(data){ + if(data.value != parentId){ + if(isNull(data.value) || data.value == '请选择'){ + layui.$(data.elem).parent('dd').nextAll().remove(); + if(layui.$(data.elem).parent('dd').prev().children('select[class=menuParent]').length > 0){ + parentId = layui.$(data.elem).parent('dd').prev().children('select[class=menuParent]')[0].value; + }else{ + parentId = "0"; + } + }else{ + layui.$(data.elem).parent('dd').nextAll().remove(); + parentId = data.value; + loadChildMenu(); + } + } + }); + form.on('submit(formAddMenu)', function (data) { //表单验证 if (winui.verifyForm(data.elem)) { @@ -41,17 +62,23 @@ layui.config({ if(data.field.menuLevel == '1'){//创世菜单 params.parentId = '0'; }else if(data.field.menuLevel == '2'){//子菜单 - if(isNull($("#parentIdOne").val())){//父菜单为空 + var $menu = layui.$('.menuParent'); + var str = ""; + for(var i = 0; i < $menu.length; i++){ + if(!isNull($menu[i].value) && $menu[i].value != '请选择'){ + str += $menu[i].value + ","; + } + } + if(isNull(str)){//父菜单为空 top.winui.window.msg("请至少选择一级父菜单", {icon: 2,time: 2000}); return false; }else{ - params.parentId = ""; + params.parentId = str; } }else{ top.winui.window.msg('状态值错误', {icon: 2,time: 2000}); } - - if($("#menuSysType").val()){ + if($("#menuSysType").val() == 'true'){ params.menuSysType = '1'; }else{ params.menuSysType = '2'; @@ -68,6 +95,32 @@ layui.config({ return false; }); + //加载同级菜单 + function loadChildMenu(){ + AjaxPostUtil.request({url:reqBasePath + "sys009", params:{parentId: parentId}, type:'json', callback:function(json){ + if(json.returnCode == 0){ + var str = '
'; + $("#lockParentSel").append(str); + form.render('select'); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); + } + + //获取菜单级别 + function getMenuLevelName(level){ + if(level == '0'){ + return "创世菜单"; + }else{ + return level + "级子菜单"; + } + } + //初始化加载隐藏创世菜单 $("#parentIdBox").addClass("layui-hide"); diff --git a/skyeye-web/src/main/webapp/js/sysevemenu/sysevemenuedit.js b/skyeye-web/src/main/webapp/js/sysevemenu/sysevemenuedit.js new file mode 100644 index 0000000000000000000000000000000000000000..5b782a0cf62756b6eefc16e42fe3e634f58de48e --- /dev/null +++ b/skyeye-web/src/main/webapp/js/sysevemenu/sysevemenuedit.js @@ -0,0 +1,213 @@ +layui.config({ + base: basePath, + version: skyeyeVersion +}).define(['table', 'jquery', 'winui'], function (exports) { + winui.renderColor(); + layui.use(['form'], function (form) { + var index = parent.layer.getFrameIndex(window.name); //获取窗口索引 + var $ = layui.$; + var parentId = "0"; + + //初始化数据 + showGrid({ + id: "showForm", + url: reqBasePath + "sys008", + params: {rowId:parent.rowId}, + pagination: false, + template: getFileContent('tpl/sysevemenu/sysevemenueditTemplate.tpl'), + ajaxSendLoadBefore: function(hdb){ + //是否为系统菜单 + hdb.registerHelper("compare2", function(v1, options){ + if(v1 == '1'){ + return 'checked'; + }else if(v1 == '2'){ + return ''; + }else{ + return ''; + } + }); + hdb.registerHelper("compare3", function(v1, options){ + if(v1 == '1'){ + return 'true'; + }else if(v1 == '2'){ + return 'false'; + }else{ + return 'false'; + } + }); + }, + ajaxSendAfter:function(json){ + //菜单级别 + if(json.bean.menuLevel == '0'){ + $("#parentIdBox").addClass("layui-hide"); + $("input:radio[name=menuLevel][value=1]").attr("checked", true); + }else{ + $("input:radio[name=menuLevel][value=2]").attr("checked", true); + //初始化父菜单 + loadChildMenuAll(json.bean.parentId.split(',')); + } + //菜单类型 + $("input:radio[name=menuType][value=" + json.bean.menuType + "]").attr("checked", true); + + form.render(); + + //菜单级别变化事件 + form.on('radio(menuLevel)', function (data) { + var val = data.value; + if(val == '1'){//创世菜单 + $("#parentIdBox").addClass("layui-hide"); + }else if(val == '2'){ + parentId = "0"; + $("#lockParentSel").html(""); + $("#parentIdBox").removeClass("layui-hide"); + loadChildMenu(); + }else{ + top.winui.window.msg('状态值错误', {icon: 2,time: 2000}); + } + }); + + //系统菜单同步 + form.on('switch(isNecessary)', function (data) { + //同步开关值 + $(data.elem).val(data.elem.checked); + }); + + //父菜单变化事件 + form.on('select(selectParent)', function(data){ + if(data.value != parentId){ + if(isNull(data.value) || data.value == '请选择'){ + layui.$(data.elem).parent('dd').nextAll().remove(); + if(layui.$(data.elem).parent('dd').prev().children('select[class=menuParent]').length > 0){ + parentId = layui.$(data.elem).parent('dd').prev().children('select[class=menuParent]')[0].value; + }else{ + parentId = "0"; + } + }else{ + layui.$(data.elem).parent('dd').nextAll().remove(); + parentId = data.value; + loadChildMenu(); + } + } + }); + + form.on('submit(formEditMenu)', function (data) { + //表单验证 + if (winui.verifyForm(data.elem)) { + + var params = { + menuName: $("#menuName").val(), + titleName: $("#menuTitle").val(), + menuIcon: $("#menuIcon").val(), + menuUrl: $("#menuUrl").val(), + menuType: data.field.menuType, + rowId: parent.rowId + }; + + if(data.field.menuLevel == '1'){//创世菜单 + params.parentId = '0'; + }else if(data.field.menuLevel == '2'){//子菜单 + var $menu = layui.$('.menuParent'); + var str = ""; + for(var i = 0; i < $menu.length; i++){ + if(!isNull($menu[i].value) && $menu[i].value != '请选择'){ + str += $menu[i].value + ","; + } + } + if(isNull(str)){//父菜单为空 + top.winui.window.msg("请至少选择一级父菜单", {icon: 2,time: 2000}); + return false; + }else{ + params.parentId = str; + } + }else{ + top.winui.window.msg('状态值错误', {icon: 2,time: 2000}); + } + if($("#menuSysType").val() == 'true'){ + params.menuSysType = '1'; + }else{ + params.menuSysType = '2'; + } + AjaxPostUtil.request({url:reqBasePath + "sys010", params:params, type:'json', callback:function(json){ + if(json.returnCode == 0){ + parent.layer.close(index); + parent.refreshCode = '0'; + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); + } + return false; + }); + } + }); + + //初始化当前子菜单的父菜单 + function loadChildMenuAll(pid){ + if(pid.length > 0){ + if(!isNull(pid[0])){ + AjaxPostUtil.request({url:reqBasePath + "sys009", params:{parentId: parentId}, type:'json', callback:function(json){ + if(json.returnCode == 0){ + var str = '
'; + $("#lockParentSel").append(str); + form.render('select'); + parentId = pid[0]; + pid.splice(0, 1); + loadChildMenuAll(pid); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); + }else{ + pid.splice(0, 1); + loadChildMenuAll(pid); + } + }else{ + loadChildMenu() + } + } + + //加载同级菜单 + function loadChildMenu(){ + AjaxPostUtil.request({url:reqBasePath + "sys009", params:{parentId: parentId}, type:'json', callback:function(json){ + if(json.returnCode == 0){ + var str = '
'; + $("#lockParentSel").append(str); + form.render('select'); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); + } + + //获取菜单级别 + function getMenuLevelName(level){ + if(level == '0'){ + return "创世菜单"; + }else{ + return level + "级子菜单"; + } + } + + //取消 + $("body").on("click", "#cancle", function(){ + parent.layer.close(index); + }); + + }); +}); \ No newline at end of file diff --git a/skyeye-web/src/main/webapp/js/sysevemenu/sysevemenulist.js b/skyeye-web/src/main/webapp/js/sysevemenu/sysevemenulist.js index 4ee8c9be70c5f7e7319135b20e651627b1c4b7fa..5d55f3184085b2ad0313f2d057cbf18daa2ed91b 100644 --- a/skyeye-web/src/main/webapp/js/sysevemenu/sysevemenulist.js +++ b/skyeye-web/src/main/webapp/js/sysevemenu/sysevemenulist.js @@ -26,15 +26,16 @@ layui.config({ { field: 'menuName', title: '菜单名称', width: 120 }, { field: 'menuIcon', title: '图标码', width: 120 }, { field: 'titleName', title: '标题名称', width: 120 }, - { field: 'menuLevel', title: '菜单级别', width: 120, templet: function(d){ + { field: 'menuLevel', title: '菜单级别', width: 180, templet: function(d){ if(d.parentId == '0'){ return "创世菜单"; }else{ return "子菜单-->" + d.menuLevel + "级子菜单"; } }}, + { field: 'menuParentName', title: '父菜单', width: 100 }, { field: 'menuType', title: '菜单类型', width: 100 }, - { field: 'menuUrl', title: '菜单链接', width: 100 }, + { field: 'menuUrl', title: '菜单链接', width: 160 }, { field: 'menuSysType', title: '系统菜单', width: 100, templet: function(d){ if(d.menuSysType == 2){ return '否'; @@ -45,6 +46,7 @@ layui.config({ } }}, { field: 'createTime', title: '创建时间', width: 180 }, + { field: 'userName', title: '创建人', width: 150 }, { title: '操作', fixed: 'right', align: 'center', width: 120, toolbar: '#tableBar'} ]] }); @@ -53,7 +55,7 @@ layui.config({ var data = obj.data; //获得当前行数据 var layEvent = obj.event; //获得 lay-event 对应的值 if (layEvent === 'del') { //删除 - del(data); + del(data, obj); }else if (layEvent === 'edit') { //编辑 edit(data); } @@ -70,17 +72,29 @@ layui.config({ }); //删除 - function del(data){ - + function del(data, obj){ + var msg = obj ? '确认删除菜单【' + obj.data.menuName + '】吗?' : '确认删除选中数据吗?'; + layer.confirm(msg, { icon: 3, title: '删除系统菜单' }, function (index) { + layer.close(index); + //向服务端发送删除指令 + AjaxPostUtil.request({url:reqBasePath + "sys011", params:{rowId: data.id}, type:'json', callback:function(json){ + if(json.returnCode == 0){ + top.winui.window.msg("删除成功", {icon: 1,time: 2000}); + loadTable(); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); + }); } //编辑 function edit(data){ rowId = data.id; _openNewWindows({ - url: "../../tpl/syseveuser/syseveuseredit.html", + url: "../../tpl/sysevemenu/sysevemenuedit.html", title: "编辑用户", - pageId: "syseveuseredit", + pageId: "sysevemenuedit", callBack: function(refreshCode){ if (refreshCode == '0') { top.winui.window.msg("操作成功", {icon: 1,time: 2000}); diff --git a/skyeye-web/src/main/webapp/js/syseveuser/syseveuseredit.js b/skyeye-web/src/main/webapp/js/syseveuser/syseveuseredit.js index acaf49dd944d21a86cfc5e37eddb2f900897d1f5..7ea525c87a90f989c7a690e1b400d1a05552702d 100644 --- a/skyeye-web/src/main/webapp/js/syseveuser/syseveuseredit.js +++ b/skyeye-web/src/main/webapp/js/syseveuser/syseveuseredit.js @@ -15,7 +15,7 @@ layui.config({ pagination: false, template: getFileContent('tpl/syseveuser/syseveusereditTemplate.tpl'), ajaxSendLoadBefore: function(hdb){ - hdb.registerHelper("compare1", function(v1,options){ + hdb.registerHelper("compare1", function(v1, options){ if(isNull(v1)){ return path + "assets/img/uploadPic.png"; }else{ diff --git a/skyeye-web/src/main/webapp/tpl/sysevemenu/sysevemenuadd.html b/skyeye-web/src/main/webapp/tpl/sysevemenu/sysevemenuadd.html index 0e06c8a854e418189cf8e2a48828c9700cbede01..8515163b0fc057ee5250270122910557ec6bcc90 100644 --- a/skyeye-web/src/main/webapp/tpl/sysevemenu/sysevemenuadd.html +++ b/skyeye-web/src/main/webapp/tpl/sysevemenu/sysevemenuadd.html @@ -19,7 +19,7 @@
- +
@@ -43,21 +43,7 @@
-
- +
diff --git a/skyeye-web/src/main/webapp/tpl/sysevemenu/sysevemenuedit.html b/skyeye-web/src/main/webapp/tpl/sysevemenu/sysevemenuedit.html new file mode 100644 index 0000000000000000000000000000000000000000..76095723b00c63a046004d181459845be445a223 --- /dev/null +++ b/skyeye-web/src/main/webapp/tpl/sysevemenu/sysevemenuedit.html @@ -0,0 +1,22 @@ + + + + + + + + + + +
+
+ +
+
+ + + + + \ No newline at end of file diff --git a/skyeye-web/src/main/webapp/tpl/sysevemenu/sysevemenueditTemplate.tpl b/skyeye-web/src/main/webapp/tpl/sysevemenu/sysevemenueditTemplate.tpl new file mode 100644 index 0000000000000000000000000000000000000000..87a86ae5ddec0eb500458e7ae134fdb82d070ded --- /dev/null +++ b/skyeye-web/src/main/webapp/tpl/sysevemenu/sysevemenueditTemplate.tpl @@ -0,0 +1,57 @@ +{{#bean}} +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+ +
+
+
+
+ +
+ + +
+
+
+ +
+ +
+
+
+
+ + +
+
+{{/bean}} \ No newline at end of file diff --git a/skyeye-web/src/main/webapp/tpl/sysevemenu/sysevemenulist.html b/skyeye-web/src/main/webapp/tpl/sysevemenu/sysevemenulist.html index ddaa893f18bc6ba257db0f224379c72869dfb9f6..5f878493ac189d93fad646f27edf997ed6a82170 100644 --- a/skyeye-web/src/main/webapp/tpl/sysevemenu/sysevemenulist.html +++ b/skyeye-web/src/main/webapp/tpl/sysevemenu/sysevemenulist.html @@ -33,7 +33,7 @@
- +