// 初始化状态应用注解
const initState = {
  // 表格数据
  info2: {
    list: [] as any,
    total: 0,
  },

  // 点击查看的单个藏品信息
  oneGoodsInfo: {
    info: {},
    fileList: {
      img: [],
      video: [],
      audio: [],
      model: [],
      doc: [],
    },
  } as any,
  // 操作记录列表
  logList: {
    list: [] as any,
    total: 0,
  },
};

type LoginActionType =
  | { type: "object2/getList"; payload: any }
  | { type: "object2/getOneGoodsInfo"; payload: any }
  | { type: "object2/getLogList"; payload: any };
// 频道 reducer
export default function object2Reducer(
  state = initState,
  action: LoginActionType
) {
  switch (action.type) {
    // 表格数据2
    case "object2/getList":
      return { ...state, info2: action.payload };
    // 查看页面的数据
    case "object2/getOneGoodsInfo":
      return { ...state, oneGoodsInfo: action.payload };
    // 操作记录列表
    case "object2/getLogList":
      return { ...state, logList: action.payload };

    default:
      return state;
  }
}
