package com.mortals.xhx.common.pdu.gen;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * 动态表单根节点
 *
 * @author: zxfei
 * @date: 2021/10/15 10:24
 */
@Data
public class GenRoot {

    @JSONField(name = "gutter")
    private Integer gutter;

    @JSONField(name = "formRef")
    private String formRef;

    @JSONField(name = "size")
    private String size;

    @JSONField(name = "formRules")
    private String formRules;

    @JSONField(name = "labelPosition")
    private String labelPosition;

    @JSONField(name = "formBtns")
    private Boolean formBtns;

    @JSONField(name = "labelWidth")
    private Integer labelWidth;

    @JSONField(name = "unFocusedComponentBorder")
    private Boolean unFocusedComponentBorder;

    @JSONField(name = "formModel")
    private String formModel;

    @JSONField(name = "fields")
    private List<FieldsItem> fields;

    @JSONField(name = "__methods__")
    private Methods methods;

    @JSONField(name = "span")
    private Integer span;


    public void initAttribute() {
        this.gutter = 10;
        this.formRef = "elForm";
        this.size = "small";
        this.labelPosition = "right";
        this.formBtns = true;
        this.labelWidth = 120;
        this.formModel = "formData";
        this.fields = new ArrayList<>();
    }


}