Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	ruoyi-ui/src/settings.js
#	ruoyi-ui/src/views/tool/gen/index.vue
Administrator 4 tahun lalu
induk
melakukan
f6451a8a8a
27 mengubah file dengan 962 tambahan dan 684 penghapusan
  1. 7 0
      boman-api/boman-api-system/src/main/java/com/boman/system/api/domain/SysMenu.java
  2. 27 0
      boman-api/boman-api-web-core/pom.xml
  3. 25 0
      boman-api/boman-api-web-core/src/main/java/com/boman/web/core/api/RemoteObjService.java
  4. 1 0
      boman-api/pom.xml
  5. 6 0
      boman-modules/boman-system/pom.xml
  6. 7 2
      boman-modules/boman-system/src/main/java/com/boman/system/controller/SysMenuController.java
  7. 32 0
      boman-modules/boman-system/src/main/java/com/boman/system/controller/SysRoleMenuController.java
  8. 9 0
      boman-modules/boman-system/src/main/java/com/boman/system/domain/SysRoleData.java
  9. 11 0
      boman-modules/boman-system/src/main/java/com/boman/system/domain/SysRoleMenu.java
  10. 8 0
      boman-modules/boman-system/src/main/java/com/boman/system/service/ISysMenuService.java
  11. 23 0
      boman-modules/boman-system/src/main/java/com/boman/system/service/impl/ISysRoleMenuService.java
  12. 37 8
      boman-modules/boman-system/src/main/java/com/boman/system/service/impl/SysMenuServiceImpl.java
  13. 45 0
      boman-modules/boman-system/src/main/java/com/boman/system/service/impl/SysRoleMenuServiceImpl.java
  14. 1 1
      boman-modules/boman-system/src/main/resources/mapper/system/SysMenuMapper.xml
  15. 3 2
      boman-modules/boman-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml
  16. 12 0
      boman-web-core/src/main/java/com/boman/web/core/controller/CommonController.java
  17. 0 3
      boman-web-core/src/main/java/com/boman/web/core/controller/ObjController.java
  18. 5 0
      boman-web-core/src/main/java/com/boman/web/core/service/common/CommonServiceImpl.java
  19. 2 0
      boman-web-core/src/main/java/com/boman/web/core/service/common/ICommonService.java
  20. 14 0
      ruoyi-ui/src/api/system/menu.js
  21. 2 1
      ruoyi-ui/src/api/system/role.js
  22. 103 66
      ruoyi-ui/src/components/DynamicForm/index.vue
  23. 102 64
      ruoyi-ui/src/components/DynamicForms/index.vue
  24. 34 5
      ruoyi-ui/src/views/system/permissions/index.vue
  25. 11 5
      ruoyi-ui/src/views/system/role/index.vue
  26. 14 24
      ruoyi-ui/src/views/tool/gen/editTable.vue
  27. 421 503
      ruoyi-ui/src/views/tool/gen/index.vue

+ 7 - 0
boman-api/boman-api-system/src/main/java/com/boman/system/api/domain/SysMenu.java

@@ -19,6 +19,13 @@ public class SysMenu extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
 
+    /** 目录*/
+    public static final String DICTIONARY = "M";
+    /** 菜单*/
+    public static final String MENU = "C";
+    /** 按钮*/
+    public static final String BUTTON = "F";
+
     /** 菜单ID */
     private Long id;
 

+ 27 - 0
boman-api/boman-api-web-core/pom.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns="http://maven.apache.org/POM/4.0.0"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<parent>
+    <groupId>com.boman</groupId>
+    <artifactId>boman-api</artifactId>
+    <version>2.5.0-SNAPSHOT</version>
+</parent>
+<modelVersion>4.0.0</modelVersion>
+
+<artifactId>boman-api-web-core</artifactId>
+
+<description>
+    boman-api-web-core系统接口模块
+</description>
+
+<dependencies>
+    <dependency>
+        <groupId>com.boman</groupId>
+        <artifactId>boman-domain</artifactId>
+        <version>2.5.0-SNAPSHOT</version>
+    </dependency>
+
+</dependencies>
+
+</project>

+ 25 - 0
boman-api/boman-api-web-core/src/main/java/com/boman/web/core/api/RemoteObjService.java

@@ -0,0 +1,25 @@
+package com.boman.web.core.api;
+
+import com.boman.common.core.constant.ServiceNameConstants;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+
+/**
+ * @author shiqian
+ * @date 2021年04月07日 10:31
+ **/
+@FeignClient(contextId = "remoteObjService", value = ServiceNameConstants.SYSTEM_SERVICE)
+public interface RemoteObjService {
+
+    /**
+     * 功能描述: 根据id查找
+     *
+     * @param tableName tableName
+     * @param pkName    pkName
+     * @return com.boman.common.core.web.domain.AjaxResult
+     */
+    @GetMapping("common/tableName/{tableName}/pkName/{pkName}")
+    Long getMaxId(@PathVariable("tableName") String tableName, @PathVariable("pkName") String pkName);
+}
+

+ 1 - 0
boman-api/pom.xml

@@ -12,6 +12,7 @@
         <module>boman-api-system</module>
         <module>boman-api-gen</module>
         <module>boman-domain</module>
+        <module>boman-api-web-core</module>
     </modules>
 
     <artifactId>boman-api</artifactId>

+ 6 - 0
boman-modules/boman-system/pom.xml

@@ -90,6 +90,12 @@
             <version>1.18.4</version>
         </dependency>
 
+        <dependency>
+            <groupId>com.boman</groupId>
+            <artifactId>boman-api-web-core</artifactId>
+            <version>2.5.0-SNAPSHOT</version>
+        </dependency>
+
     </dependencies>
 
     <build>

+ 7 - 2
boman-modules/boman-system/src/main/java/com/boman/system/controller/SysMenuController.java

@@ -72,8 +72,8 @@ public class SysMenuController extends BaseController
     /**
      * 加载对应角色菜单列表树, 不包含叶子结点 不包含叶子结点 不包含叶子结点 重要的事情说三遍
      */
-    @GetMapping(value = "/roleMenuTreeselect/{roleId}")
-    public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId)
+    @GetMapping(value = "/treeMenuNotAddLeafNode/{roleId}")
+    public AjaxResult treeMenuNotAddLeafNode(@PathVariable("roleId") Long roleId)
     {
         Long userId = SecurityUtils.getUserId();
         List<SysMenu> menus = menuService.selectMenuList(userId);
@@ -83,6 +83,11 @@ public class SysMenuController extends BaseController
         return ajax;
     }
 
+    @GetMapping(value = "/allLeafNodeById/{menuId}")
+    public AjaxResult allLeafNodeById(@PathVariable("menuId") Long menuId) {
+        return AjaxResult.success(menuService.allLeafNodeById(menuId));
+    }
+
     /**
      * 新增菜单
      */

+ 32 - 0
boman-modules/boman-system/src/main/java/com/boman/system/controller/SysRoleMenuController.java

@@ -0,0 +1,32 @@
+package com.boman.system.controller;
+
+import com.boman.common.core.web.domain.AjaxResult;
+import com.boman.system.domain.SysRoleMenu;
+import com.boman.system.service.impl.ISysRoleMenuService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author shiqian
+ * @date 2021年04月27日 14:31
+ **/
+@RestController
+@RequestMapping("/role/menu")
+public class SysRoleMenuController {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(SysRoleMenuController.class);
+
+    @Resource
+    private ISysRoleMenuService service;
+    @PostMapping
+    public AjaxResult list(@RequestBody List<SysRoleMenu> roleMenuList) {
+        return AjaxResult.success(service.saveList(roleMenuList));
+    }
+}

+ 9 - 0
boman-modules/boman-system/src/main/java/com/boman/system/domain/SysRoleData.java

@@ -13,6 +13,15 @@ public class SysRoleData extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
 
+    /**
+     * 1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)5 :仅本人数据
+     */
+    public static final String ALL_DATA = "1";
+    public static final String DIY_DATA = "2";
+    public static final String SELF_DEPT_DATA = "3";
+    public static final String ALL_DEPT_DATA = "4";
+    public static final String MYSELF_DATA = "5";
+
     /** 角色权限id */
     private Long id;
 

+ 11 - 0
boman-modules/boman-system/src/main/java/com/boman/system/domain/SysRoleMenu.java

