/**
 * 现场检测记录
 */
import request from '../../index'
import type { IListQuery } from '@/views/business/fieldTest/record/record-interface'

// 列表查询
export function getFieldTestRecordList(data: IListQuery) {
  return request({
    url: `/business/siteExecutive/log/listPage?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}

// 删除
export function delFieldTestRecordList(data: { id: string }) {
  return request({
    url: '/business/siteExecutive/log/delete',
    method: 'post',
    data,
  })
}

// 新增
export function addFieldTestRecordList(data: object) {
  return request({
    url: '/business/siteExecutive/log/add',
    method: 'post',
    data,
  })
}

// 编辑
export function updateFieldTestRecord(data: object) {
  return request({
    url: '/business/siteExecutive/log/update',
    method: 'post',
    data,
  })
}

// 详情
export function getRecordDetail(data: { id: string }) {
  return request({
    url: '/business/siteExecutive/log/detail',
    method: 'post',
    data,
  })
}

// 导出列表
export function exportRecordDetail(data: Omit<IListQuery, 'limit' | 'offset'>) {
  return request({
    url: '/business/siteExecutive/log/export',
    method: 'post',
    responseType: 'blob',
    data,
  })
}

