forgeplus-react/src/glcc/api.js

297 lines
6.2 KiB
JavaScript

import fetch from './fetch';
// 获取当前用户项目报名信息(项目、课题)
export function getUserApplyInfo(params) {
return fetch({
url: `/api/applyInformation/getUserApplyInfo`,
method: 'get',
params
});
}
//报名夏令营(项目、课题报名)
export function applyGlcc(data) {
return fetch({
url: '/api/applyInformation/create',
method: 'post',
data: data
});
}
// 修改报名信息
export function updateApplyGlcc(data) {
return fetch({
url: '/api/applyInformation/update',
method: 'post',
data: data
});
}
//提交报名信息(学生)
export function studentApply(data) {
return fetch({
url: '/api/studentApply/create',
method: 'post',
data: data
});
}
//修改报名信息(学生)
export function studentApplyEdit(data) {
return fetch({
url: '/api/studentApply/update',
method: 'post',
data: data
});
}
// 项目列表
export function projectList(params) {
return fetch({
url: `/api/applyInformation/list`,
method: 'get',
params
});
}
// 0元项目列表
export function freeProjectList(params) {
return fetch({
url: `/api/applyInformation/projectListFor0`,
method: 'get',
params
});
}
// 课题列表
export function taskList(params) {
return fetch({
url: `/api/applyInformation/taskList`,
method: 'get',
params
});
}
// 0元课题列表
export function freeTaskList(params) {
return fetch({
url: `/api/applyInformation/taskListFor0`,
method: 'get',
params
});
}
// 项目id查询项目详情
export function getProjectById(id, params) {
return fetch({
url: `/api/applyInformation/${id}`,
method: 'get',
params
});
}
// 获取用户(学生)课题报名信息
export function getStudentApplyInfo(params) {
return fetch({
url: `/api/studentApply/getUserApplyInfo`,
method: 'get',
params
});
}
// 用户取消课题报名
export function cancelTaskApply(data) {
return fetch({
url: '/api/studentApply/delete',
method: 'post',
data: data
});
}
// 学生报名课题列表
export function studentApplyList(params) {
return fetch({
url: `/api/studentApply/list`,
method: 'get',
params
});
}
// 课题详情
export function getTaskById(id) {
return fetch({
url: `/api/applyInformation/task/${id}`,
method: 'get'
});
}
// 学生报名列表查询
export function getStudentList(params) {
return fetch({
url: '/api/studentApply/list',
method: 'get',
params,
});
}
// 是否有审核权限
export function hasAuditRole(params) {
return fetch({
url: '/api/applyInformation/hasAuditRole',
method: 'get',
params,
});
}
// 审核课题列表
export function getAuditList(params) {
return fetch({
url: '/api/applyInformation/auditList',
method: 'get',
params,
});
}
// 审核课题列表(匹配成功)
export function getLockedAuditList(params) {
return fetch({
url: '/api/applyInformation/lockedAuditList',
method: 'get',
params,
});
}
// 导师审核报名课题
export function auditPassTask(data) {
return fetch({
url: `/api/studentApply/auditPassTask`,
method: 'post',
data
});
}
// 导师审核结果
export function getPassList(params) {
return fetch({
url: '/api/studentApply/passList',
method: 'get',
params,
});
}
// 中期考核-查看中期考核信息(返回导师评分)
export function getMediumTermExamineInfo(taskId, params) {
return fetch({
url: `/api/examineMaterial/getExamineInfo/${taskId}`,
method: 'get',
params
});
}
// 中期考核-查看中期考核信息(不返回返回导师评分)
export function getBriefMediumTermExamineMaterial(taskId) {
return fetch({
url: `/api/mediumTermExamineMaterial/getBriefMediumTermExamineMaterial/${taskId}`,
method: 'get'
});
}
// 中期考核-提交中期考核信息
export function submitMedium(data) {
return fetch({
url: `/api/examineMaterial/create`,
method: 'post',
data
});
}
// 中期考核-导师提交中期考核评分
export function submitTutorEvaluation(data) {
return fetch({
url: `/api/tutorEvaluation/create`,
method: 'post',
data
});
}
// 中期考核-导师更新中期考核评分
export function updateTutorEvaluation(data) {
return fetch({
url: `/api/tutorEvaluation/update`,
method: 'post',
data
});
}
// 中期考核结果list
export function getMediumTermExamineInfoList(params) {
return fetch({
url: `/api/examineMaterial/getExamineInfoList`,
method: 'get',
params,
});
}
// 查看GLCC配置信息列表
export function getGlccSettings(params) {
return fetch({
url: `/api/glccSettings/settingList`,
method: 'get',
params,
});
}
// 删除项目报名信息
export function deleteApplyInfo(data) {
return fetch({
url: `/api/applyInformation/delete`,
method: 'post',
data
});
}
// 判断课题是否有学生报名
export async function findStudentTaskByTaskId(params) {
return await fetch({
url: '/api/applyInformation/findStudentTaskByTaskId',
method: 'get',
params: params,
});
}
// 返回年月日时间
export function formatParsedResult(setting, type= "range") {
if(setting && setting[0]){
const dataMap = setting[0].value.split(',');
const startDate = new Date(dataMap[0]);
const endDate = new Date(dataMap[1]);
const startYear = startDate.getFullYear();
const startMonth = startDate.getMonth() + 1;
const startDay = startDate.getDate();
const startHour = startDate.getHours();
const endYear = endDate.getFullYear();
const endMonth = endDate.getMonth() + 1;
const endDay = endDate.getDate();
const endHour = endDate.getHours();
let result = `${startYear}${startMonth}${startDay}${startHour}点-${endYear}${endMonth}${endDay}${endHour}`;
if(type === "start"){
result= `${startYear}${startMonth}${startDay}${startHour}`;
}else if(type === "end"){
result= `${endYear}${endMonth}${endDay}${endHour}`;
}
return result;
}
}
// 是否通过中期考核
export function hasFinalExam(data) {
return fetch({
url: `/api/applyInformation/hasFinalExam`,
method: 'get',
data
});
}