Переглянути джерело

提交一个步骤表单模板

master
xiaxl 2 роки тому
джерело
коміт
d11bf6bc5a
2 змінених файлів з 433 додано та 0 видалено
  1. +19
    -0
      smtweb-framework/bpm/src/main/resources/static/template/index.yaml
  2. +414
    -0
      smtweb-framework/bpm/src/main/resources/static/template/model_step_card.ftl

+ 19
- 0
smtweb-framework/bpm/src/main/resources/static/template/index.yaml Переглянути файл

@@ -38,6 +38,25 @@ model:
label: '列数'
desc: '请选择表单列数'
-
name: 'model_step_card'
label: '步骤卡片'
# list/card/view
type: 'card'
# 布局
layout:
-
name: 'c1'
label: '步骤卡片'
type: 'card'
hasGroup: false
# 变量
param:
-
name: 'col'
type: 'number'
label: '列数'
desc: '请选择表单列数(目前只支持1,2,3)'
-
name: 'model_list_card'
label: '简单列表(含卡片)'
# list/card/view


+ 414
- 0
smtweb-framework/bpm/src/main/resources/static/template/model_step_card.ftl Переглянути файл

@@ -0,0 +1,414 @@
{
"version": 6,
"form": [
{
"page": {
"id": "id${newId()}",
"type": "fx-page",
"props": {
"title": "编辑",
"key": "${newId()}",
"tipsExpand": false
}
},
"graph": {
"shape": "panel",
"id": "root_panel",
"type": "fx-split-panel",
"props": {
"horizontal": false,
"shadow": "",
"scroll": false,
"size": "",
"name": "s0"
},
"children": [
{
"id": "${newId()}",
"type": "fx-split-panel",
"shape": "panel",
"props": {
"size": "56",
"horizontal": true,
"scroll": false,
"name": "s11"
},
"children": [
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"alignY": "center",
"backgroundImage":"bgImg-region-title",
"size": "50"

},
"children": [
{
"id": "${newId()}",
"type": "fx-button-group",
"props": {
"menus": []
},
"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",
"backgroundImage":"bgImg-region-title",
"paddingLeft": 10
},
"children": [
{
"id": "${newId()}",
"type": "fx-title",
"props": {
"label": "${title}"
}
}
]
},
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"alignY": "center",
"backgroundImage": "bgImg-region-title",
"paddingRight": 32
},
"children": [
{
"id": "${newId()}",
"type": "fx-button-group",
"props": {
"menus": [],
"textAlign": "right"
},
"slots": {
"default": [
{
"id": "${newId()}",
"type": "fx-button",
"props": {
"label": "新增",
"type": "primary",
"linkType": "curr",
"leftIcon": "plus"
}
},
{
"type": "fx-button",
"props": {
"label": "删除",
"leftIcon": "",
"type": "",
"action": "button:remove"
},
"id": "${newId()}"
},
{
"id": "id182152b2a3a",
"type": "fx-button",
"props": {
"label": "停用",
"type": ""
}
}
],
"dropdown": []
}
}
]
}
]
},
{
"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": [
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"alignY": "center",
"size": "0",
"paddingTop": 30,
"paddingLeft": 200,
"paddingRight": 200
},
"children": [
{
"id": "id${newId()}",
"type": "fx-steps",
"w": 3,
"h": 2,
"props": {
"active": 1,
"alignCenter": true
},
"slots": {
"default": [
{
"type": "fx-step",
"props": {
"label": "步骤一",
"description": "我是一段描述"
},
"id": "id${newId()}"
},
{
"type": "fx-step",
"props": {
"label": "步骤二",
"description": "我也是一段描述"
},
"id": "id${newId()}"
},
{
"type": "fx-step",
"props": {
"label": "步骤三",
"description": "我也也是一段描述"
},
"id": "id${newId()}"
}
]
},
"events": {}
}
]
},
{
<#list layout.c1 as group>
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"size": "0",
<#if param.col lte 1 || param.col gte 3>
"gridTemplateColumns": "1fr 1fr 1fr",
<#elseif param.col == 2>
"gridTemplateColumns": "1fr 1fr 1fr 1fr",
</#if>
"paddingTop": 32
},
<#assign fields = group.fields>
"children": [
<#list fields as field>
<#if (param.col lte 1)>
{
"id": "id${newId()}",
"type": "fx-placeholder",
"props": {
"label": "占位"
},
"layout": {
"row": 1
}
},
<#elseif (param.col = 2 && ((field_index+1) % 2 = 1 ) )>
{
"id": "id${newId()}",
"type": "fx-placeholder",
"props": {
"label": "占位"
},
"layout": {
"row": 1
}
},
</#if>
{
"id": "id${newId()}",
<#if (field.readonly = true)>
"type": "fx-text",
<#else>
"type": "fx-${field.editor}",
</#if>
"props": {
"label": "${field.label}",
"type": "text",
"dataset": "${field.dataset}",
"required": "${field.required}",
"field": "${field.id}",
<#if field.maxlength gt 0>
"maxlength": ${field.maxlength},
</#if>
"placeholder": "请输入内容",
<#if (param.col gte 2)>
"tips": "${field.desc}",
</#if>
"labelWidth": 150,
<#if (field.readonly = true)>
"readonly": true,
<#else>
"readonly": false,
</#if>
"affixError": true
},
"events": {}
}
<#if field_has_next>
<#if (param.col lte 1 )>
<#if (field.desc != "")>
,{
"id": "id181d83cdb41",
"type": "fx-label",
"props": {
"label": "${field.desc}",
"labelWidth": 0,
"affixError": true,
"labelAlign": "left"
}
}
<#else>
,{
"id": "id${newId()}",
"type": "fx-placeholder",
"props": {
"label": "占位"
},
"layout": {
"row": 1
}
}
</#if>
</#if>
<#if (param.col = 2 && ((field_index+1) % 2 = 0 ) )>
,{
"id": "id${newId()}",
"type": "fx-placeholder",
"props": {
"label": "占位"
},
"layout": {
"row": 1
}
}
</#if>
,
</#if>
</#list>
]
</#list>
},

{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"size": "56",
"alignY": "center",
"alignX": "center"
},
"children": [
{
"id": "${newId()}",
"type": "fx-button-group",
"props": {
"menus": []
},
"slots": {
"default": [
{
"type": "fx-button",
"props": {
"label": "下一步",
"type": "primary",
"action": "button:saveAndAdd",
"linkType": "curr"
},
"id": "${newId()}"
},
{
"type": "fx-button",
"props": {
"label": "重置",
"leftIcon": "",
"type": "",
"action": "button:save"
},
"id": "${newId()}"
}
]
}
}
]
},
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"name": "d2"
},
"children": []
}
]
}
]
}
}
],
"model": [
<#list datasets as dataset>
<#include "incModel/inc_model.ftl"/><#if dataset_has_next>,</#if>
</#list>
],
"option": {
"widgetRef": [${widgetRef}],
"vars": []
}
}

Завантаження…
Відмінити
Зберегти