!5 代码生成页面的编辑页列数允许多列

Merge pull request !5 from 晨曦/0416
This commit is contained in:
数据小王子 2024-04-16 11:34:16 +00:00 committed by Gitee
commit 844aa24b43
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 717 additions and 691 deletions

View File

@ -156,6 +156,9 @@ public class GenTable implements Serializable
/** 备注 */ /** 备注 */
private String remark; private String remark;
/** 编辑页列数 */
private Integer editColumns;
/** /**
* 请求参数 * 请求参数
*/ */

View File

@ -70,6 +70,8 @@ public class VelocityUtils {
velocityContext.put("columns", genTable.getColumns()); velocityContext.put("columns", genTable.getColumns());
velocityContext.put("table", genTable); velocityContext.put("table", genTable);
velocityContext.put("dicts", getDicts(genTable)); velocityContext.put("dicts", getDicts(genTable));
/* 编辑页列数*/
velocityContext.put("editColumns", genTable.getEditColumns());
setMenuVelocityContext(velocityContext, genTable); setMenuVelocityContext(velocityContext, genTable);
if (GenConstants.TPL_TREE.equals(tplCategory)) { if (GenConstants.TPL_TREE.equals(tplCategory)) {
setTreeVelocityContext(velocityContext, genTable); setTreeVelocityContext(velocityContext, genTable);

View File

@ -147,8 +147,9 @@
/> />
</el-card> </el-card>
<!-- 添加或修改${functionName}对话框 --> <!-- 添加或修改${functionName}对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="780px" append-to-body> <el-dialog :title="dialog.title" v-model="dialog.visible" width="1000px" append-to-body>
<el-form ref="${businessName}FormRef" :model="form" :rules="rules" label-width="80px"> <el-form ref="${businessName}FormRef" :model="form" :rules="rules" label-width="100px">
<el-row>
#foreach($column in $columns) #foreach($column in $columns)
#set($field=$column.javaField) #set($field=$column.javaField)
#if(($column.insert || $column.edit) && !$column.pk) #if(($column.insert || $column.edit) && !$column.pk)
@ -159,6 +160,18 @@
#set($comment=$column.columnComment) #set($comment=$column.columnComment)
#end #end
#set($dictType=$column.dictType) #set($dictType=$column.dictType)
#if(${editColumns}==1)
<el-col :span="24">
#end
#if(${editColumns}==2)
<el-col :span="12">
#end
#if(${editColumns}==3)
<el-col :span="8">
#end
#if(${editColumns}==4)
<el-col :span="6">
#end
#if($column.htmlType == "input") #if($column.htmlType == "input")
#if(${field} == "version") #if(${field} == "version")
<el-form-item label="${comment}" prop="${field}" v-show="false"> <el-form-item label="${comment}" prop="${field}" v-show="false">
@ -253,8 +266,10 @@
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
</el-form-item> </el-form-item>
#end #end
</el-col>
#end #end
#end #end
</el-row>
#if($table.sub) #if($table.sub)
<el-divider content-position="center">${subTable.functionName}信息</el-divider> <el-divider content-position="center">${subTable.functionName}信息</el-divider>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">

View File

@ -72,3 +72,6 @@ insert into sys_menu values('130', 'EasyRetry控制台', '2', '6', 'easyret
-- 增加ancestors字段 -- 增加ancestors字段
ALTER TABLE `mf_product` ADD COLUMN `ancestors` VARCHAR(760) NULL DEFAULT '' COMMENT '祖级列表' AFTER `parent_id`; ALTER TABLE `mf_product` ADD COLUMN `ancestors` VARCHAR(760) NULL DEFAULT '' COMMENT '祖级列表' AFTER `parent_id`;
ALTER TABLE `demo_product` ADD COLUMN `ancestors` VARCHAR(760) NULL DEFAULT '' COMMENT '祖级列表' AFTER `parent_id`; ALTER TABLE `demo_product` ADD COLUMN `ancestors` VARCHAR(760) NULL DEFAULT '' COMMENT '祖级列表' AFTER `parent_id`;
--edit_columns字段
ALTER TABLE `gen_table` ADD COLUMN `edit_columns` TINYINT NULL DEFAULT 1 AFTER `remark`;

View File

@ -133,3 +133,6 @@ insert into sys_menu values('130', 'EasyRetry控制台', '2', '6', 'easyret
-- 增加ancestors字段 -- 增加ancestors字段
ALTER TABLE "mf_product" ADD "ancestors" VARCHAR(760) NULL; ALTER TABLE "mf_product" ADD "ancestors" VARCHAR(760) NULL;
COMMENT ON COLUMN "mf_product"."ancestors" IS '祖级列表'; COMMENT ON COLUMN "mf_product"."ancestors" IS '祖级列表';
--edit_columns字段
ALTER TABLE `gen_table` ADD COLUMN `edit_columns` TINYINT NULL DEFAULT 1 AFTER `remark`;