解决实体管理 结构图无法上传

dev^2
shiji 1 year ago
parent b4e0df4711
commit 9d748bffeb
  1. 6
      ant-design-vue-jeecg/src/views/tablex/TablexList.vue
  2. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/controller/TablexController.java

@ -157,7 +157,8 @@ import JEllipsis from '@/components/jeecg/JEllipsis'
import FieldxList from "@/views/fieldx/FieldxList";
import {getAction, httpAction} from "@api/manage";
import {filterObj} from "@/utils/util";
import {JVXETypes} from "@comp/jeecg/JVxeTable";
// import {JVXETypes} from "@comp/jeecg/JVxeTable";
import { JVXETypes } from '@/components/jeecg/JVxeTable'
export default {
name: 'TablexList',
@ -230,7 +231,8 @@ export default {
{
title:'结构图', width: '10%',
key: 'structuralDiagram',
type: JVXETypes.upload,
type:JVXETypes.image,
token:true,
scopedSlots: {customRender: 'imgSlot'},
align: 'center',

@ -49,6 +49,7 @@ import org.jeecgframework.poi.excel.entity.TemplateExportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecgframework.poi.excel.view.JeecgTemplateExcelView;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -194,14 +195,14 @@ public class TablexController extends JeecgController<Tablex, ITablexService> {
@AutoLog(value = "实体表-编辑")
@ApiOperation(value = "实体表-编辑", notes = "实体表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody Tablex tablex) {
public Result<?> edit(@NotNull @RequestBody Tablex tablex) {
tablex.setVerison(tablex.getVerison() + 1);
List<Tablex> tablexList = tablexService.list();
for (Tablex tablex1 : tablexList) {
if (tablex1.getModuleId().equals(tablex.getModuleId())) {
return Result.error("该模块已有实体,编辑失败");
}
}
// List<Tablex> 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());

Loading…
Cancel
Save