/**
 * 分包证书管理
 */
import request from '../../index'
import type { IListQuery } from '@/views/business/subpackage/certificate/certificate-interface'
const prefix = '/business/outsource/certificate'

// 列表查询
export function getCertificateList(data: IListQuery) {
  return request({
    url: `${prefix}/listPage?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}
// 导出
export function exportCertificateList(data: IListQuery) {
  return request({
    url: `${prefix}/listExport`,
    method: 'post',
    data,
    responseType: 'blob',
  })
}

// 新建
export function addCertificateList(data: Object) {
  return request({
    url: `${prefix}/add`,
    method: 'post',
    data,
  })
}
// 编辑
export function updateCertificateList(data: Object) {
  return request({
    url: `${prefix}/update`,
    method: 'post',
    data,
  })
}

// 删除
export function deleteCertificateList(data: { id: string }) {
  return request({
    url: `${prefix}/delete`,
    method: 'post',
    data,
  })
}
