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

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

    default:
      return state;
  }
}
