Sfoglia il codice sorgente

页面双列表模板

master
xiaxl 2 anni fa
parent
commit
2d696c98c8
3 ha cambiato i file con 859 aggiunte e 1 eliminazioni
  1. +75
    -0
      smtweb-framework/bpm/src/main/resources/static/template/incModel/inc_list_dialog.ftl
  2. +66
    -1
      smtweb-framework/bpm/src/main/resources/static/template/index.yaml
  3. +718
    -0
      smtweb-framework/bpm/src/main/resources/static/template/model_list_list.ftl

+ 75
- 0
smtweb-framework/bpm/src/main/resources/static/template/incModel/inc_list_dialog.ftl Vedi File

@@ -0,0 +1,75 @@
<#assign col1 = col>
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"size": "0",
"paddingTop": 32,
"colNum": 2
},
"children": [
<#list dfields as dfield>
{
"id": "id${newId()}",
<#if (dfield.readonly = true)>
"type": "fx-text",
<#else>
"type": "fx-${dfield.editor}",
</#if>
"props": {
"label": "${dfield.label}",
"type": "text",
"dataset": "${dfield.dataset}",
"field": "${dfield.id}",
"required": "${field.required}",
<#if dfield.maxlength gt 0>
"maxlength": ${dfield.maxlength},
</#if>
"placeholder": "请输入内容",
<#if (col1 gte 2)>
"tips": "${dfield.desc}",
</#if>
"labelWidth": 150,
<#if (dfield.readonly = true)>
"readonly": true,
<#else>
"readonly": false,
</#if>
"affixError": true
},
"events": {}
}
<#if dfield_has_next>

<#if (col1 lte 1 )>
<#if (dfield.desc != "")>
,{
"id": "id${newId()}",
"type": "fx-label",
"props": {
"label": "${dfield.desc}",
"labelWidth": 0,
"affixError": true,
"labelAlign": "left"
}
}
<#else>
,{
"id": "id${newId()}",
"type": "fx-placeholder",
"props": {
"label": "占位"
},
"layout": {
"row": 1
}
}
</#if>
</#if>
,
</#if>

</#list>
]
}

+ 66
- 1
smtweb-framework/bpm/src/main/resources/static/template/index.yaml Vedi File

@@ -75,4 +75,69 @@ model:
type: 'number'
label: '弹窗卡片列数'
desc: '请选择弹窗卡片列数(1或2)'

-
name: 'model_list_list'
label: '双列表'
# list/card/view
type: 'list'
# 布局
layout:
-
name: 'c1'
label: '主列表'
type: 'list'
hasGroup: false
- name: 'c2'
label: '附列表'
type: 'list'
hasGroup: false
- name: 'c3'
label: '主编辑卡片'
type: 'card'
hasGroup: false
- name: 'c4'
label: '附编辑卡片'
type: 'card'
hasGroup: false
# 变量
param:
-
name: 'listDs_main'
type: 'ds'
label: '主列表数据集'
desc: '请选择主列表数据集'
-
name: 'editDs_main'
type: 'ds'
label: '主卡片数据集'
desc: '请选择弹窗主卡片数据集'
-
name: 'main_col'
type: 'number'
label: '主卡片列数'
desc: '请选择弹窗主卡片列数(1或2)'
-
name: 'editDs_main_title'
type: 'input'
label: '主卡片标题'
desc: '请选择主弹窗卡片标题'
-
name: 'listDs_assist'
type: 'ds'
label: '附列表数据集'
desc: '请选择附列表数据集'
-
name: 'editDs_assist'
type: 'ds'
label: '附卡片数据集'
desc: '请选择弹窗附列表卡片数据集'
-
name: 'assist_col'
type: 'number'
label: '附卡片列数'
desc: '请选择弹窗附列表卡片列数(1或2)'
-
name: 'editDs_assist_title'
type: 'input'
label: '附卡片标题'
desc: '请选择附弹窗卡片标题'

+ 718
- 0
smtweb-framework/bpm/src/main/resources/static/template/model_list_list.ftl Vedi File

