setting.js 4.1 KB
import * as types from '../constants/ActionTypes';

const initialState = {
    basicInfo:[],
    roles:[],
    role:{},
    sysperms:[],
    actionPerms:[],
    admins:[],
    adminOptions:[],
    adminCount:0,
    simpleAdmins:[],
    simpleAdminCount:0,
    adminInfo:{},
    legalList:{},
    maskShow:false,
    height: 0,
    width: 0,
    maskShowTitle:'此操作可能耗费较长时间,请等待......',
    handOverData: {},
    pcFormDefind: [],
    wxFormDefind: [],
    canExport: '',
    resumsExportList: {},
    data_range_setting:{},
    view_perm:''
};

export default function environment(state = initialState,action) {
    switch(action.type) { 
        case types.BASIC_INFO:    
            return Object.assign({}, state, {
                basicInfo: action.basicInfo
            });
        case types.CHANGE_WIDTH_AND_HEIGHT:
            return Object.assign({}, state, {
                height: action.height,
                width: action.width
            });
         case types.MASK_SHOW:    
            return Object.assign({}, state, {
                maskShow: action.maskShow,
                maskShowTitle: action.title
            });
        case types.LOAD_ROLES:    
            return Object.assign({}, state, {
                roles: action.roles
            });
        case types.SELECT_ROLE:    
            return Object.assign({}, state, {
                role: action.role
            });
        case types.LOAD_SYS_PERMS:    
            return Object.assign({}, state, {
                sysperms: action.sysperms
            });
        case types.LOAD_SYS_ACTION_PERMS:    
            return Object.assign({}, state, {
                actionPerms: action.actionPerms,
                view_perm: action.view_perm
            });
        case types.LOAD_ADMINS:    
            return Object.assign({}, state, {
                admins: action.admins,
                adminCount:action.adminCount
            });
        case types.LOAD_ADMINS_OPTIONS:    
            return Object.assign({}, state, {
                adminOptions: action.adminOptions
            });
        case types.LOAD_SIMPLE_ADMINS:    
            return Object.assign({}, state, {
                simpleAdmins: action.simpleAdmins,
                simpleAdminCount:action.simpleAdminCount
            });
        case types.LOAD_ADMIN_INFO:    
            return Object.assign({}, state, {
                adminInfo: action.adminInfo 
            });
        case types.LEGAL_LIST:    
            return Object.assign({}, state, {
                legalList: action.legalList 
            });
        case types.LOAD_ADMINS:    
            return Object.assign({}, state, {
                addInterview: action.addInterview,
            });
        case types.LOAD_CUSTOMER_ADMINS:    
            return Object.assign({}, state, {
                customerAdmins: action.customerAdmins 
            });
        case types.ADD_INTERVIEW_CUSTOMER:    
            return Object.assign({}, state, {
                addInterviewItem: action.addInterviewItem 
            });
        case types.GET_HAND_OVER_DATA:    
            return Object.assign({}, state, {
                handOverData: action.handOverData 
            });
        case types.LOAD_QUESTION_BANK_LIST:
            return Object.assign({}, state, {
                questionBankList: action.questionBankList
            });
        case types.LOAD_PCRESUME_DEFIND:    
            return Object.assign({}, state, {
                pcFormDefind: action.pcFormDefind 
            });
        case types.LOAD_WXRESUME_DEFIND:
            return Object.assign({}, state, {
                wxFormDefind: action.wxFormDefind
            });
        case types.CAN_EXPORT:
            return Object.assign({}, state, {
                canExport: action.canExport
            });
        case types.LOAD_RESUMES_EXPORT_LIST:
            return Object.assign({}, state, {
                resumsExportList: action.resumsExportList
            })
        case types.DATA_RANGE_SETTING:
            return Object.assign({}, state, {
                data_range_setting: action.data_range_setting
            })
        default:
            return state;
    }
}