import request from '/@/utils/request';

/**
 * 分页查询批量请假列表
 * @param query
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/classleaveapply/page',
    method: 'get',
    params: query
  });
};

/**
 * 新增批量请假
 * @param data
 */
export const addObj = (data: any) => {
  return request({
    url: '/stuwork/classleaveapply',
    method: 'post',
    data
  });
};

/**
 * 获取详情
 * @param id
 */
export const getDetail = (id: string) => {
  return request({
    url: '/stuwork/classleaveapply/detail',
    method: 'get',
    params: { id }
  });
};

/**
 * 编辑批量请假
 * @param data
 */
export const editObj = (data: any) => {
  return request({
    url: '/stuwork/classleaveapply/edit',
    method: 'post',
    data
  });
};

/**
 * 删除批量请假
 * @param ids
 */
export const delObj = (ids: string[]) => {
  return request({
    url: '/stuwork/classleaveapply/delete',
    method: 'post',
    data: ids
  });
};

/**
 * 整班删除
 * @param id
 */
export const deleteByClass = (id: string) => {
  return request({
    url: '/stuwork/classleaveapply/deleteByClass',
    method: 'post',
    data: { id }
  });
};

/**
 * 获取待办任务
 * @param query
 */
export const getClassLeaveApplyTask = (query?: any) => {
  return request({
    url: '/stuwork/classleaveapply/task',
    method: 'get',
    params: query
  });
};

