import request from '@/utils/request'

// 查询假期规则列表
export function listRule(query) {
  return request({
    url: '/clocking/rule/list',
    method: 'get',
    params: query
  })
}

// 查询假期规则详细
export function getRule(id) {
  return request({
    url: '/clocking/rule/' + id,
    method: 'get'
  })
}

// 新增假期规则
export function addRule(data) {
  return request({
    url: '/clocking/rule',
    method: 'post',
    data: data
  })
}

// 修改假期规则
export function updateRule(data) {
  return request({
    url: '/clocking/rule',
    method: 'put',
    data: data
  })
}

// 删除假期规则
export function delRule(id) {
  return request({
    url: '/clocking/rule/' + id,
    method: 'delete'
  })
}

// 导出假期规则
export function exportRule(query) {
  return request({
    url: '/clocking/rule/export',
    method: 'get',
    params: query
  })
}