import request from '@/utils/request'

// 查询列表
export function listLeave(query) {
  return request({
    url: '/personnel/attendance/leave/page',
    method: 'get',
    params: query
  })
}

// 查询详细
export function getLeave(id) {
  return request({
    url: '/personnel/attendance/leave/get?id=' + id,
    method: 'get'
  })
}

// 新增
export function addLeave(data) {
  return request({
    url: '/personnel/attendance/leave/create',
    method: 'post',
    data: data
  })
}

// 修改
export function updateLeave(data) {
  return request({
    url: '/personnel/attendance/leave/update',
    method: 'put',
    data: data
  })
}

// 删除
export function delLeave(id) {
  return request({
    url: '/personnel/attendance/leave/delete?id=' + id,
    method: 'delete'
  })
}

// 导出
export function exportLeave(query) {
  return request({
    url: '/personnel/attendance/leave/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}