import request from '@/utils/request'

// 查询导出任务列表
export function listExport(query) {
  return request({
    url: '/business/export/list',
    method: 'get',
    params: query
  })
}

// 查询导出任务详细
export function getExport(id) {
  return request({
    url: '/business/export/' + id,
    method: 'get'
  })
}

// 查询导出任务详细
export function getExportDetail(id) {
  return request({
    url: '/business/export/detail/' + id,
    method: 'get'
  })
}


// 新增导出任务
export function addExport(data) {
  return request({
    url: '/business/export/add',
    method: 'post',
    data: data
  })
}

// 修改导出任务
export function updateExport(data) {
  return request({
    url: '/business/export/update',
    method: 'post',
    data: data
  })
}

// 删除导出任务
export function delExport(id) {
  return request({
    url: '/business/export/delete/' + id,
    method: 'get'
  })
}

// 打印导出任务
export function printExport(query) {
  return request({
    url: '/business/export/print',
    method: 'get',
    params: query
  })
}

// 开始导出任务
export function startExport(id) {
  return request({
    url: '/business/export/start/' + id,
    method: 'post',
  })
}

// 导出任务日志
export function exportLog(id, offset) {
  return request({
    url: '/business/export/log/' + id,
    method: 'get',
    params: {offset}
  })
}

// 下载导出任务日志
export function downloadLog(id) {
  return request({
    url: '/business/export/downloadLog/' + id,
    method: 'get',
    responseType: 'blob',
  })
}

// 下载导出任务文件
export function downloadFile(id) {
  return request({
    url: '/business/export/downloadFile/' + id,
    method: 'get',
    responseType: 'blob',
  })
}
