@@ -68,15 +68,14 @@ public interface SwEnum { | |||||
class EditorType extends StrEnum { | class EditorType extends StrEnum { | ||||
public static EditorType instance = new EditorType(); | public static EditorType instance = new EditorType(); | ||||
public static StrEnumBean INPUT = instance.addEnum("input", "文本"); | |||||
public static StrEnumBean TEXT = instance.addEnum("text", "长文本"); | |||||
public static StrEnumBean NUMBER = instance.addEnum("num", "数字"); | |||||
public static StrEnumBean INPUT = instance.addEnum("text", "文本"); | |||||
public static StrEnumBean TEXT = instance.addEnum("textarea", "长文本"); | |||||
public static StrEnumBean NUMBER = instance.addEnum("number", "数字"); | |||||
public static StrEnumBean DATE = instance.addEnum("date", "日期"); | public static StrEnumBean DATE = instance.addEnum("date", "日期"); | ||||
public static StrEnumBean TIME = instance.addEnum("time", "时间"); | public static StrEnumBean TIME = instance.addEnum("time", "时间"); | ||||
public static StrEnumBean DATETIME = instance.addEnum("datetime", "日期时间"); | public static StrEnumBean DATETIME = instance.addEnum("datetime", "日期时间"); | ||||
public static StrEnumBean COMBO = instance.addEnum("combo", "下拉"); | |||||
public static StrEnumBean TREE = instance.addEnum("tree", "树型"); | |||||
public static StrEnumBean COMBO = instance.addEnum("select", "下拉列表"); | |||||
public static StrEnumBean TREE = instance.addEnum("select-tree", "下拉树"); | |||||
} | } | ||||
/** | /** | ||||
@@ -428,8 +428,9 @@ public class ModelFormHelper { | |||||
field.put("label", pdf.label); | field.put("label", pdf.label); | ||||
field.put("required", pdf.isFieldNotNull()); | field.put("required", pdf.isFieldNotNull()); | ||||
final SwEnum.DataTypeBean dtb = SwEnum.DataType.instance.getByValue(pdf.dataType); | final SwEnum.DataTypeBean dtb = SwEnum.DataType.instance.getByValue(pdf.dataType); | ||||
if (dtb != null && dtb.dataLength > 0) { | |||||
field.put("maxlength", dtb.dataLength); | |||||
if (dtb != null) { | |||||
if (dtb.dataLength > 0) field.put("maxlength", dtb.dataLength); | |||||
field.put("editor", dtb.editor); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -33,6 +33,7 @@ public class PageDatasetField { | |||||
public long link; | public long link; | ||||
//控件类型:TEXT/TextArea/NUMBER/COMBO | //控件类型:TEXT/TextArea/NUMBER/COMBO | ||||
public String editor; | public String editor; | ||||
public String editModel; | |||||
@JsonIgnore | @JsonIgnore | ||||
public boolean isFieldNotNull() { | public boolean isFieldNotNull() { | ||||
@@ -13,7 +13,7 @@ | |||||
<#list fields as field> | <#list fields as field> | ||||
{ | { | ||||
"id": "id${newId()}", | "id": "id${newId()}", | ||||
"type": "${ctrl}", | |||||
"type": "${field.editor}", | |||||
"props": { | "props": { | ||||
"label": "${field.label}", | "label": "${field.label}", | ||||
"type": "text", | "type": "text", | ||||
@@ -13,4 +13,4 @@ model: | |||||
param: | param: | ||||
- | - | ||||
name: 'p1' | name: 'p1' | ||||
type: 'ds/...' | |||||
type: 'ds' |