import request from '@/utils/request'

/**
 * 作息配置页面
 * */
// 获取table数据
export function tableList(params) {
  return request({
    url: '/system/work/time/pageList',
    method: 'get',
    showLoading:false,
    params
  })
}

// 修改作息信息
export function editWorkTime(data) {
  return request({
    url: '/system/work/time/saveOneWorkTime',
    method: 'post',
    showLoading:true,
    data
  })
}

// 通过id查询org信息
export function queryOrgInfo(id) {
  return request({
    url: '/system/work/time/findOneWorkTimeById/'+id,
    method: 'get',
    showLoading:true,
  })
}


/**
 * 按周配置作息页面
 * */

//获取周配置列表
export function weekTableList(params) {
  return request({
    url: '/system/work/timeSet/find',
    method: 'get',
    showLoading:false,
    params
  })
}

//通过id获取详情
export function queryInfoById(params) {
  return request({
    url: '/system/work/timeSet/findId',
    method: 'get',
    showLoading:true,
    params
  })
}

// 新增时数据检查是否合法
export function checkData(data) {
  return request({
    url: '/system/work/time/checkData',
    method: 'post',
    showLoading:true,
    data
  })
}


// 新增按周配置作息列表
export function addTimeWeek(data) {
  return request({
    url: '/system/work/timeSet/add',
    method: 'post',
    showLoading:true,
    data
  })
}


// 新增指定日期作息配置
export function addWorkTimeDay(data) {
  return request({
    url: '/system/work/time/month/edit',
    method: 'post',
    showLoading:true,
    data
  })
}


