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

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

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

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

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

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