@@ -0,0 +1,718 @@
{
"version": 6,
"form": [
{
"page": {
"id": "id${newId()}",
"type": "fx-page",
"props": {
"title": "${title}",
"key": "${newId()}"
}
},
"graph": {
"shape": "panel",
"id": "root_panel",
"type": "fx-split-panel",
"props": {
"shadow": ""
},
"children": [
{
"shape": "panel",
"id": "root_panel",
"type": "fx-split-panel",
"props": {
"horizontal": true,
"shadow": ""
},
"children": [
<#list layout.c2 as assist>
{
"id": "${newId()}",
"type": "fx-split-panel",
"shape": "panel",
"props": {
"horizontal": false,
"size": "420"
},
"children": [
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"size": "56",
"alignY": "center",
"backgroundImage": "bgImg-region-title",
"paddingLeft": 32,
"colNum": 2,
"gridTemplateColumns": "",
"paddingRight": 32
},
"children": [
{
"id": "id${newId()}",
"type": "fx-title",
"props": {
"label": "${assist.label}"
}
},
{
"id": "id${newId()}",
"type": "fx-button-group",
"props": {
"menus": [],
"textAlign": "right"
},
"slots": {
"default": [
{
"type": "fx-button",
"props": {
"label": "新增",
"leftIcon": "plus",
"type": "primary",
"action": "button:add",
"linkType": "dialog",
"link": false,
"dataset": "${param.editDs_assist}",
"fxLink": "dialog:editAssistDialog",
"fxLink_text": "${param.editDs_assist_title}"
},
"id": "id${newId()}"
}
]
}
}
]
},
{
"id":"${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"size": "0"
},
"children": [
{
"id": "id${newId()}",
"type": "fx-divider",
"props": {
"label": "",
"contentPosition": "center",
"direction": "horizontal"
}
}
]
},
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"alignY": "center",
"size": "56",
"gridTemplateColumns": "1fr 50px",
"paddingLeft": 32,
"paddingRight": 32
},
"children": [
<#list assist.cfilters as cfilters>
{
"id": "id${newId()}",
"type": "fx-${cfilters.editor}",
"props": {
"label": "${cfilters.label}",
"type": "text",
"maxlength": 50,
"placeholder": "请输入内容",
"labelWidth": 150,
"affixError": false,
"hideLabel": true,
"leftIcon": "",
"dataset": "${cfilters.dataset}",
"field": "${cfilters.id}"
},
"events": {}
},
</#list>
{
"id": "id${newId()}",
"type": "fx-button-group",
"props": {
"menus": [],
"textAlign": "right"
},
"slots": {
"default": [
{
"type": "fx-button",
"props": {
"label": "搜索",
"leftIcon": "",
"action": "button:search",
"link": true,
"type": "primary",
"dataset": "${param.listDs_assist}"
},
"id": "id${newId()}"
}
]
}
}
]
},
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"size": "",
"colNum": 0
},
"children": [
{
"id": "id${newId()}",
"type": "fx-table",
"props": {
"label": "表格",
"border": true,
"stripe": true,
"showHeader": false,
"fit": true,
"hideOp": false,
"hideNo": true,
"dataset": "${param.listDs_assist}",
"hidePagination": true
},
"slots": {
"button": [
{
"type": "fx-button",
"props": {
"label": "编辑",
"type": "primary",
"leftIcon": "edit",
"action": "button:edit",
"linkType": "dialog",
"dataset": "${param.editDs_assist}",
"fxLink": "dialog:editAssistDialog",
"fxLink_text": "${param.editDs_assist_title}",
"link": true
},
"id": "id${newId()}"
},
{
"type": "fx-button",
"props": {
"label": "删除",
"type": "primary",
"leftIcon": "delete",
"action": "button:remove",
"link": true,
"text": false,
"dataset": "${param.editDs_assist}",
"confirm": ""
},
"id": "id${newId()}"
}
],
"default": [
<#list assist.fields as field>
{
"id": "id${newId()}",
"type": "fx-table-column",
"props": {
"field": "${field.id}",
"label": "${field.label}"
}
}<#if field_has_next>,</#if>
</#list>
]
},
"events": {
"on-row-click": "dictTypeRowClick"
}
}
]
}
]
},
</#list>
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"size": "10",
"backgroundColor": "--color-transparent"
},
"children": []
},
<#list layout.c1 as main>
{
"id": "${newId()}",
"type": "fx-split-panel",
"shape": "panel",
"props": {
"horizontal": false
},
"children": [
{
"shape": "panel",
"id": "form_panel",
"type": "fx-form-panel",
"props": {
"colNum": 3,
"label": "查询条件",
"size": "80",
"alignY": "center"
},
"children": [
<#list main.cfilters as cfilters>
{
"id": "id${newId()}",
"type": "fx-${cfilters.editor}",
"props": {
"label": "${cfilters.label}",
"type": "text",
"maxlength": 50,
"placeholder": "请输入内容",
"labelWidth": 100,
"affixError": false
},
"events": {}
},
</#list>
{
"id": "id${newId()}",
"type": "fx-button-group",
"props": {
"menus": []
},
"slots": {
"default": [
{
"type": "fx-button",
"props": {
"label": "查询",
"leftIcon": "search",
"type": "primary",
"action": "button:search",
"linkType": "",
"dataset": "${param.listDs_main}"
},
"id": "id${newId()}"
},
{
"type": "fx-button",
"props": {
"label": "重置",
"leftIcon": "clear",
"action": "button:reset"
},
"id": "id${newId()}"
}
<#if (main.sfilters?size>0)>
,{
"id": "id${newId()}",
"type": "fx-button",
"props": {
"label": "高级筛选",
"leftIcon": "hamburger-button",
"action": "button:link",
"link": true,
"linkType": "drawer",
"fxLink": "dialog:qrueydialog"
}
}
</#if>
]
}
}
]
},
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"label": "间隔",
"size": "10",
"backgroundColor": "--color-transparent"
},
"children": []
},
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"label": "表格标题区",
"size": "68",
"backgroundImage": "bgImg-region-title",
"colNum": 2,
"alignY": "center",
"paddingLeft": 32,
"paddingRight": 32
},
"children": [
{
"id": "id${newId()}",
"type": "fx-title",
"props": {
"label": "${main.label}"
}
},
{
"id": "id${newId()}",
"type": "fx-button-group",
"props": {
"menus": [],
"textAlign": "right"
},
"slots": {
"default": [
{
"type": "fx-button",
"props": {
"label": "新增",
"leftIcon": "plus",
"type": "primary",
"action": "button:add",
"linkType": "dialog",
"dataset": "${param.editDs_main}",
"fxLink": "dialog:editDict",
"fxLink_text": "${param.editDs_main_title}",
"preAction": ""
},
"id": "id${newId()}"
}
]
}
}
]
},
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"label": "表格区",
"colNum": 0
},
"children": [
{
"id": "id${newId()}",
"type": "fx-table",
"props": {
"label": "表格",
"border": true,
"stripe": true,
"showHeader": true,
"fit": true,
"dataset": "${param.listDs_main}"
},
"slots": {
"button": [
{
"type": "fx-button",
"props": {
"label": "编辑",
"type": "primary",
"leftIcon": "edit",
"action": "button:edit",
"link": true,
"dataset": "${param.editDs_main}",
"linkType": "dialog",
"fxLink": "dialog:editDict",
"fxLink_text": "${param.editDs_main_title}"
},
"id": "id${newId()}"
},
{
"type": "fx-button",
"props": {
"label": "删除",
"type": "primary",
"leftIcon": "delete",
"action": "button:remove",
"link": true,
"dataset": "${param.editDs_main}",
"preAction": ""
},
"id": "id${newId()}"
}
],
"default": [
<#list main.fields as field>
{
"id": "id${newId()}",
"type": "fx-table-column",
"props": {
"field": "${field.id}",
"label": "${field.label}"
}
}<#if field_has_next>,</#if>
</#list>
]
},
"events": {}
}
]
}
]
}
</#list>
]
},
{
"shape": "panel",
"id": "fx-form-panel",
"type": "fx-split-panel",
"props": {
"shadow": "",
"size": 24
},
"children": []
}
]
}
},
<#list layout.c4 as assist_dialog>
{
"page": {
"id": "id${newId()}",
"type": "fx-dialog",
"props": {
<#if (assist_dialog.label == "")>
"title": "附卡片",
<#else>
"title": "${param.editDs_assist_title}",
</#if>
"key": "editAssistDialog",
"closeOnClickModal": false
},
"events": {}
},
"graph": {
"shape": "panel",
"id": "root_panel",
"type": "fx-split-panel",
"props": {
"horizontal": false,
"shadow": "never"
},
"children": [
{
"id": "${newId()}",
"type": "fx-split-panel",
"shape": "panel",
"props": {
"horizontal": false,
"scroll": true,
"backgroundColor": "--color-white"
},
"children": [
<#assign dfields = assist_dialog.fields>
<#assign col = param.assist_col>
<#include "incModel/inc_list_dialog.ftl"/>
]
},
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"size": "0"
},
"children": [
{
"id": "id${newId()}",
"type": "fx-divider",
"props": {
"label": "",
"contentPosition": "center",
"direction": "horizontal"
}
}
]
},
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"size": "56",
"paddingRight": 10,
"alignY": "center"
},
"children": [
{
"id": "id${newId()}",
"type": "fx-button-group",
"props": {
"menus": [],
"textAlign": "right"
},
"slots": {
"default": [
{
"type": "fx-button",
"props": {
"label": "保存",
"leftIcon": "save",
"type": "success",
"action": "button:save",
"dataset": "${param.editDs_assist}"
},
"id": "id${newId()}"
},
{
"type": "fx-button",
"props": {
"label": "关闭",
"leftIcon": "close",
"type": "",
"action": "button:closeDialog",
"nextAction": "button:search"
},
"id": "id${newId()}"
}
]
}
}
]
}
]
}
},
</#list>
<#list layout.c3 as main_dialog>
{
"page": {
"id": "id${newId()}",
"type": "fx-dialog",
"props": {
<#if (main_dialog.label == "")>
"title": "附卡片",
<#else>
"title": "${param.editDs_main_title}",
</#if>
"key": "editDict",
"closeOnClickModal": false
},
"events": {}
},
"graph": {
"shape": "panel",
"id": "root_panel",
"type": "fx-split-panel",
"props": {
"horizontal": false,
"shadow": "never"
},
"children": [
{
"id": "${newId()}",
"type": "fx-split-panel",
"shape": "panel",
"props": {
"horizontal": false,
"scroll": true,
"backgroundColor": "--color-white"
},
"children": [
<#assign dfields = main_dialog.fields>
<#assign col = param.main_col>
<#include "incModel/inc_list_dialog.ftl"/>
]
},
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"size": "0"
},
"children": [
{
"id": "id${newId()}",
"type": "fx-divider",
"props": {
"label": "",
"contentPosition": "center",
"direction": "horizontal"
}
}
]
},
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"size": "56",
"paddingRight": 10,
"alignY": "center"
},
"children": [
{
"id": "id${newId()}",
"type": "fx-button-group",
"props": {
"menus": [],
"textAlign": "right"
},
"slots": {
"default": [
{
"type": "fx-button",
"props": {
"label": "保存",
"leftIcon": "save",
"type": "success",
"action": "button:save",
"dataset": "${param.editDs_main}"
},
"id": "id${newId()}"
},
{
"type": "fx-button",
"props": {
"label": "关闭",
"leftIcon": "close",
"type": "",
"action": "button:closeDialog",
"nextAction": "button:search"
},
"id": "id${newId()}"
}
]
}
}
]
}
]
}
}
</#list>

<#list layout.c1 as main_quy_dialog>
<#assign group = main_quy_dialog >
<#if (group.sfilters?size>0)>
<#include "incModel/inc_query_sfilters.ftl"/>
</#if>
</#list>
],
"model": [
<#list datasets as dataset>
<#include "incModel/inc_model.ftl"/><#if dataset_has_next>,</#if>
</#list>
],
"option": {
"widgetRef": [${widgetRef}],
"vars": []
}
}

Caricamento…
Annulla
Salva