From aaab9cbec5d24525f43aeb660c8efda25d091d48 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Thu, 5 Jul 2018 16:17:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=8F=9C=E5=8D=95=E5=A2=9E?= =?UTF-8?q?=E5=88=A0=E6=94=B9=E6=9F=A5=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skyeye/authority/dao/SysEveMenuDao.java | 10 + .../skyeye/authority/dao/SysEveUserDao.java | 60 +---- .../authority/service/SysEveMenuService.java | 8 + .../service/impl/SysEveMenuServiceImpl.java | 90 +++++++- .../controller/SysEveMenuController.java | 64 ++++++ .../resources/dbmapper/SysEveMenuMapper.xml | 91 +++++++- .../src/main/resources/mapping/reqmapping.xml | 19 ++ .../webapp/js/sysevemenu/sysevemenuadd.js | 61 ++++- .../webapp/js/sysevemenu/sysevemenuedit.js | 213 ++++++++++++++++++ .../webapp/js/sysevemenu/sysevemenulist.js | 28 ++- .../webapp/js/syseveuser/syseveuseredit.js | 2 +- .../webapp/tpl/sysevemenu/sysevemenuadd.html | 18 +- .../webapp/tpl/sysevemenu/sysevemenuedit.html | 22 ++ .../tpl/sysevemenu/sysevemenueditTemplate.tpl | 57 +++++ .../webapp/tpl/sysevemenu/sysevemenulist.html | 2 +- 15 files changed, 652 insertions(+), 93 deletions(-) create mode 100644 skyeye-web/src/main/webapp/js/sysevemenu/sysevemenuedit.js create mode 100644 skyeye-web/src/main/webapp/tpl/sysevemenu/sysevemenuedit.html create mode 100644 skyeye-web/src/main/webapp/tpl/sysevemenu/sysevemenueditTemplate.tpl 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 6ac82b188..34915289c 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 f99f23134..bafc63a4d 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 6d203a214..1b5a5fab5 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 684a6bf62..98ef7b58e 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 36aa62c94..c4dc5bb8c 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 5e69c3606..9d1c39f23 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 a673b4ca5..b8e1a9114 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 d7694cca9..511d9c1fb 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 000000000..5b782a0cf --- /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 4ee8c9be7..5d55f3184 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 acaf49dd9..7ea525c87 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 0e06c8a85..8515163b0 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 000000000..76095723b --- /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 000000000..87a86ae5d --- /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 ddaa893f1..5f878493a 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 @@
- +
-- GitLab