diff --git a/ant-design-vue-jeecg/src/views/fieldx/FieldxList.vue b/ant-design-vue-jeecg/src/views/fieldx/FieldxList.vue index a3882c9..3100bb4 100644 --- a/ant-design-vue-jeecg/src/views/fieldx/FieldxList.vue +++ b/ant-design-vue-jeecg/src/views/fieldx/FieldxList.vue @@ -9,6 +9,7 @@ >
+ 实体名称:{{tableName}} - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - + @cancel="handleCancel"> + +
+ 模块名称:{{moduleName}} + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + height='auto' + + toolbar + :toolbarConfig="toolbarConfig" - \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/controller/TablexController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/controller/TablexController.java index b9728fc..a283457 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/controller/TablexController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/controller/TablexController.java @@ -1,8 +1,6 @@ package org.jeecg.modules.tablex.controller; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -86,7 +84,22 @@ public class TablexController extends JeecgController { IPage pageList = tablexService.page(page, queryWrapper); return Result.OK(pageList); } - + @AutoLog(value = "实体管理-通过模块查询实体") + @ApiOperation(value="实体管理-通过模块查询实体", notes="实体管理-通过模块查询实体") + @GetMapping(value = "/getTableByModuleId") + public Result getTableByModuleId(@RequestParam(name="moduleId",required=true) String moduleId){ + if (moduleId!=null){ + List tablexList = tablexService.list(new QueryWrapper().eq("module_id", moduleId)); + ArrayList hashMaps = new ArrayList<>(); + for (Tablex tablex:tablexList){ + HashMap hashMap = new HashMap<>(); + hashMap.put("text",tablex.getTableName()); + hashMap.put("value",tablex.getId()); + hashMaps.add(hashMap); + } + return Result.OK(hashMaps); + }else return Result.error("未找到数据,请重试"); + } /** * 添加 * @@ -127,12 +140,12 @@ public class TablexController extends JeecgController { @PutMapping(value = "/edit") public Result edit(@RequestBody Tablex tablex) { tablex.setVerison(tablex.getVerison()+1); - List tablexList = tablexService.list(); - for (Tablex tablex1 : tablexList){ - if (tablex1.getModuleId().equals(tablex.getModuleId())){ - return Result.error("该模块已有实体,编辑失败"); - } - } +// List tablexList = tablexService.list(); +// for (Tablex tablex1 : tablexList){ +// if (tablex1.getModuleId().equals(tablex.getModuleId())){ +// return Result.error("该模块已有实体,编辑失败"); +// } +// } if (tablex.getModuleId() != null){ Modulex modulex = modulexService.getById(tablex.getModuleId()); tablex.setTableName(modulex.getModuleName());