@@ -10,12 +10,23 @@ import org.apache.commons.lang3.builder.ToStringStyle;
  */
 public class SysRoleMenu
 {
+    /** id */
+    private Long id;
+
     /** 角色ID */
     private Long roleId;
     
     /** 菜单ID */
     private Long menuId;
 
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
     public Long getRoleId()
     {
         return roleId;

+ 8 - 0
boman-modules/boman-system/src/main/java/com/boman/system/service/ISysMenuService.java

@@ -49,6 +49,14 @@ public interface ISysMenuService
      */
     public List<SysMenu> selectMenuTreeById(Long id);
 
+    /**
+     * 根据用户ID查询菜单树信息
+     *
+     * @param menuId menuId
+     * @return 菜单列表
+     */
+    List<SysMenu> allLeafNodeById(Long menuId);
+
     /**
      * 根据角色ID查询菜单树信息
      * 

+ 23 - 0
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/ISysRoleMenuService.java

@@ -0,0 +1,23 @@
+package com.boman.system.service.impl;
+
+import com.boman.system.domain.SysRoleMenu;
+
+import java.util.List;
+
+/**
+ * 参数配置 服务层
+ *
+ * @author ruoyi
+ */
+public interface ISysRoleMenuService {
+
+    /**
+     * 功能描述: 批量保存roleMenu
+     *
+     * @param roleMenuList roleMenuList
+     * @return boolean
+     */
+    int saveList(List<SysRoleMenu> roleMenuList);
+
+
+}

+ 37 - 8
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/SysMenuServiceImpl.java

@@ -1,17 +1,12 @@
 package com.boman.system.service.impl;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 import java.util.stream.Collectors;
 
 import com.boman.common.core.utils.obj.ObjectUtils;
 import com.boman.common.core.web.domain.AjaxResult;
 import com.boman.system.api.domain.SysMenu;
+import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.boman.common.core.constant.UserConstants;
@@ -123,6 +118,40 @@ public class SysMenuServiceImpl implements ISysMenuService
         return getChildPerms(menus, 0);
     }
 
+    /**
+     * 根据用户ID查询菜单树信息
+     *
+     * @param menuId menuId
+     * @return 菜单列表
+     */
+    @Override
+    public List<SysMenu> allLeafNodeById(Long menuId) {
+        List<SysMenu> tempList = Lists.newArrayListWithCapacity(16);
+        SysMenu menu = selectMenuById(menuId);
+        List<SysMenu> menus = menuMapper.selectMenuList(new SysMenu());
+        List<SysMenu> sysMenus = recursionList(menus, menu, tempList);
+        return ObjectUtils.filter(sysMenus, menu1 -> SysMenu.BUTTON.equals(menu1.getMenuType()));
+    }
+
+    private List<SysMenu> recursionList(List<SysMenu> menus, SysMenu menu, List<SysMenu> tempList) {
+        int child = 0;
+        // 得到子节点列表
+        List<SysMenu> childList = getChildList(menus, menu);
+        for (SysMenu tChild : childList) {
+            if (hasChild(menus, tChild)) {
+                recursionList(menus, tChild, tempList);
+            } else {
+                child++;
+            }
+        }
+
+        if (child == childList.size() && childList.size() != 0) {
+            tempList.addAll(childList);
+        }
+
+        return tempList;
+    }
+
     /**
      * 根据角色ID查询菜单树信息
      * 
@@ -521,6 +550,6 @@ public class SysMenuServiceImpl implements ISysMenuService
      */
     private boolean hasChild(List<SysMenu> list, SysMenu t)
     {
-        return getChildList(list, t).size() > 0 ? true : false;
+        return getChildList(list, t).size() > 0;
     }
 }

+ 45 - 0
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/SysRoleMenuServiceImpl.java

@@ -0,0 +1,45 @@
+package com.boman.system.service.impl;
+
+import com.boman.system.domain.SysRoleMenu;
+import com.boman.system.mapper.SysRoleMenuMapper;
+import com.boman.web.core.api.RemoteObjService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+import static com.boman.common.core.utils.obj.ObjectUtils.isEmpty;
+
+/**
+ * @author shiqian
+ * @date 2021年04月27日 14:34
+ **/
+public class SysRoleMenuServiceImpl implements ISysRoleMenuService{
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(SysRoleMenuServiceImpl.class);
+
+    @Resource
+    private SysRoleMenuMapper mapper;
+    @Resource
+    private RemoteObjService remoteObjService;
+    /**
+     * 功能描述: 批量保存roleMenu
+     *
+     * @param roleMenuList roleMenuList
+     * @return int
+     */
+    @Override
+    public int saveList(List<SysRoleMenu> roleMenuList) {
+        if (isEmpty(roleMenuList)) {
+            return 0;
+        }
+
+        for (SysRoleMenu sysRoleMenu : roleMenuList) {
+            Long maxId = remoteObjService.getMaxId("sys_role_menu", "id");
+            sysRoleMenu.setId(maxId);
+        }
+
+        return mapper.batchRoleMenu(roleMenuList);
+    }
+}

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

@@ -83,7 +83,7 @@
 			 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 = #{id} and m.menu_type in ('M', 'C') and m.status = 0  AND ro.status = 0
 		order by m.parent_id, m.order_num
 	</select>
 	

+ 3 - 2
boman-modules/boman-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml

@@ -5,6 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 <mapper namespace="com.boman.system.mapper.SysRoleMenuMapper">
 
 	<resultMap type="SysRoleMenu" id="SysRoleMenuResult">
+		<result property="id"     column="id"      />
 		<result property="roleId"     column="role_id"      />
 		<result property="menuId"     column="menu_id"      />
 	</resultMap>
@@ -25,9 +26,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  	</delete>
 	
 	<insert id="batchRoleMenu">
-		insert into sys_role_menu(role_id, menu_id) values
+		insert into sys_role_menu(id, role_id, menu_id) values
 		<foreach item="item" index="index" collection="list" separator=",">
-			(#{item.roleId},#{item.menuId})
+			(#{item.id},#{item.roleId},#{item.menuId})
 		</foreach>
 	</insert>
 	

+ 12 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/CommonController.java

@@ -42,4 +42,16 @@ public class CommonController {
         return AjaxResult.success(commonService.getByMap(dto.getTable(), dto.getFixedData()));
     }
 
+    /**
+     * 功能描述: getMaxId
+     *
+     * @param tableName tableName
+     * @param pkName        pkName
+     * @return com.boman.common.core.web.domain.AjaxResult
+     */
+    @GetMapping("tableName/{tableName}/pkName/{pkName}")
+    public Long getMaxId(@PathVariable("tableName") String tableName, @PathVariable("pkName") String pkName) {
+        return commonService.getMaxId(tableName, pkName);
+    }
+
 }

+ 0 - 3
boman-web-core/src/main/java/com/boman/web/core/controller/ObjController.java

@@ -138,7 +138,6 @@ public class ObjController {
     /**
      * 功能描述: 获取表单查询字段、按钮、表头
      * 注意: 都是从redis中拿的,如果数据库和redis不一致,则需刷新一下redis
-     * 刷新的入口为 {@link MyController#loadTable(GenTable)}
      *
      *                    eg:{
      *                          "table": "sys_config"
@@ -156,7 +155,6 @@ public class ObjController {
     /**
      * 功能描述: 获取表单查询字段
      * 注意: 都是从redis中拿的,如果数据库和redis不一致,则需刷新一下redis
-     * 刷新的入口为 {@link MyController#loadTable(GenTable)}
      *
      *                    eg:{
      *                          "table": "sys_config"
@@ -193,7 +191,6 @@ public class ObjController {
     /**
      * 功能描述: 获取表单按钮
      * 注意: 都是从redis中拿的,如果数据库和redis不一致,则需刷新一下redis
-     * 刷新的入口为 {@link MyController#loadTable(GenTable)}
      *
      *                    eg:{
      *                          "table": "sys_config"

+ 5 - 0
boman-web-core/src/main/java/com/boman/web/core/service/common/CommonServiceImpl.java

@@ -58,4 +58,9 @@ public class CommonServiceImpl implements ICommonService {
         requireNonNull(tableName, "tableName is empty");
         return selectService.getByMap(tableName, condition);
     }
+
+    @Override
+    public Long getMaxId(String tableName, String pkName) {
+        return IdUtils.getMaxId(tableName, pkName);
+    }
 }

+ 2 - 0
boman-web-core/src/main/java/com/boman/web/core/service/common/ICommonService.java

@@ -28,4 +28,6 @@ public interface ICommonService {
      * @return java.util.List<com.alibaba.fastjson.JSONObject>
      */
     List<JSONObject> getByMap(String tableName, JSONObject condition);
+
+    Long getMaxId(String tableName, String pkName);
 }

+ 14 - 0
ruoyi-ui/src/api/system/menu.js

@@ -31,6 +31,20 @@ export function roleMenuTreeselect(roleId) {
     url: '/system/menu/roleMenuTreeselect/' + roleId,
     method: 'get'
   })
