// 计量人员相关接口api
import request from '../index'
import type { StaffListType } from '@/views/measure/person/person-interface'
// 计量人员列表
export function getStaffList(data: StaffListType) {
  return request({
    url: `/staff/selectStaffList?limit=${data.limit}&offset=${data.offset}`,
    method: 'post',
    data,
  })
}
// 人员详细信息
export function getStaffDetail(data: object) {
  return request({
    url: '/staff/selectStaffInfo',
    method: 'post',
    data,
  })
}
// 删除人员
export function getStaffDelete(data: object) {
  return request({
    url: '/staff/deleteStaff',
    method: 'post',
    data,
  })
}
// 新增人员
export function getStaffAdd(data: object) {
  return request({
    url: '/staff/addStaffInfo',
    method: 'post',
    data,
  })
}
// 编辑人员
export function getStaffupdate(data: object) {
  return request({
    url: '/staff/updateStaffInfo',
    method: 'post',
    data,
  })
}
// 列表导出
export function exportList(data: object) {
  return request({
    url: '/staff/exportStaffList',
    method: 'post',
    data,
    responseType: 'blob',
  })
}
// 导入计量人员
export function uploadList(data: FormData) {
  return request({
    url: '/staff/batchImportStaff',
    method: 'post',
    data,
  })
}
// 证书记录列表
export function getCertificateList(data: StaffListType) {
  return request({
    url: `/certificate/queryCertificateList?limit=${data.limit}&offset=${data.offset}`,
    method: 'post',
    data,
  })
}
// 证书记录导出
export function CertificateListList(data: object) {
  return request({
    url: '/certificate/exportCertificateList',
    method: 'post',
    data,
    responseType: 'blob',
  })
}
// 证书记录新增
export function addCertificateList(data: object) {
  return request({
    url: '/certificate/addStaffCertificate',
    method: 'post',
    data,
  })
}
// 获取证书记录详情
export function getCertificateDetail(data: object) {
  return request({
    url: '/certificate/queryStaffCertificateInfo',
    method: 'post',
    data,
  })
}
// 证书记录更新
export function getCertificateUpdate(data: object) {
  return request({
    url: '/certificate/updateStaffCertificateInfo',
    method: 'post',
    data,
  })
}
// 证书记录导入
export function getCertificateUpload(data: FormData) {
  return request({
    url: '/certificate/batchImportCertificate',
    method: 'post',
    data,
  })
}
// 证书过期提醒
export function getCertificateRemind(data: object) {
  return request({
    url: '/certificate/expirationReminder',
    method: 'post',
    data,
  })
}
// 证书记录删除
export function getCertificateRemove(data: object) {
  return request({
    url: '/certificate/deleteCertificate',
    method: 'post',
    data,
  })
}
