diff --git a/smtweb-framework/bpm/src/main/resources/static/template/model_card.ftl b/smtweb-framework/bpm/src/main/resources/static/template/model_card.ftl index 713b23f..56375ac 100644 --- a/smtweb-framework/bpm/src/main/resources/static/template/model_card.ftl +++ b/smtweb-framework/bpm/src/main/resources/static/template/model_card.ftl @@ -1,12 +1,14 @@ { + "version": 6, "form": [ { "page": { - "id": "p${newId()}", + "id": "id${newId()}", "type": "fx-page", "props": { - "title": "${title}", - "key": "${newId()}" + "title": "编辑", + "key": "${newId()}", + "tipsExpand": false } }, "graph": { @@ -15,88 +17,268 @@ "type": "fx-split-panel", "props": { "horizontal": false, - "shadow": "never" + "shadow": "", + "scroll": false, + "size": "", + "name": "s0" }, "children": [ -<#list layout.c1 as group> - <#if (group.type == "list")> - <#if (group.cfilters?size>0)> - <#include "incModel/inc_filter.ftl"/> - - <#include "incModel/inc_grid_opt.ftl"/> - <#elseif (group.type == "card")> - <#include "incModel/inc_form.ftl"/> - , - -{ + { "id": "${newId()}", - "type": "fx-form-panel", + "type": "fx-split-panel", "shape": "panel", "props": { - "paddingY": 3, - "paddingX": 10, - "size": 20 + "size": "56", + "horizontal": true, + "scroll": false, + "name": "s11" }, "children": [ { - "id": "id${newId()}", - "type": "fx-button-group", + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", "props": { - "menus": [], - "textAlign": "center" + "alignY": "center", + "size": "50" }, - "slots": { - "default": [ - { - "type": "fx-button", - "props": { - "label": "新增", - "leftIcon": "plus", - "type": "primary", - "action": "button:add" - }, - "id": "id${newId()}" + "children": [ + { + "id": "${newId()}", + "type": "fx-button-group", + "props": { + "menus": [] }, - { - "type": "fx-button", - "props": { - "label": "保存并新增", - "type": "primary", - "action": "button:saveAndAdd" - }, - "id": "id${newId()}" - }, - { - "type": "fx-button", - "props": { - "label": "保存", - "leftIcon": "save", - "type": "success", - "action": "button:save" - }, - "id": "id${newId()}" + "slots": { + "default": [ + { + "type": "fx-button", + "props": { + "label": "返回", + "leftIcon": "left", + "action": "button:return", + "text": false, + "link": true, + "type": "primary", + "size": "large" + }, + "id": "${newId()}" + } + ] + } + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "alignY": "center", + "size": "200", + "paddingLeft": 10 + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-title", + "props": { + "label": "${title}" + } + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "alignY": "center", + "paddingRight": 32 + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-button-group", + "props": { + "menus": [], + "textAlign": "right" }, + "slots": { + "default": [ + { + "type": "fx-button", + "props": { + "label": "删除", + "leftIcon": "delete", + "type": "", + "action": "button:remove" + }, + "id": "${newId()}" + }, + { + "id": "${newId()}", + "type": "fx-button", + "props": { + "label": "新增", + "type": "primary", + "linkType": "curr", + "leftIcon": "plus" + } + } + ] + } + } + ] + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "0" + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-divider", + "props": { + "label": "", + "contentPosition": "center", + "direction": "horizontal" + } + } + ] + }, + { + "id": "${newId()}", + "type": "fx-split-panel", + "shape": "panel", + "props": { + "size": "", + "horizontal": false, + "scroll": true, + "name": "s12" + }, + "children": [ + { + <#list layout.c1 as group> + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "0", + <#if param.col lte 1> + "gridTemplateColumns": "1fr 2fr", + <#elseif param.col gte 2> + "gridTemplateColumns": "1fr 1fr 1fr", + + "paddingTop": 32 + }, + <#assign fields = group.fields> + "children": [ + <#list fields as field> { - "type": "fx-button", + "id": "id${newId()}", + "type": "fx-${field.editor}", "props": { - "label": "删除", - "leftIcon": "delete", - "type": "danger", - "action": "button:remove" + "label": "${field.label}", + "type": "text", + <#if field.maxlength gt 0> + "maxlength": ${field.maxlength}, + + "placeholder": "请输入内容", + "labelWidth": 150, + "affixError": true }, - "id": "id${newId()}" + "events": {} + } + <#if field_has_next> + <#if (param.col lte 1 )> + ,{ + "id": "id${newId()}", + "type": "fx-placeholder", + "props": { + "label": "占位" + }, + "layout": { + "row": 1 + } + } + + <#if (param.col = 2 && ((field_index+1) % 2 = 0 ) )> + ,{ + "id": "id${newId()}", + "type": "fx-placeholder", + "props": { + "label": "占位" + }, + "layout": { + "row": 1 + } + } + + , + + + + ] + + }, + + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "56", + "alignY": "center", + "paddingLeft": 150 + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-button-group", + "props": { + "menus": [] }, - { - "type": "fx-button", - "props": { - "label": "返回", - "leftIcon": "return", - "action": "button:return" - }, - "id": "id${newId()}" + "slots": { + "default": [ + { + "type": "fx-button", + "props": { + "label": "保存并新增", + "type": "primary", + "action": "button:saveAndAdd", + "linkType": "curr" + }, + "id": "${newId()}" + }, + { + "type": "fx-button", + "props": { + "label": "保存", + "leftIcon": "save", + "type": "success", + "action": "button:save" + }, + "id": "${newId()}" + } + ] } - ] - } + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "name": "d2" + }, + "children": [] } ] } @@ -105,9 +287,9 @@ } ], "model": [ -<#list datasets as dataset> - <#include "incModel/inc_model.ftl"/><#if dataset_has_next>, - + <#list datasets as dataset> + <#include "incModel/inc_model.ftl"/><#if dataset_has_next>, + ], "option": { "widgetRef": [${widgetRef}],