import request from '@/utils/request'

// 创建装册
export function createPackages(data) {
  return request({
    url: '/archives/packages/create',
    method: 'post',
    data: data
  })
}

// 更新装册
export function updatePackages(data) {
  return request({
    url: '/archives/packages/update',
    method: 'put',
    data: data
  })
}

// 删除装册
export function deletePackages(id) {
  return request({
    url: '/archives/packages/delete?id=' + id,
    method: 'delete'
  })
}

// 获得装册
export function getPackages(id) {
  return request({
    url: '/archives/packages/get?id=' + id,
    method: 'get'
  })
}

// 获得装册分页
export function getPackagesPage(query) {
  return request({
    url: '/archives/packages/page',
    method: 'get',
    params: query
  })
}

// 导出装册 Excel
export function exportPackagesExcel(query) {
  return request({
    url: '/archives/packages/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
