import { TypeZ2list } from '@/pages/Z_system/Z2numRule/type'

// 初始化状态
const initState = {
  // 列表数据
  tableList: [] as TypeZ2list[]
}

// 定义 action 类型
type Props = {
  type: 'Z2/getList'
  payload: TypeZ2list[]
}

// reducer
export default function userReducer(state = initState, action: Props) {
  switch (action.type) {
    // 获取列表数据
    case 'Z2/getList':
      return { ...state, tableList: action.payload }

    default:
      return state
  }
}
