Pārlūkot izejas kodu

fix:通用按钮操作渲染

侯茂昌 1 gadu atpakaļ
vecāks
revīzija
98e7453e09
29 mainītis faili ar 94 papildinājumiem un 1303 dzēšanām
  1. 1 7
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/DragFormController.java
  2. 1 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/DragTableConditionController.java
  3. 0 104
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/DragTableController.java
  4. 0 74
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/DragTableGroupController.java
  5. 6 7
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/DragTableStatisticController.java
  6. 1 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/DragTableStyleController.java
  7. 1 46
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/TableSqlController.java
  8. 1 0
      ruoyi-business/src/main/java/com/ruoyi/business/mapper/CommonMapper.java
  9. 1 0
      ruoyi-business/src/main/java/com/ruoyi/business/mapper/DragFormMapper.java
  10. 1 7
      ruoyi-business/src/main/java/com/ruoyi/business/mapper/DragTableMapper.java
  11. 0 34
      ruoyi-business/src/main/java/com/ruoyi/business/service/IDragFormService.java
  12. 0 40
      ruoyi-business/src/main/java/com/ruoyi/business/service/IDragTableGroupService.java
  13. 2 46
      ruoyi-business/src/main/java/com/ruoyi/business/service/IDragTableService.java
  14. 0 30
      ruoyi-business/src/main/java/com/ruoyi/business/service/IDragTableStatisticService.java
  15. 1 0
      ruoyi-business/src/main/java/com/ruoyi/business/service/IDragTableStyleService.java
  16. 1 32
      ruoyi-business/src/main/java/com/ruoyi/business/service/ITableSqlService.java
  17. 1 1
      ruoyi-business/src/main/java/com/ruoyi/business/service/impl/CommonServiceImpl.java
  18. 4 128
      ruoyi-business/src/main/java/com/ruoyi/business/service/impl/DragFormServiceImpl.java
  19. 0 1
      ruoyi-business/src/main/java/com/ruoyi/business/service/impl/DragTableBtnServiceImpl.java
  20. 0 1
      ruoyi-business/src/main/java/com/ruoyi/business/service/impl/DragTableConditionServiceImpl.java
  21. 10 270
      ruoyi-business/src/main/java/com/ruoyi/business/service/impl/DragTableGroupServiceImpl.java
  22. 31 255
      ruoyi-business/src/main/java/com/ruoyi/business/service/impl/DragTableServiceImpl.java
  23. 2 149
      ruoyi-business/src/main/java/com/ruoyi/business/service/impl/DragTableStatisticServiceImpl.java
  24. 5 0
      ruoyi-business/src/main/java/com/ruoyi/business/service/impl/DragTableStyleServiceImpl.java
  25. 5 48
      ruoyi-business/src/main/java/com/ruoyi/business/service/impl/TableSqlServiceImpl.java
  26. 1 6
      ruoyi-business/src/main/resources/mapper/dragmapper/DragTableMapper.xml
  27. 12 6
      ruoyi-ui/src/api/system/dict/data.js
  28. 6 6
      ruoyi-ui/src/api/system/tenant/data.js
  29. 0 5
      ruoyi-ui/src/utils/index.js

+ 1 - 7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/DragFormController.java

@@ -18,11 +18,7 @@ import java.util.List;
 /**
  * 动态表单
  * Controller
- *
- * @author hzh
- * @date 2023-07-12
  */
