142 lines
4.0 KiB
JavaScript
142 lines
4.0 KiB
JavaScript
import { http } from '../../utils/request';
|
|
|
|
|
|
// ==================== 成绩与证书管理 ====================
|
|
|
|
/**
|
|
* 运动员成绩列表
|
|
* @param {Object} data - 查询参数
|
|
* @param {number} [data.pageNo] - 当前页码
|
|
* @param {number} [data.pageSize] - 每页条数
|
|
* @param {number} [data.eventId] - 赛事ID
|
|
* @param {number} [data.projectId] - 项目ID
|
|
* @param {string} [data.groupName] - 组别名称
|
|
* @param {string} [data.name] - 运动员姓名 (模糊查询)
|
|
* @param {string} [data.unitName] - 单位名称 (模糊查询)
|
|
* @returns {Promise<{
|
|
* pageNo: number,
|
|
* pageSize: number,
|
|
* pages: number,
|
|
* total: number,
|
|
* rows: Array<{
|
|
* id: number,
|
|
* name: string,
|
|
* score: string,
|
|
* unitName: string,
|
|
* rank: number,
|
|
* gender: string,
|
|
* resultId: number,
|
|
* certificateId: number
|
|
* }>
|
|
* }>}
|
|
*/
|
|
export const eventscorePageathletePost = (data) => {
|
|
return http.post('/eventscore/pageathlete', data);
|
|
};
|
|
|
|
/**
|
|
* 教练/领队列表
|
|
* @param {Object} data - 查询参数
|
|
* @param {number} [data.pageNo] - 当前页码
|
|
* @param {number} [data.pageSize] - 每页条数
|
|
* @param {number} [data.eventId] - 赛事ID
|
|
* @param {string} [data.personType] - 人员类型 (User=用户, Coach=教练, Leader=领队)
|
|
* @param {string} [data.name] - 姓名 (模糊查询)
|
|
* @param {string} [data.phone] - 联系电话
|
|
* @returns {Promise<{
|
|
* pageNo: number,
|
|
* pageSize: number,
|
|
* pages: number,
|
|
* total: number,
|
|
* rows: Array<{
|
|
* id: number,
|
|
* name: string,
|
|
* age: number,
|
|
* gender: string,
|
|
* idCard: string,
|
|
* phone: string,
|
|
* certificateId: number
|
|
* }>
|
|
* }>}
|
|
*/
|
|
export const eventscorePagecoachleaderPost = (data) => {
|
|
return http.post('/eventscore/pagecoachleader', data);
|
|
};
|
|
|
|
/**
|
|
* 导入成绩
|
|
* @param {number} eventid - 赛事ID (路径参数)
|
|
* @param {FormData} formData - 表单数据
|
|
* @param {File} formData.file - 成绩文件 (Excel格式)
|
|
*/
|
|
export const eventscoreImportscorePost = (eventid, formData) => {
|
|
return http.post(`/eventscore/importscore/${eventid}`, formData, {
|
|
headers: {
|
|
'Content-Type': 'multipart/form-data'
|
|
}
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 发放证书
|
|
* @param {Object} data - 发放参数
|
|
* @param {Array<number>} data.personIds - 人员ID列表
|
|
* @param {number} data.eventId - 赛事ID
|
|
*/
|
|
export const eventscoreIssuecertificatePost = (data) => {
|
|
return http.post('/eventscore/issuecertificate', data);
|
|
};
|
|
|
|
/**
|
|
* 查看证书
|
|
* @param {number} id - 报名人员ID (EventRegistrationPerson的Id) (路径参数)
|
|
* @returns {Promise<Object>} 返回证书详情
|
|
*/
|
|
export const eventscoreGetCertificateDetailGet = (id) => {
|
|
return http.get(`/EventScore/GetCertificateDetail/${id}`);
|
|
};
|
|
|
|
/**
|
|
* 下载模板
|
|
* @returns {Promise<Blob>} 返回模板文件流
|
|
*/
|
|
export const eventscoreDownloadtemplateGet = () => {
|
|
return http.get('/eventscore/downloadtemplate', {
|
|
responseType: 'blob'
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 导出证书
|
|
* @param {Object} data - 导出参数
|
|
* @param {number} [data.pageNo] - 当前页码
|
|
* @param {number} [data.pageSize] - 每页条数
|
|
* @param {number} [data.eventId] - 赛事ID
|
|
* @param {number} [data.projectId] - 项目ID
|
|
* @param {string} [data.groupName] - 组别名称
|
|
* @param {string} [data.name] - 姓名
|
|
* @param {string} [data.unitName] - 单位名称
|
|
* @returns {Promise<string>} 返回导出文件URL
|
|
*/
|
|
export const eventscoreExportcertificatePost = (data) => {
|
|
return http.post('/eventscore/exportcertificate', data);
|
|
};
|
|
|
|
/**
|
|
* 删除成绩/证书信息
|
|
* @param {Object} data - 删除参数
|
|
* @param {number} data.id - 记录ID
|
|
*/
|
|
export const eventscoreDeleteDelete = (data) => {
|
|
return http.delete('/eventscore/delete', { data });
|
|
};
|
|
|
|
/**
|
|
* 修改成绩/证书状态
|
|
* @param {Object} data - 状态参数
|
|
* @param {number} data.id - 记录ID
|
|
* @param {string} data.status - 状态 (Enable=启用, Disable=禁用)
|
|
*/
|
|
export const eventscoreSetstatusPatch = (data) => {
|
|
return http.patch('/eventscore/setstatus', data);
|
|
}; |