<#--group当前分组-->
<#--colNum卡片列数-->
<#assign field = group.fields>
{
    "id": "${newId()}",
    "type": "fx-form-panel",
    "shape": "panel",
    "props": {
        "size": "0",
        <#if colNum lte 1>
            "gridTemplateColumns": "1fr 2fr",
        <#elseif colNum gte 2>
            "gridTemplateColumns": "1fr 1fr 1fr",
        </#if>
        "paddingTop": 32
    },
    "children": [
        <#list group.fields as fields>
            {
                "id": "id${newId()}",
                <#if (fields.readonly = true)>
                    "type": "fx-text",
                <#else>
                    "type": "${fields.editor}",
                </#if>
                "props": {
                    "label": "${fields.label}",
                    "dataset": "${fields.dataset}",
                    "required": "${fields.required}",
                    "field": "${fields.id}",
                    <#if fields.maxlength gt 0>
                        "maxlength": ${fields.maxlength},
                    </#if>
                    <#if fields.lookup??>
                        "lookup": {
                            <#list fields.lookup as k, v>
                                <#if v?is_enumerable>
                                    "${k}": [
                                    <#list v as v1>
                                        {
                                            <#list v1 as vk1, vv1>
                                                "${vk1}": "${vv1}"<#if vk1_has_next>,</#if>
                                            </#list>
                                        }
                                        <#if v1_has_next>,</#if>
                                    </#list>
                                    ]
                                <#else>
                                    "${k}": "${v}"
                                </#if>
                                <#if k_has_next>,</#if>
                            </#list>
                        },
                    </#if>
                    "placeholder": "请输入内容",
                    <#if (colNum = 2)>
                        "tips": "${fields.desc}",
                    </#if>
                    "labelWidth": 100,
                    <#if (fields.readonly = true)>
                        "readonly": true,
                    <#else>
                        "readonly": false,
                    </#if>
                    "affixError": true
                },
                "events": {}
            }
            <#if fields_has_next>
                <#if (colNum lte 1 )>
                    <#if (fields.desc != "")>
                        ,{
                            "id": "${newId()}",
                            "type": "fx-label",
                            "props": {
                                "label": "${fields.desc}",
                                "labelWidth": 0,
                                "affixError": true,
                                "labelAlign": "left"
                            }
                        }
                        <#else>
                        ,{
                            "id": "id${newId()}",
                            "type": "fx-placeholder",
                            "props": {
                                "label": "占位"
                            },
                            "layout": {
                                "row": 1
                            }
                        }
                    </#if>
                </#if>
                <#if (colNum = 2 && ((fields_index+1) % 2 = 0 ) )>
                    ,{
                        "id": "id${newId()}",
                        "type": "fx-placeholder",
                        "props": {
                            "label": "占位"
                        },
                        "layout": {
                            "row": 1
                        }
                    }
                </#if>
            ,
            </#if>
        </#list>
    ]
}
