import request from '@/utils/request'

// 查询考勤规则配置列表
export function listConfig(query) {
  return request({
    url: '/kaoqin/config/list',
    method: 'get',
    params: query
  })
}

export function listConfigts(query) {
  return request({
    url: '/system/time/list',
    method: 'get',
    params: query
  })
}

// 查询考勤规则配置详细
export function getConfig(kaoqinId) {
  return request({
    url: '/kaoqin/config/' + kaoqinId,
    method: 'get'
  })
}

export function getConfigts(kaoqinId) {
  return request({
    url: '/system/time/' + kaoqinId,
    method: 'get'
  })
}

// 新增考勤规则配置
export function addConfig(data) {
  return request({
    url: '/kaoqin/config',
    method: 'post',
    data: data
  })
}

export function addConfigts(data) {
  return request({
    url: '/system/time',
    method: 'post',
    data: data
  })
}

// 修改考勤规则配置
export function updateConfig(data) {
  return request({
    url: '/kaoqin/config/put',
    method: 'post',
    data: data
  })
}

export function updateConfigts(data) {
  return request({
    url: '/system/time/put',
    method: 'post',
    data: data
  })
}

// 删除考勤规则配置
export function delConfig(kaoqinId) {
  return request({
    url: '/kaoqin/config/delete/' + kaoqinId,
    method: 'get'
  })
}
export function delConfigts(kaoqinId) {
  return request({
    url: '/system/time/delete/' + kaoqinId,
    method: 'get'
  })
}
