Browse Source

修改:model_list_card.ftl调整

4.0
FLYPHT 2 years ago
parent
commit
e82f445e4e
4 changed files with 34 additions and 8 deletions
  1. +8
    -1
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelFormHelper.java
  2. +8
    -2
      smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_list_query.ftl
  3. +8
    -2
      smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_query_sfilters.ftl
  4. +10
    -3
      smtweb-framework/bpm/src/main/resources/static/template/default/model_list_card.ftl

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

@@ -497,6 +497,13 @@ public class ModelFormHelper {
} else { } else {
field.put("maxlength", 0); field.put("maxlength", 0);
} }
Map lookup = (Map)field.get("lookup");
if (lookup!=null){
long widgetId = MapUtil.readLong(lookup, "widgetId",-1L);
if(widgetId>0){
setWidget.add(widgetId);
}
}
} }
} }


@@ -520,7 +527,7 @@ public class ModelFormHelper {
col.put("editor", dtb != null ? dtb.editor: SwEnum.EditorType.INPUT.value); col.put("editor", dtb != null ? dtb.editor: SwEnum.EditorType.INPUT.value);


if (field.getLink() == 0L) return; if (field.getLink() == 0L) return;
Set<ModelForm> set = ModelFormCache.getInstance().getListByTable(field.getLink(), SwEnum.FormType.WIDGET.value); Set<ModelForm> set = ModelFormCache.getInstance().getListByTable(field.getLink(), SwEnum.FormType.WIDGET.value);
if (set == null || set.isEmpty()) return; if (set == null || set.isEmpty()) return;
ModelForm form = set.iterator().next(); ModelForm form = set.iterator().next();


+ 8
- 2
smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_list_query.ftl View File

@@ -18,10 +18,9 @@
<#list fields as filter> <#list fields as filter>
{ {
"id": "id${newId()}", "id": "id${newId()}",
"type": "fx-${filter.editor}",
"type": "${filter.editor}",
"props": { "props": {
"label": "${filter.label}", "label": "${filter.label}",
"type": "text",
<#if filter.maxlength gt 0> <#if filter.maxlength gt 0>
"maxlength": ${filter.maxlength}, "maxlength": ${filter.maxlength},
</#if> </#if>
@@ -31,6 +30,13 @@
"affixError": false, "affixError": false,
"dataset": "${filter.dataset}", "dataset": "${filter.dataset}",
"field": "${filter.id}", "field": "${filter.id}",
<#if filter.lookup??>
"lookup": {
<#list filter.lookup as k, v>
"${k}": "${v}" <#if k_has_next>,</#if>
</#list>
},
</#if>
"name": "${filter.name}" "name": "${filter.name}"
}, },
"events": {} "events": {}


+ 8
- 2
smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_query_sfilters.ftl View File

@@ -39,10 +39,9 @@
<#list fields as filter > <#list fields as filter >
{ {
"id": "id${newId()}", "id": "id${newId()}",
"type": "fx-${filter.editor}",
"type": "${filter.editor}",
"props": { "props": {
"label": "${filter.label}", "label": "${filter.label}",
"type": "text",
<#if filter.maxlength gt 0 > <#if filter.maxlength gt 0 >
"maxlength": ${filter.maxlength}, "maxlength": ${filter.maxlength},
</#if> </#if>
@@ -50,6 +49,13 @@
"labelWidth": 100, "labelWidth": 100,
"dataset": "${filter.dataset}", "dataset": "${filter.dataset}",
"field": "${filter.id}", "field": "${filter.id}",
<#if filter.lookup??>
"lookup": {
<#list filter.lookup as k, v>
"${k}": "${v}" <#if k_has_next>,</#if>
</#list>
},
</#if>
"name": "${filter.name}" "name": "${filter.name}"
}, },
"events": {} "events": {}


+ 10
- 3
smtweb-framework/bpm/src/main/resources/static/template/default/model_list_card.ftl View File

@@ -156,15 +156,22 @@
"id": "id${newId()}", "id": "id${newId()}",
<#if (dfield.readonly = true)> <#if (dfield.readonly = true)>
"type": "fx-text", "type": "fx-text",
"disabled": true,
<#else> <#else>
"type": "fx-${dfield.editor}",
"type": "${dfield.editor}",
</#if> </#if>
"props": { "props": {
"label": "${dfield.label}", "label": "${dfield.label}",
"type": "text",
"dataset": "${dfield.dataset}", "dataset": "${dfield.dataset}",
"field": "${dfield.id}", "field": "${dfield.id}",
"required": "${field.required}",
"required": "${dfield.required}",
<#if dfield.lookup??>
"lookup": {
<#list dfield.lookup as k, v>
"${k}": "${v}" <#if k_has_next>,</#if>
</#list>
},
</#if>
<#if dfield.maxlength gt 0> <#if dfield.maxlength gt 0>
"maxlength": ${dfield.maxlength}, "maxlength": ${dfield.maxlength},
</#if> </#if>


Loading…
Cancel
Save