+}
+// 根据角色ID查询菜单下拉树结构
+export function treeMenuNotAddLeafNode(roleId) {
+  return request({
+    url: '/system/menu/treeMenuNotAddLeafNode/' + roleId,
+    method: 'get'
+  })
+}
+// 获取权限
+export function allLeafNodeById(id) {
+  return request({
+    url: '/system/menu/allLeafNodeById/' + id,
+    method: 'get'
+  })
 }
 
 // 新增菜单

+ 2 - 1
ruoyi-ui/src/api/system/role.js

@@ -63,4 +63,5 @@ export function delRole(id) {
     url: '/system/role/' + id,
     method: 'delete'
   })
-}
+}
+

+ 103 - 66
ruoyi-ui/src/components/DynamicForm/index.vue

@@ -1,59 +1,69 @@
 <template>
-    <el-form-item :label="formConfig.columnComment" style="display: inline-block;" :prop="formConfig.columnName">
-      <!-- 输入框 -->
-      <el-input v-if="formConfig.htmlType == 'input'" v-model="config[formConfig.columnName]" :placeholder="'请输入'+formConfig.columnComment"
-        clearable @keyup.enter.native="handleQuery" />
-      <!-- 多行输入框 -->
-      <el-input v-if="formConfig.htmlType == 'textarea'" type="textarea" v-model="config[formConfig.columnName]" :placeholder="'请输入'+formConfig.columnComment"
-        clearable @keyup.enter.native="handleQuery" />
-      <!-- 下拉框 -->
-      <el-select v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'select'" filterable :placeholder="'请输入'+formConfig.columnComment">
-        <el-option v-for="itemChild in formConfig.sysDictData" :key="itemChild.dictValue" :label="itemChild.dictLabel" :value="itemChild.dictValue">
-        </el-option>
-      </el-select>
-      <!-- 复选框 -->
-      <el-checkbox-group v-model="config" v-if="formConfig.htmlType == 'checkbox'">
-        <el-checkbox @change="handleCheckedCitiesChange" v-for="itemChild in formConfig.sysDictData" :label="itemChild.dictValue" :key="itemChild.dictLabel" >
-          {{itemChild.dictLabel}}
-        </el-checkbox>
-      </el-checkbox-group>
-      <!-- 单选框 -->
-      <el-radio-group v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'radio'">
-        <el-radio v-for="itemChild in formConfig.sysDictData" :key="itemChild.dictValue" :label="itemChild.dictValue">{{itemChild.dictLabel}}</el-radio>
-      </el-radio-group>
-      <!-- 时间控件 -->
-      <el-date-picker  v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'datetime'" type="date" :placeholder="'请输入'+formConfig.columnComment">
-      </el-date-picker>
-      <!-- 上传图片 -->
-      <el-upload 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>
-      </el-upload>
-      <el-dialog :visible.sync="dialogVisible" v-if="formConfig.htmlType == 'imageUpload'">
-        <img width="100%" :src="dialogImageUrl" alt="">
-      </el-dialog>
-      <!-- 上传文件 -->
-      <el-upload
-        class="upload-demo"
-        :headers="{Authorization: 'Bearer ' + getToken()}"
-        v-if="formConfig.htmlType == 'fileUpload'"
-        :action="process + '/boman-file/upload'"
-        :on-change="handleChange"
-        :on-success="upImageFn"
-        :on-remove="reseImage"
-        :file-list="config">
-        <el-button size="small" type="primary">点击上传</el-button>
-        <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
-      </el-upload>
-      <!-- 富文本 -->
-      <editor v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'editor'" :min-height="192"/>
-    </el-form-item>
+  <el-form-item :label="formConfig.columnComment" style="display: inline-block;" :prop="formConfig.columnName">
+    <!-- 输入框 -->
+    <el-input v-if="formConfig.htmlType == 'input'" v-model="config[formConfig.columnName]" :placeholder="'请输入'+formConfig.columnComment"
+      clearable @keyup.enter.native="handleQuery" />
+    <!-- 多行输入框 -->
+    <el-input v-if="formConfig.htmlType == 'textarea'" type="textarea" v-model="config[formConfig.columnName]"
+      :placeholder="'请输入'+formConfig.columnComment" clearable @keyup.enter.native="handleQuery" />
+    <!-- 下拉框 -->
+    <el-select v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'select'&&(!formConfig.fkInfo.fkTableName)"
+      filterable :placeholder="'请输入'+formConfig.columnComment">
+      <el-option v-for="itemChild in formConfig.sysDictData" :key="itemChild.dictValue" :label="itemChild.dictLabel"
+        :value="itemChild.dictValue">
+      </el-option>
+    </el-select>
+    <!-- 下拉框搜索 -->
+    <el-select v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'select'&&(formConfig.fkInfo.fkTableName)"
+      filterable remote :remote-method="remoteMethod" :loading="loading" :placeholder="'请输入'+formConfig.columnComment">
+      <el-option v-for="itemChild in filterList" :key="itemChild.table_id" :label="itemChild.table_name" :value="itemChild.table_id">
+      </el-option>
+    </el-select>
+    <!-- 复选框 -->
+    <el-checkbox-group v-model="config" v-if="formConfig.htmlType == 'checkbox'">
+      <el-checkbox @change="handleCheckedCitiesChange" v-for="itemChild in formConfig.sysDictData" :label="itemChild.dictValue"
+        :key="itemChild.dictLabel">
+        {{itemChild.dictLabel}}
+      </el-checkbox>
+    </el-checkbox-group>
+    <!-- 单选框 -->
+    <el-radio-group v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'radio'">
+      <el-radio v-for="itemChild in formConfig.sysDictData" :key="itemChild.dictValue" :label="itemChild.dictValue">{{itemChild.dictLabel}}</el-radio>
+    </el-radio-group>
+    <!-- 时间控件 -->
+    <el-date-picker v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'datetime'" type="date"
+      :placeholder="'请输入'+formConfig.columnComment">
+    </el-date-picker>
+    <!-- 上传图片 -->
+    <el-upload 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>
+    </el-upload>
+    <el-dialog :visible.sync="dialogVisible" v-if="formConfig.htmlType == 'imageUpload'">
+      <img width="100%" :src="dialogImageUrl" alt="">
+    </el-dialog>
+    <!-- 上传文件 -->
+    <el-upload class="upload-demo" :headers="{Authorization: 'Bearer ' + getToken()}" v-if="formConfig.htmlType == 'fileUpload'"
+      :action="process + '/boman-file/upload'" :on-change="handleChange" :on-success="upImageFn" :on-remove="reseImage"
+      :file-list="config">
+      <el-button size="small" type="primary">点击上传</el-button>
+      <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
+    </el-upload>
+    <!-- 富文本 -->
+    <editor v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'editor'" :min-height="192" />
+  </el-form-item>
 </template>
 
 <script>
   const defaultSettings = require('@/settings.js')
   import Editor from '@/components/Editor';
