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

/**
 * 分页查询学籍异动列表
 * @param query
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/stuturnover/page',
    method: 'get',
    params: query
  });
};

/**
 * 新增学籍异动（批量）
 * @param data
 */
export const addObj = (data: any) => {
  return request({
    url: '/stuwork/stuturnover',
    method: 'post',
    data
  });
};

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

/**
 * 编辑学籍异动
 * @param data
 */
export const editObj = (data: any) => {
  return request({
    url: '/stuwork/stuturnover/edit',
    method: 'post',
    data
  });
};

/**
 * 删除学籍异动
 * @param ids
 */
export const delObj = (ids: string[]) => {
  return request({
    url: '/stuwork/stuturnover/delete',
    method: 'post',
    data: ids
  });
};

/**
 * 撤销学籍异动
 * @param ids 异动记录ID列表
 */
export const cancelObj = (ids: string[]) => {
  return request({
    url: '/stuwork/stuturnover/cancel',
    method: 'post',
    data: ids
  });
};

/**
 * 导出学籍异动
 * @param query
 */
export const exportData = (query?: any) => {
  return request({
    url: '/stuwork/stuturnover/export',
    method: 'post',
    data: query,
    responseType: 'blob'
  });
};

