From 86cb7555ebfd6c3e03aeeaf310df7523abcff8ce Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Thu, 02 Apr 2026 11:08:38 +0800
Subject: [PATCH] 代码生成支持表单布局选项
---
ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/domain/GenTable.java | 135 +++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 131 insertions(+), 4 deletions(-)
diff --git a/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/domain/GenTable.java b/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/domain/GenTable.java
index 86fc86a..f682cfa 100644
--- a/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/domain/GenTable.java
+++ b/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/domain/GenTable.java
@@ -1,8 +1,8 @@
package com.ruoyi.gen.domain;
import java.util.List;
-import javax.validation.Valid;
-import javax.validation.constraints.NotBlank;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotBlank;
import org.apache.commons.lang3.ArrayUtils;
import com.ruoyi.common.core.constant.GenConstants;
import com.ruoyi.common.core.utils.StringUtils;
@@ -28,12 +28,21 @@
@NotBlank(message = "表描述不能为空")
private String tableComment;
+ /** 关联父表的表名 */
+ private String subTableName;
+
+ /** 本表关联父表的外键名 */
+ private String subTableFkName;
+
/** 实体类名称(首字母大写) */
@NotBlank(message = "实体类名称不能为空")
private String className;
- /** 使用的模板(crud单表操作 tree树表操作) */
+ /** 使用的模板(crud单表操作 tree树表操作 sub主子表操作) */
private String tplCategory;
+
+ /** 前端类型(element-ui模版 element-plus模版 element-plus-typescript模版) */
+ private String tplWebType;
/** 生成包路径 */
@NotBlank(message = "生成包路径不能为空")
@@ -55,8 +64,20 @@
@NotBlank(message = "作者不能为空")
private String functionAuthor;
+ /** 表单布局(单列 双列 三列) */
+ private Integer formColNum;
+
+ /** 生成代码方式(0zip压缩包 1自定义路径) */
+ private String genType;
+
+ /** 生成路径(不填默认项目路径) */
+ private String genPath;
+
/** 主键信息 */
private GenTableColumn pkColumn;
+
+ /** 子表信息 */
+ private GenTable subTable;
/** 表列信息 */
@Valid
@@ -73,6 +94,12 @@
/** 树名称字段 */
private String treeName;
+
+ /** 上级菜单ID字段 */
+ private Long parentMenuId;
+
+ /** 上级菜单名称字段 */
+ private String parentMenuName;
public Long getTableId()
{
@@ -104,6 +131,26 @@
this.tableComment = tableComment;
}
+ public String getSubTableName()
+ {
+ return subTableName;
+ }
+
+ public void setSubTableName(String subTableName)
+ {
+ this.subTableName = subTableName;
+ }
+
+ public String getSubTableFkName()
+ {
+ return subTableFkName;
+ }
+
+ public void setSubTableFkName(String subTableFkName)
+ {
+ this.subTableFkName = subTableFkName;
+ }
+
public String getClassName()
{
return className;
@@ -122,6 +169,16 @@
public void setTplCategory(String tplCategory)
{
this.tplCategory = tplCategory;
+ }
+
+ public String getTplWebType()
+ {
+ return tplWebType;
+ }
+
+ public void setTplWebType(String tplWebType)
+ {
+ this.tplWebType = tplWebType;
}
public String getPackageName()
@@ -174,6 +231,36 @@
this.functionAuthor = functionAuthor;
}
+ public Integer getFormColNum()
+ {
+ return formColNum;
+ }
+
+ public void setFormColNum(Integer formColNum)
+ {
+ this.formColNum = formColNum;
+ }
+
+ public String getGenType()
+ {
+ return genType;
+ }
+
+ public void setGenType(String genType)
+ {
+ this.genType = genType;
+ }
+
+ public String getGenPath()
+ {
+ return genPath;
+ }
+
+ public void setGenPath(String genPath)
+ {
+ this.genPath = genPath;
+ }
+
public GenTableColumn getPkColumn()
{
return pkColumn;
@@ -182,6 +269,16 @@
public void setPkColumn(GenTableColumn pkColumn)
{
this.pkColumn = pkColumn;
+ }
+
+ public GenTable getSubTable()
+ {
+ return subTable;
+ }
+
+ public void setSubTable(GenTable subTable)
+ {
+ this.subTable = subTable;
}
public List<GenTableColumn> getColumns()
@@ -234,6 +331,36 @@
this.treeName = treeName;
}
+ public Long getParentMenuId()
+ {
+ return parentMenuId;
+ }
+
+ public void setParentMenuId(Long parentMenuId)
+ {
+ this.parentMenuId = parentMenuId;
+ }
+
+ public String getParentMenuName()
+ {
+ return parentMenuName;
+ }
+
+ public void setParentMenuName(String parentMenuName)
+ {
+ this.parentMenuName = parentMenuName;
+ }
+
+ public boolean isSub()
+ {
+ return isSub(this.tplCategory);
+ }
+
+ public static boolean isSub(String tplCategory)
+ {
+ return tplCategory != null && StringUtils.equals(GenConstants.TPL_SUB, tplCategory);
+ }
+
public boolean isTree()
{
return isTree(this.tplCategory);
@@ -268,4 +395,4 @@
}
return StringUtils.equalsAnyIgnoreCase(javaField, GenConstants.BASE_ENTITY);
}
-}
\ No newline at end of file
+}
--
Gitblit v1.9.3