package cc.smtweb.system.bpm.web.engine.dynPage;

import cc.smtweb.framework.core.common.SwMap;
import cc.smtweb.framework.core.db.impl.DefaultEntity;
import cc.smtweb.framework.core.mvc.service.SwListData;
import lombok.Data;

/**
 * Created by Akmm at 2022/4/21 19:26
 * 动态页面加载
 */
@Data
public class DynRetBean {
    //单个表单
    private SwMap form = null;
    //列表返回
    private SwListData list = null;

    public static DynRetBean createBean(DefaultEntity bean) {
        return createBean(bean.getData());
    }

    public static DynRetBean createBean(SwMap swMap) {
        SwMap form = (SwMap) swMap.clone();
        DynRetBean bean = new DynRetBean();
        bean.form = form;
        bean.form.remove(DefaultEntity.tableNameKey);
        //bean.form.remove(DefaultEntity.statusKey);
        return bean;
    }

    public static DynRetBean createList(SwListData list) {
        DynRetBean bean = new DynRetBean();
        bean.list = list;
        return bean;
    }
/*
    public static DynRetBean createTree(SwListData list) {
        DynRetBean bean = new DynRetBean();
        bean.list = list;
        return bean;
    }*/
}
