/**
 * 现场检测记录
 */
import request from '../../index'
import type { IListQuery } from '@/views/business/fieldTest/record/record-interface'
const prefix = 'business/siteExecutive'
// 列表查询
export function getFieldTestRecordList(data: IListQuery) {
  return request({
    url: `${prefix}/log/listPage?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}

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

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

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

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

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

