import request, { postBlob, getBlob, handleImport } from '@/utils/request'

export function dispatchListDispatch(data) {
  return request({
    url: `/dispatch/listDispatch?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

export function dispatchListDispatchExport(data, name) {
  return postBlob({
    url: '/dispatch/listDispatch/export',
    data,
    name
  })
}

export function dispatchDelDispatch(params) {
  return request({
    url: '/dispatch/delDispatch',
    method: 'post',
    params
  })
}

export function dispatchImport(data) {
  return handleImport('/dispatch/import', data.formdata, data.id || '')
}

export function dispatchPList(data) {
  return request({
    url: '/dispatch/pList',
    method: 'post',
    data
  })
}
export function dispatchCList(data) {
  return request({
    url: '/dispatch/cList',
    method: 'post',
    data
  })
}
export function dispatchAList(data) {
  return request({
    url: '/dispatch/aList',
    method: 'post',
    data
  })
}
export function dispatchSList(data) {
  return request({
    url: '/dispatch/sList',
    method: 'post',
    data
  })
}
//
export function dispatchChannel(data) {
  return request({
    url: '/dispatch/channel',
    method: 'post',
    data
  })
}
export function dispatchSmallList(data) {
  return request({
    url: '/dispatch/smallList',
    method: 'post',
    data
  })
}
export function dispatchCategoryList(data) {
  return request({
    url: '/dispatch/categoryList',
    method: 'post',
    data
  })
}
export function dispatchSourceList(data) {
  return request({
    url: '/dispatch/sourceList',
    method: 'post',
    data
  })
}
export function dispatchSaveDispatch(data) {
  return request({
    url: '/dispatch/saveDispatch',
    method: 'post',
    data
  })
}
