export default {
    namespace: 'dashboardDesigner',
    state: {
        basicConfig: {
            title:'可爱的标题！',  
            description:'',
            type:'',   //分为Dynamic和Static
            refreshTimer: 0, //自动刷新时间，如果是Static时应当无效或为0
            width: '',   //Grid宽度，数字
            cols: '',  //Grid列数 数字
            compactType:'',   //Grid紧凑方式
            margin:'', //Grid内Element之间的间隔
            containerPadding:'',  //Element的内垫
            rowHeight:'', //Grid单行高，数字
        },
        parameters: {
        },  //全局可用参数
        elementList:[{
            key:0,
            type:'chart',  //基础元素simple vs 图表元素chart
            layout:{},
            content:{},            
        }, {
            key:1,
            type:'simple',
            layout: {},
            content:{},
        }],
        configBoxForm: {
        }
    },
    
    reducers: {
        handleFieldChange(state, action) {
            const { name, value } = action;
            let configBoxForm = state.configBoxForm;
            configBoxForm[name] = value;
            return Object.assign({}, state, {configBoxForm})
        },
        resetConfigBoxForm(state, action) {
            return Object.assign({}, state, {configBoxForm: {}});
        },
        loadConfigBoxForm(state, action) {
            const { element } = action;
            let configBoxForm = Object.assign({}, element);
            return Object.assign({}, state, {configBoxForm})
        }
    },

    effects: {

    },
    subscription: {

    },
};

