From eaf53cf9fad8a93cc34c9ccef580304f5493de99 Mon Sep 17 00:00:00 2001 From: thinkgem Date: Fri, 22 Oct 2021 09:53:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=EF=BC=9A?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=A1=A8=E5=8D=95=EF=BC=881=E5=88=97?= =?UTF-8?q?=E3=80=812=E5=88=97=E3=80=813=E5=88=97=EF=BC=89=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E9=80=89=E9=A1=B9=E7=9A=84=E5=BF=AB=E9=80=9F=E9=80=89?= =?UTF-8?q?=E6=8B=A9=EF=BC=8C=E7=9B=B8=E6=AF=94=E5=88=97=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=A0=85=E6=A0=BC=EF=BC=8C=E6=9B=B4=E4=BE=BF=E4=BA=8E=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E5=92=8C=E7=90=86=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jeesite/modules/sys/db/InitCoreData.java | 2 +- .../modules/gen/include/formControl.html | 45 +++++++++++-------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/db/InitCoreData.java b/modules/core/src/main/java/com/jeesite/modules/sys/db/InitCoreData.java index ed99e43f..947bf5e3 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/db/InitCoreData.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/db/InitCoreData.java @@ -506,7 +506,7 @@ public class InitCoreData extends BaseInitDataTests { ){ column.setQueryType("LIKE"); column.getOptionMap().put("isNewLine", Global.YES); - column.getOptionMap().put("gridRowCol", "12/2/10"); +// column.getOptionMap().put("gridRowCol", "12/2/10"); } else if ("test_select".equals(column.getColumnName()) || "test_select_multiple".equals(column.getColumnName()) diff --git a/modules/core/src/main/resources/templates/modules/gen/include/formControl.html b/modules/core/src/main/resources/templates/modules/gen/include/formControl.html index adc0e76c..da223ca4 100644 --- a/modules/core/src/main/resources/templates/modules/gen/include/formControl.html +++ b/modules/core/src/main/resources/templates/modules/gen/include/formControl.html @@ -1,5 +1,12 @@ <% - var rowFlag = -1, preGridRowCol; + var rowFlag = -1, preGridRowCol, txtGridRowCol; + if (table.optionMap['formColNum'] == "1") { + txtGridRowCol = ['col-xs-12', 'col-sm-2', 'col-sm-8']; + } else if (table.optionMap['formColNum'] == "3") { + txtGridRowCol = ['col-xs-12', 'col-sm-2 col-sm-9-1', 'col-sm-10 col-sm-9-8']; + } else { + txtGridRowCol = ['col-xs-12', 'col-sm-2', 'col-sm-10']; + } for (c in table.columnList){ if (c.isEdit == '1' || c.isPk == '1'){ // 如果是树结构的字段,则自动忽略 @@ -15,13 +22,15 @@ // 输出表单字段 else{ // 栅格参数获取 - var gridRowCol = @StringUtils.split(c.optionMap['gridRowCol'], '/'); - if (isBlank(gridRowCol) || gridRowCol.~size != 3){ - if (c.showType == 'textarea'){ - gridRowCol = @StringUtils.split('12/2/10', '/'); - }else{ - gridRowCol = @StringUtils.split('6/4/8', '/'); - } + var gridRowCol = null; + if (c.showType == 'textarea') { + gridRowCol = txtGridRowCol; + } else if (table.optionMap['formColNum'] == "1") { + gridRowCol = ['col-xs-12', 'col-sm-2', 'col-sm-4']; + } else if (table.optionMap['formColNum'] == "3") { + gridRowCol = ['col-xs-4', 'col-sm-4', 'col-sm-8']; + } else { + gridRowCol = ['col-xs-6', 'col-sm-4', 'col-sm-8']; } // 是否强制新行获取,生成字段界面用户设定的 var isNewLine = @Global.YES.equals(c.optionMap['isNewLine']); @@ -31,7 +40,7 @@ } } // 如果上一个控件占12列,则强制新行算了 - if (isNotEmpty(preGridRowCol) && preGridRowCol[0] == '12'){ + if (isNotEmpty(preGridRowCol) && preGridRowCol[0] == 'col-xs-12'){ isNewLine = true; } // 保存上一个控件输出栅格对象 @@ -71,11 +80,11 @@ } // 开始输出控件 %> -
+
-