-  import { getToken } from "@/utils/auth";
+  import {
+    listIndexfou
+  } from "@/api/tool/gen";
+  import {
+    getToken
+  } from "@/utils/auth";
   export default {
     data() {
       return {
@@ -63,7 +73,18 @@
         process: process.env.VUE_APP_BASE_API,
         dialogVisible: false,
         disabled: false,
+        loading: false,
+        filterList: [],
         config: {},
+        aliemg: {
+          table: '',
+          orderBy: 'create_time desc',
+          pageNo: 1,
+          pageSize: 10,
+          fixedData: {
+            condition: {}
+          }
+        },
       }
     },
     components: {
@@ -82,19 +103,36 @@
       this.config = {}
       this.init()
     },
-    mounted() {
-    },
+    mounted() {},
     methods: {
-      upImageFn(res, file){
-        this.config.push(res.data);
-        console.log(res,12153)
+      listIndexfouFn() {
+        listIndexfou(this.aliemg).then(response => {
+          if (response.data) {
+            this.filterList = response.data.rows
+          }
+          this.loading = false;
+        })
+      },
+      remoteMethod(query) {
+        if (query !== '') {
+          this.loading = true;
+          this.aliemg.fixedData.condition[this.formConfig.fkInfo.dkColumnName] = query
+          this.listIndexfouFn()
+        } else {
+          this.filterList = [];
+        }
+      },
+      upImageFn(res, file) {
+        this.config.push(res.data);
       },
       init() {
-        if(this.formConfig.htmlType == 'checkbox' || this.formConfig.htmlType == 'imageUpload' || this.formConfig.htmlType == 'fileUpload'){
-          this.config =  this.formConfig.columnValue || []
-        }else{
-          this.$set(this.config, this.formConfig.columnName,(this.formConfig.columnValue || ''))
+        if (this.formConfig.htmlType == 'checkbox' || this.formConfig.htmlType == 'imageUpload' || this.formConfig.htmlType ==
+          'fileUpload') {
+          this.config = []
+        } else {
+          this.$set(this.config, this.formConfig.columnName, (this.formConfig.columnValue || ''))
         }
+        this.aliemg.table = this.formConfig.fkInfo.fkTableName
       },
       handleChange(file, fileList) {
         this.fileList = fileList.slice(-3);
@@ -104,9 +142,9 @@
       },
       reseImage(file, fileList) {
         let urls = ""
-        if(file.response){
+        if (file.response) {
           urls = file.response.url
-        }else{
+        } else {
           urls = file.url
         }
         for (let i = this.config.length - 1; i >= 0; i--) {
@@ -117,9 +155,9 @@
       },
       reseImage1(file, fileList) {
         let urls = ""
-        if(file.response){
+        if (file.response) {
           urls = file.response.url
-        }else{
+        } else {
           urls = file.url
         }
         for (let i = this.config.length - 1; i >= 0; i--) {
@@ -130,7 +168,6 @@
       },
       handlePictureCardPreview(file) {
         this.dialogImageUrl = file.url;
-		// console.log(this.dialogImageUrl)
         this.dialogVisible = true;
       },
       handleDownload(file) {
@@ -139,7 +176,7 @@
       handleQuery() {
         this.$emit('btns')
       },
-      handleCheckedCitiesChange(value){
+      handleCheckedCitiesChange(value) {
         console.log(this.config)
       }
     }
@@ -147,4 +184,4 @@
 </script>
 
 <style>
-</style>
+</style>

+ 102 - 64
ruoyi-ui/src/components/DynamicForms/index.vue

@@ -1,59 +1,69 @@
 <template>
-    <el-form-item :label="formConfig.columnComment" style="display: inline-block;" :prop="formConfig.columnName">
-      <!-- 输入框 -->
-      <el-input v-if="formConfig.htmlType == 'input'" v-model="config[formConfig.columnName]" :placeholder="'请输入'+formConfig.columnComment"
-        clearable @keyup.enter.native="handleQuery" />
-      <!-- 多行输入框 -->
-      <el-input v-if="formConfig.htmlType == 'textarea'" type="textarea" v-model="config[formConfig.columnName]" :placeholder="'请输入'+formConfig.columnComment"
-        clearable @keyup.enter.native="handleQuery" />
-      <!-- 下拉框 -->
-      <el-select v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'select'" filterable :placeholder="'请输入'+formConfig.columnComment">
-        <el-option v-for="itemChild in formConfig.sysDictData" :key="itemChild.dictValue" :label="itemChild.dictLabel" :value="itemChild.dictValue">
-        </el-option>
-      </el-select>
-      <!-- 复选框 -->
-      <el-checkbox-group v-model="config" v-if="formConfig.htmlType == 'checkbox'">
-        <el-checkbox @change="handleCheckedCitiesChange" v-for="itemChild in formConfig.sysDictData" :label="itemChild.dictValue" :key="itemChild.dictLabel" >
-          {{itemChild.dictLabel}}
-        </el-checkbox>
-      </el-checkbox-group>
-      <!-- 单选框 -->
-      <el-radio-group v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'radio'">
-        <el-radio v-for="itemChild in formConfig.sysDictData" :key="itemChild.dictValue" :label="itemChild.dictValue">{{itemChild.dictLabel}}</el-radio>
-      </el-radio-group>
-      <!-- 时间控件 -->
-      <el-date-picker  v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'datetime'" type="date" :placeholder="'请输入'+formConfig.columnComment">
-      </el-date-picker>
-      <!-- 上传图片 -->
-      <el-upload 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>
-      </el-upload>
-      <el-dialog :visible.sync="dialogVisible" v-if="formConfig.htmlType == 'imageUpload'">
-        <img width="100%" :src="dialogImageUrl" alt="">
-      </el-dialog>
-      <!-- 上传文件 -->
-      <el-upload
-        class="upload-demo"
-        :headers="{Authorization: 'Bearer ' + getToken()}"
-        v-if="formConfig.htmlType == 'fileUpload'"
-        :action="process + '/boman-file/upload'"
-        :on-change="handleChange"
-        :on-success="upImageFn"
-         :on-remove="reseImage"
-        :file-list="config">
-        <el-button size="small" type="primary">点击上传</el-button>
-        <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
-      </el-upload>
-      <!-- 富文本 -->
-      <editor v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'editor'" :min-height="192"/>
-    </el-form-item>
+  <el-form-item :label="formConfig.columnComment" style="display: inline-block;" :prop="formConfig.columnName">
+    <!-- 输入框 -->
+    <el-input v-if="formConfig.htmlType == 'input'" v-model="config[formConfig.columnName]" :placeholder="'请输入'+formConfig.columnComment"
+      clearable @keyup.enter.native="handleQuery" />
+    <!-- 多行输入框 -->
+    <el-input v-if="formConfig.htmlType == 'textarea'" type="textarea" v-model="config[formConfig.columnName]"
+      :placeholder="'请输入'+formConfig.columnComment" clearable @keyup.enter.native="handleQuery" />
+    <!-- 下拉框 -->
+    <el-select v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'select'&&(!formConfig.fkInfo.fkTableName)"
+      filterable :placeholder="'请输入'+formConfig.columnComment">
+      <el-option v-for="itemChild in formConfig.sysDictData" :key="itemChild.dictValue" :label="itemChild.dictLabel"
+        :value="itemChild.dictValue">
+      </el-option>
+    </el-select>
+    <!-- 下拉框搜索 -->
+    <el-select v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'select'&&(formConfig.fkInfo.fkTableName)"
+      filterable remote :remote-method="remoteMethod" :loading="loading" :placeholder="'请输入'+formConfig.columnComment">
+      <el-option v-for="itemChild in filterList" :key="itemChild.table_id" :label="itemChild.table_name" :value="itemChild.table_id">
+      </el-option>
+    </el-select>
+    <!-- 复选框 -->
+    <el-checkbox-group v-model="config" v-if="formConfig.htmlType == 'checkbox'">
+      <el-checkbox @change="handleCheckedCitiesChange" v-for="itemChild in formConfig.sysDictData" :label="itemChild.dictValue"
+        :key="itemChild.dictLabel">
+        {{itemChild.dictLabel}}
+      </el-checkbox>
+    </el-checkbox-group>
+    <!-- 单选框 -->
+    <el-radio-group v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'radio'">
+      <el-radio v-for="itemChild in formConfig.sysDictData" :key="itemChild.dictValue" :label="itemChild.dictValue">{{itemChild.dictLabel}}</el-radio>
+    </el-radio-group>
+    <!-- 时间控件 -->
+    <el-date-picker v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'datetime'" type="date"
+      :placeholder="'请输入'+formConfig.columnComment">
+    </el-date-picker>
+    <!-- 上传图片 -->
+    <el-upload 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>
+    </el-upload>
+    <el-dialog :visible.sync="dialogVisible" v-if="formConfig.htmlType == 'imageUpload'">
+      <img width="100%" :src="dialogImageUrl" alt="">
+    </el-dialog>
+    <!-- 上传文件 -->
+    <el-upload class="upload-demo" :headers="{Authorization: 'Bearer ' + getToken()}" v-if="formConfig.htmlType == 'fileUpload'"
+      :action="process + '/boman-file/upload'" :on-change="handleChange" :on-success="upImageFn" :on-remove="reseImage"
+      :file-list="config">
+      <el-button size="small" type="primary">点击上传</el-button>
+      <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
+    </el-upload>
+    <!-- 富文本 -->
+    <editor v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'editor'" :min-height="192" />
+  </el-form-item>
 </template>
 
 <script>
   const defaultSettings = require('@/settings.js')
   import Editor from '@/components/Editor';
-  import { getToken } from "@/utils/auth";
+  import {
+    listIndexfou
+  } from "@/api/tool/gen";
+  import {
+    getToken
+  } from "@/utils/auth";
   export default {
     data() {
       return {
@@ -63,7 +73,18 @@
         process: process.env.VUE_APP_BASE_API,
         dialogVisible: false,
         disabled: false,
+        loading: false,
+        filterList: [],
         config: {},
+        aliemg: {
+          table: '',
+          orderBy: 'create_time desc',
+          pageNo: 1,
+          pageSize: 10,
+          fixedData: {
+            condition: {}
+          }
+        },
       }
     },
     components: {
@@ -82,19 +103,36 @@
       this.config = {}
       this.init()
     },
-    mounted() {
-    },
+    mounted() {},
     methods: {
-      upImageFn(res, file){
+      listIndexfouFn() {
+        listIndexfou(this.aliemg).then(response => {
+          if (response.data) {
+            this.filterList = response.data.rows
+          }
+          this.loading = false;
+        })
+      },
+      remoteMethod(query) {
+        if (query !== '') {
+          this.loading = true;
+          this.aliemg.fixedData.condition[this.formConfig.fkInfo.dkColumnName] = query
+          this.listIndexfouFn()
+        } else {
+          this.filterList = [];
+        }
+      },
+      upImageFn(res, file) {
         this.config.push(res.data);
-        console.log(this.config,12153)
       },
       init() {
-        if(this.formConfig.htmlType == 'checkbox' || this.formConfig.htmlType == 'imageUpload' || this.formConfig.htmlType == 'fileUpload'){
-          this.config =  []
-        }else{
-          this.$set(this.config, this.formConfig.columnName,(this.formConfig.columnValue || ''))
+        if (this.formConfig.htmlType == 'checkbox' || this.formConfig.htmlType == 'imageUpload' || this.formConfig.htmlType ==
+          'fileUpload') {
+          this.config = []
+        } else {
+          this.$set(this.config, this.formConfig.columnName, (this.formConfig.columnValue || ''))
         }
+        this.aliemg.table = this.formConfig.fkInfo.fkTableName
       },
       handleChange(file, fileList) {
         this.fileList = fileList.slice(-3);
@@ -104,9 +142,9 @@
       },
       reseImage(file, fileList) {
         let urls = ""
-        if(file.response){
+        if (file.response) {
           urls = file.response.url
-        }else{
+        } else {
           urls = file.url
         }
         for (let i = this.config.length - 1; i >= 0; i--) {
@@ -117,9 +155,9 @@
       },
       reseImage1(file, fileList) {
         let urls = ""
-        if(file.response){
+        if (file.response) {
           urls = file.response.url
-        }else{
+        } else {
           urls = file.url
         }
         for (let i = this.config.length - 1; i >= 0; i--) {
@@ -138,7 +176,7 @@
       handleQuery() {
         this.$emit('btns')
       },
-      handleCheckedCitiesChange(value){
+      handleCheckedCitiesChange(value) {
         console.log(this.config)
       }
     }
@@ -146,4 +184,4 @@
 </script>
 
 <style>
-</style>
+</style>

+ 34 - 5
ruoyi-ui/src/views/system/permissions/index.vue

@@ -49,7 +49,7 @@
           <el-col :span="24">
             <div class="searContLeft">
               <el-table v-loading="loading" :data="cloumns" @selection-change="handleSelectionChange" :max-height="tableHeight">
-                <el-table-column type="selection" width="55" align="center" />
+                <el-table-column type="selection"   width="55" align="center" />
                 <el-table-column label="序号" align="center"  prop="id" />
                 <el-table-column label="用户角色" align="center" prop="roleName" />
                 <el-table-column label="权限表单" align="center" prop="tableName" />
@@ -58,9 +58,12 @@
                     {{scope.row.dataScope | relationTypeFn}}
                   </template> -->
                 </el-table-column>
-                <el-table-column label="是否可用"  align="center">
+                <el-table-column  label="是否可用"  align="center">
+                  <!-- <template slot="header" slot-scope="scope">
+                    <div><el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange"></el-checkbox>数据过滤4</div>
+                  </template> -->
                   <template slot-scope="scope">
-                    <el-checkbox true-label="Y" false-label="N" v-model="scope.row.isUse"></el-checkbox>
+                    <el-checkbox true-label="Y" false-label="N" v-model="scope.row.isUse" ></el-checkbox>
                   </template>
                 </el-table-column>
               </el-table>
@@ -187,7 +190,10 @@
         // 表格的高度
         tableHeight: document.documentElement.scrollHeight - 245 + "px",
         ijeudid:-1,
-        indexdw:-1
+        indexdw:-1,
+         isIndeterminate: true,
+         checkAll: false,
+         kiejfur:[]
       };
     },
 
@@ -461,7 +467,30 @@
         this.queryParamstr.roleId = id
         this.getDeptTreeselect()
        console.log(this.form.roleId)
-      }
+      },
+      handleCheckAllChange(val) {
+              // this.checkedCities = val ? cityOptions : [];
+              console.log(val)
+              if(val == true){
+                // cloumns.isUse
+                // this.cloumns.fill()
+                this.cloumns.filter(router =>{
+                  router.isUse = 'Y'
+                })
+              }else{
+                this.cloumns.filter(router =>{
+                  router.isUse = 'N'
+                })
+              }
+              this.isIndeterminate = false;
+      },
+       handleCheckedCitiesChange(value) {
+              // let checkedCount = value.length;
+              console.log(value)
+             // this.kiejfur.push(value)
+              // this.checkAll = checkedCount === this.cities.length;
+              // this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
+       }
     }
   };
 </script>

+ 11 - 5
ruoyi-ui/src/views/system/role/index.vue

@@ -44,7 +44,7 @@
         <div class="roleContrBox">
           <el-col :span="7">
             <div class="searContLeft">
-              <el-tree class="tree-border" :data="deptOptions" default-expand-all ref="dept" node-key="id" :props="defaultProps"></el-tree>
+              <el-tree class="tree-border" @node-click="qxList" :data="deptOptions" default-expand-all ref="dept" node-key="id" :props="defaultProps"></el-tree>
             </div>
           </el-col>
           <el-col :span="17">
@@ -81,12 +81,13 @@
     addRole,
     updateRole,
     exportRole,
-    dataScope,
+    dataScope,
     changeRoleStatus
   } from "@/api/system/role";
   import {
-    treeselect as menuTreeselect,
-    roleMenuTreeselect
+    treeselect as menuTreeselect,
+    allLeafNodeById,
+    treeMenuNotAddLeafNode
   } from "@/api/system/menu";
   import {
     treeselect as deptTreeselect,
@@ -197,6 +198,11 @@
       });
     },
     methods: {
+      qxList(e) {
+        allLeafNodeById(e.id).then(res => {
+          console.log(res)
+        })
+      },
       refreshFn() {
         this.getList()
         this.deptOptions = []
@@ -251,7 +257,7 @@
       },
       /** 根据角色ID查询菜单树结构 */
       getRoleMenuTreeselect(id) {
-        return roleMenuTreeselect(id).then(response => {
+        return treeMenuNotAddLeafNode(id).then(response => {
           this.menuOptions = response.menus;
           return response;
         });

+ 14 - 24
ruoyi-ui/src/views/tool/gen/editTable.vue

@@ -58,15 +58,15 @@
           <el-table-column label="关联HR字段" min-width="13%" align="center" prop="hrParentId">
             <template slot-scope="scope">
               <div>
-                {{scope.row.hrParentId | zdFn}}
+                {{scope.row.hrParentName}}
               </div>
             </template>
           </el-table-column>
           <el-table-column label="缺省值" min-width="10%" align="center" prop="defaultValue" />
           <el-table-column label="外键" min-width="10%" align="center" prop="foreignKey">
             <template slot-scope="scope">
-              <div>
-                {{scope.row.foreignKey | zdFn}}
+              <div>
+                {{scope.row.foreignKeyName}}
               </div>
             </template>
           </el-table-column>
@@ -108,7 +108,7 @@
             <el-row>
               <el-col :span="8">
                 <el-form-item label="字段名:" prop="columnName">
-                  <el-input :disabled="this.formZd.columnId" v-model="formZd.columnName" placeholder="请输入字段名" />
+                  <el-input :disabled="this.formZd.id" v-model="formZd.columnName" placeholder="请输入字段名" />
                 </el-form-item>
               </el-col>
               <el-col :span="8">
@@ -163,7 +163,6 @@
                   <el-input v-model="formZd.defaultValue" placeholder="请输入缺省值" />
                 </el-form-item>
               </el-col>
-
             </el-row>
             <el-row>
               <el-col :span="8">
@@ -218,7 +217,6 @@
                   </el-select>
                 </el-form-item>
               </el-col>
-
             </el-row>
             <el-row>
               <el-col :span="8">
@@ -459,7 +457,6 @@
         foreignKey: [],
         openZd: false,
         formZd: {
-          columnId: ''
         },
         rulesZd: {
           columnName: [{
@@ -472,11 +469,6 @@
             message: "请输入字段描述",
             trigger: "blur"
           }],
-          regular: [{
-            required: true,
-            message: "请输入正则表达式",
-            trigger: "blur"
-          }],
           columnType: [{
             required: true,
             message: "请输入物理类型",
@@ -619,8 +611,9 @@
         });
         // 关联字段
         listAllColumnsByTableId({
-          tableId
-        }).then(response => {
+          id:tableId
+        }).then(response => {
+          console.log(response.data,9999888)
           this.columList = response.data;
         });
         // 关联表数据
@@ -688,10 +681,10 @@
               // this.tableDataalid = response.data.tableHeadList;
               this.postListquery = response.data
               this.postListquery.rows.filter(route => {
-                if(route.table_id.name){
+                if(route.table_id){
                    route.table_id = route.table_id.name
                 }
-              })
+              })
               this.totalquery = response.data.total;
             }
             this.loading = false;
@@ -703,7 +696,7 @@
           if (valid) {
             const tableId = this.$route.params && this.$route.params.tableId;
             this.formZd.tableId = tableId
-            if (this.formZd.columnId != undefined) {
+            if (this.formZd.id != undefined) {
               setGenTableColumn(this.formZd).then(response => {
                 this.msgSuccess("修改成功");
                 this.openZd = false;
@@ -766,12 +759,11 @@
       },
       dbSelectedZd(row) {
         this.reset();
-        const id = row.columnId
+        const id = row.id
         getByIdWithForeignKey(id).then(response => {
           let data = response.data
           data.foreignKey = data.foreignKey ? data.foreignKey - 0 : ''
           this.formZd = data;
-          console.log(data,8890)
           if(data.fkInfo){
             this.ForeName = data.fkInfo.value
           }
@@ -839,7 +831,7 @@
       cancel() {
         this.open = false;
         this.reset();
-        this.openZd = false;
+        this.openZd = false;
         this.resetZd();
       },
       // 关联表数据
@@ -861,7 +853,6 @@
       },
       handleDel_gl(row) {
         const ids = row.id || this.ids1;
-        console.log(ids, 1223)
         this.$confirm('是否确认删除id为"' + ids + '"的数据项?', "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
@@ -882,7 +873,6 @@
       },
       resetZd() {
         this.formZd = {
-
         };
         this.resetForm("formZd");
       },
@@ -950,7 +940,7 @@
       },
       // 多选框选中数据
       handleSelectionChange(selection) {
-        this.ids = selection.map(item => item.columnId)
+        this.ids = selection.map(item => item.id)
         this.single = selection.length != 1
         this.multiple = !selection.length
       },
@@ -981,7 +971,7 @@
         })
       },
       handleAdd() {
-        this.resetZd();
+        this.resetZd();
         this.openZd = true;
         this.title = "新增字段信息";
       }

+ 421 - 503
ruoyi-ui/src/views/tool/gen/index.vue

@@ -1,503 +1,421 @@
-<template>
-  <div class="app-container">
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleGenTableadd"
-
-        >新增</el-button>
-        <!-- v-hasPermi="['tool:gen:code']" -->
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleGenTable"
-          v-hasPermi="['tool:gen:code']"
-        >生成</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="info"
-          plain
-          icon="el-icon-upload"
-          size="mini"
-          @click="openImportTable"
-          v-hasPermi="['tool:gen:import']"
-        >导入</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleEditTable"
-          v-hasPermi="['tool:gen:edit']"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['tool:gen:remove']"
-        >删除</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-refresh"
-          size="mini"
-          style="background-color: #FDD6F3;color: #C790B9;border: 1px solid #C790B9;"
-          @click="handleCxbtn"
-          v-hasPermi="['tool:gen:remove']"
-        >重载缓存</el-button>
-      </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
-
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="表名称" prop="tableName">
-        <el-input
-          v-model="queryParams.tableName"
-          placeholder="请输入表名称"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="表描述" prop="tableComment">
-        <el-input
-          v-model="queryParams.tableComment"
-          placeholder="请输入表描述"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间">
-        <el-date-picker
-          v-model="dateRange"
-          size="small"
-          style="width: 240px"
-          value-format="yyyy-MM-dd"
-          type="daterange"
-          range-separator="-"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-        ></el-date-picker>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
-
-    <el-table v-loading="loading" style="max-height: calc(100vh - 288px);overflow-y: auto;" :data="tableList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" align="center" width="55"></el-table-column>
-      <el-table-column label="序号" type="index" width="50" align="center">
-        <template slot-scope="scope">
-          <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
-        </template>
-      </el-table-column>
-      <el-table-column
-        label="表名称"
-        align="center"
-        prop="tableName"
-        :show-overflow-tooltip="true"
-      />
-      <el-table-column
-        label="表描述"
-        align="center"
-        prop="tableComment"
-        :show-overflow-tooltip="true"
-      />
-      <el-table-column
-        label="实际数据库表"
-        align="center"
-        prop="realTableName"
-        :show-overflow-tooltip="true"
-      />
-      <el-table-column label="是否菜单" align="center">
-        <template slot-scope="scope">
-          <el-checkbox true-label="Y" false-label="N" v-model="scope.row.isMenu"></el-checkbox>
-        </template>
-      </el-table-column>
-      <el-table-column label="菜单权限" align="center" prop="menuRole" />
-     <!-- <el-table-column label="创建时间" align="center" prop="createTime" />
-      <el-table-column label="更新时间" align="center" prop="updateTime" /> -->
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-        <template slot-scope="scope">
-          <!-- <el-button
-            type="text"
-            size="small"
-            icon="el-icon-view"
-            @click="handlePreview(scope.row)"
-            v-hasPermi="['tool:gen:preview']"
-          >预览</el-button> -->
-          <el-button
-            type="text"
-            size="small"
-            icon="el-icon-edit"
-            @click="handleEditTable(scope.row)"
-            v-hasPermi="['tool:gen:edit']"
-          >编辑</el-button>
-          <el-button
-            type="text"
-            size="small"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['tool:gen:remove']"
-          >删除</el-button>
-          <el-button
-            type="text"
-            size="small"
-            icon="el-icon-refresh"
-            @click="handleSynchDb(scope.row)"
-            v-hasPermi="['tool:gen:edit']"
-          >同步</el-button>
-          <el-button
-            type="text"
-            size="small"
-            icon="el-icon-download"
-            @click="handleGenTable(scope.row)"
-            v-hasPermi="['tool:gen:code']"
-          >生成代码</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
-    <!-- 新增弹框 -->
-    <el-dialog :close-on-click-modal="false" :title="preview.title" :visible.sync="preview.open" width="65%" top="5vh" append-to-body>
-      <!-- <el-tabs v-model="preview.activeName">
-        <el-tab-pane
-          v-for="(value, key) in preview.data"
-          :label="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))"
-          :name="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))"
-          :key="key"
-        >
-        <pre><code class="hljs" v-html="highlightedCode(value, key)"></code></pre>
-        </el-tab-pane>
-      </el-tabs> -->
-     <el-form ref="form" :model="form" :rules="rules" label-width="120px">
-       <el-row :gutter="20">
-         <el-col :span="12">
-           <el-form-item label="表名称" prop="tableName">
-             <el-input v-model="form.tableName" placeholder="请输入表名称" />
-           </el-form-item>
-         </el-col>
-         <el-col :span="12">
-           <el-form-item label="实际数据库表" prop="className">
-             <el-input v-model="form.className" placeholder="请输入实际数据库表" />
-           </el-form-item>
-         </el-col>
-         <el-col :span="24">
-           <el-form-item label="表描述" prop="tableComment">
-             <el-input v-model="form.tableComment" placeholder="请输入表描述" />
-           </el-form-item>
-         </el-col>
-         <el-col :span="12">
-           <el-form-item  label="是否菜单" >
-             <el-radio-group v-model="form.isMenu">
-               <el-radio label="Y">是</el-radio>
-               <el-radio label="N">否</el-radio>
-             </el-radio-group>
-           </el-form-item>
-         </el-col>
-         <el-col :span="12">
-           <el-form-item  label="菜单权限" prop="menuRole">
-             <el-input v-model="form.menuRole" placeholder="请输入菜单权限" />
-           </el-form-item>
-         </el-col>
-         <el-col :span="12" >
-           <el-form-item label="新增程序" prop="triggerCreate">
-             <el-input v-model="form.triggerCreate" placeholder="请输入新增程序" />
-           </el-form-item>
-         </el-col>
-         <el-col :span="12">
-           <el-form-item  label="检索程序" prop="triggerRetrieve">
-             <el-input v-model="form.triggerRetrieve" placeholder="请输入检索程序" maxlength="50" />
-           </el-form-item>
-         </el-col>
-         <el-col :span="12">
-           <el-form-item  label="微改程序" prop="triggerUpdate">
-             <el-input v-model="form.triggerUpdate" placeholder="请输入微改程序" maxlength="50" />
-           </el-form-item>
-         </el-col>
-         <el-col :span="12">
-           <el-form-item  label="删除程序" prop="triggerDelete">
-             <el-input v-model="form.triggerDelete" placeholder="请输入删除程序" maxlength="50" />
-           </el-form-item>
-         </el-col>
-         <el-col :span="12">
-           <el-form-item  label="提交程序" prop="triggerSubmit">
-             <el-input v-model="form.triggerSubmit" placeholder="请输入提交程序" maxlength="50" />
-           </el-form-item>
-         </el-col>
-         <el-col :span="12">
-           <el-form-item  label="过滤条件" prop="filterConditions">
-             <el-input v-model="form.filterConditions" placeholder="请输入过滤条件" maxlength="50" />
-           </el-form-item>
-         </el-col>
-         <el-col :span="12">
-           <el-form-item  label="扩展属性" prop="extendedAttributes">
-               <el-input v-model="form.extendedAttributes" type="textarea" placeholder="请输入内容"></el-input>
-           </el-form-item>
-         </el-col>
-         <el-col :span="12">
-           <el-form-item  label="备注" prop="remark">
-               <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
-           </el-form-item>
-         </el-col>
-       </el-row>
-     </el-form>
-     <div slot="footer" class="dialog-footer">
-       <el-button type="primary" @click="submitForm">确 定</el-button>
-       <el-button @click="cancel">取 消</el-button>
-     </div>
-    </el-dialog>
-    <import-table ref="import" @ok="handleQuery" />
-  </div>
-</template>
-
-<script>
-import { listTable, previewTable, delTable, genCode, synchDb, addMenu, getLoadTable } from "@/api/tool/gen";
-import importTable from "./importTable";
-import { downLoadZip } from "@/utils/zipdownload";
-import hljs from "highlight.js/lib/highlight";
-import "highlight.js/styles/github-gist.css";
-hljs.registerLanguage("java", require("highlight.js/lib/languages/java"));
-hljs.registerLanguage("xml", require("highlight.js/lib/languages/xml"));
-hljs.registerLanguage("html", require("highlight.js/lib/languages/xml"));
-hljs.registerLanguage("vue", require("highlight.js/lib/languages/xml"));
-hljs.registerLanguage("javascript", require("highlight.js/lib/languages/javascript"));
-hljs.registerLanguage("sql", require("highlight.js/lib/languages/sql"));
-
-export default {
-  name: "Gen",
-  components: { importTable },
-  data() {
-    return {
-      // 遮罩层
-      loading: true,
-      // 唯一标识符
-      uniqueId: "",
-      // 选中数组
-      ids: [],
-      // 选中表数组
-      tableNames: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // 表数据
-      tableList: [],
-      // 日期范围
-      dateRange: "",
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        tableName: undefined,
-        tableComment: undefined
-      },
-      // 预览参数
-      preview: {
-        open: false,
-        title: "代码预览",
-        data: {},
-        activeName: "domain.java"
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-        tableName: [
-          { required: true, message: "表名称不能为空", trigger: "blur" }
-        ],
-        tableComment: [
-          { required: true, message: "表描述不能为空", trigger: "blur" }
-        ],
-        menuRole: [
-          { required: true, message: "菜单权限不能为空", trigger: "blur" }
-        ]
-      }
-    };
-  },
-  created() {
-    this.getList();
-  },
-  activated() {
-    const time = this.$route.query.t;
-    if (time != null && time != this.uniqueId) {
-      this.uniqueId = time;
-      this.resetQuery();
-    }
-  },
-  methods: {
-    handleCxbtn() {
-      getLoadTable().then(res => {
-        this.msgSuccess('重载缓存成功')
-      })
-    },
-    /** 查询表集合 */
-    getList() {
-      this.loading = true;
-      listTable(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
-          this.tableList = response.rows;
-          this.total = response.total;
-          this.loading = false;
-        }
-      );
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 生成代码操作 */
-    handleGenTable(row) {
-      const tableNames = row.tableName || this.tableNames;
-      if (tableNames == "") {
-        this.msgError("请选择要生成的数据");
-        return;
-      }
-      if(row.genType === "1") {
-        genCode(row.tableName).then(response => {
-          this.msgSuccess("成功生成到自定义路径:" + row.genPath);
-        });
-      } else {
-        downLoadZip("/code/gen/batchGenCode?tables=" + tableNames, "ruoyi");
-      }
-    },
-    /** 同步数据库操作 */
-    handleSynchDb(row) {
-      const tableName = row.tableName;
-      this.$confirm('确认要强制同步"' + tableName + '"表结构吗?', "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(function() {
-          return synchDb(tableName);
-      }).then(() => {
-          this.msgSuccess("同步成功");
-      })
-    },
-    /** 打开导入表弹窗 */
-    openImportTable() {
-      this.$refs.import.show();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-
-      };
-      this.resetForm("form");
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.dateRange = [];
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    /** 预览按钮 */
-    handlePreview(row) {
-      previewTable(row.tableId).then(response => {
-        this.preview.data = response.data;
-        this.preview.open = true;
-      });
-    },
-    /** 高亮显示 */
-    highlightedCode(code, key) {
-      const vmName = key.substring(key.lastIndexOf("/") + 1, key.indexOf(".vm"));
-      var language = vmName.substring(vmName.indexOf(".") + 1, vmName.length);
-      const result = hljs.highlight(language, code || "", true);
-      return result.value || '&nbsp;';
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.tableId);
-      this.tableNames = selection.map(item => item.tableName);
-      this.single = selection.length != 1;
-      this.multiple = !selection.length;
-    },
-    /** 修改按钮操作 */
-    handleEditTable(row) {
-      const tableId = row.tableId || this.ids[0];
-      this.$router.push("/gen/edit/" + tableId);
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const tableIds = row.tableId || this.ids;
-      this.$confirm('是否确认删除表编号为"' + tableIds + '"的数据项?', "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(function() {
-          return delTable(tableIds);
-      }).then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-      })
-    },
-    // 取消弹框按钮
-    cancel(){
-      console.log(123)
-     this.reset()
-     this.preview.open = false;
-
-    },
-    //新增
-    handleGenTableadd(){
-    console.log(345)
-    this.reset()
-    this.preview.open = true;
-    this.preview.title = '新增信息';
-    },
-    /** 提交按钮 */
-    submitForm: function() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.id != undefined) {
-            // updateMenu(this.form).then(response => {
-            //   this.msgSuccess("修改成功");
-            //   this.open = false;
-            //   this.getList();
-            // });
-            console.log(23)
-          } else {
-            console.log(this.form)
-            addMenu(this.form).then(response => {
-              this.msgSuccess("新增成功");
-              this.preview.open = false;
-              this.getList();
-            });
-          }
-        }
-      });
-    }
-  }
-};
-</script>
+<template>
+  <div class="app-container">
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button type="warning" plain icon="el-icon-plus" size="mini" @click="handleGenTableadd">新增</el-button>
+        <!-- v-hasPermi="['tool:gen:code']" -->
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="primary" plain icon="el-icon-download" size="mini" @click="handleGenTable" v-hasPermi="['tool:gen:code']">生成</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="info" plain icon="el-icon-upload" size="mini" @click="openImportTable" v-hasPermi="['tool:gen:import']">导入</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleEditTable"
+          v-hasPermi="['tool:gen:edit']">修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
+          v-hasPermi="['tool:gen:remove']">删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="danger" plain icon="el-icon-refresh" size="mini" style="background-color: #FDD6F3;color: #C790B9;border: 1px solid #C790B9;"
+          @click="handleCxbtn" v-hasPermi="['tool:gen:remove']">重载缓存</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="表名称" prop="tableName">
+        <el-input v-model="queryParams.tableName" placeholder="请输入表名称" clearable size="small" @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item label="表描述" prop="tableComment">
+        <el-input v-model="queryParams.tableComment" placeholder="请输入表描述" clearable size="small" @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item label="创建时间">
+        <el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
+          range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-table v-loading="loading" style="max-height: calc(100vh - 288px);overflow-y: auto;" :data="tableList"
+      @selection-change="handleSelectionChange">
+      <el-table-column type="selection" align="center" width="55"></el-table-column>
+      <el-table-column label="序号" type="index" width="50" align="center">
+        <template slot-scope="scope">
+          <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="表名称" align="center" prop="tableName" :show-overflow-tooltip="true" />
+      <el-table-column label="表描述" align="center" prop="tableComment" :show-overflow-tooltip="true" />
+      <el-table-column label="实际数据库表" align="center" prop="realTableName" :show-overflow-tooltip="true" />
+      <el-table-column label="是否菜单" align="center">
+        <template slot-scope="scope">
+          <el-checkbox true-label="Y" false-label="N" v-model="scope.row.isMenu"></el-checkbox>
+        </template>
+      </el-table-column>
+      <el-table-column label="菜单权限" align="center" prop="menuRole" />
+      <!-- <el-table-column label="创建时间" align="center" prop="createTime" />
+      <el-table-column label="更新时间" align="center" prop="updateTime" /> -->
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <!-- <el-button
+            type="text"
+            size="small"
+            icon="el-icon-view"
+            @click="handlePreview(scope.row)"
+            v-hasPermi="['tool:gen:preview']"
+          >预览</el-button> -->
+          <el-button type="text" size="small" icon="el-icon-edit" @click="handleEditTable(scope.row)" v-hasPermi="['tool:gen:edit']">编辑</el-button>
+          <el-button type="text" size="small" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['tool:gen:remove']">删除</el-button>
+          <el-button type="text" size="small" icon="el-icon-refresh" @click="handleSynchDb(scope.row)" v-hasPermi="['tool:gen:edit']">同步</el-button>
+          <!--          <el-button
+            type="text"
+            size="small"
+            icon="el-icon-download"
+            @click="handleGenTable(scope.row)"
+            v-hasPermi="['tool:gen:code']"
+          >生成代码</el-button> -->
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
+      @pagination="getList" />
+    <!-- 新增弹框 -->
+    <el-dialog :close-on-click-modal="false" :title="preview.title" :visible.sync="preview.open" width="65%" top="5vh"
+      append-to-body>
+      <!-- <el-tabs v-model="preview.activeName">
+        <el-tab-pane
+          v-for="(value, key) in preview.data"
+          :label="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))"
+          :name="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))"
+          :key="key"
+        >
+        <pre><code class="hljs" v-html="highlightedCode(value, key)"></code></pre>
+        </el-tab-pane>
+      </el-tabs> -->
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="表名称" prop="tableName">
+              <el-input v-model="form.tableName" placeholder="请输入表名称" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="实际数据库表" prop="className">
+              <el-input v-model="form.className" placeholder="请输入实际数据库表" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="表描述" prop="tableComment">
+              <el-input v-model="form.tableComment" placeholder="请输入表描述" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="是否菜单">
+              <el-radio-group v-model="form.isMenu">
+                <el-radio label="Y">是</el-radio>
+                <el-radio label="N">否</el-radio>
+              </el-radio-group>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="菜单权限" prop="menuRole">
+              <el-input v-model="form.menuRole" placeholder="请输入菜单权限" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="新增程序" prop="triggerCreate">
+              <el-input v-model="form.triggerCreate" placeholder="请输入新增程序" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="检索程序" prop="triggerRetrieve">
+              <el-input v-model="form.triggerRetrieve" placeholder="请输入检索程序" maxlength="50" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="微改程序" prop="triggerUpdate">
+              <el-input v-model="form.triggerUpdate" placeholder="请输入微改程序" maxlength="50" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="删除程序" prop="triggerDelete">
+              <el-input v-model="form.triggerDelete" placeholder="请输入删除程序" maxlength="50" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="提交程序" prop="triggerSubmit">
+              <el-input v-model="form.triggerSubmit" placeholder="请输入提交程序" maxlength="50" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="过滤条件" prop="filterConditions">
+              <el-input v-model="form.filterConditions" placeholder="请输入过滤条件" maxlength="50" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="扩展属性" prop="extendedAttributes">
+              <el-input v-model="form.extendedAttributes" type="textarea" placeholder="请输入内容"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="备注" prop="remark">
+              <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <import-table ref="import" @ok="handleQuery" />
+  </div>
+</template>
+
+<script>
+  import {
+    listTable,
+    previewTable,
+    delTable,
+    genCode,
+    synchDb,
+    addMenu,
+    getLoadTable
+  } from "@/api/tool/gen";
+  import importTable from "./importTable";
+  import {
+    downLoadZip
+  } from "@/utils/zipdownload";
+  import hljs from "highlight.js/lib/highlight";
+  import "highlight.js/styles/github-gist.css";
+  hljs.registerLanguage("java", require("highlight.js/lib/languages/java"));
+  hljs.registerLanguage("xml", require("highlight.js/lib/languages/xml"));
+  hljs.registerLanguage("html", require("highlight.js/lib/languages/xml"));
+  hljs.registerLanguage("vue", require("highlight.js/lib/languages/xml"));
+  hljs.registerLanguage("javascript", require("highlight.js/lib/languages/javascript"));
+  hljs.registerLanguage("sql", require("highlight.js/lib/languages/sql"));
+
+  export default {
+    name: "Gen",
+    components: {
+      importTable
+    },
+    data() {
+      return {
+        // 遮罩层
+        loading: true,
+        // 唯一标识符
+        uniqueId: "",
+        // 选中数组
+        ids: [],
+        // 选中表数组
+        tableNames: [],
+        // 非单个禁用
+        single: true,
+        // 非多个禁用
+        multiple: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 总条数
+        total: 0,
+        // 表数据
+        tableList: [],
+        // 日期范围
+        dateRange: "",
+        // 查询参数
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          tableName: undefined,
+          tableComment: undefined
+        },
+        // 预览参数
+        preview: {
+          open: false,
+          title: "代码预览",
+          data: {},
+          activeName: "domain.java"
+        },
+        // 表单参数
+        form: {},
+        // 表单校验
+        rules: {
+          tableName: [{
+            required: true,
+            message: "表名称不能为空",
+            trigger: "blur"
+          }],
+          tableComment: [{
+            required: true,
+            message: "表描述不能为空",
+            trigger: "blur"
+          }],
+          menuRole: [{
+            required: true,
+            message: "菜单权限不能为空",
+            trigger: "blur"
+          }]
+        }
+      };
+    },
+    created() {
+      this.getList();
+    },
+    activated() {
+      const time = this.$route.query.t;
+      if (time != null && time != this.uniqueId) {
+        this.uniqueId = time;
+        this.resetQuery();
+      }
+    },
+    methods: {
+      handleCxbtn() {
+        getLoadTable().then(res => {
+          this.msgSuccess('重载缓存成功')
+        })
+      },
+      /** 查询表集合 */
+      getList() {
+        this.loading = true;
+        listTable(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+          this.tableList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        });
+      },
+      /** 搜索按钮操作 */
+      handleQuery() {
+        this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      /** 生成代码操作 */
+      handleGenTable(row) {
+        const tableNames = row.tableName || this.tableNames;
+        if (tableNames == "") {
+          this.msgError("请选择要生成的数据");
+          return;
+        }
+        if (row.genType === "1") {
+          genCode(row.tableName).then(response => {
+            this.msgSuccess("成功生成到自定义路径:" + row.genPath);
+          });
+        } else {
+          downLoadZip("/code/gen/batchGenCode?tables=" + tableNames, "ruoyi");
+        }
+      },
+      /** 同步数据库操作 */
+      handleSynchDb(row) {
+        const tableName = row.tableName;
+        this.$confirm('确认要强制同步"' + tableName + '"表结构吗?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return synchDb(tableName);
+        }).then(() => {
+          this.msgSuccess("同步成功");
+        })
+      },
+      /** 打开导入表弹窗 */
+      openImportTable() {
+        this.$refs.import.show();
+      },
+      // 表单重置
+      reset() {
+        this.form = {
+
+        };
+        this.resetForm("form");
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.dateRange = [];
+        this.resetForm("queryForm");
+        this.handleQuery();
+      },
+      /** 预览按钮 */
+      handlePreview(row) {
+        previewTable(row.tableId).then(response => {
+          this.preview.data = response.data;
+          this.preview.open = true;
+        });
+      },
+      /** 高亮显示 */
+      highlightedCode(code, key) {
+        const vmName = key.substring(key.lastIndexOf("/") + 1, key.indexOf(".vm"));
+        var language = vmName.substring(vmName.indexOf(".") + 1, vmName.length);
+        const result = hljs.highlight(language, code || "", true);
+        return result.value || '&nbsp;';
+      },
+      // 多选框选中数据
+      handleSelectionChange(selection) {
+        this.ids = selection.map(item => item.id);
+        this.tableNames = selection.map(item => item.tableName);
+        this.single = selection.length != 1;
+        this.multiple = !selection.length;
+      },
+      /** 修改按钮操作 */
+      handleEditTable(row) {
+        const tableId = row.id || this.ids[0];
+        this.$router.push("/gen/edit/" + tableId);
+      },
+      /** 删除按钮操作 */
+      handleDelete(row) {
+        const tableIds = row.id || this.ids;
+        this.$confirm('是否确认删除表编号为"' + tableIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delTable(tableIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+      },
+      // 取消弹框按钮
+      cancel() {
+        console.log(123)
+        this.reset()
+        this.preview.open = false;
+
+      },
+      //新增
+      handleGenTableadd() {
+        this.reset()
+        this.preview.open = true;
+        this.preview.title = '新增信息';
+      },
+      /** 提交按钮 */
+      submitForm: function() {
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+            if (this.form.id != undefined) {
+              // updateMenu(this.form).then(response => {
+              //   this.msgSuccess("修改成功");
+              //   this.open = false;
+              //   this.getList();
+              // });
+              console.log(23)
+            } else {
+              console.log(this.form)
+              addMenu(this.form).then(response => {
+                this.msgSuccess("新增成功");
+                this.preview.open = false;
+                this.getList();
+              });
+            }
+          }
+        });
+      }
+    }
+  };
+</script>