Переглянути джерело

feat:封装按钮图标选择器,401页面开放,表格初始化按钮批量新增权限接口

韩帛霖 1 рік тому
батько
коміт
9965a48502

+ 13 - 2
zkqy-admin/src/main/java/com/zkqy/web/controller/system/SysMenuController.java

@@ -87,6 +87,17 @@ public class SysMenuController extends BaseController {
         }
     }
 
+    /**
+     * 批量新增菜单按钮权限
+     */
+    @PreAuthorize("@ss.hasPermi('system:menu:add')")
+    @Log(title = "菜单管理", businessType = BusinessType.INSERT)
+    @PostMapping("/tbnHasPerms")
+    public AjaxResult add(@Validated @RequestBody List<SysMenu> menus) {
+        return AjaxResult.success(menuService.insertMenusByList(menus));
+    }
+
+
     /**
      * 修改菜单
      */
@@ -128,10 +139,10 @@ public class SysMenuController extends BaseController {
     @Log(title = "菜单管理", businessType = BusinessType.DELETE)
     @DeleteMapping("/removeBatch/{menuIds}")
     public AjaxResult removeBatch(@PathVariable List<Long> menuIds) {
-        if(menuService.hasChildByMenuIdBatchRemove(menuIds)){
+        if (menuService.hasChildByMenuIdBatchRemove(menuIds)) {
             return warn("当前选择的菜单中、存在子菜单,不允许删除");
         }
-        if(menuService.checkMenuExistRoleBatchRemove(menuIds)){
+        if (menuService.checkMenuExistRoleBatchRemove(menuIds)) {
             return warn("当前选择的菜单中、菜单已分配,不允许删除");
         }
         return toAjax(menuService.batchDeleteMenuByIds(menuIds));

+ 8 - 0
zkqy-system/src/main/java/com/zkqy/system/mapper/SysMenuMapper.java

@@ -173,4 +173,12 @@ public interface SysMenuMapper {
     List<SysMenu> selectMenusByIds(List<Long> ids);
 
 
+    /**
+     * 批量新增新增菜单信息
+     *
+     * @param menus
+     * @return 结果
+     */
+    public int insertMenuBatch(List<SysMenu> menus);
+
 }

+ 31 - 21
zkqy-system/src/main/java/com/zkqy/system/service/ISysMenuService.java

@@ -2,20 +2,20 @@ package com.zkqy.system.service;
 
 import java.util.List;
 import java.util.Set;
+
 import com.zkqy.common.core.domain.TreeSelect;
 import com.zkqy.common.core.domain.entity.SysMenu;
 import com.zkqy.system.domain.vo.RouterVo;
 
 /**
  * 菜单 业务层
- * 
+ *
  * @author zkqy
  */
-public interface ISysMenuService
-{
+public interface ISysMenuService {
     /**
      * 根据用户查询系统菜单列表
-     * 
+     *
      * @param userId 用户ID
      * @return 菜单列表
      */
@@ -23,8 +23,8 @@ public interface ISysMenuService
 
     /**
      * 根据用户查询系统菜单列表
-     * 
-     * @param menu 菜单信息
+     *
+     * @param menu   菜单信息
      * @param userId 用户ID
      * @return 菜单列表
      */
@@ -32,7 +32,7 @@ public interface ISysMenuService
 
     /**
      * 根据用户ID查询权限
-     * 
+     *
      * @param userId 用户ID
      * @return 权限列表
      */
@@ -40,7 +40,7 @@ public interface ISysMenuService
 
     /**
      * 根据角色ID查询权限
-     * 
+     *
      * @param roleId 角色ID
      * @return 权限列表
      */
@@ -48,7 +48,7 @@ public interface ISysMenuService
 
     /**
      * 根据用户ID查询菜单树信息
-     * 
+     *
      * @param userId 用户ID
      * @return 菜单列表
      */
@@ -56,7 +56,7 @@ public interface ISysMenuService
 
     /**
      * 根据角色ID查询菜单树信息
-     * 
+     *
      * @param roleId 角色ID
      * @return 选中菜单列表
      */
@@ -64,7 +64,7 @@ public interface ISysMenuService
 
     /**
      * 构建前端路由所需要的菜单
-     * 
+     *
      * @param menus 菜单列表
      * @return 路由列表
      */
@@ -72,7 +72,7 @@ public interface ISysMenuService
 
     /**
      * 构建前端所需要树结构
-     * 
+     *
      * @param menus 菜单列表
      * @return 树结构列表
      */
@@ -80,7 +80,7 @@ public interface ISysMenuService
 
     /**
      * 构建前端所需要下拉树结构
-     * 
+     *
      * @param menus 菜单列表
      * @return 下拉树结构列表
      */
@@ -88,7 +88,7 @@ public interface ISysMenuService
 
     /**
      * 根据菜单ID查询信息
-     * 
+     *
      * @param menuId 菜单ID
      * @return 菜单信息
      */
@@ -96,7 +96,7 @@ public interface ISysMenuService
 
     /**
      * 是否存在菜单子节点
-     * 
+     *
      * @param menuId 菜单ID
      * @return 结果 true 存在 false 不存在
      */
@@ -113,7 +113,7 @@ public interface ISysMenuService
 
     /**
      * 查询菜单是否存在角色
-     * 
+     *
      * @param menuId 菜单ID
      * @return 结果 true 存在 false 不存在
      */
@@ -129,7 +129,7 @@ public interface ISysMenuService
 
     /**
      * 新增保存菜单信息
-     * 
+     *
      * @param menu 菜单信息
      * @return 结果
      */
@@ -137,7 +137,7 @@ public interface ISysMenuService
 
     /**
      * 修改保存菜单信息
-     * 
+     *
      * @param menu 菜单信息
      * @return 结果
      */
@@ -145,7 +145,7 @@ public interface ISysMenuService
 
     /**
      * 删除菜单管理信息
-     * 
+     *
      * @param menuId 菜单ID
      * @return 结果
      */
@@ -161,7 +161,7 @@ public interface ISysMenuService
 
     /**
      * 校验菜单名称是否唯一
-     * 
+     *
      * @param menu 菜单信息
      * @return 结果
      */
@@ -186,5 +186,15 @@ public interface ISysMenuService
      * @param menu 菜单信息
      * @return 结果
      */
-    Long insertMenus(SysMenu menu,Long userId);
+    Long insertMenus(SysMenu menu, Long userId);
+
+    /**
+     * 新增保存菜单信息(添加租户逻辑)
+     *
+     * @param menu 菜单信息
+     * @return 结果
+     */
+    Long insertMenusByList(List<SysMenu> sysMenuList);
+
+
 }

+ 13 - 0
zkqy-system/src/main/java/com/zkqy/system/service/impl/SysMenuServiceImpl.java

@@ -334,6 +334,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
     public int deleteMenuById(Long menuId) {
         return menuMapper.deleteMenuById(menuId);
     }
+
     /**
      * 批量删除菜单管理信息
      *
@@ -398,6 +399,18 @@ public class SysMenuServiceImpl implements ISysMenuService {
         return i;
     }
 
+    @Override
+    public Long insertMenusByList(List<SysMenu> sysMenuList) {
+        sysMenuList.forEach(item -> {
+            menuMapper.insertMenu(item);
+            SysTenantMenu tenantMenu = new SysTenantMenu();
+            tenantMenu.setTenantId(item.getTenantId());
+            tenantMenu.setMenuId(item.getMenuId());
+            tenantMenuMapper.insertSysTenantMenu(tenantMenu);
+        });
+        return 1L;
+    }
+
     /**
      * 获取路由名称
      *

+ 478 - 364
zkqy-system/src/main/resources/mapper/system/SysMenuMapper.xml

@@ -1,371 +1,485 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-		PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-		"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.zkqy.system.mapper.SysMenuMapper">
 
-	<resultMap type="SysMenu" id="SysMenuResult">
-		<id     property="menuId"         column="menu_id"        />
-		<result property="menuName"       column="menu_name"      />
-		<result property="parentName"     column="parent_name"    />
-		<result property="parentId"       column="parent_id"      />
-		<result property="orderNum"       column="order_num"      />
-		<result property="path"           column="path"           />
-		<result property="component"      column="component"      />
-		<result property="query"          column="query"          />
-		<result property="isFrame"        column="is_frame"       />
-		<result property="isCache"        column="is_cache"       />
-		<result property="menuType"       column="menu_type"      />
-		<result property="visible"        column="visible"        />
-		<result property="status"         column="status"         />
-		<result property="perms"          column="perms"          />
-		<result property="icon"           column="icon"           />
-		<result property="createBy"       column="create_by"      />
-		<result property="createTime"     column="create_time"    />
-		<result property="updateTime"     column="update_time"    />
-		<result property="updateBy"       column="update_by"      />
-		<result property="remark"         column="remark"         />
-		<result property="tenantName"     column="tenant_name"    />
-	</resultMap>
-
-	<sql id="selectMenuVo">
-		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
-	</sql>
-
-	<select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
-		SELECT
-		m.menu_id,
-		m.menu_name,
-		m.parent_id,
-		m.order_num,
-		m.path,
-		m.component,
-		m.`query`,
-		m.is_frame,
-		m.is_cache,
-		m.menu_type,
-		m.visible,
-		m.STATUS,
-		ifnull( m.perms, '' ) AS perms,
-		m.icon,
-		m.create_time,
-		t.tenant_name
-		FROM
-		sys_menu m
-		LEFT JOIN sys_user u on m.create_by = u.user_name
-		LEFT JOIN sys_tenant t on t.tenant_id = u.tenant_id
-		where
-		m.menu_id not in (select DISTINCT menu_id from sys_tenant_menu)
-		<if test="menuName != null and menuName != ''">
-			AND m.menu_name like concat('%', #{menuName}, '%')
-		</if>
-		<if test="visible != null and visible != ''">
-			AND m.visible = #{visible}
-		</if>
-		<if test="status != null and status != ''">
-			AND m.status = #{status}
-		</if>
-		<if test="tenantName != null and tenantName != ''">
-			AND t.tenant_name like concat('%', #{tenantName}, '%')
-		</if>
-		order by parent_id, order_num
-	</select>
-
-	<select id="selectTenantMenuList" parameterType="Long" resultMap="SysMenuResult">
-		select m.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, tm.`tenant_id`
-		from sys_menu m
-				 left join sys_tenant_menu tm on tm.menu_id = m.menu_id
-		where tm.tenant_id = #{tenantId}
-		  and m.menu_name not in ('数据引擎','流程引擎','表单引擎')
-		  and parent_id not in (select menu_id from  sys_menu where menu_name in ("数据引擎","流程引擎","表单引擎"))
-		order by parent_id, order_num
-
-	</select>
-
-	<select id="selectMenuTreeAll" resultMap="SysMenuResult">
-		select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, 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
-		from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
-						  and m.menu_id not in (select DISTINCT menu_id from sys_tenant_menu)
-		order by m.parent_id, m.order_num
-	</select>
-
-	<select id="selectTenantMenuTreeAll" parameterType="Long" resultMap="SysMenuResult">
-		select distinct m.menu_id,
-						m.parent_id,
-						m.menu_name,
-						m.path,
-						m.component,
-						m.`query`,
-						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
-		from sys_tenant_menu tm
-				 left join sys_menu m on
-			tm.menu_id = m.menu_id
-		where m.menu_type in ('M', 'C')
-		  and m.status = 0
-		  and tm.tenant_id = #{tenantId}
-		  and m.menu_name in ('数据引擎', '流程引擎', '表单引擎')
-
-
-		UNION
-
-
-		select distinct m.menu_id,
-						m.parent_id,
-						m.menu_name,
-						m.path,
-						m.component,
-						m.`query`,
-						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
-		from sys_tenant_menu tm
-				 left join sys_menu m on
-			tm.menu_id = m.menu_id
-		where m.menu_type in ('M', 'C')
-		  and m.status = 0
-		  and tm.tenant_id = #{tenantId}
-		  and m.parent_id in (select menu_id
-							  from sys_menu
-							  where menu_name in ("数据引擎", "流程引擎", "表单引擎"))
-
-	</select>
-
-	<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
-		select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, 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,t.tenant_name
-		from sys_menu m
-		left join sys_role_menu rm on m.menu_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.role_id
-		LEFT JOIN sys_user u on m.create_by = u.user_name
-		LEFT JOIN sys_tenant t on t.tenant_id = u.tenant_id
-		where ur.user_id = #{params.userId}
-		<if test="menuName != null and menuName != ''">
-			AND m.menu_name like concat('%', #{menuName}, '%')
-		</if>
-		<if test="visible != null and visible != ''">
-			AND m.visible = #{visible}
-		</if>
-		<if test="status != null and status != ''">
-			AND m.status = #{status}
-		</if>
-		<if test="tenantName != null and tenantName != ''">
-			AND t.tenant_name like concat('%', #{tenantName}, '%')
-		</if>
-		order by m.parent_id, m.order_num
-	</select>
-
-	<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
-		select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, 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
-		from sys_menu m
-				 left join sys_role_menu rm on m.menu_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.role_id
-				 left join sys_user u on ur.user_id = u.user_id
-		where u.user_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="selectMenuListByRoleId" resultType="Long">
-		select m.menu_id
-		from sys_menu m
-		left join sys_role_menu rm on m.menu_id = rm.menu_id
-		where rm.role_id = #{roleId}
-		<if test="menuCheckStrictly">
-			and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id = rm.menu_id and rm.role_id = #{roleId})
-		</if>
-		order by m.parent_id, m.order_num
-	</select>
-
-	<select id="selectMenuPerms" resultType="String">
-		select distinct m.perms
-		from sys_menu m
-				 left join sys_role_menu rm on m.menu_id = rm.menu_id
-				 left join sys_user_role ur on rm.role_id = ur.role_id
-	</select>
-
-	<select id="selectMenuPermsByUserId" parameterType="Long" resultType="String">
-		select distinct m.perms
-		from sys_menu m
-				 left join sys_role_menu rm on m.menu_id = rm.menu_id
-				 left join sys_user_role ur on rm.role_id = ur.role_id
-				 left join sys_role r on r.role_id = ur.role_id
-		where m.status = '0' and r.status = '0' and ur.user_id = #{userId}
-	</select>
-
-	<select id="selectMenuPermsByRoleId" parameterType="Long" resultType="String">
-		select distinct m.perms
-		from sys_menu m
-				 left join sys_role_menu rm on m.menu_id = rm.menu_id
-		where m.status = '0' and rm.role_id = #{roleId}
-	</select>
-
-	<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
-		<include refid="selectMenuVo"/>
-		where menu_id = #{menuId}
-	</select>
-
-	<select id="hasChildByMenuId" resultType="Integer">
-		select count(1) from sys_menu where parent_id = #{menuId}
-	</select>
-
-	<select id="hasChildByMenuIdBatchRemove" resultType="Integer" parameterType="java.util.List">
-		select count(1) from sys_menu where parent_id in
-		<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
-			#{item}
-		</foreach>
-	</select>
-
-	<!--	<include refid="selectMenuVo"/>-->
-	<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
-		SELECT sys.menu_id,
-		sys.menu_name,
-		sys.parent_id,
-		sys.order_num,
-		sys.path,
-		sys.component,
-		sys.`query`,
-		sys.is_frame,
-		sys.is_cache,
-		sys.menu_type,
-		sys.visible,
-		sys.STATUS,
-		ifnull(sys.perms, '') AS perms,
-		sys.icon,
-		sys.create_time
-		FROM sys_menu AS sys
-		LEFT JOIN sys_tenant_menu AS tenant ON sys.menu_id = tenant.menu_id
-		WHERE sys.menu_name = #{menuName}
-		AND sys.parent_id = #{parentId}
-		<if test="tenantId != null and tenantId != ''">
-			AND tenant.tenant_id = #{tenantId}
-		</if>
-		LIMIT 1
-	</select>
-
-	<update id="updateMenu" parameterType="SysMenu">
-		update sys_menu
-		<set>
-			<if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
-			<if test="parentId != null">parent_id = #{parentId},</if>
-			<if test="orderNum != null">order_num = #{orderNum},</if>
-			<if test="path != null and path != ''">path = #{path},</if>
-			<if test="component != null">component = #{component},</if>
-			<if test="query != null">`query` = #{query},</if>
-			<if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if>
-			<if test="isCache != null and isCache != ''">is_cache = #{isCache},</if>
-			<if test="menuType != null and menuType != ''">menu_type = #{menuType},</if>
-			<if test="visible != null">visible = #{visible},</if>
-			<if test="status != null">status = #{status},</if>
-			<if test="perms !=null">perms = #{perms},</if>
-			<if test="icon !=null and icon != ''">icon = #{icon},</if>
-			<if test="remark != null and remark != ''">remark = #{remark},</if>
-			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
-			update_time = sysdate()
-		</set>
-		where menu_id = #{menuId}
-	</update>
-
-	<insert id="insertMenu" parameterType="SysMenu" useGeneratedKeys="true" keyProperty="menuId">
-		insert into sys_menu(
-		<if test="menuId != null and menuId != 0">menu_id,</if>
-		<if test="parentId != null and parentId != 0">parent_id,</if>
-		<if test="menuName != null and menuName != ''">menu_name,</if>
-		<if test="orderNum != null">order_num,</if>
-		<if test="path != null and path != ''">path,</if>
-		<if test="component != null and component != ''">component,</if>
-		<if test="query != null and query != ''">`query`,</if>
-		<if test="isFrame != null and isFrame != ''">is_frame,</if>
-		<if test="isCache != null and isCache != ''">is_cache,</if>
-		<if test="menuType != null and menuType != ''">menu_type,</if>
-		<if test="visible != null">visible,</if>
-		<if test="status != null">status,</if>
-		<if test="perms !=null and perms != ''">perms,</if>
-		<if test="icon != null and icon != ''">icon,</if>
-		<if test="remark != null and remark != ''">remark,</if>
-		<if test="createBy != null and createBy != ''">create_by,</if>
-		create_time
-		)values(
-		<if test="menuId != null and menuId != 0">#{menuId},</if>
-		<if test="parentId != null and parentId != 0">#{parentId},</if>
-		<if test="menuName != null and menuName != ''">#{menuName},</if>
-		<if test="orderNum != null">#{orderNum},</if>
-		<if test="path != null and path != ''">#{path},</if>
-		<if test="component != null and component != ''">#{component},</if>
-		<if test="query != null and query != ''">#{query},</if>
-		<if test="isFrame != null and isFrame != ''">#{isFrame},</if>
-		<if test="isCache != null and isCache != ''">#{isCache},</if>
-		<if test="menuType != null and menuType != ''">#{menuType},</if>
-		<if test="visible != null">#{visible},</if>
-		<if test="status != null">#{status},</if>
-		<if test="perms !=null and perms != ''">#{perms},</if>
-		<if test="icon != null and icon != ''">#{icon},</if>
-		<if test="remark != null and remark != ''">#{remark},</if>
-		<if test="createBy != null and createBy != ''">#{createBy},</if>
-		sysdate()
-		)
-	</insert>
-
-	<delete id="deleteMenuById" parameterType="Long">
-		delete from sys_menu where menu_id = #{menuId}
-	</delete>
-
-	<delete id="batchDeleteMenuById" parameterType="java.util.List">
-		delete from sys_menu where menu_id in
-		<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
-			#{item}
-		</foreach>
-	</delete>
-
-	<select id="getMenuList" resultMap="SysMenuResult">
-		SELECT
-			m.menu_id,
-			m.menu_name,
-			m.parent_id,
-			m.order_num,
-			m.path,
-			m.component,
-			m.`query`,
-			m.is_frame,
-			m.is_cache,
-			m.menu_type,
-			m.visible,
-			m.STATUS,
-			ifnull( m.perms, '' ) AS perms,
-			m.icon,
-			m.create_time
-		FROM
-			sys_menu m
-				join sys_tenant_menu tm on m.menu_id = tm.menu_id
-		where m.menu_type != 'F' and m.STATUS = '0' and tm.tenant_id = #{tenantId}
-	</select>
-
-	<select id="selectMenuByPath" parameterType="string" resultMap="SysMenuResult">
-		<include refid="selectMenuVo"/>
-		where path = #{path}
-	</select>
-
-	<select id="selectMenusByIds" resultMap="SysMenuResult">
-		<include refid="selectMenuVo"></include>
-		where menu_id in
-		<foreach collection="list" item="id" open="(" close=")" separator=",">
-			#{id}
-		</foreach>
-	</select>
+    <resultMap type="SysMenu" id="SysMenuResult">
+        <id property="menuId" column="menu_id"/>
+        <result property="menuName" column="menu_name"/>
+        <result property="parentName" column="parent_name"/>
+        <result property="parentId" column="parent_id"/>
+        <result property="orderNum" column="order_num"/>
+        <result property="path" column="path"/>
+        <result property="component" column="component"/>
+        <result property="query" column="query"/>
+        <result property="isFrame" column="is_frame"/>
+        <result property="isCache" column="is_cache"/>
+        <result property="menuType" column="menu_type"/>
+        <result property="visible" column="visible"/>
+        <result property="status" column="status"/>
+        <result property="perms" column="perms"/>
+        <result property="icon" column="icon"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="remark" column="remark"/>
+        <result property="tenantName" column="tenant_name"/>
+    </resultMap>
+
+    <sql id="selectMenuVo">
+        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
+    </sql>
+
+    <select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
+        SELECT
+        m.menu_id,
+        m.menu_name,
+        m.parent_id,
+        m.order_num,
+        m.path,
+        m.component,
+        m.`query`,
+        m.is_frame,
+        m.is_cache,
+        m.menu_type,
+        m.visible,
+        m.STATUS,
+        ifnull( m.perms, '' ) AS perms,
+        m.icon,
+        m.create_time,
+        t.tenant_name
+        FROM
+        sys_menu m
+        LEFT JOIN sys_user u on m.create_by = u.user_name
+        LEFT JOIN sys_tenant t on t.tenant_id = u.tenant_id
+        where
+        m.menu_id not in (select DISTINCT menu_id from sys_tenant_menu)
+        <if test="menuName != null and menuName != ''">
+            AND m.menu_name like concat('%', #{menuName}, '%')
+        </if>
+        <if test="visible != null and visible != ''">
+            AND m.visible = #{visible}
+        </if>
+        <if test="status != null and status != ''">
+            AND m.status = #{status}
+        </if>
+        <if test="tenantName != null and tenantName != ''">
+            AND t.tenant_name like concat('%', #{tenantName}, '%')
+        </if>
+        order by parent_id, order_num
+    </select>
+
+    <select id="selectTenantMenuList" parameterType="Long" resultMap="SysMenuResult">
+        select m.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,
+               tm.`tenant_id`
+        from sys_menu m
+                 left join sys_tenant_menu tm on tm.menu_id = m.menu_id
+        where tm.tenant_id = #{tenantId}
+          and m.menu_name not in ('数据引擎', '流程引擎', '表单引擎')
+          and parent_id not in (select menu_id from sys_menu where menu_name in ("数据引擎", "流程引擎", "表单引擎"))
+        order by parent_id, order_num
+
+    </select>
+
+    <select id="selectMenuTreeAll" resultMap="SysMenuResult">
+        select distinct m.menu_id,
+                        m.parent_id,
+                        m.menu_name,
+                        m.path,
+                        m.component,
+                        m.`query`,
+                        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
+        from sys_menu m
+        where m.menu_type in ('M', 'C')
+          and m.status = 0
+          and m.menu_id not in (select DISTINCT menu_id from sys_tenant_menu)
+        order by m.parent_id, m.order_num
+    </select>
+
+    <select id="selectTenantMenuTreeAll" parameterType="Long" resultMap="SysMenuResult">
+        select distinct m.menu_id,
+                        m.parent_id,
+                        m.menu_name,
+                        m.path,
+                        m.component,
+                        m.`query`,
+                        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
+        from sys_tenant_menu tm
+                 left join sys_menu m on
+            tm.menu_id = m.menu_id
+        where m.menu_type in ('M', 'C')
+          and m.status = 0
+          and tm.tenant_id = #{tenantId}
+          and m.menu_name in ('数据引擎', '流程引擎', '表单引擎')
+
+
+        UNION
+
+
+        select distinct m.menu_id,
+                        m.parent_id,
+                        m.menu_name,
+                        m.path,
+                        m.component,
+                        m.`query`,
+                        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
+        from sys_tenant_menu tm
+                 left join sys_menu m on
+            tm.menu_id = m.menu_id
+        where m.menu_type in ('M', 'C')
+          and m.status = 0
+          and tm.tenant_id = #{tenantId}
+          and m.parent_id in (select menu_id
+                              from sys_menu
+                              where menu_name in ("数据引擎", "流程引擎", "表单引擎"))
+
+    </select>
+
+    <select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
+        select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, 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,t.tenant_name
+        from sys_menu m
+        left join sys_role_menu rm on m.menu_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.role_id
+        LEFT JOIN sys_user u on m.create_by = u.user_name
+        LEFT JOIN sys_tenant t on t.tenant_id = u.tenant_id
+        where ur.user_id = #{params.userId}
+        <if test="menuName != null and menuName != ''">
+            AND m.menu_name like concat('%', #{menuName}, '%')
+        </if>
+        <if test="visible != null and visible != ''">
+            AND m.visible = #{visible}
+        </if>
+        <if test="status != null and status != ''">
+            AND m.status = #{status}
+        </if>
+        <if test="tenantName != null and tenantName != ''">
+            AND t.tenant_name like concat('%', #{tenantName}, '%')
+        </if>
+        order by m.parent_id, m.order_num
+    </select>
+
+    <select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
+        select distinct m.menu_id,
+                        m.parent_id,
+                        m.menu_name,
+                        m.path,
+                        m.component,
+                        m.`query`,
+                        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
+        from sys_menu m
+                 left join sys_role_menu rm on m.menu_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.role_id
+                 left join sys_user u on ur.user_id = u.user_id
+        where u.user_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="selectMenuListByRoleId" resultType="Long">
+        select m.menu_id
+        from sys_menu m
+        left join sys_role_menu rm on m.menu_id = rm.menu_id
+        where rm.role_id = #{roleId}
+        <if test="menuCheckStrictly">
+            and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id =
+            rm.menu_id and rm.role_id = #{roleId})
+        </if>
+        order by m.parent_id, m.order_num
+    </select>
+
+    <select id="selectMenuPerms" resultType="String">
+        select distinct m.perms
+        from sys_menu m
+                 left join sys_role_menu rm on m.menu_id = rm.menu_id
+                 left join sys_user_role ur on rm.role_id = ur.role_id
+    </select>
+
+    <select id="selectMenuPermsByUserId" parameterType="Long" resultType="String">
+        select distinct m.perms
+        from sys_menu m
+                 left join sys_role_menu rm on m.menu_id = rm.menu_id
+                 left join sys_user_role ur on rm.role_id = ur.role_id
+                 left join sys_role r on r.role_id = ur.role_id
+        where m.status = '0'
+          and r.status = '0'
+          and ur.user_id = #{userId}
+    </select>
+
+    <select id="selectMenuPermsByRoleId" parameterType="Long" resultType="String">
+        select distinct m.perms
+        from sys_menu m
+                 left join sys_role_menu rm on m.menu_id = rm.menu_id
+        where m.status = '0'
+          and rm.role_id = #{roleId}
+    </select>
+
+    <select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
+        <include refid="selectMenuVo"/>
+        where menu_id = #{menuId}
+    </select>
+
+    <select id="hasChildByMenuId" resultType="Integer">
+        select count(1)
+        from sys_menu
+        where parent_id = #{menuId}
+    </select>
+
+    <select id="hasChildByMenuIdBatchRemove" resultType="Integer" parameterType="java.util.List">
+        select count(1) from sys_menu where parent_id in
+        <foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+    </select>
+
+    <!--	<include refid="selectMenuVo"/>-->
+    <select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
+        SELECT sys.menu_id,
+        sys.menu_name,
+        sys.parent_id,
+        sys.order_num,
+        sys.path,
+        sys.component,
+        sys.`query`,
+        sys.is_frame,
+        sys.is_cache,
+        sys.menu_type,
+        sys.visible,
+        sys.STATUS,
+        ifnull(sys.perms, '') AS perms,
+        sys.icon,
+        sys.create_time
+        FROM sys_menu AS sys
+        LEFT JOIN sys_tenant_menu AS tenant ON sys.menu_id = tenant.menu_id
+        WHERE sys.menu_name = #{menuName}
+        AND sys.parent_id = #{parentId}
+        <if test="tenantId != null and tenantId != ''">
+            AND tenant.tenant_id = #{tenantId}
+        </if>
+        LIMIT 1
+    </select>
+
+    <update id="updateMenu" parameterType="SysMenu">
+        update sys_menu
+        <set>
+            <if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
+            <if test="parentId != null">parent_id = #{parentId},</if>
+            <if test="orderNum != null">order_num = #{orderNum},</if>
+            <if test="path != null and path != ''">path = #{path},</if>
+            <if test="component != null">component = #{component},</if>
+            <if test="query != null">`query` = #{query},</if>
+            <if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if>
+            <if test="isCache != null and isCache != ''">is_cache = #{isCache},</if>
+            <if test="menuType != null and menuType != ''">menu_type = #{menuType},</if>
+            <if test="visible != null">visible = #{visible},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="perms !=null">perms = #{perms},</if>
+            <if test="icon !=null and icon != ''">icon = #{icon},</if>
+            <if test="remark != null and remark != ''">remark = #{remark},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            update_time = sysdate()
+        </set>
+        where menu_id = #{menuId}
+    </update>
+
+    <insert id="insertMenu" parameterType="SysMenu" useGeneratedKeys="true" keyProperty="menuId">
+        insert into sys_menu(
+        <if test="menuId != null and menuId != 0">menu_id,</if>
+        <if test="parentId != null and parentId != 0">parent_id,</if>
+        <if test="menuName != null and menuName != ''">menu_name,</if>
+        <if test="orderNum != null">order_num,</if>
+        <if test="path != null and path != ''">path,</if>
+        <if test="component != null and component != ''">component,</if>
+        <if test="query != null and query != ''">`query`,</if>
+        <if test="isFrame != null and isFrame != ''">is_frame,</if>
+        <if test="isCache != null and isCache != ''">is_cache,</if>
+        <if test="menuType != null and menuType != ''">menu_type,</if>
+        <if test="visible != null">visible,</if>
+        <if test="status != null">status,</if>
+        <if test="perms !=null and perms != ''">perms,</if>
+        <if test="icon != null and icon != ''">icon,</if>
+        <if test="remark != null and remark != ''">remark,</if>
+        <if test="createBy != null and createBy != ''">create_by,</if>
+        create_time
+        )values(
+        <if test="menuId != null and menuId != 0">#{menuId},</if>
+        <if test="parentId != null and parentId != 0">#{parentId},</if>
+        <if test="menuName != null and menuName != ''">#{menuName},</if>
+        <if test="orderNum != null">#{orderNum},</if>
+        <if test="path != null and path != ''">#{path},</if>
+        <if test="component != null and component != ''">#{component},</if>
+        <if test="query != null and query != ''">#{query},</if>
+        <if test="isFrame != null and isFrame != ''">#{isFrame},</if>
+        <if test="isCache != null and isCache != ''">#{isCache},</if>
+        <if test="menuType != null and menuType != ''">#{menuType},</if>
+        <if test="visible != null">#{visible},</if>
+        <if test="status != null">#{status},</if>
+        <if test="perms !=null and perms != ''">#{perms},</if>
+        <if test="icon != null and icon != ''">#{icon},</if>
+        <if test="remark != null and remark != ''">#{remark},</if>
+        <if test="createBy != null and createBy != ''">#{createBy},</if>
+        sysdate()
+        )
+    </insert>
+
+    <delete id="deleteMenuById" parameterType="Long">
+        delete
+        from sys_menu
+        where menu_id = #{menuId}
+    </delete>
+
+    <delete id="batchDeleteMenuById" parameterType="java.util.List">
+        delete from sys_menu where menu_id in
+        <foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+    </delete>
+
+    <select id="getMenuList" resultMap="SysMenuResult">
+        SELECT m.menu_id,
+               m.menu_name,
+               m.parent_id,
+               m.order_num,
+               m.path,
+               m.component,
+               m.`query`,
+               m.is_frame,
+               m.is_cache,
+               m.menu_type,
+               m.visible,
+               m.STATUS,
+               ifnull(m.perms, '') AS perms,
+               m.icon,
+               m.create_time
+        FROM sys_menu m
+                 join sys_tenant_menu tm on m.menu_id = tm.menu_id
+        where m.menu_type != 'F' and m.STATUS = '0' and tm.tenant_id = #{tenantId}
+    </select>
+
+    <select id="selectMenuByPath" parameterType="string" resultMap="SysMenuResult">
+        <include refid="selectMenuVo"/>
+        where path = #{path}
+    </select>
+
+    <select id="selectMenusByIds" resultMap="SysMenuResult">
+        <include refid="selectMenuVo"></include>
+        where menu_id in
+        <foreach collection="list" item="id" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+    </select>
+
+
+    <insert id="insertMenuBatch" parameterType="java.util.List">
+        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
+        <foreach collection="list" item="item" separator=",">
+            (
+            #{item.menuId},
+            #{item.parentId},
+            #{item.menuName},
+            #{item.orderNum},
+            #{item.path},
+            #{item.component},
+            #{item.query},
+            #{item.isFrame},
+            #{item.isCache},
+            #{item.menuType},
+            #{item.visible},
+            #{item.status},
+            #{item.perms},
+            #{item.icon},
+            #{item.remark},
+            #{item.createBy},
+            sysdate()
+            )
+        </foreach>
+    </insert>
 
 </mapper>
 

+ 20 - 2
zkqy-ui/babel.config.js

@@ -9,5 +9,23 @@ module.exports = {
       // This plugin can significantly increase the speed of hot updates, when you have a large number of pages.
       'plugins': ['dynamic-import-node']
     }
-  },
-}
+  }
+}
+
+// module.exports = {
+//   presets: [
+//     '@vue/babel-preset-jsx',
+//     [
+//       '@babel/preset-env',
+//       {
+//         'useBuiltIns': 'entry',
+//         'corejs': 3
+//       }
+//     ]
+//   ],
+//   'env': {
+//     'development': {
+//       'plugins': ['dynamic-import-node']
+//     }
+//   }
+// }

+ 1 - 1
zkqy-ui/src/permission.js

@@ -8,7 +8,7 @@ import {isRelogin} from '@/utils/request'
 
 NProgress.configure({showSpinner: false})
 
-const whiteList = ['/login', '/register', '/404', '/adminLogin']
+const whiteList = ['/login', '/register', '/404', '/adminLogin','/401']
 
 router.beforeEach((to, from, next) => {
   NProgress.start()

Різницю між файлами не показано, бо вона завелика
+ 0 - 0
zkqy-ui/src/utils/icon.js


+ 2 - 3
zkqy-ui/src/views/login.vue

@@ -8,8 +8,7 @@
       ref="loginForm"
       :model="loginForm"
       :rules="loginRules"
-      class="login-form"
-    >
+      class="login-form">
       <el-row>
         <el-col :span="12" class="comlogo"></el-col>
         <el-col :span="12">
@@ -161,7 +160,6 @@ export default {
         // 得到tenantId 查询裤中是否存在该租户
         isTenantExist({tenantCode: tenantCode}).then(res => {
           if (res == undefined) {
-            this.$message.warning("请访问正确地址!")
             this.$router.push({path: "/401"})
           } else if (res.data?.tenantId) { // 判断当前编号是否存在库中
             this.tenantId = res.data.tenantId;
@@ -174,6 +172,7 @@ export default {
             this.getCode();
             this.getCookie();
           } else {
+            console.log("租户有问题!")
             // 当前访问链接中的租户编号不存在
             this.$router.push({path: "/401"})
           }

+ 165 - 90
zkqy-ui/src/views/system/excuteBtnMange/index.vue

@@ -30,10 +30,12 @@
           icon="el-icon-search"
           size="mini"
           @click="handleQuery"
-          >搜索</el-button
+        >搜索
+        </el-button
         >
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
-          >重置</el-button
+        >重置
+        </el-button
         >
       </el-form-item>
     </el-form>
@@ -47,7 +49,8 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['system:menu:add']"
-          >新增</el-button
+        >新增
+        </el-button
         >
       </el-col>
       <el-col :span="1.5">
@@ -57,7 +60,8 @@
           icon="el-icon-sort"
           size="mini"
           @click="toggleExpandAll"
-          >展开/折叠</el-button
+        >展开/折叠
+        </el-button
         >
       </el-col>
       <el-col :span="1.5">
@@ -93,7 +97,7 @@
       ></el-table-column>
       <el-table-column prop="btnIcon" label="图标" align="center" width="100">
         <template v-if="scope.row.btnIcon" slot-scope="scope">
-          <svg-icon :icon-class="scope.row.btnIcon" />
+          <svg-icon :icon-class="scope.row.btnIcon"/>
         </template>
       </el-table-column>
       <el-table-column
@@ -126,34 +130,43 @@
             </el-button>
             <el-dropdown-menu slot="dropdown">
               <el-dropdown-item
-                ><el-button
+              >
+                <el-button
                   size="mini"
                   type="text"
                   icon="el-icon-edit"
                   @click="handleUpdate(scope.row)"
                   v-hasPermi="['system:menu:edit']"
-                  >修改</el-button
-                ></el-dropdown-item
+                >修改
+                </el-button
+                >
+              </el-dropdown-item
               >
               <el-dropdown-item v-if="scope.row.btnType == 'DIRECTORY'"
-                ><el-button
+              >
+                <el-button
                   size="mini"
                   type="text"
                   icon="el-icon-plus"
                   @click="handleAdd(scope.row)"
                   v-hasPermi="['system:menu:add']"
-                  >新增</el-button
-                ></el-dropdown-item
+                >新增
+                </el-button
+                >
+              </el-dropdown-item
               >
               <el-dropdown-item
-                ><el-button
+              >
+                <el-button
                   size="mini"
                   type="text"
                   icon="el-icon-delete"
                   @click="handleDelete(scope.row)"
                   v-hasPermi="['system:menu:remove']"
-                  >删除</el-button
-                ></el-dropdown-item
+                >删除
+                </el-button
+                >
+              </el-dropdown-item
               >
             </el-dropdown-menu>
           </el-dropdown>
@@ -235,35 +248,54 @@
           <el-col :span="12">
             <el-form-item label="按钮图标" prop="btnIcon">
               <el-popover
-                placement="bottom-start"
-                width="460"
-                trigger="click"
-                @show="$refs['iconSelect'].reset()"
-              >
-                <IconSelect
-                  ref="iconSelect"
-                  @selected="selected"
-                  :active-icon="btnGroupFormData.icon"
-                />
-                <el-input
-                  slot="reference"
-                  v-model="btnGroupFormData.icon"
-                  placeholder="点击选择图标"
-                  readonly
-                >
-                  <svg-icon
-                    v-if="btnGroupFormData.btnIcon"
-                    slot="prefix"
-                    :icon-class="btnGroupFormData.btnIcon"
-                    style="width: 25px"
-                  />
-                  <i
-                    v-else
-                    slot="prefix"
-                    class="el-icon-search el-input__icon"
-                  />
-                </el-input>
+                placement="bottom"
+                width="450"
+                trigger="click">
+                  <span slot="reference" style="display:inline-block;width:200px;height:40px;line-height:40px;">
+                                    <el-input
+                                      :prefix-icon="btnGroupFormData.icon"
+                                      slot="reference"
+                                      v-model="btnGroupFormData.icon"
+                                      placeholder="点击选择图标"
+                                      readonly></el-input>
+                  </span>
+                <div class="iconList">
+                  <i v-for="item in iconList" :key="item" :class="item" @click="setIcon(item)"
+                     style="font-size:20px"></i>
+                </div>
               </el-popover>
+
+
+              <!--              <el-popover-->
+              <!--                placement="bottom-start"-->
+              <!--                width="460"-->
+              <!--                trigger="click"-->
+              <!--                @show="$refs['iconSelect'].reset()"-->
+              <!--              >-->
+              <!--                <IconSelect-->
+              <!--                  ref="iconSelect"-->
+              <!--                  @selected="selected"-->
+              <!--                  :active-icon="btnGroupFormData.icon"-->
+              <!--                />-->
+              <!--                <el-input-->
+              <!--                  slot="reference"-->
+              <!--                  v-model="btnGroupFormData.icon"-->
+              <!--                  placeholder="点击选择图标"-->
+              <!--                  readonly-->
+              <!--                >-->
+              <!--                  <svg-icon-->
+              <!--                    v-if="btnGroupFormData.btnIcon"-->
+              <!--                    slot="prefix"-->
+              <!--                    :icon-class="btnGroupFormData.btnIcon"-->
+              <!--                    style="width: 25px"-->
+              <!--                  />-->
+              <!--                  <i-->
+              <!--                    v-else-->
+              <!--                    slot="prefix"-->
+              <!--                    class="el-icon-search el-input__icon"-->
+              <!--                  />-->
+              <!--                </el-input>-->
+              <!--              </el-popover>-->
             </el-form-item>
           </el-col>
           <el-col
@@ -497,7 +529,7 @@
               </el-table>
             </div> -->
             <el-col :span="24">
-              <!-- 
+              <!--
               v-show="
                 btnGroupFormData.btnType != 3 && btnGroupFormData.btnType != 7
               " -->
@@ -512,11 +544,12 @@
                   }}参数</span
                 > -->
                 <el-divider content-position="center">{{
-                  btnGroupFormData.btnType != "OUTLINK" &&
-                  btnGroupFormData.btnType != "INNERLINK"
-                    ? "默认修改字段"
-                    : "query参数"
-                }}</el-divider>
+                    btnGroupFormData.btnType != "OUTLINK" &&
+                    btnGroupFormData.btnType != "INNERLINK"
+                      ? "默认修改字段"
+                      : "query参数"
+                  }}
+                </el-divider>
                 <el-table :data="commonFieldData" style="width: 100%">
                   <el-table-column label="序号" type="index" width="50">
                   </el-table-column>
@@ -538,15 +571,15 @@
                           :value="item.tableName + '.' + item.key"
                         >
                           <span class="descibe" style="float: left">{{
-                            item.value
-                          }}</span>
+                              item.value
+                            }}</span>
                           <span
                             style="
                               float: right;
                               color: #8492a6;
                               font-size: 13px;
                             "
-                            >{{ item.tableName + "." + item.key }}</span
+                          >{{ item.tableName + "." + item.key }}</span
                           >
                         </el-option>
                       </el-select>
@@ -593,7 +626,7 @@
                         type="danger"
                         icon="el-icon-delete"
                         @click="deleteFilterItem(scope.$index)"
-                        >删除
+                      >删除
                       </el-button>
                     </template>
                   </el-table-column>
@@ -633,11 +666,11 @@
                       :value="item.tableName + '.' + item.key"
                     >
                       <span class="descibe" style="float: left">{{
-                        item.value
-                      }}</span>
+                          item.value
+                        }}</span>
                       <span
                         style="float: right; color: #8492a6; font-size: 13px"
-                        >{{ item.tableName + "." + item.key }}</span
+                      >{{ item.tableName + "." + item.key }}</span
                       >
                     </el-option>
                   </el-select>
@@ -684,7 +717,7 @@
                     type="danger"
                     icon="el-icon-delete"
                     @click="deleteConditionItem(scope.$index)"
-                    >删除
+                  >删除
                   </el-button>
                 </template>
               </el-table-column>
@@ -722,11 +755,11 @@
                       :value="item.tableName + '.' + item.key"
                     >
                       <span class="descibe" style="float: left">{{
-                        item.value
-                      }}</span>
+                          item.value
+                        }}</span>
                       <span
                         style="float: right; color: #8492a6; font-size: 13px"
-                        >{{ item.tableName + "." + item.key }}</span
+                      >{{ item.tableName + "." + item.key }}</span
                       >
                     </el-option>
                   </el-select>
@@ -779,7 +812,7 @@
                     type="danger"
                     icon="el-icon-delete"
                     @click="deleteBtnHidenCondition(scope.$index)"
-                    >删除
+                  >删除
                   </el-button>
                 </template>
               </el-table-column>
@@ -814,23 +847,29 @@ import {
   delBtn,
   checkBtn,
 } from "@/api/system/btn";
-import { listForm } from "@/api/dragform/form";
-import { listProcess } from "@/api/bpmprocess/process";
-import { listTable } from "@/api/dragform/tableList";
-import { listScript } from "@/api/bpmprocess/process";
+import {listForm} from "@/api/dragform/form";
+import {listProcess} from "@/api/bpmprocess/process";
+import {listTable} from "@/api/dragform/tableList";
+import {listScript} from "@/api/bpmprocess/process";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import IconSelect from "@/components/IconSelect";
-import { v4 as uuidv4 } from "uuid";
-import { dragTableInfo } from "@/api/tablelist/commonTable";
-import { camelCase } from "@/utils";
-import { listFormGroup } from "@/api/system/formGroup";
+import {v4 as uuidv4} from "uuid";
+import {dragTableInfo} from "@/api/tablelist/commonTable";
+import {camelCase} from "@/utils";
+import {listFormGroup} from "@/api/system/formGroup";
+
+import {elementIcons} from '@/utils/icon'
+
+
 export default {
   name: "ExcuteBtnMange",
   dicts: ["sys_show_hide", "sys_normal_disable"],
-  components: { Treeselect, IconSelect },
+  components: {Treeselect, IconSelect},
   data() {
     return {
+      chooseIcons: "",
+      iconList: [],
       // 顶部按钮 start
       activeName: "right",
       // 顶部按钮 end
@@ -869,12 +908,12 @@ export default {
       // 表单校验
       rules: {
         btnParentId: [
-          { required: true, message: "上级按钮不能为空", trigger: "change" },
+          {required: true, message: "上级按钮不能为空", trigger: "change"},
         ],
         btnGroupName: [
-          { required: true, message: "按钮组名不能为空", trigger: "blur" },
+          {required: true, message: "按钮组名不能为空", trigger: "blur"},
         ],
-        btnSort: [{ required: true, message: "排序不能为空", trigger: "blur" }],
+        btnSort: [{required: true, message: "排序不能为空", trigger: "blur"}],
         btnType: [
           {
             required: true,
@@ -1044,10 +1083,9 @@ export default {
       ],
     };
   },
-  // created() {
-  //   this.getList();
-  //   this.initFormSubData();
-  // },
+  created() {
+    this.iconList = elementIcons
+  },
   mounted() {
     this.getList();
     this.initFormSubData();
@@ -1149,13 +1187,18 @@ export default {
     },
   },
   methods: {
+    setIcon(val) {
+      console.log(val)
+      this.btnGroupFormData.icon = val;//将i的样式设为选中的样式el-icon-xxx
+      // this.chooseIcons = ""
+    },
     // tab切换回调
     handleClick(value) {
       this.getList();
     },
     // 自定义字段校验
     checkBtnFormKey(rule, value, callback) {
-      let { btnType } = this.btnGroupFormData;
+      let {btnType} = this.btnGroupFormData;
       console.log(btnType);
       if (btnType == "INSERT" || btnType == "UPDATE") {
         if (!value) {
@@ -1166,7 +1209,7 @@ export default {
       callback();
     },
     checkBtnProcessKey(rule, value, callback) {
-      let { btnType } = this.btnGroupFormData;
+      let {btnType} = this.btnGroupFormData;
       console.log(btnType);
       if (btnType == "EXECUTE" || btnType == "INITIATED") {
         if (!value) {
@@ -1176,7 +1219,7 @@ export default {
       callback();
     },
     checkBtnScriptKey(rule, value, callback) {
-      let { btnType } = this.btnGroupFormData;
+      let {btnType} = this.btnGroupFormData;
       console.log(btnType);
       if (btnType == "EXECUTE") {
         if (!value) {
@@ -1236,11 +1279,11 @@ export default {
     },
     // 获取根节点绑定表格的字段数据
     async getRootFieldInfo(btnKey) {
-      let res = await checkBtn({ btnKey });
+      let res = await checkBtn({btnKey});
       if (res.code == 200) {
         if (res.rows[0]?.tableKey) {
           let tableInfo = await dragTableInfo({
-            queryMap: { tableKey: res.rows[0].tableKey },
+            queryMap: {tableKey: res.rows[0].tableKey},
           });
           this.rootFieldInfo.fieldList = this.columnsHandler(
             JSON.parse(tableInfo.data.resultMap.template.spare)
@@ -1264,7 +1307,7 @@ export default {
         return resArr;
       }
       resArr = columns.map((item) => {
-        let { fieldName, fieldDescription, tableName } = item;
+        let {fieldName, fieldDescription, tableName} = item;
         return {
           key: fieldName,
           value: fieldDescription,
@@ -1323,7 +1366,7 @@ export default {
     },
     /** 查询菜单下拉树结构 */
     getTreeselect() {
-      listBtn({ ...this.queryParams, isEnablePaging: false }).then(
+      listBtn({...this.queryParams, isEnablePaging: false}).then(
         (response) => {
           this.menuOptions = [];
           const btnTemp = {
@@ -1428,7 +1471,7 @@ export default {
       //在已知节点下新增
       await this.getRootFieldInfo(row.rootKey);
       getBtn(row.id).then((response) => {
-        let { btnType, btnParams, btnShowCondition } = response.data;
+        let {btnType, btnParams, btnShowCondition} = response.data;
         if ((btnType == "OUTLINK" || btnType == "INNERLINK") && btnParams) {
           //内链或外链
           let tempObj = JSON.parse(btnParams);
@@ -1565,13 +1608,14 @@ export default {
           this.getList();
           this.$modal.msgSuccess("删除成功");
         })
-        .catch(() => {});
+        .catch(() => {
+        });
     },
     // 初始化表单辅助数据
     async initFormSubData() {
       try {
         //获取表单选项数据
-        let formRes = await listForm({ isEnablePaging: false });
+        let formRes = await listForm({isEnablePaging: false});
         if (formRes.code == 200) {
           formRes.rows.forEach((item) => {
             item.fId = item.fId.toString();
@@ -1587,7 +1631,7 @@ export default {
           this.$message.error("网络异常请稍后再试");
         }
         // 获取流程选项数据
-        let processRes = await listProcess({ isEnablePaging: false });
+        let processRes = await listProcess({isEnablePaging: false});
         if (processRes.code == 200) {
           this.processOptions = [
             ...processRes.rows,
@@ -1600,21 +1644,21 @@ export default {
           this.$message.error("网络异常请稍后再试");
         }
         // 获取表格选项数据
-        let TableRes = await listTable({ isEnablePaging: false });
+        let TableRes = await listTable({isEnablePaging: false});
         if (TableRes.code == 200) {
           this.tableOptions = TableRes.rows;
         } else {
           this.$message.error("网络异常请稍后再试");
         }
         // 获取脚本选项数据
-        let scriptRes = await listScript({ isEnablePaging: false });
+        let scriptRes = await listScript({isEnablePaging: false});
         if (scriptRes.code == 200) {
           this.scriptOptions = scriptRes.rows;
         } else {
           this.$message.error("网络异常请稍后再试");
         }
         // 获取表单组列表
-        let formGroupRes = await listFormGroup({ isEnablePaging: false });
+        let formGroupRes = await listFormGroup({isEnablePaging: false});
         if (formGroupRes.code == 200) {
           this.groupFormOptions = formGroupRes.rows.map((item) => {
             return {
@@ -1643,6 +1687,35 @@ export default {
 };
 </script>
 <style scoped lang="scss" scoped>
+
+.iconList {
+  width: 400px;
+  height: 300px;
+  overflow-y: scroll; //y轴显示滚动条
+  overflow-x: hidden; //x轴溢出隐藏
+  display: flex;
+  justify-content: space-around;
+  flex-wrap: wrap; //一定要换行
+  i {
+    display: inline-block;
+    width: 60px;
+    height: 45px;
+    color: #000000;
+    font-size: 20px;
+    border: 1px solid #E6E6E6;
+    border-radius: 4px;
+    cursor: pointer;
+    text-align: center;
+    line-height: 45px;
+    margin: 5px;
+
+    //&:hover {
+    //  color: $ft;
+    //  border-color: $ft;
+    //}
+  }
+}
+
 /* #app .sidebar-container .submenu-title-noDropdown:hover, #app .sidebar-container .el-submenu__title:hover {
     background-color: rgba(0, 0, 0, 0.06) !important;
 }  */
@@ -1655,12 +1728,14 @@ export default {
   flex-direction: column;
   align-items: center;
 }
+
 .table-wrap {
   width: 100%;
   display: flex;
   flex-direction: column;
   align-items: center;
 }
+
 .title {
   font-weight: 600;
 }

+ 5 - 6
zkqy-ui/vue.config.js

@@ -37,30 +37,29 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        // target: `http://192.168.110.76:8080`,//xue
-        target: `http://192.168.110.59:8080`,//han
-        // target: `http://62.234.61.92:8080`,
+        // target: `http://192.168.110.59:8080`,
+        target: `http://192.168.110.59:8080`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''
         }
       },
       '/DB': {
-        target: `http://62.234.61.92:8099`,
+        target: `http://192.168.110.59:8099`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + '/DB']: ''
         }
       },
       '/FORM': {
-        target: `http://62.234.61.92:8088`,
+        target: `http://192.168.110.59:8088`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + '/FORM']: ''
         }
       },
       '/BPM': {
-        target: `http://62.234.61.92:8055`,
+        target: `http://192.168.110.59:8055`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + '/BPM']: ''

Деякі файли не було показано, через те що забагато файлів було змінено