import request from '@/utils/request'
import { downFile } from '@/utils/request'

/**
 * 工作记录分页查询
 * @param {查询条件} data
 */
export function listCamWorkrecord(query) {
  return request({
    url: 'business/CamWorkrecord/list',
    method: 'get',
    params: query,
  })
}

/**
 * 新增工作记录
 * @param data
 */
export function addCamWorkrecord(data) {
  return request({
    url: 'addworkrecord',
    method: 'post',
    data: data,
  })
}
/**
 * 修改工作记录
 * @param data
 */
export function updateCamWorkrecord(data) {
  return request({
    url: 'addworkrecord',
    method: 'post',
    data: data,
  })
}
/**
 * 获取工作记录详情
 * @param {Id}
 */
export function getCamWorkrecord(id) {
  return request({
    url: 'business/CamWorkrecord/' + id,
    method: 'get'
  })
}

/**
 * 删除工作记录
 * @param {主键} pid
 */
export function delCamWorkrecord(pid) {
  return request({
    url: 'business/CamWorkrecord/delete/' + pid,
    method: 'POST'
  })
}
// 导出工作记录
export async function exportCamWorkrecord(query) {
  await downFile('business/CamWorkrecord/export', { ...query })
}
