Преглед изворни кода

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	boman-modules/boman-system/src/main/java/com/boman/system/service/impl/SysUserServiceImpl.java
Administrator пре 4 година
родитељ
комит
7c09448fdd
37 измењених фајлова са 385 додато и 613 уклоњено
  1. 9 0
      boman-api/boman-api-system/src/main/java/com/boman/system/api/RemoteMenuService.java
  2. 1 1
      boman-api/boman-domain/src/main/java/com.boman.domain/dto/RoleMenuDto.java
  3. 1 1
      boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/JSONArrayUtils.java
  4. 16 1
      boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/collection/CollectionUtils.java
  5. 43 20
      boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/obj/ObjectUtils.java
  6. 2 2
      boman-modules/boman-gen/src/main/java/com/boman/gen/service/LoadTableServerImpl.java
  7. 13 1
      boman-modules/boman-system/src/main/java/com/boman/system/controller/SysMenuController.java
  8. 10 2
      boman-modules/boman-system/src/main/java/com/boman/system/mapper/SysMenuMapper.java
  9. 2 1
      boman-modules/boman-system/src/main/java/com/boman/system/mapper/SysRoleMenuMapper.java
  10. 19 2
      boman-modules/boman-system/src/main/java/com/boman/system/service/ISysMenuService.java
  11. 2 1
      boman-modules/boman-system/src/main/java/com/boman/system/service/impl/ISysRoleMenuService.java
  12. 27 20
      boman-modules/boman-system/src/main/java/com/boman/system/service/impl/SysMenuServiceImpl.java
  13. 30 11
      boman-modules/boman-system/src/main/java/com/boman/system/service/impl/SysRoleMenuServiceImpl.java
  14. 7 4
      boman-modules/boman-system/src/main/java/com/boman/system/service/impl/SysUserServiceImpl.java
  15. 20 3
      boman-modules/boman-system/src/main/resources/mapper/system/SysMenuMapper.xml
  16. 5 0
      boman-modules/boman-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml
  17. 37 14
      boman-web-core/src/main/java/com/boman/web/core/service/TableServiceCmdService.java
  18. 4 6
      boman-web-core/src/main/java/com/boman/web/core/service/select/BaseSelectServiceImpl.java
  19. 1 1
      boman-web-core/src/main/java/com/boman/web/core/service/update/BaseUpdateServiceImpl.java
  20. 3 1
      ruoyi-ui/package.json
  21. 10 0
      ruoyi-ui/src/api/modeler.js
  22. 4 3
      ruoyi-ui/src/components/DynamicForms/index.vue
  23. 4 12
      ruoyi-ui/src/components/FlowChartComponent/index.vue
  24. 1 1
      ruoyi-ui/src/components/FormItemComponent/index.vue
  25. 3 3
      ruoyi-ui/src/components/ItemComponent/index.vue
  26. 16 16
      ruoyi-ui/src/components/ParameterConfiguration/index.vue
  27. 23 14
      ruoyi-ui/src/components/listModalComponent/index.vue
  28. 3 2
      ruoyi-ui/src/main.js
  29. 4 1
      ruoyi-ui/src/store/modules/settings.js
  30. 0 435
      ruoyi-ui/src/views/activiti/TemplateManagementLists/index.vue
  31. 23 11
      ruoyi-ui/src/views/activiti/TemplateManagementNew/index.vue
  32. 2 2
      ruoyi-ui/src/views/activiti/modeler/index.vue
  33. 2 1
      ruoyi-ui/src/views/index.vue
  34. 30 12
      ruoyi-ui/src/views/system/permissions/index.vue
  35. 1 1
      ruoyi-ui/src/views/system/role/fz-index.vue
  36. 3 3
      ruoyi-ui/src/views/system/table/index.vue
  37. 4 4
      ruoyi-ui/src/views/system/user/index.vue

+ 9 - 0
boman-api/boman-api-system/src/main/java/com/boman/system/api/RemoteMenuService.java

@@ -23,5 +23,14 @@ public interface RemoteMenuService {
      */
     @GetMapping("/menu/listMenusByUserId/{userId}")
     List<SysMenu> listMenusByUserId(@PathVariable("userId") Long userId);
+
+    /**
+     * 根据用户ID查询按钮
+     *
+     * @param userId 用户ID
+     * @return 菜单列表
+     */
+    @GetMapping("/menu/listBtnByUserId/{userId}")
+    List<SysMenu> listBtnByUserId(@PathVariable("userId") Long userId);
 }
 

+ 1 - 1
boman-api/boman-domain/src/main/java/com.boman.domain/dto/RoleMenuDto.java

