attendance.js 1.2 KB
import * as types from '../constants/ActionTypes'

const initialState = {
  attendanceRecordAbsentData: [],
  attendanceRecordClockData: [],
  attendanceStatistics_list: [],
  attendanceDetaileData: null,
  attendanceWayListData: [],
}

export default function attendance(state = initialState, action) {
  switch (action.type) {
    case types.GET_ATTENDANCE_RECORD_ABSENT:
      return Object.assign({}, state, {
        attendanceRecordAbsentData: action.attendanceRecordAbsentData
      })
      break
    case types.GET_ATTENDANCE_RECORD_CLOCK:
      return Object.assign({}, state, {
        attendanceRecordClockData: action.attendanceRecordClockData
      })
      break
    case types.ATTENDANCESTATISTICS_LIST:
      return Object.assign({}, state, {
        attendanceStatistics_list: action.attendanceStatistics_list
      })
      break
    case types.ATTENDANCE_DETAILE_DATA:
      return Object.assign({}, state, {
        attendanceDetaileData: action.attendanceDetaileData
      })
      break
    case types.GET_ATTENDANCE_WAY_LIST:
      return Object.assign({}, state, {
        attendanceWayListData: action.attendanceWayListData
      })
      break
    default:
      return state
  }
}