import request from '@/utils/request'

// 创建归档
export function createRecord(data) {
  return request({
    url: '/archives/record/create',
    method: 'post',
    data: data
  })
}

// 更新归档
export function updateRecord(data) {
  return request({
    url: '/archives/record/update',
    method: 'put',
    data: data
  })
}

// 批量归档
export function archivesRecord(data) {
  return request({
    url: '/archives/record/record?ids=' + data,
    method: 'put',
  })
}

// 删除归档
export function deleteRecord(id) {
  return request({
    url: '/archives/record/delete?id=' + id,
    method: 'delete'
  })
}

// 获得归档
export function getRecord(id) {
  return request({
    url: '/archives/record/get?id=' + id,
    method: 'get'
  })
}

// 获得归档分页
export function getRecordPage(query) {
  return request({
    url: '/archives/record/page',
    method: 'get',
    params: query
  })
}

// 导出归档 Excel
export function exportRecordExcel(query) {
  return request({
    url: '/archives/record/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}


// 生成编码
export function createCodeRule(data) {
  return request({
    url: '/archives/code-rule/create',
    method: 'post',
    data: data
  })
}


// 生成WS
export function createWS(data) {
  return request({
    url: '/archives/code-rule/createWS',
    method: 'post',
    data: data
  })
}