@@ -23,7 +23,7 @@ public class RoleMenuDto {
     public static String getBtnFromPerms(String perms) {
         // sys_user:A
         String[] split = perms.split(":");
-        if (split.length != 2) {
+        if (split.length == 0) {
             throw new IllegalArgumentException("menu对应的perms未配置");
         }
         // A

+ 1 - 1
boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/JSONArrayUtils.java

@@ -10,7 +10,7 @@ import com.boman.common.core.utils.obj.ObjectUtils;
 public class JSONArrayUtils {
     
     public static long[] jsonArrayToLongArray(JSONArray jsonArray){
-        ObjectUtils.requireNonNull(jsonArray);
+        ObjectUtils.requireNonNull(jsonArray, "jsonArrayToLongArray jsonArray is empty");
         long[] result = new long[jsonArray.size()];
         for (int i = 0; i < jsonArray.size(); i++) {
             result[i] = jsonArray.getLong(i);

+ 16 - 1
boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/collection/CollectionUtils.java

@@ -4,6 +4,7 @@ import com.boman.common.core.utils.obj.ObjectUtils;
 
 import java.util.Collection;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @author shiqian
@@ -12,11 +13,25 @@ import java.util.List;
 public class CollectionUtils {
 
     public static Long[] listToArray(List<Long> longList){
-        ObjectUtils.requireNonNull(longList);
+        ObjectUtils.requireNonNull(longList, "listToArray input data is empty");
         return longList.toArray(new Long[0]);
     }
 
     public static boolean containsIgnoreCase(Collection<String> list, String key) {
         return list.contains(key.toLowerCase()) || list.contains(key.toUpperCase());
     }
+
+    public static <T> String listToString(List<T> list){
+        StringBuilder buffer = new StringBuilder();
+        for (T t : list) {
+            buffer.append(t);
+        }
+
+        return buffer.toString();
+    }
+
+    public static <T> List<T> addAllDistinct(List<T> one, List<T> another) {
+        one.addAll(another);
+        return one.stream().distinct().collect(Collectors.toList());
+    }
 }

+ 43 - 20
boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/obj/ObjectUtils.java

@@ -20,9 +20,16 @@ public class ObjectUtils {
     private static final String NULL = "null";
     private static final String UNDEFINED = "undefined";
 
-    public static  <T> Collection<T> requireNonNull(Collection<T> input, String... errorMsg){
+    public static  <T> Collection<T> requireNonNull(Collection<T> input, String errorMsg){
         if (null == input || input.size() == 0) {
-            throw new IllegalArgumentException(errorMsg[0]);
+            throw new IllegalArgumentException(errorMsg);
+        }
+        return input;
+    }
+
+    public static  <T> List<T> requireNonNull(List<T> input, String errorMsg){
+        if (null == input || input.size() == 0) {
+            throw new IllegalArgumentException(errorMsg);
         }
         return input;
     }
@@ -35,40 +42,40 @@ public class ObjectUtils {
         return !isEmpty(input);
     }
 
-    public static long[] requireNonNull(long[] input, String... errorMsg){
+    public static long[] requireNonNull(long[] input, String errorMsg){
         if (ArrayUtils.isEmpty(input)) {
-            throw new IllegalArgumentException(errorMsg[0]);
+            throw new IllegalArgumentException(errorMsg);
         }
 
         return input;
     }
 
 
-    public static Long[] requireNonNull(Long[] input, String... errorMsg){
+    public static Long[] requireNonNull(Long[] input, String errorMsg){
         if (ArrayUtils.isEmpty(input)) {
-            throw new IllegalArgumentException(errorMsg[0]);
+            throw new IllegalArgumentException(errorMsg);
         }
 
         return input;
     }
 
-    public static Boolean requireNonNull(Boolean input, String... errorMsg) {
+    public static Boolean requireNonNull(Boolean input, String errorMsg) {
         if (input == null) {
-            throw new IllegalArgumentException(errorMsg[0]);
+            throw new IllegalArgumentException(errorMsg);
         }
         return input;
     }
 
-    public static <T> T requireNonNull(T input, String... errorMsg) {
+    public static <T> T requireNonNull(T input, String errorMsg) {
         if (input == null) {
-            throw new IllegalArgumentException(errorMsg[0]);
+            throw new IllegalArgumentException(errorMsg);
         }
         return input;
     }
 
-    public static Integer requireNonNull(Integer input, String... errorMsg) {
+    public static Integer requireNonNull(Integer input, String errorMsg) {
         if (input == null || input < 0) {
-            throw new IllegalArgumentException(errorMsg[0]);
+            throw new IllegalArgumentException(errorMsg);
         }
         return input;
     }
@@ -90,24 +97,24 @@ public class ObjectUtils {
         return !isEmpty(input);
     }
 
-    public static String requireNonNull(String input, String... errorMsg) {
+    public static String requireNonNull(String input, String errorMsg) {
         if (input == null || input.isEmpty() || NULL.equalsIgnoreCase(input) || UNDEFINED.equalsIgnoreCase(input)) {
-            throw new IllegalArgumentException(errorMsg[0]);
+            throw new IllegalArgumentException(errorMsg);
         }
         return input;
     }
 
-    public static int requireNonNull(int input, String... errorMsg) {
+    public static int requireNonNull(int input, String errorMsg) {
         if (input <= 0) {
-            throw new IllegalArgumentException(errorMsg[0]);
+            throw new IllegalArgumentException(errorMsg);
         }
         return input;
     }
 
 
-    public static JSONObject requireNonNull(JSONObject input, String... errorMsg) {
+    public static JSONObject requireNonNull(JSONObject input, String errorMsg) {
         if (input == null || input.isEmpty()) {
-            throw new IllegalArgumentException(errorMsg[0]);
+            throw new IllegalArgumentException(errorMsg);
         }
         return input;
     }
@@ -180,9 +187,9 @@ public class ObjectUtils {
         return !isEmpty(input);
     }
 
-    public static JSONArray requireNonNull(JSONArray input, String... errorMsg) {
+    public static JSONArray requireNonNull(JSONArray input, String errorMsg) {
         if (input == null || input.isEmpty()) {
-            throw new IllegalArgumentException(errorMsg[0]);
+            throw new IllegalArgumentException(errorMsg);
         }
         return input;
     }
@@ -255,6 +262,22 @@ public class ObjectUtils {
                 .stream().map(function).distinct().collect(Collectors.toList());
     }
 
+    /**
+     * 功能描述: 根据规则获取
+     *
+     * @param input    原数据
+     * @param function FunctionalInterface
+     * @return java.util.List<T>
+     */
+    public static <T, R> List<R> mapFilter(List<T> input, Function<T, R> function, Predicate<T> predicate) {
+        return requireNonNull(input, "list is null")
+                .stream()
+                .filter(predicate)
+                .map(function)
+                .distinct()
+                .collect(Collectors.toList());
+    }
+
 
     /**
      * 功能描述: 根据规则获取单个

+ 2 - 2
boman-modules/boman-gen/src/main/java/com/boman/gen/service/LoadTableServerImpl.java

@@ -47,12 +47,12 @@ public class LoadTableServerImpl implements ILoadTableServer{
     @Override
     public AjaxResult loadTable(GenTable genTable) {
         List<GenTable> tableList = genTableService.selectGenTableList(genTable);
-        requireNonNull(tableList);
+        requireNonNull(tableList, "tableList is empty");
 
         // load table and tableColumn
         List<Long> tableIdList = tableList.stream().map(GenTable::getId).collect(Collectors.toList());
         List<GenTableColumn> genTableColumns = genTableColumnService.listByTableIdList(tableIdList);
-        requireNonNull(genTableColumns);
+        requireNonNull(genTableColumns, "genTableColumns is empty");
         packTableAndInsertToRedis(tableList, genTableColumns);
 
         List<GenTableRelation> relationList = genTableRelationService.selectGenTableRelationList(new GenTableRelation());

+ 13 - 1
boman-modules/boman-system/src/main/java/com/boman/system/controller/SysMenuController.java

@@ -235,7 +235,19 @@ public class SysMenuController extends BaseController
     public AjaxResult getRouters()
     {
         Long userId = SecurityUtils.getUserId();
-        List<SysMenu> menus = menuService.selectMenuTreeById(userId);
+        List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
         return AjaxResult.success(menuService.buildMenus(menus));
     }
+
+    /**
+     * 根据用户ID查询按钮
+     *
+     * @param userId 用户ID
+     * @return 菜单列表
+     */
+    @GetMapping("listBtnByUserId/{userId}")
+    public List<SysMenu> listBtnByUserId(@PathVariable("userId") Long userId) {
+        return menuService.listBtnByUserId(userId);
+    }
+
 }

+ 10 - 2
boman-modules/boman-system/src/main/java/com/boman/system/mapper/SysMenuMapper.java

@@ -53,10 +53,18 @@ public interface SysMenuMapper
     /**
      * 根据用户ID查询菜单
      * 
-     * @param id 用户ID
+     * @param userId 用户ID
+     * @return 菜单列表
+     */
+    public List<SysMenu> selectMenuTreeByUserId(Long userId);
+
+    /**
+     * 根据用户ID查询按钮
+     *
+     * @param userId 用户ID
      * @return 菜单列表
      */
-    public List<SysMenu> selectMenuTreeById(Long id);
+    List<SysMenu> listBtnByUserId(Long userId);
 
     /**
      * 根据角色ID查询菜单树信息

+ 2 - 1
boman-modules/boman-system/src/main/java/com/boman/system/mapper/SysRoleMenuMapper.java

@@ -32,9 +32,10 @@ public interface SysRoleMenuMapper
      * 功能描述: 通过角色ID批量删除角色和菜单关联
      *
      * @param roleIdList roleIdList
+     * @param menuIdList menuIdList
      * @return int
      */
-    public int deleteByRoleIdList(@Param("roleIdList") List<Long> roleIdList);
+    public int deleteByRoleIdList(@Param("roleIdList") List<Long> roleIdList, @Param("menuIdList") List<Long> menuIdList);
 
     /**
      * 批量删除角色菜单关联信息

+ 19 - 2
boman-modules/boman-system/src/main/java/com/boman/system/service/ISysMenuService.java

@@ -56,10 +56,10 @@ public interface ISysMenuService
     /**
      * 根据用户ID查询菜单树信息
      * 
-     * @param id 用户ID
+     * @param userId 用户ID
      * @return 菜单列表
      */
-    public List<SysMenu> selectMenuTreeById(Long id);
+    public List<SysMenu> selectMenuTreeByUserId(Long userId);
 
     /**
      * 功能描述: 根据菜单id,找到此菜单以及子菜单下所有的叶子节点
@@ -184,4 +184,21 @@ public interface ISysMenuService
      */
     List<SysMenu>  listTreeByRoleId(Long roleId);
 
+    /**
+     * 功能描述: 找到sonMenus对应的所有的父类,结果存放于result中
+     *
+     * @param allMenus    allMenus
+     * @param targetMenus 就是查他的祖宗
+     * @param parentList  targetMenus中所有的祖宗都在这里面
+     */
+    void recGetParent(List<SysMenu> allMenus, List<SysMenu> targetMenus, List<SysMenu> parentList);
+
+    /**
+     * 根据用户ID查询按钮
+     *
+     * @param userId 用户ID
+     * @return 菜单列表
+     */
+    List<SysMenu> listBtnByUserId(Long userId);
+
 }

+ 2 - 1
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/ISysRoleMenuService.java

@@ -24,9 +24,10 @@ public interface ISysRoleMenuService {
      * 功能描述: 根据roleIdList删除
      *
      * @param roleIdList roleIdList
+     * @param menuIdList menuIdList
      * @return int
      */
-    int deleteByRoleIdList(List<Long> roleIdList);
+    int deleteByRoleIdList(List<Long> roleIdList, List<Long> menuIdList);
 
     /**
      * 功能描述: 批量保存roleMenuList

+ 27 - 20
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/SysMenuServiceImpl.java

@@ -130,16 +130,16 @@ public class SysMenuServiceImpl implements ISysMenuService {
     /**
      * 根据用户ID查询菜单
      *
-     * @param id 用户名称
+     * @param userId 用户名称
      * @return 菜单列表
      */
     @Override
-    public List<SysMenu> selectMenuTreeById(Long id) {
+    public List<SysMenu> selectMenuTreeByUserId(Long userId) {
         List<SysMenu> menus = null;
-        if (SecurityUtils.isAdmin(id)) {
+        if (SecurityUtils.isAdmin(userId)) {
             menus = menuMapper.selectMenuTreeAll();
         } else {
-            menus = menuMapper.selectMenuTreeById(id);
+            menus = menuMapper.selectMenuTreeByUserId(userId);
         }
         return getChildPerms(menus, 0);
     }
@@ -517,12 +517,11 @@ public class SysMenuServiceImpl implements ISysMenuService {
      */
     public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId) {
         List<SysMenu> returnList = new ArrayList<SysMenu>();
-        for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext(); ) {
-            SysMenu t = (SysMenu) iterator.next();
+        for (SysMenu menu : list) {
             // 一、根据传入的某个父节点ID,遍历该父节点的所有子节点
-            if (t.getParentId() == parentId) {
-                recursionFn(list, t);
-                returnList.add(t);
+            if (menu.getParentId() == parentId) {
+                recursionFn(list, menu);
+                returnList.add(menu);
             }
         }
         return returnList;
@@ -667,7 +666,12 @@ public class SysMenuServiceImpl implements ISysMenuService {
         List<String> btnList = Lists.newArrayList();
         for (SysMenu childMenu : childList) {
             if (roleMenuIdList.contains(childMenu.getId())) {
-                String btn = RoleMenuDto.getBtnFromPerms(childMenu.getPerms());
+                String perms = childMenu.getPerms();
+                if (isEmpty(perms)) {
+                    throw new IllegalArgumentException("[" + childMenu.getMenuName() + "]菜单未配置权限标识");
+                }
+
+                String btn = RoleMenuDto.getBtnFromPerms(perms);
                 btnList.add(btn);
             }
         }
@@ -707,8 +711,9 @@ public class SysMenuServiceImpl implements ISysMenuService {
      * @param sonMenus sonMenus
      * @param result   没有按照规则排序只是把父类全部存放于result中
      */
-    private void recGetParent(List<SysMenu> allMenus, List<SysMenu> roleMenus, List<SysMenu> result) {
-        for (SysMenu sonMenu : roleMenus) {
+    @Override
+    public void recGetParent(List<SysMenu> allMenus, List<SysMenu> targetMenus, List<SysMenu> result) {
+        for (SysMenu sonMenu : targetMenus) {
             for (SysMenu parentMenu : allMenus) {
                 if (sonMenu.getParentId().equals(parentMenu.getId())) {
                     if (isNotEmpty(result)) {
@@ -742,14 +747,16 @@ public class SysMenuServiceImpl implements ISysMenuService {
         }
     }
 
-    // 得到子节点列表
-//    List<SysMenu> childList = getChildList(list, t);
-//        t.setChildren(childList);
-//        for (SysMenu tChild : childList) {
-//        if (hasChild(list, tChild)) {
-//            recursionFn(list, tChild);
-//        }
-//    }
+    /**
+     * 根据用户ID查询按钮
+     *
+     * @param userId 用户ID
+     * @return 菜单列表
+     */
+    @Override
+    public List<SysMenu> listBtnByUserId(Long userId) {
+        return menuMapper.listBtnByUserId(userId);
+    }
 
     private void switchBtn(List<Map<String, Object>> containsHead, String btn, Object value) {
         Map<String, Object> jsonObject = new HashMap<>(2);

+ 30 - 11
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/SysRoleMenuServiceImpl.java

@@ -1,5 +1,6 @@
 package com.boman.system.service.impl;
 
+import com.boman.common.core.utils.collection.CollectionUtils;
 import com.boman.domain.constant.TableNameConst;
 import com.boman.domain.dto.RoleMenuDto;
 import com.boman.system.api.domain.SysMenu;
@@ -41,31 +42,43 @@ public class SysRoleMenuServiceImpl implements ISysRoleMenuService{
     /**
      * 功能描述: 批量保存roleMenu
      *
-     * @param dto dto
+     * @param dtos dtos
      * @return int
      */
     @Override
     @Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
     public int saveList(List<RoleMenuDto> dtos) {
         int effective = 0;
+        List<SysMenu> allMenus =menuService.selectMenuListAll(new SysMenu());
         for (RoleMenuDto dto : dtos) {
             Long menuId = requireNonNull(dto.getMenuId(), "menuId is empty");
             Long roleId = requireNonNull(dto.getRoleId(), "roleId is empty");
+
             SysMenu menu = requireNonNull(menuService.selectMenuById(menuId), "根据menuId = [" + menuId + "], 未找到菜单");
-            List<String> head = dto.getHead();
-            requireNonNull(head, "操作为空");
-            List<SysMenu> allMenus = menuService.selectMenuListAll(new SysMenu());
+            // 当前menu的祖宗十八代都在里面
+            List<SysMenu> parentList = Lists.newArrayListWithCapacity(16);
+            // 此方法只找到menu的祖宗十八代,但是不包含自己
+            menuService.recGetParent(allMenus, Collections.singletonList(menu), parentList);
+            parentList.add(menu);
+
+            List<String> head = requireNonNull(dto.getHead(), "操作为空");
             List<SysMenu> childList = menuService.getChildList(allMenus, menu);
             if (isEmpty(childList)) {
                 return 0;
             }
 
+            // 父类下所有的子类
+            List<SysMenu> originChildList = Lists.newArrayList(childList);
+            // 把parentList放进去
+            childList.addAll(parentList);
             // 根据子菜单和前台传过来的head来判断包含AMD...中的哪些
             childList = buildBtnByHead(head, childList);
-            List<SysRoleMenu> roleMenuList = buildRoleMenu(roleId, map(childList, SysMenu::getId));
-            // 先删除,再添加,防止联合索引报错
+            List<Long> childIdList = map(childList, SysMenu::getId);
+            List<SysRoleMenu> roleMenuList = buildRoleMenu(roleId, childIdList);
+            List<Long> distinct = CollectionUtils.addAllDistinct(childIdList, map(originChildList, SysMenu::getId));
             try {
-                deleteByRoleIdList(Collections.singletonList(roleId));
+                // 先删除,再添加,防止联合索引报错
+                deleteByRoleIdList(Collections.singletonList(roleId), distinct);
                 effective += batchRoleMenu(roleMenuList);
             } catch (Exception e) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -86,9 +99,14 @@ public class SysRoleMenuServiceImpl implements ISysRoleMenuService{
     private List<SysMenu> buildBtnByHead(List<String> head, List<SysMenu> menuList) {
         List<SysMenu> result = Lists.newArrayListWithCapacity(menuList.size());
         for (SysMenu menu : menuList) {
+            if (!"F".equalsIgnoreCase(menu.getMenuType())) {
+                result.add(menu);
+                continue;
+            }
+
             String perms = menu.getPerms();
             if (isEmpty(perms)) {
-                continue;
+                throw new IllegalArgumentException(menu.getMenuName() + " 未配置权限标识, 请配置以后再次保存");
             }
 
             if (head.contains(RoleMenuDto.getBtnFromPerms(menu.getPerms()))) {
@@ -103,14 +121,15 @@ public class SysRoleMenuServiceImpl implements ISysRoleMenuService{
      * 功能描述: 根据roleIdList删除
      *
      * @param roleIdList roleIdList
+     * @param menuIdList menuIdList
      * @return int
      */
     @Override
-    public int deleteByRoleIdList(List<Long> roleIdList) {
-        if (isEmpty(roleIdList)) {
+    public int deleteByRoleIdList(List<Long> roleIdList, List<Long> menuIdList) {
+        if (isEmpty(roleIdList) ||isEmpty(menuIdList) ) {
             return 0;
         }
-        return mapper.deleteByRoleIdList(roleIdList);
+        return mapper.deleteByRoleIdList(roleIdList, menuIdList);
     }
 
     /**

+ 7 - 4
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/SysUserServiceImpl.java

@@ -1,7 +1,10 @@
 package com.boman.system.service.impl;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
+
+import com.boman.common.core.utils.obj.ObjectUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -466,10 +469,10 @@ public class SysUserServiceImpl implements ISysUserService
      */
     @Override
     public List<SysUser> listByDeptId(List<Long> deptIdList) {
-        List<SysUser> sysUsers = new ArrayList<>();
-        if(deptIdList != null && deptIdList.size() > 0){
-             sysUsers = userMapper.listByDeptId(deptIdList);
+        if (ObjectUtils.isEmpty(deptIdList)) {
+            return Collections.emptyList();
         }
-        return  sysUsers;
+
+        return userMapper.listByDeptId(deptIdList);
     }
 }

+ 20 - 3
boman-modules/boman-system/src/main/resources/mapper/system/SysMenuMapper.xml

@@ -79,17 +79,34 @@
 		order by m.parent_id, m.order_num
 	</select>
     
-    <select id="selectMenuTreeById" parameterType="Long" resultMap="SysMenuResult">
+    <select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
 		select distinct m.id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time, m.create_by, m.update_by, m.update_time, m.remark, m.sys_table_name
 		from sys_menu m
 			 left join sys_role_menu rm on m.id = rm.menu_id
 			 left join sys_user_role ur on rm.role_id = ur.role_id
 			 left join sys_role ro on ur.role_id = ro.id
 			 left join sys_user u on ur.user_id = u.id
-		where u.id = #{id} and m.menu_type in ('M', 'C') and m.status = 0  AND ro.status = 0
+		where u.id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0  AND ro.status = 0
 		order by m.parent_id, m.order_num
 	</select>
-	
+
+	<select id="listBtnByUserId" parameterType="Long" resultMap="SysMenuResult">
+		select distinct m.id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as
+		perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time, m.create_by, m.update_by,
+		m.update_time, m.remark, m.sys_table_name
+		from sys_menu m
+		left join sys_role_menu rm on m.id = rm.menu_id
+		left join sys_user_role ur on rm.role_id = ur.role_id
+		left join sys_role ro on ur.role_id = ro.id
+		left join sys_user u on ur.user_id = u.id
+		where m.menu_type in ('F')
+		<if test="userId != null and userId != ''">
+			and u.id = #{userId}
+		</if>
+		and m.status = 0 AND ro.status = 0
+		order by m.parent_id, m.order_num
+	</select>
+
 	<select id="selectMenuListByRoleId" resultType="java.lang.Integer">
 		select m.id
 		from sys_menu m

+ 5 - 0
boman-modules/boman-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml

@@ -42,6 +42,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<foreach collection="roleIdList" item="roleId" open="(" separator="," close=")">
 			#{roleId}
 		</foreach>
+		and menu_id in
+		<foreach collection="menuIdList" item="menuId" open="(" separator="," close=")">
+			#{menuId}
+		</foreach>
+
 	</delete>
 	
 	<delete id="deleteRoleMenu" parameterType="Long">

+ 37 - 14
boman-web-core/src/main/java/com/boman/web/core/service/TableServiceCmdService.java

@@ -14,9 +14,12 @@ import com.boman.common.redis.service.RedisService;
 import com.boman.domain.GenTable;
 import com.boman.domain.GenTableColumn;
 import com.boman.domain.constant.*;
+import com.boman.domain.dto.RoleMenuDto;
 import com.boman.domain.exception.NoSuchFunctionException;
 import com.boman.gen.api.RemoteGenTableColumnService;
 import com.boman.gen.api.RemoteGenTableService;
+import com.boman.system.api.RemoteMenuService;
+import com.boman.system.api.domain.SysMenu;
 import com.boman.web.core.domain.ActionType;
 import com.boman.web.core.domain.FormDataDto;
 import com.boman.web.core.domain.RowResult;
@@ -82,6 +85,8 @@ public class TableServiceCmdService {
     private RemoteGenTableService remoteGenTableService;
     @Resource
     private RemoteGenTableColumnService remoteGenTableColumnService;
+    @Resource
+    private RemoteMenuService remoteMenuService;
 
     private static final Logger LOGGER = LoggerFactory.getLogger(TableServiceCmdService.class);
 
@@ -199,7 +204,7 @@ public class TableServiceCmdService {
     public AjaxResult objectLogicDelete(FormDataDto dto) {
         requireNonNull(dto.getTable(), "tableName = [" + dto.getTable() + "] 此表不存在");
         Long[] idArr = CollectionUtils.listToArray(dto.getIdList());
-        requireNonNull(idArr);
+        requireNonNull(idArr, "objectLogicDelete idArr is empty");
 
         // 拿到pkName
         GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, dto.getTable());
@@ -380,12 +385,7 @@ public class TableServiceCmdService {
             if (GenTableColumn.IS_QUERY.equalsIgnoreCase(column.getIsQuery())) {
                 String dictType = column.getDictType();
                 if (ObjectUtils.isNotEmpty(dictType)) {
-                    try {
-                        column.setSysDictData(listSysDictDataByType(dictType));
-                    } catch (Exception e) {
-                        System.out.println("sq_dictType = " + dictType);
-                        e.printStackTrace();
-                    }
+                    column.setSysDictData(listSysDictDataByType(dictType));
                 }
 
                 queryList.add(column);
@@ -393,14 +393,37 @@ public class TableServiceCmdService {
         }
 
         jsonObject.put(FormDataConstant.QUERY_LIST, queryList);
-        // genTable.getMenuRole() 暂时数据库没有数据,
-        jsonObject.put(FormDataConstant.BUTTON_LIST, Strings.nullToEmpty(genTable.getMenuRole()));
 
+        List<String> btns = buildBtnList(genTable.getTableName());
+        jsonObject.put(FormDataConstant.BUTTON_LIST, Strings.nullToEmpty(CollectionUtils.listToString(btns)));
         jsonObject.put(ViewTypeConst.VIEW_TYPE, Strings.nullToEmpty(genTable.getTplCategory()));
         jsonObject.put(RULES, packRequireColumn(columns));
         return AjaxResult.success(jsonObject);
     }
 
+    /**
+     * 功能描述: 查找当前登陆人操作的表对应的btn
+     *
+     * @param tableName tableName
+     * @return java.util.List<java.lang.String>
+     */
+    private List<String> buildBtnList(String tableName) {
+        List<SysMenu> menus = remoteMenuService.listBtnByUserId(SecurityUtils.getUserId());
+        if (isEmpty(menus)) {
+            return Collections.emptyList();
+        }
+
+        List<String> permses = map(menus, SysMenu::getPerms);
+        ArrayList<String> btns = Lists.newArrayListWithCapacity(permses.size());
+        for (String perms : permses) {
+            if (perms.contains(tableName)) {
+                btns.add(RoleMenuDto.getBtnFromPerms(perms));
+            }
+        }
+
+        return btns;
+    }
+
     /**
      * 功能描述: 获取表单查询字段
      * 注意: 都是从redis中拿的,如果数据库和redis不一致,则需刷新一下redis
@@ -494,7 +517,7 @@ public class TableServiceCmdService {
         List<Long> idList = map(commitData, jsonObject -> jsonObject.getLong(FormDataConstant.ID));
 
         List<JSONObject> beforeList = selectService.selectByIdList(tableName, pkName, idList, Lists.newArrayList(pkName, STATUS));
-        requireNonNull(beforeList);
+        requireNonNull(beforeList, "beforeList is empty");
 
         for (JSONObject commitDatum : commitData) {
             String dbStatus = getStatusFromFormData(commitDatum, beforeList);
@@ -558,8 +581,8 @@ public class TableServiceCmdService {
      * @return 结果
      */
     public List<JSONObject> isCustomized(String tableName, List<JSONObject> result, String action) {
-        requireNonNull(tableName);
-        requireNonNull(action);
+        requireNonNull(tableName, "tableName is empty");
+        requireNonNull(action, "action is empty");
         if (result != null && result.size() > 0) {
             //获取到服务名称
             String triggerName = getTriggerName(tableName, action);
@@ -580,7 +603,7 @@ public class TableServiceCmdService {
      */
     private String getTriggerName(String tableName, String action) {
         GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, tableName);
-        requireNonNull(genTable);
+        requireNonNull(genTable, "genTable empty");
         if (action.equals(TriggerActionConstant.ACTION_CREATE)) {
             return genTable.getTriggerCreate();
         } else if (action.equals(TriggerActionConstant.ACTION_RETRIEVE)) {
@@ -604,7 +627,7 @@ public class TableServiceCmdService {
      */
     public GenTable getTableFromRedisByTableName(String redisKeyPrefix, String tableName) {
         tableName = tableName.trim().toLowerCase();
-        String key = requireNonNull(redisKeyPrefix) + requireNonNull(tableName);
+        String key = requireNonNull(redisKeyPrefix, "redisKeyPrefix is empty") + requireNonNull(tableName, "tableName is empty");
         GenTable genTable = redisService.getCacheObject(key);
         if (ObjectUtils.isEmpty(genTable)) {
             genTable = remoteGenTableService.getByTableName(tableName);

+ 4 - 6
boman-web-core/src/main/java/com/boman/web/core/service/select/BaseSelectServiceImpl.java

@@ -44,16 +44,14 @@ public class BaseSelectServiceImpl implements IBaseSelectService {
      * @param condition     原始查询条件
      * @param packCondition 封装的查询条件
      * @param showData      前台需要查询的列
-     * @param orderBy       orderBy
-     * @param limit         分页
-     * @param offset        分页
+     * @param dto           orderBy limit offset
      * @return java.util.List<com.alibaba.fastjson.JSONObject>
      */
     @Override
     public List<JSONObject> selectByCondition(String tableName, JSONObject condition, JSONObject packCondition, JSONArray showData, FormDataDto dto) {
         requireNonNull(tableName, "表名为空");
         requireNonNull(showData, "表: [" + tableName + "] , 过滤了可展示字段,一个展示字段都没有,还查个鬼啊");
-        String orderBy = requireNonNull(dto.getOrderBy());
+        String orderBy = requireNonNull(dto.getOrderBy(), "order by is empty");
         return mapper.selectByCondition(tableName, condition, packCondition, showData, orderBy, dto.getLimit(), dto.getOffset());
     }
 
@@ -122,7 +120,7 @@ public class BaseSelectServiceImpl implements IBaseSelectService {
     public JSONObject selectById(String tableName, String pkName, Long id) {
         requireNonNull(tableName, "表名为空");
         requireNonNull(pkName, "主键名称为空");;
-        requireNonNull(id);
+        requireNonNull(id, "selectById id is empty");
         return mapper.selectById(tableName, pkName, id);
     }
 
@@ -139,7 +137,7 @@ public class BaseSelectServiceImpl implements IBaseSelectService {
     public List<JSONObject> selectByIdList(String tableName, String pkName, List<Long> idList, List<String> showData) {
         requireNonNull(tableName, "表名为空");
         requireNonNull(pkName, "主键名称为空");;
-        requireNonNull(idList);
+        requireNonNull(idList, "selectByIdList idList is empty");
 
         return mapper.selectByIdList(tableName, pkName, idList, showData);
     }

+ 1 - 1
boman-web-core/src/main/java/com/boman/web/core/service/update/BaseUpdateServiceImpl.java

@@ -54,7 +54,7 @@ public class BaseUpdateServiceImpl implements IBaseUpdateService {
     }
 
     private JSONObject escapeByQueryType(List<GenTableColumn> columns, JSONObject commitData) {
-        requireNonNull(columns);
+        requireNonNull(columns, "columns is empty");
         JSONObject result = new JSONObject(columns.size());
         for (Map.Entry<String, Object> entry : commitData.entrySet()) {
             String key = entry.getKey();

+ 3 - 1
ruoyi-ui/package.json

@@ -77,7 +77,9 @@
     "sass-loader": "10.1.0",
     "script-ext-html-webpack-plugin": "2.1.5",
     "svg-sprite-loader": "5.1.1",
-    "vue-template-compiler": "2.6.12"
+    "vue-template-compiler": "2.6.12",
+    "less": "^4.1.1",
+    "less-loader": "^4.1.0"
   },
   "engines": {
     "node": ">=8.9",

+ 10 - 0
ruoyi-ui/src/api/modeler.js

@@ -10,6 +10,16 @@ export const getTabList = (data) => {
     data
   })
 }
+export const delRemove = (data) => {
+  return request({
+    headers: {
+      'accountName': 'guest'
+    },
+    url: '/jflow/p/cs/module/remove',
+    method: 'post',
+    data
+  })
+}
 export const getColumnList = (data) => {
   return request({
     headers: {

+ 4 - 3
ruoyi-ui/src/components/DynamicForms/index.vue

@@ -35,7 +35,7 @@
       :placeholder="'请输入'+formConfig.columnComment">
     </el-date-picker>
     <!-- 上传图片 -->
-    <el-upload :disabled="formConfig.disabshow" v-if="formConfig.htmlType == 'imageUpload'" :headers="{Authorization: 'Bearer ' + getToken()}" :action="process + '/boman-file/upload'"
+    <el-upload  :disabled="formConfig.disabshow" v-if="formConfig.htmlType == 'imageUpload'" :headers="{Authorization: 'Bearer ' + getToken()}" :action="process + '/boman-file/upload'"
       :file-list="config" list-type="picture-card" :on-preview="handlePictureCardPreview" :on-success="upImageFn"
       :on-remove="reseImage">
       <i class="el-icon-plus"></i>
@@ -116,7 +116,7 @@
           this.formConfig.disabshow = false
         }
         if(this.formConfig.fkInfo == null){
-            this.formConfig.fkInfo=false
+          this.formConfig.fkInfo=false
         }
       }
       this.init()
@@ -194,7 +194,8 @@
           }
         }
       },
-      handlePictureCardPreview(file) {
+      handlePictureCardPreview(file) {
+        console.log(file)
         this.dialogImageUrl = file.url;
         this.dialogVisible = true;
       },

+ 4 - 12
ruoyi-ui/src/components/FlowChartComponent/index.vue

@@ -2,7 +2,7 @@
   <div class="FlowChartComponent">
     <!-- <Alert show-icon closable v-if="currentSteps === 1">双击空白区域即可直接新增一个中间节点,双击节点可编辑</Alert> -->
     <div class="chartContent">
-      <div id="paletteDiv"></div>
+      <div id="paletteDiv" v-show="currentSteps === 1"></div>
       <div id="goChart" v-show="currentSteps === 1">
       </div>
       <div id="showChart" v-show="currentSteps === 2">
@@ -38,15 +38,7 @@
   </div>
 </template>
 <script>
-import '@/utils/go'
-import FlowDesinger from '@/utils/flow-desinger';
-import startNodeInfo from '@/components/startNodeInfo'
-import endNodeInfo from '@/components/endNodeInfo'
-import linkInfo from '@/components/linkInfo'
-import ProcessNodeConfig from '@/components/ProcessNodeConfig'
-import DynamicProcessNodeConfig from '@/components/DynamicProcessNodeConfig'
-import ServiceNodeConfig from '@/components/ServiceNodeConfig'
-import FlowDisplay from '@/utils/flow-display';
+import '@/utils/go'
import FlowDesinger from '@/utils/flow-desinger';
import startNodeInfo from '@/components/startNodeInfo'
import endNodeInfo from '@/components/endNodeInfo'
import linkInfo from '@/components/linkInfo'
import ProcessNodeConfig from '@/components/ProcessNodeConfig'
import DynamicProcessNodeConfig from '@/components/DynamicProcessNodeConfig'
import ServiceNodeConfig from '@/components/ServiceNodeConfig'
import FlowDisplay from '@/utils/flow-display';
 export default {
   components:{
     startNodeInfo, endNodeInfo, linkInfo, ProcessNodeConfig, DynamicProcessNodeConfig, ServiceNodeConfig
@@ -134,6 +126,7 @@ export default {
             });
 
           }
+
           this.initToolbar = this.myDesigner.initToolbar('paletteDiv',this.data.moduleType)
           this.myDesigner.displayFlow(JSON.parse(JSON.stringify(this.data.guiStyle)));// 在设计面板中显示流程图
           this.data.myDisplay = this.myDesigner.diagram
@@ -162,7 +155,6 @@ export default {
     },
     dataProcessing () {  //处理后端返回节点数据和路径数据
       if(this.data.nodeMsg){
-
         this.data.nodeMsg.forEach(item => {
           this.nodeMsg[item.key] = item
           if(item.type === 2){  //结束节点对数据排序,区分执行程序还是抄送人
@@ -518,7 +510,7 @@ export default {
   }
 }
 </script>
-<style lang="scss" >
+<style lang="less" >
 .FlowChartComponent{
   width: 100%;
   height: 100%;

+ 1 - 1
ruoyi-ui/src/components/FormItemComponent/index.vue

@@ -23,7 +23,7 @@
     <p v-if="buttonType">
       <el-button type="primary" plain icon="el-icon-search" @click="search">搜索</el-button>
       <el-button icon="el-icon-refresh" size="mini" @click="reset">重置</el-button>
-      </p>
+    </p>
   </div>
 </template>
 <script>

+ 3 - 3
ruoyi-ui/src/components/ItemComponent/index.vue

@@ -188,7 +188,7 @@ export default {
       // const item = this.items;
       item.props = Object.assign(
         {},
-        // dataProp[item.type].props,
+        dataProp[item.type].props,
         this.items.props
       );
       item.event = Object.assign({}, this.items.event);
@@ -215,7 +215,7 @@ export default {
       }else{
          this.$emit("inputChange", this._items.value, this._items);
       }
-
+     
       // this.$emit("inputChange", this._items.value, this._items);
     },
     // Switch
@@ -630,7 +630,7 @@ export default {
   }
 };
 </script>
-<style lang="scss" scoped>
+<style lang="less" scoped>
 .ItemComponentRoot {
   width: 100%;
   height: 100%;

+ 16 - 16
ruoyi-ui/src/components/ParameterConfiguration/index.vue

@@ -417,9 +417,9 @@
         getTabList({
           DESCRIPTION: value
         }).then(res => {
-          if (res.data.code === 0) {
-            this.row = res.data.data.row.concat([])
-            this.formLists[1].item.props.AutoData = res.data.data.row.reduce((arr, item) => {
+          if (res.code === 0) {
+            this.row = res.data.row.concat([])
+            this.formLists[1].item.props.AutoData = res.data.row.reduce((arr, item) => {
               arr.push({
                 value: item.NAME.val,
                 id: item.ID.val,
@@ -436,9 +436,9 @@
           pageSize: instance.pageSize,
           page: currentPage ? currentPage : 1
         }).then(res => {
-          if (res.data.code === 0) {
-            this.row = res.data.data.row.concat([])
-            res.data.data.tabth.forEach(item => {
+          if (res.code === 0) {
+            this.row = res.data.row.concat([])
+            res.data.tabth.forEach(item => {
               if (item.colname === 'DESCRIPTION') {
                 item.isak = true
               }
@@ -448,8 +448,8 @@
             //   item.ID.val = item.NAME.val
             //   return item
             // })
-            this.formLists[1].item.props.data = res.data.data;
-            this.formLists[1].item.props.totalRowCount = res.data.data.totalRowCount;
+            this.formLists[1].item.props.data = res.data;
+            this.formLists[1].item.props.totalRowCount = res.data.totalRowCount;
           }
 
         })
@@ -460,9 +460,9 @@
           DESCRIPTION: value,
           AD_TABLE_ID: this.data.businessType[0].ID
         }).then(res => {
-          if (res.data.code === 0) {
-            this.row = res.data.data.row.concat([])
-            this.formLists[3].item.props.AutoData = res.data.data.row.reduce((arr, item) => {
+          if (res.code === 0) {
+            this.row = res.data.row.concat([])
+            this.formLists[3].item.props.AutoData = res.data.row.reduce((arr, item) => {
               arr.push({
                 value: item.NAME.val,
                 id: item.ID.val,
@@ -480,9 +480,9 @@
           page: currentPage ? currentPage : 1,
           AD_TABLE_ID: this.data.businessType[0].ID
         }).then(res => {
-          if (res.data.code === 0) {
-            this.row = res.data.data.row.concat([])
-            res.data.data.tabth.forEach(item => {
+          if (res.code === 0) {
+            this.row = res.data.row.concat([])
+            res.data.tabth.forEach(item => {
               if (item.colname === 'DESCRIPTION') {
                 item.isak = true
               }
@@ -492,8 +492,8 @@
             //   item.ID.val = item.NAME.val
             //   return item
             // })
-            this.formLists[3].item.props.data = res.data.data;
-            this.formLists[3].item.props.totalRowCount = res.data.data.totalRowCount;
+            this.formLists[3].item.props.data = res.data;
+            this.formLists[3].item.props.totalRowCount = res.data.totalRowCount;
           }
 
         })

+ 23 - 14
ruoyi-ui/src/components/listModalComponent/index.vue

@@ -40,6 +40,7 @@ import {
     setPublish,
     setUnpublish,
     setCopy,
+    delRemove
   } from '@/api/modeler.js'
 export default {
   name:'listModalComponent',
@@ -109,22 +110,30 @@ export default {
     releaseProcess () {  //发布流程
       this.$refs.poptip.handleClose()
       setPublish({id:this.items.id}).then((res) => {
+        if(res.resultCode === 0){
         if(typeof this.items.event.queryLists === 'function'){
           this.items.event.queryLists()
         }
+        }else{
+          this.$Modal.fcWarning({
+            title:'警告',
+            content:res.resultMsg,
+            mask:true
+          })
+        }
       })
     },
     editingProcess () { //编辑流程
       this.$refs.poptip.handleClose()
-      this.changeKeepAliveArray(['TemplateManagementLists'])
+      // this.changeKeepAliveArray(['modeler'])
       this.$router.push({ path: `/tool/activiti/TemplateManagementNew/${this.items.id}` })
-      this.currentChange({
-        path:'/TemplateManagementLists'
-      });
+      // this.currentChange({
+      //   path:'/tool/activiti/modeler'
+      // });
     },
     deleteProcess () {  //删除流程
       this.$refs.poptip.handleClose()
-      this.$network.post('/p/cs/module/remove', {id:this.items.id}).then((res) => {
+      delRemove({id:this.items.id}).then((res) => {
         if(typeof this.items.event.queryLists === 'function'){
           this.items.event.queryLists()
         }
@@ -142,11 +151,11 @@ export default {
       this.$refs.poptip.handleClose()
       setCopy({id:this.items.id}).then((res) => {
         if(res.resultCode === 0){
-          this.changeKeepAliveArray(['TemplateManagementLists'])
-          this.$router.push({ path: `/TemplateManagementNew/${res.data.data.id}` })
-          this.currentChange({
-            path:'/TemplateManagementLists'
-          });
+          // this.changeKeepAliveArray(['modeler'])
+          this.$router.push({ path: `/tool/activiti/TemplateManagementNew/${res.data.id}` })
+          // this.currentChange({
+          //   path:'/tool/activiti/modeler'
+          // });
         }else{
           this.$Modal.fcError({
             title:'错误',
@@ -159,11 +168,11 @@ export default {
     },
     previewProcess () { //预览流程
       this.$refs.poptip.handleClose()
-      this.changeKeepAliveArray(['TemplateManagementLists'])
+      // this.changeKeepAliveArray(['modeler'])
       this.$router.push({ path: `/tool/activiti/TemplateManagementNew/${this.items.id}/1` })
-      this.currentChange({
-        path:'/TemplateManagementLists'
-      });
+      // this.currentChange({
+      //   path:'/tool/activiti/modeler'
+      // });
     },
 
     ckeckModal () {  //选择流程

+ 3 - 2
ruoyi-ui/src/main.js

@@ -33,10 +33,11 @@ import DynamicForm from "@/components/DynamicForm"
 import DynamicForms from "@/components/DynamicForms"
 import MemoranDum from "@/components/MemoranDum"
 import 'burgeon-ui/dist/styles/burgeon-ui.css';
+import 'burgeon-ui/dist/styles/bjIconfonts/iconfont.css';
 import BigPicture from "@/components/BigPicture";
 Vue.component('BigPicture', BigPicture)
 import BurgeonUi from 'burgeon-ui';
-Vue.use(BurgeonUi);
+
 // 全局方法挂载
 Vue.prototype.getDicts = getDicts
 Vue.prototype.getConfigKey = getConfigKey
@@ -84,7 +85,7 @@ Vue.use(permission)
 Vue.use(Element, {
   size: Cookies.get('size') || 'medium' // set element-ui default size
 })
-
+Vue.use(BurgeonUi);
 Vue.config.productionTip = false
 
 new Vue({

+ 4 - 1
ruoyi-ui/src/store/modules/settings.js

@@ -9,6 +9,7 @@ const state = {
   showSettings: showSettings,
   tagsView: tagsView,
   fixedHeader: fixedHeader,
+  keepAliveArray:['TemplateManagementLists'],//控制kepp-alive组件
   sidebarLogo: sidebarLogo
 }
 
@@ -17,6 +18,9 @@ const mutations = {
     if (state.hasOwnProperty(key)) {
       state[key] = value
     }
+  },
+  changeKeepAliveArray(state,data) {
+    state.keepAliveArray = data
   }
 }
 
@@ -32,4 +36,3 @@ export default {
   mutations,
   actions
 }
-

+ 0 - 435
ruoyi-ui/src/views/activiti/TemplateManagementLists/index.vue

@@ -1,435 +0,0 @@
-<template>
-  <div class="TemplateManagementLists">
-    <div class="listContent">
-      <p class="title">模版管理</p>
-      <p class="buttonLists">
-        <Button type="primary" @click="searchData.page = 1;queryLists()">查询</Button>
-        <Button type="fcdefault" :disabled="listsStatus === 1" @click="addTemplate">新建模板</Button>
-        <Button type="fcdefault" v-if="listsStatus === 0" @click="templateMigration">模版迁移</Button>
-        <Button type="fcdefault" v-if="listsStatus === 1" @click="removeMigration">取消迁移</Button>
-        <Button type="fcdefault" v-if="listsStatus === 1" @click="perform">执行</Button>
-        <Button type="fcdefault" v-if="listsStatus === 1" @click="performAll">执行全部</Button>
-      </p>
-      <Alert show-icon closable v-if="listsStatus === 1">依次单击模板可进行多选模板</Alert>
-      <FormItemComponent
-        class="form"
-        :formItemLists="formLists"
-        :buttonType="false"
-        @formChange="formChange"
-      ></FormItemComponent>
-
-      <StandardTable
-        class="table"
-        :currentPage="searchData.page"
-        :pageSize="searchData.pageSize"
-        :pageSizeOpts="[20,40,60,80]"
-        :total="total"
-        :showTable="false"
-        :standardTableEvent="standardTableEvent"
-      >
-      </StandardTable>
-
-      <div class="list">
-        <FormItemComponent
-          class="listsForm"
-          :formItemLists="listsConfig"
-          :buttonType="false"
-          :readonly="listsStatus === 1"
-        ></FormItemComponent>
-
-        <div  class="noData" v-if="listsConfig.length == 0" >
-          <span>
-            暂无模版
-          </span>
-        </div>
-      </div>
-    </div>
-
-    <!-- 模版迁移弹窗 -->
-    <Modal
-      v-model="migrationModel"
-      title="模版迁移"
-      mask
-      :width="440"
-      :mask-closable="false"
-      >
-      <div class="migrationModelContent">
-        <p>
-          <Input v-model="serverUrl"  placeholder="请输入目标服务器地址" style="width: 320px" />
-        </p>
-      </div>
-
-      <p slot="footer">
-        <Button :loading="performloading" @click="migrationModel = false">取消</Button>
-        <Button :loading="performloading" type="primary" @click="performConfirm">确定</Button>
-      </p>
-    </Modal>
-  </div>
-</template>
-<script>
-import FormItemComponent from '@/components/FormItemComponent';
-import ItemComponent from '@/components/ItemComponent';
-import StandardTable from '@/components/StandardTable';
-import listModalComponent from '@/components/listModalComponent'
-// import router from '../config/router.config'
-import {  mapMutations,mapState } from 'vuex';
-export default {
-  name:'TemplateManagementLists',
-  components:{FormItemComponent,StandardTable},
-  data () {
-    return {
-      // 状态  0为搜索状态,1为模版迁移状态
-      listsStatus:0,
-      //表单配置
-      formLists:[
-        {
-          row:1,
-          col:1,
-          component:ItemComponent,
-          item:{
-            type:'input',
-            title:'模型名称',
-            filed:'name',
-            event:{
-              'keydown': (event) => {
-                if(event.keyCode === 13){
-                  this.searchData.page = 1
-                  this.queryLists()
-                }
-              }
-            }
-          }
-        },
-        {
-          row:1,
-          col:1,
-          component:ItemComponent,
-          item:{
-            type:'select',
-            title:'模版状态',
-            filed:'status',
-            options: [
-              { value: 1, label: '已发布'},
-              { value: 0, label: '未发布'},
-              { value: 2, label: '已停用'}
-            ],
-            props:{
-              multiple: true,
-              multipleType: true
-            },
-            value:[0,1]
-          }
-        },
-        {
-          row:1,
-          col:1,
-          component:ItemComponent,
-          item:{
-            type:'DatePicker',
-            title:'创建时间',
-            filed:'createTime',
-            value:[]
-          }
-        }
-      ],
-      //查询条件
-      searchData:{
-        page:1,
-        pageSize:20,
-        createTime:[],
-        status: [0,1]
-      },
-
-      //分页数据
-      total:0,
-      standardTableEvent:{
-        'on-change':(page) => {
-          this.searchData.page = page
-          this.queryLists()
-        },
-        'on-page-size-change':(pageSize) => {
-          this.searchData.page = 1
-          this.searchData.pageSize = pageSize
-          this.queryLists()
-        }
-      },
-      listsConfig:[  //列表数据
-      ],
-
-      // 迁移数据
-      selectModal:[],  //选中的迁移模版
-      migrationModel:false, //控制模版迁移弹窗
-      serverUrl:null,  //目标服务地址
-      migrationType:null,  //0为执行  1为执行全部
-      performloading:false
-
-    }
-  },
-  computed:{
-    ...mapState({
-      currentMenu:(state) =>{
-        return  state.currentMenu
-      }
-    })
-  },
-  watch:{
-    listsStatus () {
-      if(this.listsStatus === 0){
-        this.selectModal = []
-      }
-    }
-  },
-  methods:{
-    ...mapMutations(['currentChange','changeKeepAliveArray']),
-    formChange (data) {  //表单数据修改时,修改searchData数据
-      if(data.status){
-        this.formLists[0].item.value = data.name
-        this.formLists[1].item.value = data.status
-        this.formLists[2].item.value = data.createTime
-        // this.formLists = this.formLists.concat([])
-      }
-      this.searchData = Object.assign({},this.searchData,data)
-      if(Object.prototype.toString.call(this.searchData.status) === '[object Array]' && this.searchData.status.length === 0){
-        delete this.searchData.searchStatus
-        delete this.searchData.status
-      }
-
-      // this.queryLists()
-    },
-    queryLists () {  //查询列表
-      if(this.searchData.status && this.searchData.status.indexOf('bSelect-all') >= 0){
-        this.searchData.searchStatus = []
-      }else{
-        this.searchData.searchStatus = this.searchData.status
-      }
-
-      if(this.searchData.createTime && this.searchData.createTime[0] && this.searchData.createTime[1]){
-        this.searchData.startTime = new Date(this.searchData.createTime[0]).format('yyyy-MM-dd hh:mm')
-        this.searchData.endTime = new Date(this.searchData.createTime[1]).format('yyyy-MM-dd hh:mm')
-      }else{
-        this.searchData.startTime = ''
-        this.searchData.endTime = ''
-      }
-
-      let obj = Object.assign({},this.searchData)
-      delete obj.createTime
-      delete obj.status
-      this.$network.post('/p/cs/module/search', obj).then((res) => {
-        if(res.data.resultCode !== 0){
-          return
-        }
-        let data = res.data.data
-        this.total = data.total
-
-        this.listsConfig = data.records.reduce((arr,item) => {
-          let items = {
-            event:{
-              queryLists:() => {
-                this.queryLists()
-              }
-            }
-          }
-          items = Object.assign(items,item)
-          arr.push({
-            row:1,
-            col:1,
-            component:listModalComponent,
-            item:items
-          })
-          return arr
-        },[])
-      });
-    },
-    addTemplate () {  //新建模版
-      this.changeKeepAliveArray(['TemplateManagementLists'])
-      // router.push({ path: '/TemplateManagementNew/-1' })
-      this.currentChange({
-        path:'/TemplateManagementLists'
-      });
-    },
-    templateMigration () { //模版迁移
-      this.listsStatus = 1
-    },
-    removeMigration () {  //取消迁移
-      this.listsStatus = 0
-    },
-    modalClick (event) {  //模版点击
-      let value = event.detail.value
-      let items = event.detail.items
-      if(value){
-        this.selectModal.push(items.id)
-      }else{
-        this.selectModal.splice(this.selectModal.findIndex(item => item === items.id), 1)
-      }
-    },
-    perform () {  //执行迁移
-      if(this.selectModal.length === 0){
-        this.$Modal.fcWarning({
-          title:'警告',
-          content:'请选择需要迁移的模版!',
-          mask:true
-        })
-        return
-      }
-      this.migrationType = 0
-      this.serverUrl = null
-      this.migrationModel = true
-
-    },
-    performAll () {  //迁移全部
-      this.migrationType = 1
-      this.serverUrl = null
-      this.migrationModel = true
-    },
-    performConfirm () {  //模版迁移确认
-      let obj = {}
-      if(!(this.serverUrl.startsWith('http://') || this.serverUrl.startsWith('https://'))){
-        this.$Modal.fcWarning({
-          title:'警告',
-          content:'目标服务器地址必须以http://或者https://开头',
-          mask:true
-        })
-        return
-      }
-      this.performloading = true
-      if(this.migrationType === 0){  //执行选中模版
-        obj = {
-          moduleIds:this.selectModal.join(',')
-        }
-      }else{  //执行所有模版
-        if(this.searchData.createTime && this.searchData.createTime[0] && this.searchData.createTime[1]){
-          this.searchData.startTime = new Date(this.searchData.createTime[0]).format('yyyy-MM-dd hh:mm')
-          this.searchData.endTime = new Date(this.searchData.createTime[1]).format('yyyy-MM-dd hh:mm')
-        }else{
-          this.searchData.startTime = ''
-          this.searchData.endTime = ''
-        }
-
-        obj = Object.assign({},this.searchData)
-      }
-
-      obj.url = this.serverUrl
-      this.$network.post('/p/cs/module/migrate', obj)
-        .then((res) => {
-          if(res.data.resultCode === 0){
-            this.$Modal.fcSuccess({
-              title:'成功',
-              content:res.data.resultMsg,
-              onOk: () => {
-                this.queryLists()
-                this.listsStatus = 0
-                this.migrationModel = false
-                this.performloading = false
-              }
-            })
-
-          }else{
-            this.performloading = false
-          }
-
-        })
-    }
-  },
-  created () {
-    //判断首页跳转状态,修改查询条件
-    let status = Number(this.$route.query.status)
-    if(status){
-      this.searchData.status = [status]
-      this.formLists[1].item.value = [status]
-      this.formLists = this.formLists.concat([])
-    }
-    this.queryLists()
-  },
-  mounted () {
-    // 监听modal的点击事件
-    window.addEventListener('modalClick',this.modalClick)
-  },
-  beforeDestroy () {
-    window.removeEventListener('modalClick', this.modalClick);
-  },
-  activated () {
-    this.queryLists()
-  }
-}
-</script>
-<style lang="less" >
-.TemplateManagementLists{
-  display: flex;
-  flex-direction: column;
-  .listContent{
-    background: white;
-    flex: 1;
-    padding: 16px;
-    display: flex;
-    flex-direction: column;
-    overflow: hidden;
-
-    .title{
-      font-size:18px;
-      font-family:PingFangSC-Medium;
-      font-weight:500;
-      color:rgba(81,90,110,1);
-      line-height:24px;
-      margin-bottom: 16px;
-    }
-
-    .buttonLists{
-      margin-bottom: 10px;
-      >button{
-        width: 90px;
-        margin-right: 10px;
-      }
-    }
-    .form{
-      margin-bottom: 16px;
-    }
-
-    .list{
-      flex: 1;
-      margin-right: -16px;
-      overflow: auto;
-      position: relative;
-      .listsForm{
-        border: none;
-        padding: 0;
-        margin-left: 5px;
-        margin-top: 5px;
-
-        .FormItemComponent-item{
-          margin-right: 16px;
-          margin-bottom: 20px;
-        }
-      }
-
-      .noData{
-        position: absolute;
-        top: 50%;
-        left: 50%;
-        width: 280px;
-        height: 292px;
-        margin-top: -146px;
-        margin-left: -140px;
-        background-image: url('~@/assets/images/nodata.png');
-        background-size: cover;
-
-        >span{
-          position: absolute;
-          bottom: 40px;
-          left: 20px;
-          display: inline-block;
-          width: 240px;
-          height: 40px;
-          text-align: center;
-        }
-      }
-    }
-
-  }
-}
-
-.migrationModelContent{
-  height: 115px;
-  padding: 30px 44px 17px 44px;
-  box-sizing: border-box;
-}
-</style>

+ 23 - 11
ruoyi-ui/src/views/activiti/TemplateManagementNew/index.vue

@@ -186,7 +186,6 @@ export default {
         if(val === 0 ){
           Vue.component(componentName,ParameterConfiguration)
         }else if(val === 1){
-          console.log(componentName,91111111111)
           Vue.component(componentName,FlowChartComponent)
         }else if(val === 2){
           Vue.component(componentName,FlowSuccess)
@@ -200,7 +199,6 @@ export default {
     getModuleInfo (id) {
       getLoad({id:id}).then((res) => {
         if(res.resultCode === 0){
-          console.log(res.data,999911111)
           res.data.businessType = [{
             ID:res.data.businessType,
             Label:res.data.businessTypeName,
@@ -219,12 +217,19 @@ export default {
             if(this.readOnly){
               this.currentSteps = 2
               this.noFreshFlag = false
+              this.$refs[this.currentComponent].activated()
             }else{
               this.$refs.component_1.init()
               this.noFreshFlag = false
             }
 
           })
+        }else{
+          this.$Modal.fcWarning({
+            title:'警告',
+            content:res.resultMsg,
+            mask:true
+          })
         }
       });
     },
@@ -335,7 +340,7 @@ export default {
           removePath: this.data.removePath
         }
         getCommit(jsonObject).then(res => {
-            if(res.data.resultCode === 0){
+            if(res.resultCode === 0){
               // this.data = {
               //   guiStyle:{
               //     "class": "go.GraphLinksModel",
@@ -347,13 +352,20 @@ export default {
               // }
               if(!flag){
                 window.flag = true
-                this.$router.push('/TemplateManagementLists')
+                this.$router.push('/tool/activiti/modeler')
                 this.currentChange({
-                  path:'/TemplateManagementLists'
+                  path:'/tool/activiti/modeler'
                 });
               }
 
               resolve(res)
+            }else{
+              this.$Modal.fcError({
+                title:'错误',
+                content:res.resultMsg,
+                onOk: () => {
+                }
+              })
             }
 
         })
@@ -450,18 +462,18 @@ export default {
       this.data = Object.assign(this.data,data)
     },
     close () {
-      this.$router.push('/TemplateManagementLists')
+      this.$router.push('/tool/activiti/modeler')
       this.currentChange({
-        path:'/TemplateManagementLists'
+        path:'/tool/activiti/modeler'
       });
     },
     confirmAndPublish () {  //保存并发布
       this.confirm(true).then(res => {
-        getPublish({id:res.data.data.id}).then((response) => {
-          if(response.data.resultCode === 0){
-            this.$router.push('/TemplateManagementLists')
+        getPublish({id:res.data.id}).then((response) => {
+          if(response.resultCode === 0){
+            this.$router.push('/tool/activiti/modeler')
             this.currentChange({
-              path:'/TemplateManagementLists'
+              path:'/tool/activiti/modeler'
             });
           }
         })

+ 2 - 2
ruoyi-ui/src/views/activiti/modeler/index.vue

@@ -257,10 +257,10 @@ export default {
       });
     },
     addTemplate () {  //新建模版
-      this.changeKeepAliveArray(['TemplateManagementLists'])
+      this.changeKeepAliveArray(['modeler'])
       this.$router.push({ path: '/tool/activiti/TemplateManagementNew/-1' })
       this.currentChange({
-        path:'/TemplateManagementLists'
+        path:'/tool/activiti/modeler'
       });
     },
     templateMigration () { //模版迁移

+ 2 - 1
ruoyi-ui/src/views/index.vue

@@ -287,7 +287,8 @@ export default {
         pageSize:10,
         fixedData:{
           condition:{
-            notice_type:1
+            notice_type:1,
+            status:0
           }
         }
 

+ 30 - 12
ruoyi-ui/src/views/system/permissions/index.vue

@@ -1,10 +1,10 @@
 <template>
-  <div class="app-container">
-    <el-row style="margin-top: 18px;">
+  <div class="app-container app-containerth">
+    <el-row style="margin-top: 18px;" class="searBoxstu" >
       <el-col :span="5" class="searBoxs">
-        <el-row class="roleBoxui">
-          <el-col :span="24" class="roleBotyu">
-            <el-row :gutter="10" class="mb8">
+        <el-row class="roleBoxui" >
+          <el-col :span="24" class="roleBotyu" style="height: 100%;">
+            <el-row :gutter="10" class="mb8" style="height: 100%;">
             <el-col :span="1.5">
               <el-button type="primary" style="background-color: #FF9639;color: #fff;border: none;" plain icon="el-icon-refresh"
                 @click="efresh" v-hasPermi="['system:role:list']">刷新</el-button>
@@ -25,6 +25,8 @@
             {{item.roleName}}
           </div>
         </div>
+        <pagination sty v-show="totale>0" :total="totale" layout="prev, pager, next" :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize" @pagination="getList" small />
       </el-col>
       <el-col :span="19" class="roleContr">
         <el-row class="roleBox">
@@ -75,6 +77,7 @@
            :page.sync="queryParamstr.pageNum"
            :limit.sync="queryParamstr.pageSize"
            @pagination="getDeptTreeselect"
+           class="pajie"
          />
         </div>
       </el-col>
@@ -132,6 +135,7 @@
         showSearch: true,
         // 总条数
         total: 0,
+        totale:0,
         // 角色表格数据
         roleList: [],
         // 弹出层标题
@@ -157,7 +161,9 @@
         queryParams: {
           roleName: undefined,
           roleId: undefined,
-          status: undefined
+          status: undefined,
+          pageNum: 1,
+          pageSize: 10,
         },
         queryParamstr:{
           pageNum: 1,
@@ -227,11 +233,12 @@
       /** 查询角色列表 */
       getList() {
         this.loading = true;
-        this.roleList = []   
+        this.roleList = []
         listRole(this.addDateRange(this.queryParams, this.dateRange)).then(
           response => {
             if(response.rows.length !==0){
               this.roleList = response.rows;
+              this.totale = response.total;
             }else{
               this.roleList.push({roleName:'暂无数据'})
             }
@@ -503,6 +510,11 @@
       margin-top: 87px;
     }
   }
+  .app-containerth{
+    .pajie{
+      bottom: 30px;
+    }
+  }
 </style>
 <style lang="scss" scoped>
   .roleContrBox {
@@ -510,11 +522,12 @@
     // border-radius: 6px;
     overflow: hidden;
     padding: 23px 0;
+    height: calc(95vh - 168px);;
   }
 
   .roleContr {
     padding-left: 17px;
-
+    height: calc(100% - 168px);
     .searContLeft {
       padding:0 17px 23px 23px;
       // border-right: 2px solid #E5E5E5;
@@ -573,12 +586,17 @@
       }
     }
   }
-
+ .searBoxstu{
+    // height: 100vh;
+    // height: calc(100vh - 70px);
+    // background-color: #fff;
+ }
   .searBoxs {
     background-color: #fff;
     border-radius: 6px;
     padding: 23px;
-
+    height: calc(100vh - 140px); ;
+    min-height: calc(100vh - 140px);
     .searBox {
       display: flex;
 
@@ -624,7 +642,7 @@
 
     .searList {
       padding: 10px 0;
-
+      height: 70%;
       .searItem {
         padding: 0 8px;
         line-height: 30px;
@@ -642,7 +660,7 @@
 
   .app-container {
     background-color: #EFF0FF;
-    min-height: calc(100vh - 70px);
+    // min-height: calc(100vh - 70px);
     box-sizing: border-box;
     box-sizing: border-box;
   }

+ 1 - 1
ruoyi-ui/src/views/system/role/fz-index.vue

@@ -43,7 +43,7 @@
           </div>
         </div>
         <pagination sty v-show="total>0" :total="total" layout="prev, pager, next" :page.sync="queryParams.pageNum"
-          :limit.sync="queryParams.pageSize" />
+          :limit.sync="queryParams.pageSize" :pager-count="2" />
       </el-col>
       <el-col :span="19" class="roleContr">
         <div class="roleContrBox">

+ 3 - 3
ruoyi-ui/src/views/system/table/index.vue

@@ -5,13 +5,13 @@
       <el-divider></el-divider> -->
       <div class="imge_tab">
         <img src="../../../assets/images/pic_sy_ytj.png" alt="" v-if="imgShoew == 2" >
-         <img src="../../../assets/images/pic_sy_shz.png" alt="" v-if="imgShoew == 4" >
-          <img src="../../../assets/images/pic_sy_ybh.png" alt="" v-if="imgShoew == 3" >
+        <img src="../../../assets/images/pic_sy_shz.png" alt="" v-if="imgShoew == 4" >
+        <img src="../../../assets/images/pic_sy_ybh.png" alt="" v-if="imgShoew == 3" >
       </div>
       <div class="table_headerBtun table_headerBtuntwo" v-if="queryData.buttonList">
         <el-button type="primary" size="mini" plain v-for="(item,index) in jeigneutwo" :key="index" @click="handleQuery(item)">{{item}}</el-button>
       </div>
-    </div>
+    </div>    
     <!-- 内容 -->
     <div class="table_nav headertable_nav" >
       <el-collapse v-model="activeNames" @change="handleChange">

+ 4 - 4
ruoyi-ui/src/views/system/user/index.vue

@@ -273,9 +273,9 @@
               <el-select v-model="form.postIds" multiple placeholder="请选择">
                 <el-option
                   v-for="item in postOptions"
-                  :key="item.postId"
+                  :key="item.id"
                   :label="item.postName"
-                  :value="item.postId"
+                  :value="item.id"
                   :disabled="item.status == 1"
                 ></el-option>
               </el-select>
@@ -286,9 +286,9 @@
               <el-select v-model="form.roleIds" multiple placeholder="请选择">
                 <el-option
                   v-for="item in roleOptions"
-                  :key="item.roleId"
+                  :key="item.id"
                   :label="item.roleName"
-                  :value="item.roleId"
+                  :value="item.id"
                   :disabled="item.status == 1"
                 ></el-option>
               </el-select>