diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java index 2abb94fa1..756a57863 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java @@ -61,6 +61,9 @@ public class GenTable extends BaseEntity @NotBlank(message = "作者不能为空") private String functionAuthor; + /** 表单布局(单列 双列 三列) */ + private int formColNum; + /** 生成代码方式(0zip压缩包 1自定义路径) */ private String genType; @@ -215,6 +218,16 @@ public class GenTable extends BaseEntity this.functionAuthor = functionAuthor; } + public int getFormColNum() + { + return formColNum; + } + + public void setFormColNum(int formColNum) + { + this.formColNum = formColNum; + } + public String getGenType() { return genType; diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java index 2698e0b9f..f73290e30 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java @@ -50,6 +50,8 @@ public class VelocityUtils velocityContext.put("basePackage", getPackagePrefix(packageName)); velocityContext.put("packageName", packageName); velocityContext.put("author", genTable.getFunctionAuthor()); + velocityContext.put("colXsNum", getColXsNum(genTable.getFormColNum())); + velocityContext.put("colSmNum", getColSmNum(genTable.getFormColNum())); velocityContext.put("datetime", DateUtils.getDate()); velocityContext.put("pkColumn", genTable.getPkColumn()); velocityContext.put("importList", getImportList(genTable)); @@ -381,4 +383,40 @@ public class VelocityUtils } return num; } + + /** + * 获取表单排列网格 + * + * @param formColNum 表单布局方式 + * @return 排列类样式 + */ + public static String getColXsNum(int formColNum) + { + String colXsNum = "col-xs-12"; + if (formColNum == 2) + { + return "col-xs-6"; + } + else if (formColNum == 3) + { + return "col-xs-4"; + } + return colXsNum; + } + + /** + * 获取表单label网格 + * + * @param formColNum 表单布局方式 + * @return 网格类样式 + */ + public static String getColSmNum(int formColNum) + { + String colSmNum = "col-sm-3"; + if (formColNum == 2 || formColNum == 3) + { + return "col-sm-4"; + } + return colSmNum; + } } diff --git a/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml b/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml index bc7cf5277..25fdafcb3 100644 --- a/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml +++ b/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml @@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -54,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table + select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, form_col_num, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table -
- - -
+ @@ -156,6 +156,18 @@ +
+
+ +
+ +
+ + +
+
+
+