import {
  download,
  get,
  post
} from '@/common/utils/http-util.ts'

export default {
  paging(data: DisposeRecodeTypes.SearchParam & G.PageParam) {
    return get<G.PageResult<DisposeRecodeTypes.DisposeRecodeData>>('/dispose_record/paging', data)
  },
  list(pid: string | null = null) {
    return get<DisposeRecodeTypes.DisposeRecodeData[]>('/dispose_record/list', {pid: pid})
  },
  detail(id: string) {
    return get<DisposeRecodeTypes.DisposeRecodeData>('/dispose_record/detail', {id})
  },
  add(data: DisposeRecodeTypes.DisposeRecodeData) {
    return post('/dispose_record/add', data)
  },
  modify(data: DisposeRecodeTypes.DisposeRecodeData) {
    return post('/dispose_record/modify', data)
  },
  del(ids: string[]) {
    return post('/dispose_record/del', ids)
  },
  exportData(date: string[]) {
    return download('/dispose_record/export', {date})
  },
  audit(data: DisposeRecodeTypes.AuditParam) {
    return post('/dispose_record/audit', data)
  },
  statistics(date: string) {
    return get<DisposeRecodeTypes.StatisticsResult>('/dispose_record/statistics', {date})
  },
}
