From bd4dfaf03d79c728be18f2409bb93978f6de374d Mon Sep 17 00:00:00 2001 From: admin <1628672303@qq.com> Date: Wed, 12 Apr 2023 09:54:16 +0800 Subject: [PATCH] 4-12 --- .../src/views/fieldx/FieldxList.vue | 17 ++++++++++++----- .../src/views/tablex/TablexList.vue | 14 ++++++++++++-- .../tablex/controller/TablexController.java | 12 ++++++++++++ 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/fieldx/FieldxList.vue b/ant-design-vue-jeecg/src/views/fieldx/FieldxList.vue index 45125c7..60544e3 100644 --- a/ant-design-vue-jeecg/src/views/fieldx/FieldxList.vue +++ b/ant-design-vue-jeecg/src/views/fieldx/FieldxList.vue @@ -138,7 +138,7 @@ } }, { - title:'对应实体id', + title:'对应实体', align:"center", dataIndex: 'tableId_dictText' }, @@ -245,8 +245,8 @@ } }, created() { - this.getSuperFieldList(); - this.loadParameter(); + this.loadParameter(); + this.getSuperFieldList(); }, computed: { importExcelUrl: function(){ @@ -256,17 +256,24 @@ methods: { initDictConfig(){ }, + searchReset() { + this.queryParam ={}; + this.queryParam.tableId = this.tableId; + this.loadData(1); + }, //加载传递参数 loadParameter() { if (this.loadRouteType == false) { + this.queryParam.tableId = this.$route.query.id; this.tableId = this.$route.query.id; - console.log(this.tableId) + console.log(this.queryParam.tableId) this.loadRouteType = true; } + this.searchQuery(); }, getSuperFieldList(){ let fieldList=[]; - fieldList.push({type:'string',value:'tableId',text:'对应实体id',dictCode:'tablex,table_name,id'}) + fieldList.push({type:'string',value:'tableId',text:'对应实体',dictCode:'tablex,table_name,id'}) fieldList.push({type:'string',value:'fieldName',text:'中文名称',dictCode:''}) fieldList.push({type:'string',value:'fieldEnName',text:'英文名称',dictCode:''}) fieldList.push({type:'sel_search',value:'type',text:'数据类型',dictTable:'', dictText:'', dictCode:'date_type'}) diff --git a/ant-design-vue-jeecg/src/views/tablex/TablexList.vue b/ant-design-vue-jeecg/src/views/tablex/TablexList.vue index a30a05c..8ec9804 100644 --- a/ant-design-vue-jeecg/src/views/tablex/TablexList.vue +++ b/ant-design-vue-jeecg/src/views/tablex/TablexList.vue @@ -88,9 +88,11 @@ - + + + 编辑 @@ -202,6 +204,14 @@ align:"center", dataIndex: 'verison' }, + { + title: '管理', + dataIndex: 'htmlSlot', + align: "center", + fixed: "right", + width: 147, + scopedSlots: {customRender: 'htmlSlot'} + }, { title: '操作', dataIndex: 'action', 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 b682662..37da16a 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 @@ -97,6 +97,12 @@ public class TablexController extends JeecgController { @ApiOperation(value="实体表-添加", notes="实体表-添加") @PostMapping(value = "/add") public Result add(@RequestBody Tablex tablex) { + 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()); @@ -118,6 +124,12 @@ public class TablexController extends JeecgController { @ApiOperation(value="实体表-编辑", notes="实体表-编辑") @PutMapping(value = "/edit") public Result edit(@RequestBody Tablex tablex) { + 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());