import store from '..'

const ZFbaseData = {
  A2formData: {
    pageNum: 1,
    pageSize: 10,
    auditType: '1',
    type: '',
    num: '',
    startTime: '',
    endTime: '',
    status: ''
  }
} as any

// 初始化状态
const initState = {
  A2formData: ZFbaseData.A2formData
}

// 定义 action 类型
type Props = {
  type: 'ZF/A2formData'
  payload: any
}

// reducer
export default function Reducer(state = initState, action: Props) {
  switch (action.type) {
    case 'ZF/A2formData':
      return { ...state, A2formData: action.payload }

    default:
      return state
  }
}

// 初始化数据
export const ZFbaseFu = () => {
  store.dispatch({ type: 'ZF/A2formData', payload: ZFbaseData.A2formData })
}
