import http from '@/utils/http'
import { AppDispatch } from '..'
/**
 * 藏品分账 - 获取分页列表 待完善
 */
export const A32_APIgetList = (data: any, exportFlag?: boolean): any => {
  if (exportFlag) return http.post('cms/goods/page', data)
  else {
    return async (dispatch: AppDispatch) => {
      const res = await http.post('cms/goods/page', data)
      if (res.code === 0) {
        const obj = {
          list: res.data.records,
          total: res.data.total
        }
        dispatch({ type: 'A32/getList', payload: obj })
      }
    }
  }
}

/**
 * 藏品分账-设置分账
 */
export const A32_APIset = (data: any) => {
  return http.post('cms/dict/save', data)
}
