Browse Source

页面定义

master
郑根木 2 years ago
parent
commit
e118ae62dc
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelFormHelper.java

+ 7
- 1
smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelFormHelper.java View File

@@ -98,6 +98,10 @@ public class ModelFormHelper {
PageDatasetField pdf = isField ? pds.getField(fn) : pds.getFilter(fn); PageDatasetField pdf = isField ? pds.getField(fn) : pds.getFilter(fn);
if (pdf == null) throw new SwException("model[" + db + "]." + key + "未找到定义的数据集字段(" + fn + "),无法解析!"); if (pdf == null) throw new SwException("model[" + db + "]." + key + "未找到定义的数据集字段(" + fn + "),无法解析!");


if (CommUtil.isStrEquals(MapUtil.readString(field, "label"), pdf.label)) {
field.remove("label");
}

//必填字段 //必填字段
if (pdf.isNotNull() == MapUtil.readBool(field, "required")) { if (pdf.isNotNull() == MapUtil.readBool(field, "required")) {
field.remove("required"); field.remove("required");
@@ -193,7 +197,9 @@ public class ModelFormHelper {
if (StringUtils.isEmpty(fn)) continue; if (StringUtils.isEmpty(fn)) continue;
PageDatasetField pdf = isField ? dataSet.getField(fn) : dataSet.getFilter(fn); PageDatasetField pdf = isField ? dataSet.getField(fn) : dataSet.getFilter(fn);
if (pdf == null) continue; if (pdf == null) continue;

if (!field.containsKey("label")) {
field.put("label", pdf.label);
}
//必填字段 //必填字段
if (!field.containsKey("required")) { if (!field.containsKey("required")) {
field.put("required", pdf.isNotNull()); field.put("required", pdf.isNotNull());


Loading…
Cancel
Save