import http from '@/utils/http'
import { AppDispatch } from '..'
/**
 * 库房管理-获取列表
 */
export const C1_APIgetlist = (data: any, exportFlag?: boolean): any => {
  if (exportFlag) return http.post('cms/orderSite/page', data)
  else {
    return async (dispatch: AppDispatch) => {
      const res = await http.post('cms/orderSite/page', data)
      if (res.code === 0) {
        const obj = {
          list: res.data.records,
          total: res.data.total
        }

        dispatch({ type: 'C1/getList', payload: obj })
      }
    }
  }
}
