package cn.stylefeng.team.form.api.factory;

import cn.stylefeng.team.form.api.entity.FormItem;
import cn.stylefeng.team.form.api.entity.FormItemStyle;
import cn.stylefeng.team.form.api.entity.FormViewConfig;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;

import java.math.BigDecimal;

public class FormItemFactory {

    public static FormItem defaultFormItem() {
        FormItem defaultFormItem = new FormItem();
        defaultFormItem.setItemId(IdWorker.getId());
        defaultFormItem.setFldSort(new BigDecimal(10));
        defaultFormItem.setItemHeight(0);
        defaultFormItem.setItemTipFlag(false);
        defaultFormItem.setItemEditFlag(true);
        defaultFormItem.setFormItemStyle(new FormItemStyle(0, 16, 0, 0));

        FormViewConfig formViewConfig = new FormViewConfig();
        formViewConfig.setOpenQueryParam(false);
        formViewConfig.setShowSelectColumn(true);
        defaultFormItem.setFormViewConfig(formViewConfig);

        defaultFormItem.setItemHiddenFlag(false);
        defaultFormItem.setItemColumnNumber(24);
        defaultFormItem.setItemRequiredFlag(false);
        defaultFormItem.setItemLabelShowFlag(true);
        defaultFormItem.setItemMultipleChoiceFlag(false);
        return defaultFormItem;
    }

}
