diff --git a/src/glcc/student/index.jsx b/src/glcc/student/index.jsx
index 4ace24175..caf128557 100644
--- a/src/glcc/student/index.jsx
+++ b/src/glcc/student/index.jsx
@@ -24,25 +24,21 @@ const gradeList = [
{ id: '博士及以上', name: '博士及以上' }
];
function Apply(props) {
- const { form, current_user, showNotification, match, history, setStudentInfoReset } = props;
+ const { form, current_user, showNotification, match, history, setStudentInfoReset, period, round } = props;
const taskId = Number(match.params.taskId);
// 可用于开发时不同账号报名
// current_user && (current_user.user_id = 6)
// current_user && (current_user.userName = "创新使者")
- const isStudentApplyDate = new Date().getTime() > new Date('2022/06/29 01:00:00').getTime() && new Date().getTime() < new Date('2022/07/01 01:00:00').getTime();
- const studentApplyEnd = new Date().getTime() > new Date('2022/07/01 01:00:00').getTime();
const { getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll } = form;
const [imageUrl, setImageUrl] = useState(undefined);
const [loading, setLoading] = useState(false);
const [reload, setReload] = useState();
const [locked, setLocked] = useState(true);
const [userApplyInfo, setUserApplyInfo] = useState(undefined);
- const [editable, setEditable] = useState(isStudentApplyDate);
+ const [editable, setEditable] = useState(false);
const [files, setFiles] = useState([]);
const [files1, setFiles1] = useState([]);
const [files2, setFiles2] = useState([]);
- // console.log( new Date());
- // console.log('isStudentApplyDate:' + isStudentApplyDate)
const initTask = {
taskId,
memo: '',
@@ -51,8 +47,9 @@ function Apply(props) {
const [myTaskList, setMyTaskList] = useState([]);
const [allTaskList, setAllTaskList] = useState([]);
- // 学生报名时间范围内
- // 已过学生报名时间
+ useEffect(()=>{
+ setEditable(period === "stuApply" || period === "stuApply1")
+ }, [period])
useEffect(() => {
// 进入此页面到填写页面
@@ -77,19 +74,20 @@ function Apply(props) {
useEffect(() => {
const params = {
curPage: 1,
- pageSize: 10000
+ pageSize: 10000,
+ round
}
taskList(params).then(response => {
if (response && response.message === "success") {
setAllTaskList(response.data.rows);
}
})
- }, [])
+ }, [round])
useEffect(() => {
// 获取当前用户报名信息
- current_user && getStudentApplyInfo({ userId: current_user.user_id }).then(response => {
+ current_user && getStudentApplyInfo({ userId: current_user.user_id, round }).then(response => {
if (response && response.message === "success" && response.data) {
let data = response.data;
let applyInfo = {
@@ -135,14 +133,14 @@ function Apply(props) {
}]);
}
- // if (item.enrollFirst) {
- // applyInfo.enrollFirst = i;
- // }
-
- if (item.status == 2) {
- item.status == 2
+ if (item.enrollFirst) {
+ applyInfo.enrollFirst = i;
}
+ // if (item.status == 2) {
+ // item.status == 2
+ // }
+
initTaskList.push(item);
// initTaskList.push({
// id: item.id,
@@ -185,7 +183,7 @@ function Apply(props) {
}).then(res => setFieldsValue({ 'taskId0': taskId }))
}
})
- }, [current_user, reload])
+ }, [current_user, reload, round])
// 当用户输入结束时 检验用户输入是否符合规范
function verify(dataIndex) {
@@ -202,20 +200,20 @@ function Apply(props) {
e.preventDefault();
Confirm({
title:'提示',
- content:'提交后将不允许修改报名信息,确认提交?',
+ content:'提交后,您的课题报名信息将无法更改,确认提交?',
onOk:()=>{
validateFieldsAndScroll((err, values) => {
if (!err) {
setLoading(true);
- // if (myTaskList.length === 2) {
- // if (values.enrollFirst == 1) {
- // myTaskList[1].enrollFirst = true;
- // myTaskList[0].enrollFirst = false;
- // } else {
- // myTaskList[1].enrollFirst = false;
- // myTaskList[0].enrollFirst = true;
- // }
- // }
+ if(myTaskList && myTaskList.length){
+ const {enrollFirst=0} = values;
+ myTaskList.map((item, index)=>{
+ // registrationStudentTaskList需要传round字段
+ item.round = round;
+ // 课题优先级
+ item.enrollFirst = index === enrollFirst
+ })
+ }
const params = {
grade: values.grade,
location: Array.isArray(values.location) && values.location.join(),
@@ -226,10 +224,9 @@ function Apply(props) {
profession: values.profession,
studentName: values.studentName,
userId: current_user.user_id,
- registrationStudentTaskList: myTaskList
+ registrationStudentTaskList: myTaskList,
+ round
}
-
-
if (userApplyInfo) {
params.id = userApplyInfo.id;
studentApplyEdit(params).then(response => {
@@ -238,7 +235,8 @@ function Apply(props) {
setStudentInfoReset(Math.random());
setReload(Math.random());
setLoading(false);
- history.push(`/glcc/subjects`)
+ window.scrollTo(0,0);
+ // history.push(`/glcc/subjects`)
}
});
} else {
@@ -248,7 +246,8 @@ function Apply(props) {
setStudentInfoReset(Math.random());
setReload(Math.random());
setLoading(false);
- history.push(`/glcc/subjects`)
+ window.scrollTo(0,0);
+ // history.push(`/glcc/subjects`)
}
});
}
@@ -256,7 +255,6 @@ function Apply(props) {
});
}
});
-
};
const helper = useCallback(
@@ -320,7 +318,6 @@ function Apply(props) {
if (info.file.status === 'removed') {
changeTaskItem('memoAttachmentId', '', i);
}
- console.log(info.fileList);
if (i==1) {
setFiles1(appendFileSizeToUploadFileAll(info.fileList).slice(-1));
}else if (i==2) {
@@ -359,33 +356,33 @@ function Apply(props) {
}
}
- // function deleteTask(i) {
- // let taskListNew = myTaskList.slice();
- // let reWriteInfo;
- // if (i) {
- // reWriteInfo = {
- // taskId1: '',
- // memo1: '',
- // memoAttachmentId1: ''
- // }
- // setFiles1([]);
- // } else {
- // reWriteInfo = {
- // taskId0: taskListNew[1].taskId,
- // memo0: taskListNew[1].memo,
- // memoAttachmentId0: taskListNew[1].memoAttachmentId,
- // taskId1: '',
- // memo1: '',
- // memoAttachmentId1: ''
- // }
- // setFiles(files1);
- // setFiles1([]);
- // }
+ function deleteTask(i) {
+ let taskListNew = myTaskList.slice();
+ let reWriteInfo;
+ if (i) {
+ reWriteInfo = {
+ taskId1: '',
+ memo1: '',
+ memoAttachmentId1: ''
+ }
+ setFiles1([]);
+ } else {
+ reWriteInfo = {
+ taskId0: taskListNew[1].taskId,
+ memo0: taskListNew[1].memo,
+ memoAttachmentId0: taskListNew[1].memoAttachmentId,
+ taskId1: '',
+ memo1: '',
+ memoAttachmentId1: ''
+ }
+ setFiles(files1);
+ setFiles1([]);
+ }
- // taskListNew.splice(i, 1);
- // setMyTaskList(taskListNew);
- // setFieldsValue(reWriteInfo);
- // }
+ taskListNew.splice(i, 1);
+ setMyTaskList(taskListNew);
+ setFieldsValue(reWriteInfo);
+ }
function changeTaskItem(field, val, i) {
let taskListNew = [...myTaskList];
@@ -402,17 +399,17 @@ function Apply(props) {
开源夏令营
- 课题及项目列表
+ 课题及项目列表
学生报名
申请说明:
-
1、学生报名时间为2022年5月26日-6月24日,请在报名截止时间(北京时间2022年6月24日24点)前提交报名信息。
+
1、学生报名时间为2023年6月4日-6月21日,请在报名截止时间(北京时间2023年6月21日24点)前提交报名信息
2、本次GLCC夏令营基于GitLink代码托管平台完成编程任务,若您没有平台账户,请先注册后完成课题申请
-
3、每位学员最多可申请2个课题,至多有且仅有1个课题可以入选
-
4、提交申请后,每位学员可实时修改自己的报名信息,但仅具有两次取消申请课题的机会,请谨慎选择课题或取消课题
+
3、每位学员最多可申请2个课题,有且仅有1个课题可以入选
+
4、每个学生有且仅有两次取消申请课题的机会,请谨慎选择课题或取消课题
5、建议在提交课题申请,与课题导师邮件沟通,详细了解课题描述、编码任务、技能要求&编程语言、预期产出结果等信息,以便您能够选择最适合的课题
-
6、提交申请后,请耐心等待,我们会在2022年7月1日公布入围结果。如有任何问题,请添加开源夏令营QQ群:210174286进行咨询
+
6、提交申请后,请耐心等待,我们会在2023年7月1日公布入围结果。如有任何问题,请添加开源夏令营QQ群:210174286进行咨询
学生报名
@@ -427,33 +424,33 @@ function Apply(props) {
'studentName',
[{ required: true, message: "请正确输入学生姓名" },
{ max: 32, message: '超出限制长度32位字符,请重新编辑' }],
-
{ verify("studentName") }} className={"disabledInput"} disabled />
+
{ verify("studentName") }} className={editable ? "" : "disabledInput"} disabled={editable ? false : true} />
)}
{helper('所在高校',
'',
'school',
[{ required: true, message: "请正确输入所在高校" },
{ max: 32, message: '超出限制长度32位字符,请重新编辑' }],
-
{ verify("school") }} className={"disabledInput"} disabled />
+
{ verify("school") }} className={editable ? "" : "disabledInput"} disabled={editable ? false : true}/>
)}
{helper('所学专业',
'',
'profession',
[{ max: 32, message: '超出限制长度32位字符,请重新编辑' }],
-
{ verify("profession") }} className={"disabledInput"} disabled />
+
{ verify("profession") }} className={editable ? "" : "disabledInput"} disabled={editable ? false : true}/>
)}
{getFieldDecorator("location", {
rules: []
})(
-
+
)}
{helper('所在年级',
'',
'grade',
[],
-