import { TypeI6table } from '@/pages/Isystem/I6role/data'

// 初始化状态
const initState = {
  // 列表数据
  tableInfo: {
    list: [] as TypeI6table[],
    total: 0
  }
}

// 定义 action 类型
type Props = {
  type: 'I6/getList'
  payload: { list: TypeI6table[]; total: number }
}

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

    default:
      return state
  }
}