-
 @RestController
 @RequestMapping("/dragform/form")
 public class DragFormController extends BaseController {
@@ -31,8 +27,7 @@ public class DragFormController extends BaseController {
     private IDragFormService dragFormService;
 
     /**
-     * 查询动态表单
-     * 列表
+     * 查询动态表单列表
      */
     //@PreAuthorize("@ss.hasPermi('system:form:list')")
     @GetMapping("/list")
@@ -42,7 +37,6 @@ public class DragFormController extends BaseController {
         return getDataTable(list);
     }
 
-
     /**
      * 获取动态表单
      * 详细信息

+ 1 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/DragTableConditionController.java

@@ -67,4 +67,5 @@ public class DragTableConditionController extends BaseController
     {
         return toAjax(dragTableConditionService.deleteDragTableConditionByTcIds(commonEntity));
     }
+
 }

+ 0 - 104
ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/DragTableController.java

@@ -51,74 +51,6 @@ public class DragTableController extends BaseController {
         return getDataTable(list);
     }
 
-    /**
-     * 导出动态表格列表
-     */
-    @Log(title = "动态表格", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, DragTable dragTable) {
-        List<DragTable> list = dragTableService.selectDragTableList(dragTable);
-        ExcelUtil<DragTable> util = new ExcelUtil<DragTable>(DragTable.class);
-        util.exportExcel(response, list, "动态表格数据");
-    }
-
-    /**
-     * 获取动态表格详细信息
-     */
-//    @GetMapping(value = "/{tId}")
-//    public AjaxResult getInfo(@PathVariable("tId") Long tId) {
-//        return success(dragTableService.selectDragTableByTId(tId));
-//    }
-
-    /**
-     * 新增动态表格
-     */
-    @Log(title = "动态表格", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody DragTable dragTable) {
-        return toAjax(dragTableService.insertDragTable(dragTable));
-    }
-
-//    /**
-//     * 修改动态表格
-//     */
-//    @Log(title = "动态表格", businessType = BusinessType.UPDATE)
-//    @PutMapping
-//    public AjaxResult edit(@RequestBody DragTable dragTable) {
-//        return toAjax(dragTableService.updateDragTable(dragTable));
-//    }
-
-//    /**
-//     * 删除动态表格
-//     */
-//    @Log(title = "动态表格", businessType = BusinessType.DELETE)
-//    @DeleteMapping("/{tIds}")
-//    public AjaxResult remove(@PathVariable Long[] tIds) {
-//        return toAjax(dragTableService.deleteDragTableByTIds(tIds));
-//    }
-
-    /**
-     * 新增动态表格模版数据
-     */
-    @PostMapping("/addDragTable")
-    public AjaxResult addDragTable(@RequestBody DragTableVo dragTableVo){
-        //新增动态表格信息
-        dragTableService.addDragTable(dragTableVo);
-        //新增动态表格样式信息
-        if(dragTableVo.getDragTableStyleList().size() > 0){
-            dragTableStyleService.batchInsertDragTableStyle(dragTableVo);
-        }
-        //新增动态表格数据统计信息
-//        if(dragTableVo.getDragTableStatisticList().size() > 0){
-//            dragTableStatisticService.batchInsertDragTableStatistic(dragTableVo);
-//        }
-        //新增表格按钮关联表
-        if(dragTableVo.getDragTableBtnRelevanceList().size() > 0){
-            dragTableBtnRelevanceService.batchInsertDragTableBtnRelevance(dragTableVo.getDragTableBtnRelevanceList());
-        }
-         return AjaxResult.success();
-    }
-
     /**
      * 获取动态表格详细信息
      */
@@ -127,42 +59,6 @@ public class DragTableController extends BaseController {
         return success(dragTableService.selectDragTableVoByTId(tId));
     }
 
-    /**
-     * 修改动态表格
-     */
-    @PutMapping("/edit")
-    public AjaxResult edit(@RequestBody DragTableVo dragTableVo) {
-        //修改动态表格信息
-        dragTableService.updateDragTable(dragTableVo);
-        //修改动态表格样式信息
-        dragTableStyleService.updateDragTableStyle(dragTableVo);
-        //修改动态表格数据统计信息
-//        dragTableStatisticService.updateDragTableStatistic(dragTableVo);
-        //修改动态表格和按钮关联表
-        dragTableBtnRelevanceService.updateDragTableBtnRelevance(dragTableVo);
-        return AjaxResult.success();
-    }
-
-    /**
-     * 删除动态表格
-     */
-    @DeleteMapping("/remove")
-    public AjaxResult remove(@RequestBody Map<String, Object> map) {
-        List<Long> tIds = (List<Long>) map.get("tIds");
-        List<String> sqlKeys = (List<String>) map.get("sqlKeys");
-        List<String> tableKeys = (List<String>) map.get("tableKeys");
-        // 删除动态表格
-        dragTableService.deleteDragTable(tIds, sqlKeys);
-        // 删除动态表格统计
-        dragTableStatisticService.deleteDragTableStatisticByTableKeys(tableKeys);
-        // 删除动态表格样式
-        dragTableStyleService.deleteDragTableStyleByTableKeys(tableKeys);
-        // 删除动态表格和按钮关联表
-        dragTableBtnRelevanceService.deleteDragTableBtnRelevanceByTableKeys(tableKeys);
-
-        return AjaxResult.success();
-    }
-
     /**
      * 查询动态表格列表
      */

+ 0 - 74
ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/DragTableGroupController.java

@@ -67,20 +67,6 @@ public class DragTableGroupController extends BaseController {
         return AjaxResult.success(list);
     }
 
-    /**
-     * 导出拖拽格组列表
-     */
-    @PreAuthorize("@ss.hasPermi('system:group:export')")
-    @Log(title = "拖拽格组", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    @ApiOperation(value = "导出拖拽格组列表")
-    public void export(HttpServletResponse response, DragTableGroup dragTableGroup)
-    {
-        List<DragTableGroup> list = dragTableGroupService.selectDragTableGroupList(dragTableGroup);
-        ExcelUtil<DragTableGroup> util = new ExcelUtil<DragTableGroup>(DragTableGroup.class);
-        util.exportExcel(response, list, "拖拽格组数据");
-    }
-
     /**
      * 获取拖拽格组详细信息
      */
@@ -92,64 +78,4 @@ public class DragTableGroupController extends BaseController {
         return success(dragTableGroupService.selectDragTableGroupById(id));
     }
 
-    /**
-     * 新增拖拽格组
-     */
-    @Log(title = "拖拽格组", businessType = BusinessType.INSERT)
-    @PostMapping
-    @ApiOperation(value = "新增拖拽格组")
-    public AjaxResult add(@RequestBody DragTableGroupVo dragTableGroupVo)
-    {
-        return toAjax(dragTableGroupService.insertDragTableGroup(dragTableGroupVo));
-    }
-
-    /**
-     * 新增配置表格组
-     */
-    @Log(title = "新增配置组", businessType = BusinessType.INSERT)
-    @PostMapping("/addConfigurationGroup")
-    @ApiOperation(value = "新增拖拽格组")
-    public AjaxResult addConfigurationGroup(@RequestBody DragTableGroupVo dragTableGroupVo)
-    {
-        return toAjax(dragTableGroupService.insertDragTableConfigurationGroup(dragTableGroupVo));
-    }
-
-    /**
-     * 修改拖拽格组
-     */
-    @PreAuthorize("@ss.hasPermi('system:group:edit')")
-    @Log(title = "拖拽格组", businessType = BusinessType.UPDATE)
-    @PutMapping
-    @ApiOperation(value = "修改拖拽格组")
-    public AjaxResult edit(@RequestBody DragTableGroupVo dragTableGroupVo)
-    {
-        return toAjax(dragTableGroupService.updateDragTableGroup(dragTableGroupVo));
-    }
-
-    /**
-     * 修改拖拽配置表格组
-     */
-    @PreAuthorize("@ss.hasPermi('system:group:edit')")
-    @Log(title = "拖拽格组", businessType = BusinessType.UPDATE)
-    @PutMapping("/editConfigurationGroup")
-    @ApiOperation(value = "修改拖拽配置表格组")
-    public AjaxResult editConfigurationGroup(@RequestBody DragTableGroupVo dragTableGroupVo)
-    {
-        return toAjax(dragTableGroupService.editConfigurationGroup(dragTableGroupVo));
-    }
-
-
-    /**
-     * 批量删除拖拽格组
-     */
-    @PreAuthorize("@ss.hasPermi('system:group:remove')")
-    @Log(title = "拖拽格组", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{ids}")
-    @ApiOperation(value = "删除拖拽格组")
-    public AjaxResult batchRemove(@PathVariable Long[] ids)
-    {
-        //Boolean aBoolean = dragTableGroupService.selectDragTableGroupTableListSize(ids);
-        return toAjax(dragTableGroupService.deleteDragTableGroupByIds(ids));
-    }
-
 }

+ 6 - 7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/DragTableStatisticController.java

@@ -21,7 +21,6 @@ import java.util.List;
 
 /**
  * 动态表格统计Controller
- *
  * @author ruoyi
  * @date 2023-10-27
  */
@@ -33,12 +32,12 @@ public class DragTableStatisticController extends BaseController
     @Autowired
     private IDragTableStatisticService dragTableStatisticService;
 
-/**
- * 查询动态表格统计列表
- */
-@PreAuthorize("@ss.hasPermi('system:statistic:list')")
-@GetMapping("/list")
-@ApiOperation(value = "查询动态表格统计列表")
+    /**
+     * 查询动态表格统计列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:statistic:list')")
+    @GetMapping("/list")
+    @ApiOperation(value = "查询动态表格统计列表")
     public TableDataInfo list(DragTableStatistic dragTableStatistic)
     {
         startPage();

+ 1 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/DragTableStyleController.java

@@ -25,6 +25,7 @@ import java.util.List;
 @RequestMapping("/system/style")
 public class DragTableStyleController extends BaseController
 {
+
     @Autowired
     private IDragTableStyleService dragTableStyleService;
 

+ 1 - 46
ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/TableSqlController.java

@@ -26,6 +26,7 @@ import java.util.List;
 @RequestMapping("/system/sql")
 public class TableSqlController extends BaseController
 {
+
     @Autowired
     private ITableSqlService tableSqlService;
 
@@ -41,19 +42,6 @@ public class TableSqlController extends BaseController
         return getDataTable(list);
     }
 
-    /**
-     * 导出table 联合查询sql存储列表
-     */
-    @PreAuthorize("@ss.hasPermi('system:sql:export')")
-    @Log(title = "table 联合查询sql存储", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, TableSql tableSql)
-    {
-        List<TableSql> list = tableSqlService.selectTableSqlList(tableSql);
-        ExcelUtil<TableSql> util = new ExcelUtil<TableSql>(TableSql.class);
-        util.exportExcel(response, list, "table 联合查询sql存储数据");
-    }
-
     /**
      * 获取table 联合查询sql存储详细信息
      */
@@ -63,37 +51,4 @@ public class TableSqlController extends BaseController
     {
         return success(tableSqlService.selectTableSqlByTId(tId));
     }
-
-    /**
-     * 新增table 联合查询sql存储
-     */
-    @PreAuthorize("@ss.hasPermi('system:sql:add')")
-    @Log(title = "table 联合查询sql存储", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody TableSql tableSql)
-    {
-        return toAjax(tableSqlService.insertTableSql(tableSql));
-    }
-
-    /**
-     * 修改table 联合查询sql存储
-     */
-    @PreAuthorize("@ss.hasPermi('system:sql:edit')")
-    @Log(title = "table 联合查询sql存储", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody TableSql tableSql)
-    {
-        return toAjax(tableSqlService.updateTableSql(tableSql));
-    }
-
-    /**
-     * 删除table 联合查询sql存储
-     */
-    @PreAuthorize("@ss.hasPermi('system:sql:remove')")
-    @Log(title = "table 联合查询sql存储", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{tIds}")
-    public AjaxResult remove(@PathVariable Long[] tIds)
-    {
-        return toAjax(tableSqlService.deleteTableSqlByTIds(tIds));
-    }
 }

+ 1 - 0
ruoyi-business/src/main/java/com/ruoyi/business/mapper/CommonMapper.java

@@ -30,6 +30,7 @@ public interface CommonMapper {
      * 修改
      */
     int edit(@Param("fields") Map<String, Object> fields, @Param("tableName") String tableName, @Param("conditions") Map<String, Object> conditions);
+
     /**
      * 执行动态sql
      *

+ 1 - 0
ruoyi-business/src/main/java/com/ruoyi/business/mapper/DragFormMapper.java

@@ -13,6 +13,7 @@ import java.util.List;
  * @date 2023-07-12
  */
 public interface DragFormMapper {
+
     /**
      * 查询动态表单
      *

+ 1 - 7
ruoyi-business/src/main/java/com/ruoyi/business/mapper/DragTableMapper.java

@@ -53,13 +53,7 @@ public interface DragTableMapper
      */
     int deleteDragTableByTId(Long tId);
 
-    /**
-     * 批量删除动态表格
-     * 
-     * @param tIds 需要删除的数据主键集合
-     * @return 结果
-     */
-    int deleteDragTableByTIds(List<Long> tIds);
+
 
     /**
      * 查询动态表格

+ 0 - 34
ruoyi-business/src/main/java/com/ruoyi/business/service/IDragFormService.java

@@ -37,40 +37,6 @@ public interface IDragFormService {
      */
     public List<DragForm> selectDragFormList(DragForm dragForm);
 
-    /**
-     * 新增动态表单
-     *
-     * @param dragForm 动态表单
-     * @return 结果
-     */
-    AjaxResult insertDragForm(DragForm dragForm);
-
-    /**
-     * 修改动态表单
-     *
-     * @param dragForm 动态表单
-     * @return 结果
-     */
-    public int updateDragForm(DragForm dragForm);
-
-    /**
-     * 批量删除动态表单
-     *
-     * @param fIds 需要删除的动态表单
-     *             主键集合
-     * @return 结果
-     */
-    public int deleteDragFormByFIds(Long[] fIds);
-
-    /**
-     * 删除动态表单
-     * 信息
-     *
-     * @param fId 动态表单
-     *            主键
-     * @return 结果
-     */
-    public int deleteDragFormByFId(Long fId);
 
     /**
      * 根据sqlKey查询动态表单

+ 0 - 40
ruoyi-business/src/main/java/com/ruoyi/business/service/IDragTableGroupService.java

@@ -30,46 +30,6 @@ public interface IDragTableGroupService {
      */
     public List<DragTableGroup> selectDragTableGroupList(DragTableGroup dragTableGroup);
 
-    /**
-     * 新增拖拽格组
-     *
-     * @param dragTableGroupVo 拖拽格组
-     * @return 结果
-     */
-    public int insertDragTableGroup(DragTableGroupVo dragTableGroupVo);
-
-    /**
-     * 新增拖拽配置组
-     * @param dragTableGroupVo
-     * @return
-     */
-    public int insertDragTableConfigurationGroup(DragTableGroupVo dragTableGroupVo);
-
-    /**
-     * 修改拖拽格组
-     *
-     * @param dragTableGroupVo 拖拽格组
-     * @return 结果
-     */
-    public int updateDragTableGroup(DragTableGroupVo dragTableGroupVo);
-
-    /**
-     * 修改配置组
-     *
-     * @param dragTableGroupVo 拖拽格组
-     * @return 结果
-     */
-    public int editConfigurationGroup(DragTableGroupVo dragTableGroupVo);
-
-
-    /**
-     * 批量删除拖拽格组
-     *
-     * @param ids 需要删除的拖拽格组主键集合
-     * @return 结果
-     */
-    public int deleteDragTableGroupByIds(Long[] ids);
-
     /**
      * 根据表格组key查询表格组信息
      * @param groupKey

+ 2 - 46
ruoyi-business/src/main/java/com/ruoyi/business/service/IDragTableService.java

@@ -18,7 +18,7 @@ public interface IDragTableService
 {
     /**
      * 查询动态表格
-     * 
+     *
      * @param tId 动态表格主键
      * @return 动态表格
      */
@@ -30,32 +30,7 @@ public interface IDragTableService
      * @param dragTable 动态表格
      * @return 动态表格集合
      */
-    public List<DragTable> selectDragTableList(DragTable dragTable);
-
-    /**
-     * 新增动态表格
-     * 
-     * @param dragTable 动态表格
-     * @return 结果
-     */
-    public int insertDragTable(DragTable dragTable);
-
-
-    /**
-     * 批量删除动态表格
-     * 
-     * @param tIds 需要删除的动态表格主键集合
-     * @return 结果
-     */
-    public int deleteDragTableByTIds(List<Long> tIds);
-
-    /**
-     * 删除动态表格信息
-     * 
-     * @param tId 动态表格主键
-     * @return 结果
-     */
-    public int deleteDragTableByTId(Long tId);
+     List<DragTable> selectDragTableList(DragTable dragTable);
 
     /**
      * 查询动态表格
@@ -65,31 +40,12 @@ public interface IDragTableService
      */
     CommonEntity dragTableInfo(String tableKey);
 
-    /**
-     * 新增动态表格
-     */
-    void addDragTable(DragTableVo dragTableVo);
-
-    /**
-     * 表格组新增动态表格
-     * @param dragTableGroupVo
-     */
-    void addDragTable(DragTableGroupVo dragTableGroupVo);
 
     /**
      * 获取动态表格详情详情
      */
     DragTableVo selectDragTableVoByTId(Long tId);
 
-    /**
-     * 修改动态表格
-     */
-    void updateDragTable(DragTableVo dragTableVo);
-
-    /**
-     * 删除动态表格信息
-     */
-    void deleteDragTable(List<Long> tIds,List<String> sqlKeys);
 
     /**
      * 根据tableKey查询sqlKey

+ 0 - 30
ruoyi-business/src/main/java/com/ruoyi/business/service/IDragTableStatisticService.java

@@ -31,36 +31,6 @@ public interface IDragTableStatisticService
      */
     List<DragTableStatistic> selectDragTableStatisticList(DragTableStatistic dragTableStatistic);
 
-    /**
-     * 新增动态表格统计
-     * 
-     * @param vo 动态表格统计
-     * @return 结果
-     */
-    int batchInsertDragTableStatistic(DragTableVo vo);
-
-    /**
-     * 修改动态表格统计
-     * 
-     * @param vo 动态表格统计
-     * @return 结果
-     */
-    void updateDragTableStatistic(DragTableVo vo);
-
-    /**
-     * 删除动态表格统计信息
-     * 
-     * @param tableKey 动态表格统计主键
-     * @return 结果
-     */
-    int deleteDragTableStatisticByTableKey(String tableKey);
-
-    /**
-     * 批量删除动态表格通
-     */
-    void deleteDragTableStatisticByTableKeys(List<String> tableKeys);
-
-
     /**
      * 根据tableKey获取详情
      * @return

+ 1 - 0
ruoyi-business/src/main/java/com/ruoyi/business/service/IDragTableStyleService.java

@@ -15,6 +15,7 @@ import java.util.List;
  */
 public interface IDragTableStyleService 
 {
+
     /**
      * 查询动态格样式
      * 

+ 1 - 32
ruoyi-business/src/main/java/com/ruoyi/business/service/ITableSqlService.java

@@ -8,11 +8,11 @@ import java.util.List;
 
 /**
  * table 联合查询sql存储Service接口
- *
  * @author ruoyi
  * @date 2023-07-19
  */
 public interface ITableSqlService {
+
     /**
      * 查询table 联合查询sql存储
      *
@@ -37,35 +37,4 @@ public interface ITableSqlService {
      */
     public List<TableSql> selectTableSqlList(TableSql tableSql);
 
-    /**
-     * 新增table 联合查询sql存储
-     *
-     * @param tableSql table 联合查询sql存储
-     * @return 结果
-     */
-    public int insertTableSql(TableSql tableSql);
-
-    /**
-     * 修改table 联合查询sql存储
-     *
-     * @param tableSql table 联合查询sql存储
-     * @return 结果
-     */
-    public int updateTableSql(TableSql tableSql);
-
-    /**
-     * 批量删除table 联合查询sql存储
-     *
-     * @param tIds 需要删除的table 联合查询sql存储主键集合
-     * @return 结果
-     */
-    public int deleteTableSqlByTIds(Long[] tIds);
-
-    /**
-     * 删除table 联合查询sql存储信息
-     *
-     * @param tId table 联合查询sql存储主键
-     * @return 结果
-     */
-    public int deleteTableSqlByTId(Long tId);
 }

+ 1 - 1
ruoyi-business/src/main/java/com/ruoyi/business/service/impl/CommonServiceImpl.java

@@ -256,6 +256,6 @@ public class CommonServiceImpl implements ICommonService {
         }
         String sqlColumn = input.substring(startIndex + identifier.length() + 1, endIndex);
         return convertToCamelCase(sqlColumn);
-
     }
+
 }

+ 4 - 128
ruoyi-business/src/main/java/com/ruoyi/business/service/impl/DragFormServiceImpl.java

@@ -4,24 +4,14 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.gson.Gson;
 import com.ruoyi.business.entity.DragForm;
-import com.ruoyi.business.entity.DragTableForm;
 import com.ruoyi.business.mapper.CommonMapper;
 import com.ruoyi.business.mapper.DragFormMapper;
-import com.ruoyi.business.mapper.DragTableFormMapper;
 import com.ruoyi.business.service.IDragFormService;
-import com.ruoyi.common.config.RuoYiConfig;
-import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 import javax.annotation.Resource;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
 import java.util.List;
 import java.util.Map;
-import java.util.UUID;
 
 /**
  * 动态表单
@@ -36,17 +26,12 @@ public class DragFormServiceImpl implements IDragFormService {
     @Autowired
     private DragFormMapper dragFormMapper;
 
-    @Resource
-    private DragTableFormMapper dragTableFormMapper;
-
     @Resource
     private CommonMapper commonMapper;
 
     /**
      * 查询动态表单
-     *
      * @param fId 动态表单
-     *            主键
      * @return 动态表单
      */
     @Override
@@ -57,7 +42,6 @@ public class DragFormServiceImpl implements IDragFormService {
     /**
      * 查询动态表单
      * 列表
-     *
      * @param dragForm 动态表单
      * @return 动态表单
      */
@@ -67,81 +51,11 @@ public class DragFormServiceImpl implements IDragFormService {
     }
 
     /**
-     * 新增动态表单
-     *
-     * @param dragForm 动态表单
-     * @return 结果
-     */
-    @Override
-    @Transactional
-    public AjaxResult insertDragForm(DragForm dragForm) {
-        String fileName = RuoYiConfig.getProfile() + UUID.randomUUID().toString() + ".html";
-        // 创建表单源文件
-        createForm(fileName, dragForm.getDfHtmlTemplate());
-        // 使用租户名 加uuid 定义表单文件名称
-        dragForm.setDfFliePath(fileName);
-        //校验dtId是否唯一
-        if (dragTableFormMapper.selectDtIdCount(dragForm.getDtId()) > 0) {
-            return AjaxResult.warn("该表格已绑定表单!");
-        }
-        //新增表单
-        dragFormMapper.insertDragForm(dragForm);
-        //新增关联表
-        DragTableForm dragTableForm = new DragTableForm();
-        dragTableForm.setDfId(dragForm.getfId());
-        dragTableForm.setDtId(dragForm.getDtId());
-        dragTableFormMapper.insertDragTableForm(dragTableForm);
-        return AjaxResult.success();
-    }
-
-    /**
-     * 修改动态表单
-     *
-     * @param dragForm 动态表单
-     * @return 结果
+     * 根据sqlKey查询动态表单
+     * @param sqlKey
+     * @return
+     * @throws JsonProcessingException
      */
-    @Override
-    public int updateDragForm(DragForm dragForm) {
-        // 修改的时候删除表单源文件后重新创建
-        delFileForm(dragForm.getfId());
-        return dragFormMapper.updateDragForm(dragForm);
-    }
-
-    /**
-     * 批量删除动态表单
-     * @param fIds 需要删除的动态表单 主键
-     * @return 结果
-     */
-    @Override
-    @Transactional
-    public int deleteDragFormByFIds(Long[] fIds) {
-        // 删除表单源文件
-        for (Long fId : fIds) {
-            delFileForm(fId);
-            //删除表单表格关联表
-            if(StringUtils.isNotNull(dragTableFormMapper.selectDragTableForm(fId))){
-                dragTableFormMapper.deleteDragTableFormByDfId(fId);
-            }
-        }
-        return dragFormMapper.deleteDragFormByFIds(fIds);
-    }
-
-    /**
-     * 删除动态表单
-     * 信息
-     *
-     * @param fId 动态表单
-     *            主键
-     * @return 结果
-     */
-    @Override
-    public int deleteDragFormByFId(Long fId) {
-
-        // 删除表单源文件
-        delFileForm(fId);
-        return dragFormMapper.deleteDragFormByFId(fId);
-    }
-
     @Override
     public DragForm selectDragFormBySqlKey(String sqlKey) throws JsonProcessingException {
         DragForm dragForm = dragFormMapper.selectDragFormBySqlKey(sqlKey);
@@ -163,42 +77,4 @@ public class DragFormServiceImpl implements IDragFormService {
         return dragForm;
     }
 
-    /**
-     * 删除表单源文件
-     *
-     * @param fId
-     */
-    public void delFileForm(Long fId) {
-        DragForm dragForm = dragFormMapper.selectDragFormByFId(fId);
-        File file = new File(dragForm.getDfFliePath());
-        if (file == null) return;
-        if (file.delete()) {
-            System.out.println("删除文件成功!");
-        } else {
-            System.out.println("删除文件失败!");
-        }
-    }
-
-    /**
-     * 创建表单源文件
-     *
-     * @param pathName 生成文件路径以及文件名称
-     * @param text     写入文件中的内容
-     */
-    public void createForm(String pathName, String text) {
-        // 新增的同时生成文件 生成路径从配置文件读取
-        File file = new File(pathName);
-        try {
-            if (file.createNewFile()) { // 判断当前文件是否存在,
-                System.out.println("创建文件成功!");
-            } else {
-                System.out.println("文件已经存在不需要重复创建");
-            }
-            FileWriter writer = new FileWriter(file);
-            writer.write(text);
-            writer.close();
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
-    }
 }

+ 0 - 1
ruoyi-business/src/main/java/com/ruoyi/business/service/impl/DragTableBtnServiceImpl.java

@@ -8,7 +8,6 @@ import com.ruoyi.common.utils.SecurityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-
 import java.util.List;
 import java.util.Objects;
 import java.util.stream.Collectors;

+ 0 - 1
ruoyi-business/src/main/java/com/ruoyi/business/service/impl/DragTableConditionServiceImpl.java

@@ -22,7 +22,6 @@ public class DragTableConditionServiceImpl implements IDragTableConditionService
     @Autowired
     private DragTableConditionMapper dragTableConditionMapper;
 
-
     @Override
     public List<CommonEntity> selectDragTableConditionList(CommonEntity commonEntity)
     {

+ 10 - 270
ruoyi-business/src/main/java/com/ruoyi/business/service/impl/DragTableGroupServiceImpl.java

@@ -13,15 +13,10 @@ import com.ruoyi.business.mapper.DragTableConditionMapper;
 import com.ruoyi.business.mapper.DragTableGroupMapper;
 import com.ruoyi.business.mapper.DragTableMapper;
 import com.ruoyi.business.mapper.TableSqlMapper;
-import com.ruoyi.business.service.IDragTableBtnRelevanceService;
 import com.ruoyi.business.service.IDragTableGroupService;
-import com.ruoyi.common.utils.SecurityUtils;
-
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.HashMap;
@@ -42,17 +37,12 @@ public class DragTableGroupServiceImpl implements IDragTableGroupService {
     @Autowired
     private DragTableMapper dragTableMapper;
 
-    @Autowired
-    private DragTableServiceImpl dragTableService;
-
     @Autowired
     private DragTableConditionMapper dragTableConditionMapper;
 
     @Autowired
     private TableSqlMapper tableSqlMapper;
 
-    @Autowired
-    private IDragTableBtnRelevanceService dragTableBtnRelevanceService;
 
     /**
      * 查询拖拽格组
@@ -78,265 +68,6 @@ public class DragTableGroupServiceImpl implements IDragTableGroupService {
         return dragTableGroupMapper.selectDragTableGroupList(dragTableGroup);
     }
 
-
-    /**
-     * 新增拖拽格组
-     *
-     * @param dragTableGroupVo 拖拽格组
-     * @return 结果
-     */
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public int insertDragTableGroup(DragTableGroupVo dragTableGroupVo)
-    {
-        //表格组实体类拷贝数据
-        DragTableGroup dragTableGroup=new DragTableGroup();
-        BeanUtils.copyProperties(dragTableGroupVo,dragTableGroup);
-        //添加动态表格列表
-        dragTableService.addDragTable(dragTableGroupVo);
-        //默认添加的是联动表格
-        dragTableGroup.setGroupType("0");
-        return dragTableGroupMapper.insertDragTableGroup(dragTableGroup);
-    }
-
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public int insertDragTableConfigurationGroup(DragTableGroupVo dragTableGroupVo)
-    {
-        //表格组实体类拷贝数据
-        DragTableGroup dragTableGroup=new DragTableGroup();
-        BeanUtils.copyProperties(dragTableGroupVo,dragTableGroup);
-        //添加动态表格列表
-        dragTableService.addDragTable(dragTableGroupVo);
-        dragTableGroup.setGroupType("1");
-        return dragTableGroupMapper.insertDragTableGroup(dragTableGroup);
-    }
-
-
-    // SQL 条件的开始
-    public static final String SQL_START = "CONCAT(";
-
-    // SQL 超级查询常量
-    public static final String SQL_MIDDLE = "IFNULL( #{VAL}, '' )";
-
-    // sqlserver || DM 数据类型的超级查询常量
-    public static final String SQL_DM_SERVER_MIDDLE = "COALESCE( #{VAL}, '' )";
-
-    // SQL 条件的结束
-    public static final String SQL_END = "LIKE '%#{val}%'";
-
-    /**
-     * 修改拖拽格组
-     *
-     * @param dragTableGroupVo 拖拽格组
-     * @return 结果
-     */
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public int updateDragTableGroup(DragTableGroupVo dragTableGroupVo) {
-        //根据id查询表格组信息
-        DragTableGroup dragTableGroupOne = dragTableGroupMapper.selectDragTableGroupById(dragTableGroupVo.getId());
-        //得到group_table_info
-        String groupTableInfo = dragTableGroupOne.getGroupTableInfo();
-        //把他转换成Map对象
-        JSONArray jsonArray = JSON.parseArray(groupTableInfo);
-        //收集tableKey
-        List<String> tableKeys = jsonArray.stream().map(item -> JSONObject.parseObject(item.toString()).get("tableKey").toString()
-        ).collect(Collectors.toList());
-        //删除条件数据
-        List<Long> dragTableIds = dragTableMapper.selectDragTableTableKeys(tableKeys)
-                .stream().map(item -> item.gettId()).collect(Collectors.toList());
-        dragTableConditionMapper.deleteDragTableConditionBytIds(dragTableIds);
-        //优化逻辑 1、表格组信息 2、表格信息、条件信息、sql信息
-        List<DragTableVo> dragTables = dragTableGroupVo.getDragTables();
-        if (dragTables.size()>0) {
-            dragTables.stream().forEach(dragTableVo->{
-                String SQL="";
-                //update drag_table
-                DragTable dragTable = new DragTable();
-                BeanUtils.copyProperties(dragTableVo, dragTable);
-                dragTable.setDtColumnName(dragTableVo.getDtColumnName().toString());
-                dragTable.setPrimaryKey(dragTableVo.getPrimaryKey());
-                dragTable.setMenuId(dragTableVo.getMenuId());
-                dragTable.setDtType("1");
-                dragTableMapper.updateDragTable(dragTable);
-                //update table_sql
-                TableSql tableSql = new TableSql();
-                //拼接sql查询条件
-                switch (SecurityUtils.getDatabaseType().toUpperCase()) {
-                    case "MYSQL":
-                        for (int i = 0; dragTableVo.getSearchFieldList().size() > i; i++) {
-                            SQL += " AND "+dragTableVo.getSearchFieldList().get(i)+"="+dragTableVo.getConditionDefaultValueMap().get(dragTableVo.getSearchFieldList().get(i));
-                        }
-                        break;
-                    case "DM":
-                    case "SQLSERVER":
-                        SQL += SQL_START;
-                        for (int i = 0; dragTableVo.getSearchFieldList().size() > i; i++) {
-                            SQL += SQL_DM_SERVER_MIDDLE.replace("#{VAL}", dragTableVo.getSearchFieldList().get(i));
-                            SQL += dragTableVo.getSearchFieldList().size() - 1 == i ? ",'')" : ",\n";
-                        }
-                        break;
-                    case "ORACLE":
-                        //SQL_START = "";
-                        for (int i = 0; dragTableVo.getSearchFieldList().size() > i; i++) {
-                            SQL += dragTableVo.getSearchFieldList().get(i);
-                            SQL += (dragTableVo.getSearchFieldList().size() - 1 == i ? " " : "||");
-                        }
-                        break;
-                }
-                String where = dragTableVo.getDtTableName() + ".del_flag = '0'";
-                tableSql.setTableCondition(where + SQL);
-                tableSql.setTableAlias(dragTableVo.getDtTableName());
-                tableSql.setOrderByColumn(dragTableVo.getOrderByColumn());
-                tableSql.setSortOrder(dragTableVo.getSortOrder());
-                tableSql.setSqlKey(dragTableVo.getSqlKey());
-                int i = tableSqlMapper.updateTableSqlBySqlKey(tableSql);
-                System.out.println(i);
-                //add drag_table_condition
-                if (dragTableVo.getSearchFieldList().size() > 0) {
-                    List<DragTableCondition> dragTableConditionList = new ArrayList<>();
-                    dragTableVo.getSearchFieldList().forEach(item -> {
-                        dragTableConditionList.add(new DragTableCondition(dragTable.gettId(), item,dragTableVo.getConditionDefaultValueMap().get(item).toString()));
-                    });
-                    dragTableConditionMapper.insertDragTableConditionByList(dragTableConditionList);
-                }
-            });
-        }
-        //修改表格组列表信息
-        DragTableGroup dragTableGroup = new DragTableGroup();
-        BeanUtils.copyProperties(dragTableGroupVo, dragTableGroup);
-        int i = dragTableGroupMapper.updateDragTableGroup(dragTableGroup);
-        return i;
-    }
-
-    /**
-     * 修改弹窗表格的信息
-     * @param dragTableGroupVo 拖拽格组
-     * @return
-     */
-    @Override
-    public int editConfigurationGroup(DragTableGroupVo dragTableGroupVo) {
-        //根据id查询表格组信息
-        DragTableGroup dragTableGroupOne = dragTableGroupMapper.selectDragTableGroupById(dragTableGroupVo.getId());
-        //得到group_table_info
-        String groupTableInfo = dragTableGroupOne.getGroupTableInfo();
-        //把他转换成Map对象
-        JSONArray jsonArray = JSON.parseArray(groupTableInfo);
-        //收集tableKey
-        List<String> tableKeys = jsonArray.stream().map(item -> JSONObject.parseObject(item.toString()).get("tableKey").toString()
-        ).collect(Collectors.toList());
-        //删除条件数据
-        List<Long> dragTableIds = dragTableMapper.selectDragTableTableKeys(tableKeys)
-                .stream().map(item -> item.gettId()).collect(Collectors.toList());
-        dragTableConditionMapper.deleteDragTableConditionBytIds(dragTableIds);
-        //优化逻辑 1、表格组信息 2、表格信息、条件信息、sql信息
-        List<DragTableVo> dragTables = dragTableGroupVo.getDragTables();
-        if (dragTables.size()>0) {
-            dragTables.stream().forEach(dragTableVo->{
-                String SQL="";
-                //add drag_table
-                DragTable dragTable = new DragTable();
-                BeanUtils.copyProperties(dragTableVo, dragTable);
-                dragTable.setDtColumnName(dragTableVo.getDtColumnName().toString());
-                dragTable.setPrimaryKey(dragTableVo.getPrimaryKey());
-                dragTable.setMenuId(dragTableVo.getMenuId());
-                dragTable.setDtType("1");
-                //add table_sql
-                TableSql tableSql = new TableSql();
-                tableSql.setSqlKey(dragTableVo.getSqlKey());
-                tableSql.setTableSql(dragTableVo.getTableSql());
-                dragTableMapper.updateDragTable(dragTable);
-                //拼接sql查询条件
-                switch (SecurityUtils.getDatabaseType().toUpperCase()) {
-                    case "MYSQL":
-                        for (int i = 0; dragTableVo.getSearchFieldList().size() > i; i++) {
-                            SQL += " AND "+dragTableVo.getSearchFieldList().get(i)+"="+dragTableVo.getConditionDefaultValueMap().get(dragTableVo.getSearchFieldList().get(i));
-                        }
-                        break;
-                    case "DM":
-                    case "SQLSERVER":
-                        SQL += SQL_START;
-                        for (int i = 0; dragTableVo.getSearchFieldList().size() > i; i++) {
-                            SQL += SQL_DM_SERVER_MIDDLE.replace("#{VAL}", dragTableVo.getSearchFieldList().get(i));
-                            SQL += dragTableVo.getSearchFieldList().size() - 1 == i ? ",'')" : ",\n";
-                        }
-                        break;
-                    case "ORACLE":
-                        //SQL_START = "";
-                        for (int i = 0; dragTableVo.getSearchFieldList().size() > i; i++) {
-                            SQL += dragTableVo.getSearchFieldList().get(i);
-                            SQL += (dragTableVo.getSearchFieldList().size() - 1 == i ? " " : "||");
-                        }
-                        break;
-                }
-                String where = dragTableVo.getDtTableName() + ".del_flag = '0'";
-                tableSql.setTableCondition(where + SQL);
-                tableSql.setTableAlias(dragTableVo.getDtTableName());
-                tableSql.setSqlKey(dragTableVo.getSqlKey());
-                tableSql.setOrderByColumn(dragTableVo.getOrderByColumn());
-                tableSql.setSortOrder(dragTableVo.getSortOrder());
-                tableSqlMapper.updateTableSql(tableSql);
-                //add drag_table_condition
-                if (dragTableVo.getSearchFieldList().size() > 0) {
-                    List<DragTableCondition> dragTableConditionList = new ArrayList<>();
-                    dragTableVo.getSearchFieldList().forEach(item -> {
-                        dragTableConditionList.add(new DragTableCondition(dragTable.gettId(), item,dragTableVo.getConditionDefaultValueMap().get(item).toString()));
-                    });
-                    dragTableConditionMapper.insertDragTableConditionByList(dragTableConditionList);
-                }
-                //修改按钮信息
-                dragTableBtnRelevanceService.updateDragTableBtnRelevance(dragTableVo);
-            });
-        }
-        //修改表格组列表信息
-        DragTableGroup dragTableGroup = new DragTableGroup();
-        BeanUtils.copyProperties(dragTableGroupVo, dragTableGroup);
-        int i = dragTableGroupMapper.updateDragTableGroup(dragTableGroup);
-        return i;
-    }
-
-    /**
-     * 批量删除拖拽格组
-     *
-     * @param ids 需要删除的拖拽格组主键
-     * @return 结果
-     */
-    @Override
-    @Transactional
-    public int deleteDragTableGroupByIds(Long[] ids)
-    {
-        //表格数据
-        List<String> tableKeys = new ArrayList<>();
-        //删除条件数据
-        List<Long> dragTableIds =new ArrayList<>();
-        for (Long id : ids) {
-            //根据id查询表格组信息
-            DragTableGroup dragTableGroupOne = dragTableGroupMapper.selectDragTableGroupById(id);
-            //得到group_table_info
-            String groupTableInfo = dragTableGroupOne.getGroupTableInfo();
-            //把他转换成Map对象
-            JSONArray jsonArray = JSON.parseArray(groupTableInfo);
-            //收集tableKey
-            jsonArray.stream().forEach(item->
-                    tableKeys.add(JSONObject.parseObject(item.toString()).get("tableKey").toString()));
-            //删除条件数据
-            dragTableMapper.selectDragTableTableKeys(tableKeys)
-                    .stream().forEach(item ->dragTableIds.add(item.gettId()));
-        }
-        //删除表格数据
-        dragTableMapper.deleteDragTableByTableKeys(tableKeys);
-        //删除条件数据
-        dragTableConditionMapper.deleteDragTableConditionBytIds(dragTableIds);
-        //删除sql数据
-        Long[] dragTableIds1 = dragTableIds.toArray(new Long[0]);
-        tableSqlMapper.deleteTableSqlByTIds(dragTableIds1);
-        //删除组数据
-        return dragTableGroupMapper.deleteDragTableGroupByIds(ids);
-    }
-
-
     /**
      * 根据表格组key查询表格组信息
      * @param groupKey
@@ -348,6 +79,11 @@ public class DragTableGroupServiceImpl implements IDragTableGroupService {
         return groupTableInfo;
     }
 
+    /**
+     * 查询表格组包含的详情信息
+     * @param dragTableGroup
+     * @return
+     */
     @Override
     public DragTableGroupVo selectDragTableGroupListDetail(DragTableGroup dragTableGroup) {
         //根据id查询表格组信息
@@ -403,6 +139,11 @@ public class DragTableGroupServiceImpl implements IDragTableGroupService {
         return    dragTableGroupVo;
     }
 
+    /**
+     * 查询当前表格组下是否包含表格信息
+     * @param ids
+     * @return
+     */
     @Override
     public Boolean selectDragTableGroupTableListSize(Long[] ids) {
         List<DragTableGroup> dragTableGroups = dragTableGroupMapper.selectDragTableGroupByIdIn(ids);
@@ -424,5 +165,4 @@ public class DragTableGroupServiceImpl implements IDragTableGroupService {
         return true;
     }
 
-
 }

+ 31 - 255
ruoyi-business/src/main/java/com/ruoyi/business/service/impl/DragTableServiceImpl.java

@@ -1,19 +1,11 @@
 package com.ruoyi.business.service.impl;
 
-import com.alibaba.fastjson2.JSON;
 import com.ruoyi.business.entity.*;
-import com.ruoyi.business.entity.vo.DragTableGroupVo;
 import com.ruoyi.business.entity.vo.DragTableVo;
 import com.ruoyi.business.mapper.*;
 import com.ruoyi.business.service.IDragTableService;
-import com.ruoyi.common.utils.DateUtils;
-import com.ruoyi.common.utils.SecurityUtils;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.transaction.support.TransactionTemplate;
-
 import javax.annotation.Resource;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -27,7 +19,6 @@ import java.util.stream.Collectors;
 @Service
 public class DragTableServiceImpl implements IDragTableService {
 
-
     @Autowired
     private DragTableMapper dragTableMapper;
 
@@ -40,9 +31,6 @@ public class DragTableServiceImpl implements IDragTableService {
     @Resource
     private CommonMapper commonMapper;
 
-    @Resource
-    private TransactionTemplate transactionTemplate;
-
     @Resource
     private DragTableStatisticMapper dragTableStatisticMapper;
 
@@ -55,6 +43,7 @@ public class DragTableServiceImpl implements IDragTableService {
     @Resource
     private DragTableBtnRelevanceMapper dragTableBtnRelevanceMapper;
 
+
     /**
      * 查询动态表格
      *
@@ -78,41 +67,10 @@ public class DragTableServiceImpl implements IDragTableService {
     }
 
     /**
-     * 新增动态表格
-     *
-     * @param dragTable 动态表格
-     * @return 结果
-     */
-    @Override
-    public int insertDragTable(DragTable dragTable) {
-        dragTable.setCreateTime(DateUtils.getNowDate());
-        dragTable.setCreateById(SecurityUtils.getUserId());
-        return dragTableMapper.insertDragTable(dragTable);
-    }
-
-
-    /**
-     * 批量删除动态表格
-     *
-     * @param tIds 需要删除的动态表格主键
-     * @return 结果
-     */
-    @Override
-    public int deleteDragTableByTIds(List<Long> tIds) {
-        return dragTableMapper.deleteDragTableByTIds(tIds);
-    }
-
-    /**
-     * 删除动态表格信息
-     *
-     * @param tId 动态表格主键
-     * @return 结果
+     * 根据tableKey查询动态表格
+     * @param tableKey 唯一标识
+     * @return
      */
-    @Override
-    public int deleteDragTableByTId(Long tId) {
-        return dragTableMapper.deleteDragTableByTId(tId);
-    }
-
     @Override
     public CommonEntity dragTableInfo(String tableKey) {
         //DragTable dragTable = dragTableMapper.selectDragTableBySqlKey(sqlKey);
@@ -163,148 +121,11 @@ public class DragTableServiceImpl implements IDragTableService {
         return commonEntity;
     }
 
-    private List<DragTableBtn> getChildrenList(DragTableBtn root, List<DragTableBtn> childNodes) {
-        List<DragTableBtn> list = childNodes.stream().filter(dragTableBtn ->
-                //筛选出下一节点元素
-                Objects.equals(dragTableBtn.getBtnParentId(), root.getId())).map(dragTableBtn -> {
-            //递归set子节点
-            dragTableBtn.setChildren(this.getChildrenList(dragTableBtn, childNodes));
-            return dragTableBtn;
-        }).collect(Collectors.toList());
-        return list;
-    }
-
-    // SQL 条件的开始
-    public static final String SQL_START = "CONCAT(";
-
-    // SQL 超级查询常量
-    public static final String SQL_MIDDLE = "IFNULL( #{VAL}, '' )";
-
-    // sqlserver || DM 数据类型的超级查询常量
-    public static final String SQL_DM_SERVER_MIDDLE = "COALESCE( #{VAL}, '' )";
-
-    // SQL 条件的结束
-    public static final String SQL_END = "LIKE '%#{val}%'";
-
-    @Transactional
-    @Override
-    public void addDragTable(DragTableVo dragTableVo) {
-        String SQL = "";
-        //add drag_table
-        DragTable dragTable = new DragTable();
-        BeanUtils.copyProperties(dragTableVo, dragTable);
-        dragTable.setDtColumnName(JSON.toJSONString(dragTableVo.getDtColumnName()));
-        dragTable.setPrimaryKey(dragTableVo.getPrimaryKey());
-        dragTable.setMenuId(dragTableVo.getMenuId());
-        dragTable.setDtType("0");//表格类型
-        //add table_sql
-        TableSql tableSql = new TableSql();
-        tableSql.setTableSql(dragTableVo.getTableSql());
-        dragTableMapper.insertDragTable(dragTable);
-        // 拼接sql查询条件
-        switch (SecurityUtils.getDatabaseType().toUpperCase()) {
-            case "MYSQL":
-                SQL += SQL_START;
-                for (int i = 0; dragTableVo.getSearchFieldList().size() > i; i++) {
-                    SQL += SQL_MIDDLE.replace("#{VAL}", dragTableVo.getSearchFieldList().get(i));
-                    SQL += dragTableVo.getSearchFieldList().size() - 1 == i ? ")" : ",\n";
-                }
-                break;
-            case "DM":
-            case "SQLSERVER":
-                SQL += SQL_START;
-                for (int i = 0; dragTableVo.getSearchFieldList().size() > i; i++) {
-                    SQL += SQL_DM_SERVER_MIDDLE.replace("#{VAL}", dragTableVo.getSearchFieldList().get(i));
-                    SQL += dragTableVo.getSearchFieldList().size() - 1 == i ? ",'')" : ",\n";
-                }
-                break;
-            case "ORACLE":
-                for (int i = 0; dragTableVo.getSearchFieldList().size() > i; i++) {
-                    SQL += dragTableVo.getSearchFieldList().get(i);
-                    SQL += (dragTableVo.getSearchFieldList().size() - 1 == i ? " " : "||");
-                }
-                break;
-        }
-        String where = dragTableVo.getDtTableName() + ".del_flag = '0' AND ";
-        tableSql.setTableCondition(where + SQL + SQL_END);
-        tableSql.setTableAlias(dragTableVo.getDtTableName());
-        tableSql.setTableExportField(JSON.toJSONString(dragTableVo.getTableExportField()));
-        tableSql.setSqlKey(dragTableVo.getSqlKey());
-        tableSql.setOrderByColumn(dragTableVo.getOrderByColumn());
-        tableSql.setSortOrder(dragTableVo.getSortOrder());
-        tableSqlMapper.insertTableSql(tableSql);
-        //add drag_table_condition
-        if (dragTableVo.getSearchFieldList().size() > 0) {
-            List<DragTableCondition> dragTableConditionList = new ArrayList<>();
-            dragTableVo.getSearchFieldList().forEach(item -> {
-                dragTableConditionList.add(new DragTableCondition(dragTable.gettId(),item));
-            });
-            dragTableConditionList.forEach(e->{
-                e.setCreateById(SecurityUtils.getUserId());
-            });
-            dragTableConditionMapper.insertDragTableConditionByList(dragTableConditionList);
-        }
-    }
-
-    @Transactional
-    @Override
-    public void addDragTable(DragTableGroupVo dragTableGroupVo) {
-        for (DragTableVo dragTableVo : dragTableGroupVo.getDragTables()) {
-            String SQL="";
-            //add drag_table
-            DragTable dragTable = new DragTable();
-            BeanUtils.copyProperties(dragTableVo, dragTable);
-            dragTable.setDtColumnName(JSON.toJSONString(dragTableVo.getDtColumnName()));
-            dragTable.setPrimaryKey(dragTableVo.getPrimaryKey());
-            dragTable.setMenuId(dragTableVo.getMenuId());
-            dragTable.setDtType("1");
-            //add table_sql
-            TableSql tableSql = new TableSql();
-            tableSql.setTableSql(dragTableVo.getTableSql());
-            dragTableMapper.insertDragTable(dragTable);
-            //拼接sql查询条件
-            switch (SecurityUtils.getDatabaseType().toUpperCase()) {
-                case "MYSQL":
-                    for (int i = 0; dragTableVo.getSearchFieldList().size() > i; i++) {
-                            SQL += " AND "+dragTableVo.getSearchFieldList().get(i)+"="+dragTableVo.getConditionDefaultValueMap().get(dragTableVo.getSearchFieldList().get(i));
-                    }
-                    break;
-                case "DM":
-                case "SQLSERVER":
-                    SQL += SQL_START;
-                    for (int i = 0; dragTableVo.getSearchFieldList().size() > i; i++) {
-                        SQL += SQL_DM_SERVER_MIDDLE.replace("#{VAL}", dragTableVo.getSearchFieldList().get(i));
-                        SQL += dragTableVo.getSearchFieldList().size() - 1 == i ? ",'')" : ",\n";
-                    }
-                    break;
-                case "ORACLE":
-                    //SQL_START = "";
-                    for (int i = 0; dragTableVo.getSearchFieldList().size() > i; i++) {
-                        SQL += dragTableVo.getSearchFieldList().get(i);
-                        SQL += (dragTableVo.getSearchFieldList().size() - 1 == i ? " " : "||");
-                    }
-                    break;
-            }
-            String where = dragTableVo.getDtTableName() + ".del_flag = '0'";
-            tableSql.setTableCondition(where + SQL);
-            tableSql.setTableAlias(dragTableVo.getDtTableName());
-            tableSql.setTableExportField(JSON.toJSONString(dragTableVo.getTableExportField()));
-            tableSql.setSqlKey(dragTableVo.getSqlKey());
-            tableSql.setOrderByColumn(dragTableVo.getOrderByColumn());
-            tableSql.setSortOrder(dragTableVo.getSortOrder());
-            tableSqlMapper.insertTableSql(tableSql);
-            //add drag_table_condition
-            if (dragTableVo.getSearchFieldList().size() > 0) {
-                    List<DragTableCondition> dragTableConditionList = new ArrayList<>();
-                    dragTableVo.getSearchFieldList().forEach(item -> {
-                        dragTableConditionList.add(new DragTableCondition(dragTable.gettId(), item,dragTableVo.getConditionDefaultValueMap().get(item).toString()));
-                    });
-                    dragTableConditionMapper.insertDragTableConditionByList(dragTableConditionList);
-            }
-        }
-    }
-
-
+    /**
+     * 获取动态表格详情
+     * @param tId
+     * @return
+     */
     @Override
     public DragTableVo selectDragTableVoByTId(Long tId) {
         DragTableVo vo = dragTableMapper.selectDragTableVoByTId(tId);
@@ -324,76 +145,31 @@ public class DragTableServiceImpl implements IDragTableService {
         return vo;
     }
 
-    @Transactional
+    /**
+     * 根据tableKey获取sqlKey
+     * @param tableKey
+     * @return
+     */
     @Override
-    public void updateDragTable(DragTableVo dragTableVo) {
-        String SQL = "";
-        //update drag_table
-        DragTable dragTable = new DragTable();
-        BeanUtils.copyProperties(dragTableVo, dragTable);
-        dragTable.setDtColumnName(JSON.toJSONString(dragTableVo.getDtColumnName()));
-        dragTableMapper.updateDragTable(dragTable);
-        //update table_sql
-        TableSql tableSql = new TableSql();
-        tableSql.setTableSql(dragTableVo.getTableSql());
-        // 拼接sql查询条件
-        switch (SecurityUtils.getDatabaseType().toUpperCase()) {
-            case "MYSQL":
-                SQL += SQL_START;
-                for (int i = 0; dragTableVo.getSearchFieldList().size() > i; i++) {
-                    SQL += SQL_MIDDLE.replace("#{VAL}", dragTableVo.getSearchFieldList().get(i));
-                    SQL += dragTableVo.getSearchFieldList().size() - 1 == i ? ")" : ",\n";
-                }
-                break;
-            case "DM":
-            case "SQLSERVER":
-                SQL += SQL_START;
-                for (int i = 0; dragTableVo.getSearchFieldList().size() > i; i++) {
-                    SQL += SQL_DM_SERVER_MIDDLE.replace("#{VAL}", dragTableVo.getSearchFieldList().get(i));
-                    SQL += dragTableVo.getSearchFieldList().size() - 1 == i ? ",'')" : ",\n";
-                }
-                break;
-            case "ORACLE":
-                for (int i = 0; dragTableVo.getSearchFieldList().size() > i; i++) {
-                    SQL += dragTableVo.getSearchFieldList().get(i);
-                    SQL += (dragTableVo.getSearchFieldList().size() - 1 == i ? " " : "||");
-                }
-                break;
-        }
-        String where = dragTableVo.getDtTableName() + ".del_flag = '0' AND ";
-        tableSql.setTableCondition(where + SQL + SQL_END);
-        tableSql.setTableAlias(dragTableVo.getDtTableName());
-        tableSql.setSqlKey(dragTableVo.getSqlKey());
-        tableSql.setTableExportField(JSON.toJSONString(dragTableVo.getTableExportField()));
-        tableSql.setOrderByColumn(dragTableVo.getOrderByColumn());
-        tableSql.setSortOrder(dragTableVo.getSortOrder());
-        tableSqlMapper.updateTableSqlBySqlKey(tableSql);
-        //update drag_table_condition
-        if (dragTableVo.getSearchFieldList().size() > 0) {
-            //delete
-            dragTableConditionMapper.deleteDragTableConditionBytIds(Collections.singletonList(dragTableVo.gettId()));
-            //insert
-            List<DragTableCondition> dragTableConditionList = new ArrayList<>();
-            dragTableVo.getSearchFieldList().forEach(item -> {
-                dragTableConditionList.add(new DragTableCondition(dragTable.gettId(),item));
-            });
-            dragTableConditionMapper.insertDragTableConditionByList(dragTableConditionList);
-        }
+    public DragTable selectSqlKeyByTableKey(String tableKey) {
+        return dragTableMapper.selectDragTableByTableKey(tableKey);
     }
 
-    @Transactional
-    @Override
-    public void deleteDragTable(List<Long> tIds, List<String> sqlKeys) {
-        // delete drag_table
-        dragTableMapper.deleteDragTableByTIds(tIds);
-        //delete table_sql
-        tableSqlMapper.deleteTableSqlBySqlKeys(sqlKeys);
-        //delete drag_table_condition
-        dragTableConditionMapper.deleteDragTableConditionBytIds(tIds);
+    /**
+     * 表格按钮过滤子级
+     * @param root
+     * @param childNodes
+     * @return
+     */
+    private List<DragTableBtn> getChildrenList(DragTableBtn root, List<DragTableBtn> childNodes) {
+        List<DragTableBtn> list = childNodes.stream().filter(dragTableBtn ->
+                //筛选出下一节点元素
+                Objects.equals(dragTableBtn.getBtnParentId(), root.getId())).map(dragTableBtn -> {
+            //递归set子节点
+            dragTableBtn.setChildren(this.getChildrenList(dragTableBtn, childNodes));
+            return dragTableBtn;
+        }).collect(Collectors.toList());
+        return list;
     }
 
-    @Override
-    public DragTable selectSqlKeyByTableKey(String tableKey) {
-        return dragTableMapper.selectDragTableByTableKey(tableKey);
-    }
 }

+ 2 - 149
ruoyi-business/src/main/java/com/ruoyi/business/service/impl/DragTableStatisticServiceImpl.java

@@ -30,6 +30,7 @@ import java.util.stream.Collectors;
 @Service
 public class DragTableStatisticServiceImpl implements IDragTableStatisticService
 {
+
     @Autowired
     private DragTableStatisticMapper dragTableStatisticMapper;
 
@@ -51,155 +52,6 @@ public class DragTableStatisticServiceImpl implements IDragTableStatisticService
         return dragTableStatisticMapper.selectDragTableStatisticList(dragTableStatistic);
     }
 
-    // SQL 条件的开始
-    public static final String SQL_START = "CONCAT(";
-
-    // SQL 超级查询常量
-    public static final String SQL_MIDDLE = "IFNULL( #{VAL}, '' )";
-
-    // sqlserver || DM 数据类型的超级查询常量
-    public static final String SQL_DM_SERVER_MIDDLE = "COALESCE( #{VAL}, '' )";
-
-    // SQL 条件的结束
-    public static final String SQL_END = "LIKE '%#{val}%'";
-
-    @Override
-    @Transactional
-    public int batchInsertDragTableStatistic(DragTableVo vo)
-    {
-        vo.getDragTableStatisticList().forEach(s -> {
-            s.setCreateBy(SecurityUtils.getUserId().toString());
-        });
-        // 拼接sql查询条件
-        String SQL = "";
-        switch (SecurityUtils.getDatabaseType().toUpperCase()) {
-            case "MYSQL":
-                SQL += SQL_START;
-                for (int i = 0; vo.getSearchFieldList().size() > i; i++) {
-                    SQL += SQL_MIDDLE.replace("#{VAL}", vo.getSearchFieldList().get(i));
-                    SQL += vo.getSearchFieldList().size() - 1 == i ? ")" : ",\n";
-                }
-                break;
-            case "DM":
-            case "SQLSERVER":
-                SQL += SQL_START;
-                for (int i = 0; vo.getSearchFieldList().size() > i; i++) {
-                    SQL += SQL_DM_SERVER_MIDDLE.replace("#{VAL}", vo.getSearchFieldList().get(i));
-                    SQL += vo.getSearchFieldList().size() - 1 == i ? ",'')" : ",\n";
-                }
-                break;
-            case "ORACLE":
-                for (int i = 0; vo.getSearchFieldList().size() > i; i++) {
-                    SQL += vo.getSearchFieldList().get(i);
-                    SQL += (vo.getSearchFieldList().size() - 1 == i ? " " : "||");
-                }
-                break;
-        }
-        String where = vo.getDtTableName() + ".del_flag = '0' AND "+ SQL + SQL_END;
-        vo.getTableSqlList().stream().forEach(t -> t.setTableCondition(where));
-
-        tableSqlMapper.batchInsertTableSql(vo.getTableSqlList());
-        return dragTableStatisticMapper.batchInsertDragTableStatistic(vo.getDragTableStatisticList());
-    }
-
-    @Override
-    @Transactional
-    public void updateDragTableStatistic(DragTableVo vo)
-    {
-        // 拼接sql查询条件
-        String SQL = "";
-        switch (SecurityUtils.getDatabaseType().toUpperCase()) {
-            case "MYSQL":
-                SQL += SQL_START;
-                for (int i = 0; vo.getSearchFieldList().size() > i; i++) {
-                    SQL += SQL_MIDDLE.replace("#{VAL}", vo.getSearchFieldList().get(i));
-                    SQL += vo.getSearchFieldList().size() - 1 == i ? ")" : ",\n";
-                }
-                break;
-            case "DM":
-            case "SQLSERVER":
-                SQL += SQL_START;
-                for (int i = 0; vo.getSearchFieldList().size() > i; i++) {
-                    SQL += SQL_DM_SERVER_MIDDLE.replace("#{VAL}", vo.getSearchFieldList().get(i));
-                    SQL += vo.getSearchFieldList().size() - 1 == i ? ",'')" : ",\n";
-                }
-                break;
-            case "ORACLE":
-                for (int i = 0; vo.getSearchFieldList().size() > i; i++) {
-                    SQL += vo.getSearchFieldList().get(i);
-                    SQL += (vo.getSearchFieldList().size() - 1 == i ? " " : "||");
-                }
-                break;
-        }
-        String sql = vo.getDtTableName() + ".del_flag = '0' AND "+ SQL + SQL_END;
-
-        LinkedList<DragTableStatistic> addList = new LinkedList<>();
-        LinkedList<DragTableStatistic> editList = new LinkedList<>();
-        List<Long> numList = new ArrayList<>();
-        vo.getDragTableStatisticList().stream().forEach(s -> {
-               if(s.getId() == null){
-                   s.setCreateById(SecurityUtils.getUserId());
-                   s.setCreateBy(SecurityUtils.getUsername());
-                   s.setCreateTime(DateUtils.getNowDate());
-                   addList.add(s);
-               }else {
-                   s.setUpdateById(SecurityUtils.getUserId());
-                   s.setUpdateBy(SecurityUtils.getUsername());
-                   s.setUpdateTime(DateUtils.getNowDate());
-                   editList.add(s);
-               }
-               numList.add(s.getId());
-           });
-        //select Statistic ids
-        List<Long> allIds = dragTableStatisticMapper.selectIdsByTableKey(vo.getTableKey());
-        allIds.removeAll(numList);
-        //remove Statistic
-        if(allIds.size() > 0){
-            dragTableStatisticMapper.deleteDragTableStatisticByIds(allIds);
-        }
-        //add Statistic
-        if(addList.size() > 0){
-            dragTableStatisticMapper.batchInsertDragTableStatistic(addList);
-        }
-        //update Statistic
-        if(editList.size() > 0){
-            editList.stream().forEach(e -> dragTableStatisticMapper.updateDragTableStatistic(e));
-        }
-        // select Statistic sqlKey
-        List<String> allSqlKey = dragTableStatisticMapper.selectSqlKeyByTableKey(vo.getTableKey());
-
-        if(vo.getTableSqlList().size() > 0){
-            vo.getTableSqlList().stream().forEach(t -> {
-                t.setCreateBy(SecurityUtils.getUserId().toString());
-                t.setCreateTime(DateUtils.getNowDate());
-                t.setTableCondition(sql);
-            });
-            if(allSqlKey.size() > 0){
-                //remove tableSql
-                tableSqlMapper.deleteTableSqlBySqlKeys(allSqlKey);
-            }
-            //add tableSql
-            tableSqlMapper.batchInsertTableSql(vo.getTableSqlList());
-        }else {
-            if(allSqlKey.size() > 0){
-                //remove tableSql
-                tableSqlMapper.deleteTableSqlBySqlKeys(allSqlKey);
-            }
-        }
-
-    }
-
-    @Override
-    public int deleteDragTableStatisticByTableKey(String tableKey)
-    {
-        return dragTableStatisticMapper.deleteDragTableStatisticByTableKey(tableKey);
-    }
-
-    @Override
-    public void deleteDragTableStatisticByTableKeys(List<String> tableKeys) {
-        dragTableStatisticMapper.deleteDragTableStatisticByTableKeys(tableKeys);
-    }
-
     @Override
     public Map<String, Object> getInfoBySqlKey(String tableKey) {
         Map<String,Object> map = new HashMap<>();
@@ -238,4 +90,5 @@ public class DragTableStatisticServiceImpl implements IDragTableStatisticService
 
 
     }
+
 }

+ 5 - 0
ruoyi-business/src/main/java/com/ruoyi/business/service/impl/DragTableStyleServiceImpl.java

@@ -118,6 +118,11 @@ public class DragTableStyleServiceImpl implements IDragTableStyleService
         return dragTableStyleMapper.deleteDragTableStyleByIds(ids);
     }
 
+    /**
+     * 删除动态表格样式信息
+     * @param tableKeys 动态格样式主键
+     * @return
+     */
     @Override
     public int deleteDragTableStyleByTableKeys(List<String> tableKeys)
     {

+ 5 - 48
ruoyi-business/src/main/java/com/ruoyi/business/service/impl/TableSqlServiceImpl.java

@@ -33,6 +33,11 @@ public class TableSqlServiceImpl implements ITableSqlService {
         return tableSqlMapper.selectTableSqlByTId(tId);
     }
 
+    /**
+     * 通过sqlKey查询Table信息
+     * @param SQLKEY 绑定table唯一标识
+     * @return
+     */
     @Override
     public TableSql selectTableSqlByTSqlKey(String SQLKEY) {
         return tableSqlMapper.selectTableSqlByTSqlKey(SQLKEY);
@@ -49,52 +54,4 @@ public class TableSqlServiceImpl implements ITableSqlService {
         return tableSqlMapper.selectTableSqlList(tableSql);
     }
 
-    /**
-     * 新增table 联合查询sql存储
-     *
-     * @param tableSql table 联合查询sql存储
-     * @return 结果
-     */
-    @Override
-    public int insertTableSql(TableSql tableSql) {
-        tableSql.setCreateTime(DateUtils.getNowDate());
-        tableSql.setCreateById(SecurityUtils.getUserId());
-        return tableSqlMapper.insertTableSql(tableSql);
-    }
-
-    /**
-     * 修改table 联合查询sql存储
-     *
-     * @param tableSql table 联合查询sql存储
-     * @return 结果
-     */
-    @Override
-    public int updateTableSql(TableSql tableSql) {
-        tableSql.setUpdateTime(DateUtils.getNowDate());
-        tableSql.setUpdateById(SecurityUtils.getUserId());
-        return tableSqlMapper.updateTableSql(tableSql);
-    }
-
-    /**
-     * 批量删除table 联合查询sql存储
-     *
-     * @param tIds 需要删除的table 联合查询sql存储主键
-     * @return 结果
-     */
-    @Override
-    public int deleteTableSqlByTIds(Long[] tIds) {
-        return tableSqlMapper.deleteTableSqlByTIds(tIds);
-    }
-
-    /**
-     * 删除table 联合查询sql存储信息
-     *
-     * @param tId table 联合查询sql存储主键
-     * @return 结果
-     */
-    @Override
-    public int deleteTableSqlByTId(Long tId) {
-        return tableSqlMapper.deleteTableSqlByTId(tId);
-    }
-
 }

+ 1 - 6
ruoyi-business/src/main/resources/mapper/dragmapper/DragTableMapper.xml

@@ -153,12 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         delete from drag_table where t_id = #{tId}
     </delete>
 
-    <delete id="deleteDragTableByTIds" parameterType="String">
-        delete from drag_table where t_id in 
-        <foreach item="tId" collection="list" open="(" separator="," close=")">
-            #{tId}
-        </foreach>
-    </delete>
+
 
     <delete id="deleteDragTableByTableKeys" parameterType="list" >
         delete from drag_table where table_key in

+ 12 - 6
ruoyi-ui/src/api/system/dict/data.js

@@ -5,7 +5,8 @@ export function listData(query) {
   return request({
     url: '/system/dict/data/list',
     method: 'get',
-    params: query
+    params: query,
+    baseURL: process.env.VUE_APP_BASE_API1
   })
 }
 
@@ -13,7 +14,8 @@ export function listData(query) {
 export function getData(dictCode) {
   return request({
     url: '/system/dict/data/' + dictCode,
-    method: 'get'
+    method: 'get',
+    baseURL: process.env.VUE_APP_BASE_API1
   })
 }
 
@@ -21,7 +23,8 @@ export function getData(dictCode) {
 export function getDicts(dictType) {
   return request({
     url: '/system/dict/data/type/' + dictType,
-    method: 'get'
+    method: 'get',
+    baseURL: process.env.VUE_APP_BASE_API1
   })
 }
 
@@ -30,7 +33,8 @@ export function addData(data) {
   return request({
     url: '/system/dict/data',
     method: 'post',
-    data: data
+    data: data,
+    baseURL: process.env.VUE_APP_BASE_API1
   })
 }
 
@@ -39,7 +43,8 @@ export function updateData(data) {
   return request({
     url: '/system/dict/data',
     method: 'put',
-    data: data
+    data: data,
+    baseURL: process.env.VUE_APP_BASE_API1
   })
 }
 
@@ -47,6 +52,7 @@ export function updateData(data) {
 export function delData(dictCode) {
   return request({
     url: '/system/dict/data/' + dictCode,
-    method: 'delete'
+    method: 'delete',
+    baseURL: process.env.VUE_APP_BASE_API1
   })
 }

+ 6 - 6
ruoyi-ui/src/api/system/tenant/data.js

@@ -6,7 +6,7 @@ export function listData(query) {
     url: '/system/dict/data/list',
     method: 'get',
     params: query,
-    baseURL: process.env.VUE_APP_BASE_API3
+    baseURL: process.env.VUE_APP_BASE_API1
   })
 }
 
@@ -15,7 +15,7 @@ export function getData(dictCode) {
   return request({
     url: '/system/dict/data/' + dictCode,
     method: 'get',
-    baseURL: process.env.VUE_APP_BASE_API3
+    baseURL: process.env.VUE_APP_BASE_API1
   })
 }
 
@@ -24,7 +24,7 @@ export function getDicts(dictType) {
   return request({
     url: '/system/dict/data/type/' + dictType,
     method: 'get',
-    baseURL: process.env.VUE_APP_BASE_API3
+    baseURL: process.env.VUE_APP_BASE_API1
   })
 }
 
@@ -34,7 +34,7 @@ export function addData(data) {
     url: '/system/dict/data',
     method: 'post',
     data: data,
-    baseURL: process.env.VUE_APP_BASE_API3
+    baseURL: process.env.VUE_APP_BASE_API1
   })
 }
 
@@ -44,7 +44,7 @@ export function updateData(data) {
     url: '/system/dict/data',
     method: 'put',
     data: data,
-    baseURL: process.env.VUE_APP_BASE_API3
+    baseURL: process.env.VUE_APP_BASE_API1
   })
 }
 
@@ -53,6 +53,6 @@ export function delData(dictCode) {
   return request({
     url: '/system/dict/data/' + dictCode,
     method: 'delete',
-    baseURL: process.env.VUE_APP_BASE_API3
+    baseURL: process.env.VUE_APP_BASE_API1
   })
 }

+ 0 - 5
ruoyi-ui/src/utils/index.js

@@ -420,8 +420,3 @@ export function toUnderline(str = '') {
 export const $ = name => document.querySelector(name)
 
 export const getContainerSize = dom => ({ width: dom.getBoundingClientRect().width, height: dom.getBoundingClientRect().height })
-
-// 驼峰转下划线
-export function toUnderline(str = '') {
-  return str.replace(/([A-Z])/g, '_$1').toLowerCase()
-}