From 35a0ef83bdec3906c34a7bd6d77435a3e5a2b7d6 Mon Sep 17 00:00:00 2001 From: likehai Date: Thu, 26 Oct 2023 02:11:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E7=AE=A1=E7=90=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/SysMenuController.java | 51 +- .../service/impl/SysMenuServiceImpl.java | 250 ++++------ .../resources/mapper/system/SysMenuMapper.xml | 454 ++++++++++-------- .../views/mountainForestSafety/role/index.vue | 4 +- .../mountainForestSafety/role/selectUser.vue | 2 +- .../views/mountainForestSafety/user/index.vue | 4 +- 6 files changed, 386 insertions(+), 379 deletions(-) diff --git a/God-Vue-master/god-admin/src/main/java/com/god/web/controller/system/SysMenuController.java b/God-Vue-master/god-admin/src/main/java/com/god/web/controller/system/SysMenuController.java index 7511715f..3799aed8 100644 --- a/God-Vue-master/god-admin/src/main/java/com/god/web/controller/system/SysMenuController.java +++ b/God-Vue-master/god-admin/src/main/java/com/god/web/controller/system/SysMenuController.java @@ -1,6 +1,7 @@ package com.god.web.controller.system; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -23,13 +24,12 @@ import com.god.system.service.ISysMenuService; /** * 菜单信息 - * + * * @author god */ @RestController @RequestMapping("/system/menu") -public class SysMenuController extends BaseController -{ +public class SysMenuController extends BaseController { @Autowired private ISysMenuService menuService; @@ -38,8 +38,7 @@ public class SysMenuController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:menu:list')") @GetMapping("/list") - public AjaxResult list(SysMenu menu) - { + public AjaxResult list(SysMenu menu) { List menus = menuService.selectMenuList(menu, getUserId()); return success(menus); } @@ -49,8 +48,7 @@ public class SysMenuController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:menu:query')") @GetMapping(value = "/{menuId}") - public AjaxResult getInfo(@PathVariable Long menuId) - { + public AjaxResult getInfo(@PathVariable Long menuId) { return success(menuService.selectMenuById(menuId)); } @@ -58,8 +56,7 @@ public class SysMenuController extends BaseController * 获取菜单下拉树列表 */ @GetMapping("/treeselect") - public AjaxResult treeselect(SysMenu menu) - { + public AjaxResult treeselect(SysMenu menu) { List menus = menuService.selectMenuList(menu, getUserId()); return success(menuService.buildMenuTreeSelect(menus)); } @@ -68,8 +65,7 @@ public class SysMenuController extends BaseController * 加载对应角色菜单列表树 */ @GetMapping(value = "/roleMenuTreeselect/{roleId}") - public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) - { + public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) { List menus = menuService.selectMenuList(getUserId()); AjaxResult ajax = AjaxResult.success(); ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId)); @@ -83,14 +79,10 @@ public class SysMenuController extends BaseController @PreAuthorize("@ss.hasPermi('system:menu:add')") @Log(title = "菜单管理", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@Validated @RequestBody SysMenu menu) - { - if (!menuService.checkMenuNameUnique(menu)) - { + public AjaxResult add(@Validated @RequestBody SysMenu menu) { + if (!menuService.checkMenuNameUnique(menu)) { return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); - } - else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) - { + } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) { return error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); } menu.setCreateBy(getUsername()); @@ -103,18 +95,12 @@ public class SysMenuController extends BaseController @PreAuthorize("@ss.hasPermi('system:menu:edit')") @Log(title = "菜单管理", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody SysMenu menu) - { - if (!menuService.checkMenuNameUnique(menu)) - { + public AjaxResult edit(@Validated @RequestBody SysMenu menu) { + if (!menuService.checkMenuNameUnique(menu)) { return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); - } - else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) - { + } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) { return error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); - } - else if (menu.getMenuId().equals(menu.getParentId())) - { + } else if (menu.getMenuId().equals(menu.getParentId())) { return error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己"); } menu.setUpdateBy(getUsername()); @@ -127,14 +113,11 @@ public class SysMenuController extends BaseController @PreAuthorize("@ss.hasPermi('system:menu:remove')") @Log(title = "菜单管理", businessType = BusinessType.DELETE) @DeleteMapping("/{menuId}") - public AjaxResult remove(@PathVariable("menuId") Long menuId) - { - if (menuService.hasChildByMenuId(menuId)) - { + public AjaxResult remove(@PathVariable("menuId") Long menuId) { + if (menuService.hasChildByMenuId(menuId)) { return warn("存在子菜单,不允许删除"); } - if (menuService.checkMenuExistRole(menuId)) - { + if (menuService.checkMenuExistRole(menuId)) { return warn("菜单已分配,不允许删除"); } return toAjax(menuService.deleteMenuById(menuId)); diff --git a/God-Vue-master/god-system/src/main/java/com/god/system/service/impl/SysMenuServiceImpl.java b/God-Vue-master/god-system/src/main/java/com/god/system/service/impl/SysMenuServiceImpl.java index d603a0f6..66f792b9 100644 --- a/God-Vue-master/god-system/src/main/java/com/god/system/service/impl/SysMenuServiceImpl.java +++ b/God-Vue-master/god-system/src/main/java/com/god/system/service/impl/SysMenuServiceImpl.java @@ -8,6 +8,8 @@ import java.util.LinkedList; import java.util.List; import java.util.Set; import java.util.stream.Collectors; + +import com.god.common.utils.http.HttpSeverGet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.god.common.constant.Constants; @@ -25,14 +27,15 @@ import com.god.system.mapper.SysRoleMapper; import com.god.system.mapper.SysRoleMenuMapper; import com.god.system.service.ISysMenuService; +import javax.servlet.http.HttpServletRequest; + /** * 菜单 业务层处理 - * + * * @author god */ @Service -public class SysMenuServiceImpl implements ISysMenuService -{ +public class SysMenuServiceImpl implements ISysMenuService { public static final String PREMISSION_STRING = "perms[\"{0}\"]"; @Autowired @@ -44,35 +47,37 @@ public class SysMenuServiceImpl implements ISysMenuService @Autowired private SysRoleMenuMapper roleMenuMapper; + @Autowired + private HttpServletRequest request; + /** * 根据用户查询系统菜单列表 - * + * * @param userId 用户ID * @return 菜单列表 */ @Override - public List selectMenuList(Long userId) - { + public List selectMenuList(Long userId) { return selectMenuList(new SysMenu(), userId); } /** * 查询系统菜单列表 - * + * * @param menu 菜单信息 * @return 菜单列表 */ @Override - public List selectMenuList(SysMenu menu, Long userId) - { + public List selectMenuList(SysMenu menu, Long userId) { List menuList = null; // 管理员显示所有菜单信息 - if (SysUser.isAdmin(userId)) - { + if (SysUser.isAdmin(userId)) { menuList = menuMapper.selectMenuList(menu); - } - else - { + } else { +// menu.setPortNum(HttpSeverGet.getPort(request)); +// if(StringUtils.isNull(menu.getDistinctionNum())){ +// menu.setDistinctionNum("0"); +// } menu.getParams().put("userId", userId); menuList = menuMapper.selectMenuListByUserId(menu); } @@ -81,19 +86,16 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 根据用户ID查询权限 - * + * * @param userId 用户ID * @return 权限列表 */ @Override - public Set selectMenuPermsByUserId(Long userId) - { + public Set selectMenuPermsByUserId(Long userId) { List perms = menuMapper.selectMenuPermsByUserId(userId); Set permsSet = new HashSet<>(); - for (String perm : perms) - { - if (StringUtils.isNotEmpty(perm)) - { + for (String perm : perms) { + if (StringUtils.isNotEmpty(perm)) { permsSet.addAll(Arrays.asList(perm.trim().split(","))); } } @@ -102,19 +104,16 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 根据角色ID查询权限 - * + * * @param roleId 角色ID * @return 权限列表 */ @Override - public Set selectMenuPermsByRoleId(Long roleId) - { + public Set selectMenuPermsByRoleId(Long roleId) { List perms = menuMapper.selectMenuPermsByRoleId(roleId); Set permsSet = new HashSet<>(); - for (String perm : perms) - { - if (StringUtils.isNotEmpty(perm)) - { + for (String perm : perms) { + if (StringUtils.isNotEmpty(perm)) { permsSet.addAll(Arrays.asList(perm.trim().split(","))); } } @@ -123,20 +122,16 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 根据用户ID查询菜单 - * + * * @param userId 用户名称 * @return 菜单列表 */ @Override - public List selectMenuTreeByUserId(Long userId) - { + public List selectMenuTreeByUserId(Long userId) { List menus = null; - if (SecurityUtils.isAdmin(userId)) - { + if (SecurityUtils.isAdmin(userId)) { menus = menuMapper.selectMenuTreeAll(); - } - else - { + } else { menus = menuMapper.selectMenuTreeByUserId(userId); } return getChildPerms(menus, 0); @@ -144,29 +139,26 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 根据角色ID查询菜单树信息 - * + * * @param roleId 角色ID * @return 选中菜单列表 */ @Override - public List selectMenuListByRoleId(Long roleId) - { + public List selectMenuListByRoleId(Long roleId) { SysRole role = roleMapper.selectRoleById(roleId); return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly()); } /** * 构建前端路由所需要的菜单 - * + * * @param menus 菜单列表 * @return 路由列表 */ @Override - public List buildMenus(List menus) - { + public List buildMenus(List menus) { List routers = new LinkedList(); - for (SysMenu menu : menus) - { + for (SysMenu menu : menus) { RouterVo router = new RouterVo(); router.setHidden("1".equals(menu.getVisible())); router.setName(getRouteName(menu)); @@ -175,14 +167,11 @@ public class SysMenuServiceImpl implements ISysMenuService router.setQuery(menu.getQuery()); router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); List cMenus = menu.getChildren(); - if (StringUtils.isNotEmpty(cMenus) && UserConstants.TYPE_DIR.equals(menu.getMenuType())) - { + if (StringUtils.isNotEmpty(cMenus) && UserConstants.TYPE_DIR.equals(menu.getMenuType())) { router.setAlwaysShow(true); router.setRedirect("noRedirect"); router.setChildren(buildMenus(cMenus)); - } - else if (isMenuFrame(menu)) - { + } else if (isMenuFrame(menu)) { router.setMeta(null); List childrenList = new ArrayList(); RouterVo children = new RouterVo(); @@ -193,9 +182,7 @@ public class SysMenuServiceImpl implements ISysMenuService children.setQuery(menu.getQuery()); childrenList.add(children); router.setChildren(childrenList); - } - else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) - { + } else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) { router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon())); router.setPath("/"); List childrenList = new ArrayList(); @@ -215,27 +202,23 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 构建前端所需要树结构 - * + * * @param menus 菜单列表 * @return 树结构列表 */ @Override - public List buildMenuTree(List menus) - { + public List buildMenuTree(List menus) { List returnList = new ArrayList(); List tempList = menus.stream().map(SysMenu::getMenuId).collect(Collectors.toList()); - for (Iterator iterator = menus.iterator(); iterator.hasNext();) - { + for (Iterator iterator = menus.iterator(); iterator.hasNext(); ) { SysMenu menu = (SysMenu) iterator.next(); // 如果是顶级节点, 遍历该父节点的所有子节点 - if (!tempList.contains(menu.getParentId())) - { + if (!tempList.contains(menu.getParentId())) { recursionFn(menus, menu); returnList.add(menu); } } - if (returnList.isEmpty()) - { + if (returnList.isEmpty()) { returnList = menus; } return returnList; @@ -243,104 +226,97 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 构建前端所需要下拉树结构 - * + * * @param menus 菜单列表 * @return 下拉树结构列表 */ @Override - public List buildMenuTreeSelect(List menus) - { + public List buildMenuTreeSelect(List menus) { List menuTrees = buildMenuTree(menus); return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); } /** * 根据菜单ID查询信息 - * + * * @param menuId 菜单ID * @return 菜单信息 */ @Override - public SysMenu selectMenuById(Long menuId) - { + public SysMenu selectMenuById(Long menuId) { return menuMapper.selectMenuById(menuId); } /** * 是否存在菜单子节点 - * + * * @param menuId 菜单ID * @return 结果 */ @Override - public boolean hasChildByMenuId(Long menuId) - { + public boolean hasChildByMenuId(Long menuId) { int result = menuMapper.hasChildByMenuId(menuId); return result > 0; } /** * 查询菜单使用数量 - * + * * @param menuId 菜单ID * @return 结果 */ @Override - public boolean checkMenuExistRole(Long menuId) - { + public boolean checkMenuExistRole(Long menuId) { int result = roleMenuMapper.checkMenuExistRole(menuId); return result > 0; } /** * 新增保存菜单信息 - * + * * @param menu 菜单信息 * @return 结果 */ @Override - public int insertMenu(SysMenu menu) - { + public int insertMenu(SysMenu menu) { + //端口赋值 + menu.setPortNum(HttpSeverGet.getPort(request)); return menuMapper.insertMenu(menu); } /** * 修改保存菜单信息 - * + * * @param menu 菜单信息 * @return 结果 */ @Override - public int updateMenu(SysMenu menu) - { + public int updateMenu(SysMenu menu) { return menuMapper.updateMenu(menu); } /** * 删除菜单管理信息 - * + * * @param menuId 菜单ID * @return 结果 */ @Override - public int deleteMenuById(Long menuId) - { + public int deleteMenuById(Long menuId) { return menuMapper.deleteMenuById(menuId); } /** * 校验菜单名称是否唯一 - * + * * @param menu 菜单信息 * @return 结果 */ @Override - public boolean checkMenuNameUnique(SysMenu menu) - { + public boolean checkMenuNameUnique(SysMenu menu) { Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId(); SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId()); - if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) - { + if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; @@ -348,16 +324,14 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 获取路由名称 - * + * * @param menu 菜单信息 * @return 路由名称 */ - public String getRouteName(SysMenu menu) - { + public String getRouteName(SysMenu menu) { String routerName = StringUtils.capitalize(menu.getPath()); // 非外链并且是一级目录(类型为目录) - if (isMenuFrame(menu)) - { + if (isMenuFrame(menu)) { routerName = StringUtils.EMPTY; } return routerName; @@ -365,27 +339,23 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 获取路由地址 - * + * * @param menu 菜单信息 * @return 路由地址 */ - public String getRouterPath(SysMenu menu) - { + public String getRouterPath(SysMenu menu) { String routerPath = menu.getPath(); // 内链打开外网方式 - if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) - { + if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) { routerPath = innerLinkReplaceEach(routerPath); } // 非外链并且是一级目录(类型为目录) if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType()) - && UserConstants.NO_FRAME.equals(menu.getIsFrame())) - { + && UserConstants.NO_FRAME.equals(menu.getIsFrame())) { routerPath = "/" + menu.getPath(); } // 非外链并且是一级目录(类型为菜单) - else if (isMenuFrame(menu)) - { + else if (isMenuFrame(menu)) { routerPath = "/"; } return routerPath; @@ -393,23 +363,17 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 获取组件信息 - * + * * @param menu 菜单信息 * @return 组件信息 */ - public String getComponent(SysMenu menu) - { + public String getComponent(SysMenu menu) { String component = UserConstants.LAYOUT; - if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu)) - { + if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu)) { component = menu.getComponent(); - } - else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu)) - { + } else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu)) { component = UserConstants.INNER_LINK; - } - else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) - { + } else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) { component = UserConstants.PARENT_VIEW; } return component; @@ -417,54 +381,48 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 是否为菜单内部跳转 - * + * * @param menu 菜单信息 * @return 结果 */ - public boolean isMenuFrame(SysMenu menu) - { + public boolean isMenuFrame(SysMenu menu) { return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType()) && menu.getIsFrame().equals(UserConstants.NO_FRAME); } /** * 是否为内链组件 - * + * * @param menu 菜单信息 * @return 结果 */ - public boolean isInnerLink(SysMenu menu) - { + public boolean isInnerLink(SysMenu menu) { return menu.getIsFrame().equals(UserConstants.NO_FRAME) && StringUtils.ishttp(menu.getPath()); } /** * 是否为parent_view组件 - * + * * @param menu 菜单信息 * @return 结果 */ - public boolean isParentView(SysMenu menu) - { + public boolean isParentView(SysMenu menu) { return menu.getParentId().intValue() != 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType()); } /** * 根据父节点的ID获取所有子节点 - * - * @param list 分类表 + * + * @param list 分类表 * @param parentId 传入的父节点ID * @return String */ - public List getChildPerms(List list, int parentId) - { + public List getChildPerms(List list, int parentId) { List returnList = new ArrayList(); - for (Iterator iterator = list.iterator(); iterator.hasNext();) - { + for (Iterator iterator = list.iterator(); iterator.hasNext(); ) { SysMenu t = (SysMenu) iterator.next(); // 一、根据传入的某个父节点ID,遍历该父节点的所有子节点 - if (t.getParentId() == parentId) - { + if (t.getParentId() == parentId) { recursionFn(list, t); returnList.add(t); } @@ -474,19 +432,16 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 递归列表 - * + * * @param list 分类表 - * @param t 子节点 + * @param t 子节点 */ - private void recursionFn(List list, SysMenu t) - { + private void recursionFn(List list, SysMenu t) { // 得到子节点列表 List childList = getChildList(list, t); t.setChildren(childList); - for (SysMenu tChild : childList) - { - if (hasChild(list, tChild)) - { + for (SysMenu tChild : childList) { + if (hasChild(list, tChild)) { recursionFn(list, tChild); } } @@ -495,15 +450,12 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 得到子节点列表 */ - private List getChildList(List list, SysMenu t) - { + private List getChildList(List list, SysMenu t) { List tlist = new ArrayList(); Iterator it = list.iterator(); - while (it.hasNext()) - { + while (it.hasNext()) { SysMenu n = (SysMenu) it.next(); - if (n.getParentId().longValue() == t.getMenuId().longValue()) - { + if (n.getParentId().longValue() == t.getMenuId().longValue()) { tlist.add(n); } } @@ -513,19 +465,17 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 判断是否有子节点 */ - private boolean hasChild(List list, SysMenu t) - { + private boolean hasChild(List list, SysMenu t) { return getChildList(list, t).size() > 0; } /** * 内链域名特殊字符替换 - * + * * @return 替换后的内链域名 */ - public String innerLinkReplaceEach(String path) - { - return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS, Constants.WWW, "." }, - new String[] { "", "", "", "/" }); + public String innerLinkReplaceEach(String path) { + return StringUtils.replaceEach(path, new String[]{Constants.HTTP, Constants.HTTPS, Constants.WWW, "."}, + new String[]{"", "", "", "/"}); } } diff --git a/God-Vue-master/god-system/src/main/resources/mapper/system/SysMenuMapper.xml b/God-Vue-master/god-system/src/main/resources/mapper/system/SysMenuMapper.xml index c1240251..e61eb906 100644 --- a/God-Vue-master/god-system/src/main/resources/mapper/system/SysMenuMapper.xml +++ b/God-Vue-master/god-system/src/main/resources/mapper/system/SysMenuMapper.xml @@ -1,202 +1,276 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - select menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time - from sys_menu + + select menu_id, + menu_name, + parent_id, + order_num, + path, + component, + `query`, + is_frame, + is_cache, + menu_type, + visible, + status, + ifnull(perms, '') as perms, + icon, + create_time + from sys_menu - + - - - - - - - - - - + + AND visible = #{visible} + + + AND status = #{status} + + + AND port_num = #{portNum} + + + AND distinction_num = #{distinctionNum} + + + order by parent_id, order_num + - - - - - - - - - - - - update sys_menu - - menu_name = #{menuName}, - parent_id = #{parentId}, - order_num = #{orderNum}, - path = #{path}, - component = #{component}, - `query` = #{query}, - is_frame = #{isFrame}, - is_cache = #{isCache}, - menu_type = #{menuType}, - visible = #{visible}, - status = #{status}, - perms = #{perms}, - icon = #{icon}, - remark = #{remark}, - update_by = #{updateBy}, - update_time = sysdate() - - where menu_id = #{menuId} - + - - insert into sys_menu( - menu_id, - parent_id, - menu_name, - order_num, - path, - component, - `query`, - is_frame, - is_cache, - menu_type, - visible, - status, - perms, - icon, - remark, - create_by, - create_time - )values( - #{menuId}, - #{parentId}, - #{menuName}, - #{orderNum}, - #{path}, - #{component}, - #{query}, - #{isFrame}, - #{isCache}, - #{menuType}, - #{visible}, - #{status}, - #{perms}, - #{icon}, - #{remark}, - #{createBy}, - sysdate() - ) - - - - delete from sys_menu where menu_id = #{menuId} - + + + + + + + + + + + + + + + + + + + + update sys_menu + + menu_name = #{menuName}, + parent_id = #{parentId}, + order_num = #{orderNum}, + path = #{path}, + component = #{component}, + `query` = #{query}, + is_frame = #{isFrame}, + is_cache = #{isCache}, + menu_type = #{menuType}, + visible = #{visible}, + status = #{status}, + perms = #{perms}, + icon = #{icon}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where menu_id = #{menuId} + + + + insert into sys_menu( + menu_id, + parent_id, + menu_name, + order_num, + path, + component, + `query`, + is_frame, + is_cache, + menu_type, + visible, + status, + perms, + icon, + remark, + create_by, + port_num, + distinction_num, + create_time + )values( + #{menuId}, + #{parentId}, + #{menuName}, + #{orderNum}, + #{path}, + #{component}, + #{query}, + #{isFrame}, + #{isCache}, + #{menuType}, + #{visible}, + #{status}, + #{perms}, + #{icon}, + #{remark}, + #{createBy}, + #{portNum}, + #{distinctionNum}, + sysdate() + ) + + + + delete + from sys_menu + where menu_id = #{menuId} + \ No newline at end of file diff --git a/god-ui/src/views/mountainForestSafety/role/index.vue b/god-ui/src/views/mountainForestSafety/role/index.vue index 0e408dcd..8393095b 100644 --- a/god-ui/src/views/mountainForestSafety/role/index.vue +++ b/god-ui/src/views/mountainForestSafety/role/index.vue @@ -341,7 +341,7 @@ export default { queryParams: { pageNum: 1, pageSize: 10, - distinctionNum: 1406, + distinctionNum: 91406, roleName: undefined, roleKey: undefined, status: undefined @@ -579,7 +579,7 @@ export default { /** 提交按钮 */ submitForm: function() { this.$refs['form'].validate(valid => { - this.form.distinctionNum = 1406 + this.form.distinctionNum = 91406 if (valid) { if (this.form.roleId != undefined) { this.form.menuIds = this.getMenuAllCheckedKeys() diff --git a/god-ui/src/views/mountainForestSafety/role/selectUser.vue b/god-ui/src/views/mountainForestSafety/role/selectUser.vue index e8274f1f..1f868f58 100644 --- a/god-ui/src/views/mountainForestSafety/role/selectUser.vue +++ b/god-ui/src/views/mountainForestSafety/role/selectUser.vue @@ -80,7 +80,7 @@ export default { queryParams: { pageNum: 1, pageSize: 10, - distinctionNum: 1406, + distinctionNum: 91406, roleId: undefined, userName: undefined, phonenumber: undefined diff --git a/god-ui/src/views/mountainForestSafety/user/index.vue b/god-ui/src/views/mountainForestSafety/user/index.vue index a642c237..296e6161 100644 --- a/god-ui/src/views/mountainForestSafety/user/index.vue +++ b/god-ui/src/views/mountainForestSafety/user/index.vue @@ -407,7 +407,7 @@ export default { queryParams: { pageNum: 1, pageSize: 10, - distinctionNum: 1406, + distinctionNum: 91406, userName: undefined, phonenumber: undefined, status: undefined, @@ -607,7 +607,7 @@ export default { /** 提交按钮 */ submitForm: function() { this.$refs["form"].validate(valid => { - this.form.distinctionNum = 1406 + this.form.distinctionNum = 91406 if (valid) { if (this.form.userId != undefined) { updateUser(this.form).then(response => {