taskReducer.js 3.7 KB
// import * as types from '../constants/ActionTypes';

// 默认数据
const initialState = {
    visible:false,
    listdata:[],
    dolistdata:[],
    cashmanagementwaitlistdata:[],
    tasksetdata:[],
    cashmanagementstayoutlistdata:[],
    cashmanagementissuedlistdata:[],
    legalentityinit:[],
    addmanagementdata:[]
};
export default (state = initialState, action)=>{
    if (action.tyoe == "MODALLOCK"){
        return {
            ...state,
            visible: action.data
        }
    }
    if(action.type == "INIT"){ //获取未发放列表
        return {
            ...state,
            listdata:action.data
        }
    }
    if (action.type == "SEARCHINIT") { //搜索 未发放 列表
        return {
            ...state,
            listdata: action.data
        }
    }
    if (action.type == "SEARCHDOINIT") { //搜索 已发放 列表
        return {
            ...state,
            dolistdata: action.data
        }
    }
    if (action.type == "DOINIT") {
        return {
            ...state,
            dolistdata: action.data // 获取已发放列表
        }
    }
    if (action.type == "CASHMANAGEMENTWAITLISTINIT") {
        return {
            ...state,
            cashmanagementwaitlistdata: action.data // 获取待处理列表
        }
    }
    if (action.type == "CASHMANAGEMENTSTAYOUTINIT") {
        return {
            ...state,
            cashmanagementstayoutlistdata: action.data // 获取未发放列表
        }
    }
    if (action.type == "GET_TASKSET_TYPE") {
        return {
            ...state,
            legalentityinit: state.legalentityinit.concat(action.data) // 获取   添加法务实体(回写)
        }
    }
    if (action.type == "CASHMANAGEMENTISSUEDINIT") {
        return {
            ...state,
            cashmanagementissuedlistdata: action.data // 获取已发放列表
        }
    }
    if (action.type == "SEARCHCASHMANAGEMENTWAITLLIST") {
        return {
            ...state,
            cashmanagementwaitlistdata: action.data // 搜索  ——待做
        }
    }
    if (action.type == "SEARCHCASHMANAGEMENTSTAYOUTLLIST") {
        return {
            ...state,
            cashmanagementstayoutlistdata: action.data // 搜索  ———— 未发放
        }
    }
    if (action.type == "SEARCHCASHMANAGEMENTISSUEDLLIST") {
        return {
            ...state,
            cashmanagementissuedlistdata: action.data // 搜索   ————已发放
        }
    }
    if (action.type == "GETTASKSETTYPEPATHINIT") {
        return {
            ...state,
            tasksetdata: action.data // 搜索   ————已发放
        }
    }
    if (action.type == "GETLEGALENTITYINIT") {
        return {
            ...state,
            legalentityinit: state.legalentityinit.concat(action.data)// taskset   添加法务实体
        }
    }
    if (action.type == "DEl_TASKSET_TYPE") {
        return {
            ...state,
            legalentityinit: action.data// 财务管理  设置  删除法务实体
        }
    }
    if (action.type == "GETMANAGEMENTLIST") {
        return {
            ...state,
            addmanagementdata: action.data// 小程序管理  ————————  获取小程序管理列表(初始化小程序列表)
        }
    }
    if (action.type == "ADDMANAGEMENT") {
        return {
            ...state,
            addmanagementdata: state.addmanagementdata.concat(action.data)// 小程序管理  ————————  添加小程序管理
        }
    }
    if (action.type == "MODIFICATIONMANAGEMENT") {
        return {
            ...state,
            addmanagementdata: action.data// 小程序管理  ————————  修改小程序管理
        }
    }
   
    return state; 
}