{
<#list layout.list as group>
  "form": [
    {
        "page": {
            "id": "${newId()}",
            "type": "fx-page",
            "props": {
                "title": "${title}",
                "key": "${newId()}"
            }
        },
        "graph": {
            "shape": "panel",
            "id": "root_panel",
            "type": "fx-split-panel",
            "props": {
                "horizontal": true,
                "shadow": ""
            },
            "children": [
                {
                    "id": "${newId()}",
                    "type": "fx-split-panel",
                    "shape": "panel",
                    "props": {
                        "size": "300",
                        "horizontal": false,
                        "shadow": ""
                    },
                    "children": [
                        {
                            "id": "${newId()}",
                            "type": "fx-split-panel",
                            "shape": "panel",
                            "props": {
                                "size": "",
                                "horizontal": false,
                                "name": "left"
                            },
                            "children": [
                                {
                                    "id": "${newId()}",
                                    "type": "fx-form-panel",
                                    "shape": "panel",
                                    "props": {
                                        "size": "",
                                        "colNum": 0,
                                        "paddingTop": 10,
                                        "paddingLeft": 10,
                                        "paddingRight": 10,
                                        "scroll": true
                                    },
                                    "children": [
                                        {
                                            "id": "${newId()}",
                                            "type": "fx-tree",
                                            "props": {
                                                "defaultExpandAll": false,
                                                "expandOnClickNode": false,
                                                "filterShow": true,
                                                "filterPlaceholder": "查询",
                                                "createVirtualRoot": false,
                                                "virtualRootLabel": "顶级虚拟节点",
                                                "dataset": "${group.dataset}"
                                            },
                                            "events": {}
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "id": "${newId()}",
                            "type": "fx-form-panel",
                            "shape": "panel",
                            "props": {
                                "size": "15",
                                "backgroundColor": "--color-transparent"
                            },
                            "children": []
                        }
                    ]
                },
                {
                    "id": "${newId()}",
                    "type": "fx-form-panel",
                    "shape": "panel",
                    "props": {
                        "size": "16",
                        "backgroundColor": "--color-transparent"
                    },
                    "children": []
                },
                {
                    "id": "${newId()}",
                    "type": "fx-split-panel",
                    "shape": "panel",
                    "props": {
                        "horizontal": false,
                        "name": "right"
                    },
                    "children": [
                        <#if (group.cfilters?size>0)>
                            <#include "incModel/inc_list_query.ftl"/>
                        </#if>
                        {
                            "id": "${newId()}",
                            "type": "fx-form-panel",
                            "shape": "panel",
                            "props": {
                                "size": "50",
                                "label": "按钮区域",
                                "colNum": 2,
                                "alignY": "center",
                                "paddingLeft": 16,
                                "paddingRight": 16,
                                "shadow": ""
                            },
                            "children": [
                                {
                                    "id": "id${newId()}",
                                    "type": "fx-title",
                                    "props": {
                                        "label": "${title}",
                                        "fontSize": 15,
                                        "color": "#313131",
                                        "fontWeight": "bold",
                                        "showPrefix": true,
                                        "prefixWidth": 5,
                                        "prefixHeight": 15,
                                        "prefixColor": "#1E90FF"
                                    }
                                },
                                {
                                    "id": "id${newId()}",
                                    "type": "fx-button-group",
                                    "props": {
                                        "showDropdown": false,
                                        "dataset": "${group.dataset}",
                                        "textAlign": "right"
                                    },
                                    "slots": {
                                        "default": [
                                            {
                                                "type": "fx-button",
                                                "props": {
                                                    "label": "新增",
                                                    "leftIcon": "plus",
                                                    "type": "primary",
                                                    "action": "button:addCard",
                                                    "link": false,
                                                    "linkType": "dialog",
                                                    "fxLink": "dialog:cardDialog",
                                                    "fxLink_text": "${param.cardTitle}"
                                                    },
                                                "id": "id${newId()}",
                                                "events": {}
                                            }
                                        ],
                                        "dropdown": []
                                    }
                                }
                            ]
                        },
                        <#include "incModel/inc_list_table.ftl"/>
                        {
                            "id": "${newId()}",
                            "type": "fx-form-panel",
                            "shape": "panel",
                            "props": {
                                "size": "16",
                                "backgroundColor": "transparent"
                            },
                            "children": []
                        }
                    ]
                }
            ]
        }
    }
    <#if (group.sfilters?size>0)>
        <#include "incModel/inc_query_sfilters.ftl"/>
    </#if>
    <#list layout.card as dialog>
    ,{
      "page": {
        "id": "id${newId()}",
        "type": "fx-dialog",
        "props": {
        <#if (param.cardTitle == "")>
            "title": "编辑卡片",
        <#else>
            "title": "${param.cardTitle}",
        </#if>
          "key": "cardDialog",
          "fontSize": 16,
          "color": "#313131",
          "fontWeight": "bold",
          "showPrefix": true,
          "prefixWidth": 5,
          "prefixHeight": 16,
          "prefixColor": "#1E90FF"
        },
        "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
            },
            "children": [
              {
                "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": 15
                },
                <#assign dfields = dialog.fields>
                "children": [
                    <#list dfields as dfield>
                        <#if (param.col lte 1)>
                            {
                                "id": "id${newId()}",
                                "type": "fx-placeholder",
                                "props": {
                                    "label": "占位"
                                },
                                "layout": {
                                    "row": 1
                                }
                            },
                        <#elseif (param.col = 2 && ((dfield_index+1) % 2 = 1 ) )>
                            {
                                "id": "id${newId()}",
                                "type": "fx-placeholder",
                                "props": {
                                    "label": "占位"
                                },
                                "layout": {
                                    "row": 1
                                }
                            },
                        </#if>
                            {
                                "id": "id${newId()}",
                                <#if (dfield.readonly = true)>
                                    "type": "fx-text",
                                    "disabled": true,
                                <#else>
                                    "type": "${dfield.editor}",
                                </#if>
                                "props": {
                                    "label": "${dfield.label}",
                                    "dataset": "${dfield.dataset}",
                                    "field": "${dfield.id}",
                                    "required": "${dfield.required}",
                                    <#if dfield.maxlength gt 0>
                                        "maxlength": ${dfield.maxlength},
                                    </#if>
                                        "placeholder": "请输入${dfield.label}",
                                    <#if (param.col 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 (param.col lte 1 )>
                                ,{
                                    "id": "id${newId()}",
                                    "type": "fx-placeholder",
                                    "props": {
                                        "label": "占位"
                                    },
                                    "layout": {
                                        "row": 1
                                    }
                                }
                            </#if>
                            <#if (param.col = 2 && ((dfield_index+1) % 2 = 0 ) )>
                                ,{
                                    "id": "id${newId()}",
                                    "type": "fx-placeholder",
                                    "props": {
                                        "label": "占位"
                                    },
                                    "layout": {
                                        "row": 1
                                    }
                                }
                            </#if>
                            ,
                        </#if>
                    </#list>
                ]
              },
              {
                "id": "${newId()}",
                "type": "fx-form-panel",
                "shape": "panel",
                "props": {},
                "children": []
              }
            ]
          },
          {
            "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": "50",
              "alignY": "center",
              "paddingRight": 20
            },
            "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:saveCard"
                      },
                      "id": "id${newId()}"
                    },
                    {
                      "type": "fx-button",
                      "props": {
                        "label": "关闭",
                        "leftIcon": "close",
                        "action": "button:closeDialog"
                      },
                      "id": "id${newId()}"
                    }
                  ]
                }
              }
            ]
          }
        ]
      }
    }
    </#list>
  ],
  "model": [
    <#list datasets as dataset>
        <#include "incModel/inc_model.ftl"/><#if dataset_has_next>,</#if>
    </#list>
  ],
  "option": {
    "widgetRef": [${widgetRef}],
    "vars": []
  }
</#list>
}
