// 初始化状态应用注解
const initState = {
  // 表格数据
  info3: {
    list: [] as any,
    total: 0,
  },
  // 表格顶部数字数据
  infoNum3: [],
  // 查看和审核的表格信息
  lookInfo: {
    info: {} as any,
    list: [] as any,
  },
  // 新增或者编辑的藏品信息列表
  goodsTableList: [] as any,
  // 点击新增或者编辑里面的添加按钮的所有藏品列表
  goodsAllList: [] as any,
};

type LoginActionType =
  | { type: "object3/getList"; payload: any }
  | { type: "object3/getListNum"; payload: any }
  | { type: "object3/getLookInfo"; payload: any }
  | { type: "object3/getGoodsTableList"; payload: any }
  | { type: "object3/setGoodsListAll"; payload: any };
// 频道 reducer
export default function object3Reducer(
  state = initState,
  action: LoginActionType
) {
  switch (action.type) {
    // 表格数据1
    case "object3/getList":
      return { ...state, info3: action.payload };
    // 表格顶部数字数据1
    case "object3/getListNum":
      return { ...state, infoNum3: action.payload };
    // 查看和审核的表格数据
    case "object3/getLookInfo":
      return { ...state, lookInfo: action.payload };
    // 新增或者编辑的藏品信息列表
    case "object3/getGoodsTableList":
      return { ...state, goodsTableList: action.payload };
    // 点击新增或者编辑里面的添加按钮的所有藏品列表
    case "object3/setGoodsListAll":
      return { ...state, goodsAllList: action.payload };

    default:
      return state;
  }
}
