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

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

/**
 * 获取活动主题列表
 */
export const getActivityInfoList = () => {
  return request({
    url: '/stuwork/activityinfo/activityInfoList',
    method: 'get'
  });
};

/**
 * 获取子项目列表
 * @param activityInfoId 活动主题ID（可选）
 */
export const getActivityInfoSubList = (activityInfoId?: string) => {
  return request({
    url: '/stuwork/activityinfosub/activityInfoSubList',
    method: 'get',
    params: activityInfoId ? { activityInfoId } : {}
  });
};

/**
 * 删除活动报名
 * @param ids
 */
export const delObj = (ids: string[]) => {
  return request({
    url: '/stuwork/activityinfosubsignup',
    method: 'delete',
    data: ids
  });
};

/**
 * 导出活动报名表
 * @param query 查询参数
 */
export const exportExcel = (query?: any) => {
  return request({
    url: '/stuwork/activityinfosubsignup/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  });
};

