diff --git a/src/glcc/api.js b/src/glcc/api.js index 3a6085ebb..f15c7a951 100644 --- a/src/glcc/api.js +++ b/src/glcc/api.js @@ -65,10 +65,11 @@ export function taskList(params) { } // 项目id查询项目详情 -export function getProjectById(id) { +export function getProjectById(id, params) { return fetch({ url: `/api/applyInformation/${id}`, - method: 'get' + method: 'get', + params }); } diff --git a/src/glcc/apply/index.jsx b/src/glcc/apply/index.jsx index e61e06de9..c30ce0051 100644 --- a/src/glcc/apply/index.jsx +++ b/src/glcc/apply/index.jsx @@ -74,7 +74,7 @@ function Apply(props) { {userApplyInfo.length > 0 &&
您已报名成功,可实时修改您的报名信息再次提交。请关注夏令营首页新闻公告获得更多活动资讯!
}

申请说明

-
1、项目报名时间为4月29日—5月30日,请在报名截止时间(北京时间2022年5月30日24点)前提交报名信息。
+
1、项目报名时间为4月29日—5月30日,请在报名截止时间(北京时间2023年5月30日24点)前提交报名信息。
2、本次GLCC夏令营建议使用GitLink为代码托管平台,学生基于GitLink上项目完成编程任务。同时也欢迎使用其他代码托管平台的项目参与活动。目前GLCC只对夏令营期间使用GitLink托管的项目提供部分资金支持。
3、如果您的项目还未迁移到GitLink上,迁移事项请查看迁移说明文档。如在迁移过程中遇到问题,请加qq群: 1071514693 联系qq群管理员。
4、提交社区和题目信息后,欢迎与组委会联系沟通宣传推广和后续合作工作。联系人微信: _TigerWang(备注GitLink编程夏令营)
diff --git a/src/glcc/home/index.jsx b/src/glcc/home/index.jsx index 40c4b89c8..51387b812 100644 --- a/src/glcc/home/index.jsx +++ b/src/glcc/home/index.jsx @@ -19,9 +19,10 @@ import { hasAuditRole } from '../api'; import './index.scss'; // round:2022届(1) 2023届(2) -// period: 项目报名阶段(0) +// period: 项目报名阶段("repoApply") +// match:{params:{id=2023}} 注意默认值记得每届修改 export default (props) => { - const { current_user, isGlccApplyDate, showNotification, studentApplyStart, history, secondStudentApplyDate, isStudentApplyDate, checkedTaskId, checkTime1, checkTime2, checkTime3, round, match:{params:{id}}, period, showLoginDialog, glccSettings} = props; + const { current_user, isGlccApplyDate, showNotification, studentApplyStart, history, secondStudentApplyDate, isStudentApplyDate, checkedTaskId, checkTime1, checkTime2, checkTime3, round, match:{params:{id=2023}}, period, showLoginDialog, glccSettings, repoPublic} = props; function goToApply() { if (isGlccApplyDate) { if (current_user && current_user.login) { @@ -75,7 +76,7 @@ export default (props) => { history.push(url); return } - showLoginDialog(`/glcc/apply`); + showLoginDialog(url); } return ( @@ -108,7 +109,7 @@ export default (props) => { {/* 当前glcc */} {round === 2 &&
{/* 项目报名入口 */} - {period === 0 && {gotoCheckLogin(`/glcc/apply`)}} className="apply project" > + {period === "repoApply" && {gotoCheckLogin(`/glcc/apply`)}} className="apply project" >
项目报名 @@ -116,6 +117,24 @@ export default (props) => {
项目报名开启,导师席位虚位以待
} + + {/* 查看项目、课题 */} + {repoPublic && +
+ + 查看项目 +
+
掌握项目课题详细信息
+ } + + {/* 学生报名6.24结束第一次报名,6.29 1:00 - 6.30 24:00第二次报名 */} + {(period === "stuApply" || period === "stuApply1") &&
{gotoCheckLogin(`/glcc/${id}/subjects`)}}> +
+ + 学生报名 +
+
选择课题,开启您的开源之旅
+
} {/* 6.28.-7.1 审核结果仅对导师可见,7.1之后对所有用户可见*/} {/* {resultTime2 &&
@@ -150,23 +169,6 @@ export default (props) => {
结项课题考核结果公示
} */} - {/* 项目报名 */} - {/* -
- - 查看项目 -
-
掌握项目课题详细信息
- */} - {/* 学生报名6.24结束第一次报名,6.29 1:00 - 6.30 24:00第二次报名 */} - {/*
-
- - 学生报名 -
-
选择课题,开启您的开源之旅
-
*/} - {/* 导师审核 */} {/* {hasRole && new Date().getTime() < new Date('2022/07/01 0:0').getTime() &&
@@ -197,7 +199,7 @@ export default (props) => {
}
- + diff --git a/src/glcc/home/lightspot/index.jsx b/src/glcc/home/lightspot/index.jsx index 3fe915888..3c5aa6e10 100644 --- a/src/glcc/home/lightspot/index.jsx +++ b/src/glcc/home/lightspot/index.jsx @@ -7,10 +7,10 @@ import './index.scss'; function Lightspot(props) { - const {current_user, period, history, round, showLoginDialog} = props; + const {current_user, period, history, round, showLoginDialog, id} = props; function goToApply(){ - const url = period === 0 ? `/glcc/apply` : `/glcc/subjects`; + const url = period === "repoApply" ? `/glcc/apply` : `/glcc/${id}/subjects`; if(current_user && !current_user.login){ showLoginDialog(url); return; @@ -27,12 +27,12 @@ function Lightspot(props) {

有兴趣成为GLCC的导师吗?

想要扩大项目知名度和影响力,为开源项目吸引新鲜血液,培养长期开发者。通过GitLink平台,与高校建立连接,指导开源新人传授他们的开源文化,享受开源的乐趣
- {period === 0 && round === 2 ?
立即报名
:
项目报名{period === -1 ? "敬请期待" : "已结束"}
} + {period === "repoApply" && round === 2 ?
立即报名
:
项目报名已结束
}

你是开源新手,有兴趣参加GLCC吗?

想要参与一线开源项目开发,熟悉开源社区运作流程,接受资深开源软件专家指导,获得丰厚奖金和实习机会。参加GLCC,开启全新的开源之旅。
- {period === 2 && round === 2 ?
学生报名
:
学生报名{period<2 && round === 2 ? "敬请期待" : "已结束"}
} + {(period === "stuApply" || period === "stuApply1") && round === 2 ?
学生报名
:
学生报名{period === "repoApply" && round === 2 ? "敬请期待" : "已结束"}
}
diff --git a/src/glcc/home/timerShaft/index.jsx b/src/glcc/home/timerShaft/index.jsx index 73e28b51b..cd808db55 100644 --- a/src/glcc/home/timerShaft/index.jsx +++ b/src/glcc/home/timerShaft/index.jsx @@ -105,17 +105,17 @@ const stepArr = [{ ] function TimerShaft({round, glccSettings}) { - if(glccSettings && glccSettings.length > 12){ - stepArr[1].date = getRangeTime(glccSettings[0].value); - stepArr[2].date = getRangeTime(glccSettings[1].value); - stepArr[3].date = getRangeTime(glccSettings[2].value); - stepArr[4].date = getTime(glccSettings[3].value); - stepArr[5].date = getRangeTime(glccSettings[11].value); - stepArr[6].date = getTime(glccSettings[7].value); - stepArr[7].date = getRangeTime(glccSettings[12].value); - stepArr[8].date = getTime(glccSettings[9].value); - stepArr[9].date = getTime(glccSettings[4].value); - } + // if(glccSettings && glccSettings.length > 12){ + // stepArr[1].date = getRangeTime(glccSettings[0].value); + // stepArr[2].date = getRangeTime(glccSettings[1].value); + // stepArr[3].date = getRangeTime(glccSettings[2].value); + // stepArr[4].date = getTime(glccSettings[3].value); + // stepArr[5].date = getRangeTime(glccSettings[11].value); + // stepArr[6].date = getTime(glccSettings[7].value); + // stepArr[7].date = getRangeTime(glccSettings[12].value); + // stepArr[8].date = getTime(glccSettings[9].value); + // stepArr[9].date = getTime(glccSettings[4].value); + // } const step = round === 2 ? stepArr : stepArr2022 // 截取月份/日期 diff --git a/src/glcc/img/studentProject.png b/src/glcc/img/studentProject.png index 6b73cf5b6..fc8b331fa 100644 Binary files a/src/glcc/img/studentProject.png and b/src/glcc/img/studentProject.png differ diff --git a/src/glcc/img/studentProject1.png b/src/glcc/img/studentProject1.png new file mode 100644 index 000000000..25eb68870 Binary files /dev/null and b/src/glcc/img/studentProject1.png differ diff --git a/src/glcc/index.jsx b/src/glcc/index.jsx index 560b7f99b..a8b310fe3 100644 --- a/src/glcc/index.jsx +++ b/src/glcc/index.jsx @@ -80,10 +80,12 @@ const Glcc = (propsF) => { const {current_user, showLoginDialog, match:{params:{id}}} = propsF; // round:2022届(1) 2023届(2) const [round, setRound] = useState(2); - // glcc 所处阶段 0(项目报名) + // glcc 所处阶段 repoApply(项目报名) stuApply(学生报名阶段) const [period, setPeriod] = useState(undefined); // glcc后台时间配置 const [glccSettings, setGLccSetting] = useState(undefined); + // 是否展示项目、课题列表入口 + const [repoPublic, setRepoPublic] = useState(false); useEffect(()=>{ if(id && id === "2022"){ @@ -96,18 +98,24 @@ const Glcc = (propsF) => { if(res && res.message === "success"){ setGLccSetting(res.data); const nowTime = new Date().getTime(); - setPeriod(res.data.findIndex(item=>judge(nowTime, item.value))); + // 判断是否展示项目、课题 + const publicRepoTask = res.data.filter(item=>item.name === "repoPublic"); + publicRepoTask[0] && setRepoPublic(judge(nowTime, publicRepoTask[0].value, "range")) + // 过滤掉 项目课题公示时间 + const filterRepoPublic = res.data.filter(item=>item.name !== "repoPublic"); + const periodIndex = filterRepoPublic.findIndex(item=>judge(nowTime, item.value, "range")); + periodIndex !== -1 && setPeriod(filterRepoPublic[periodIndex].name); } }) }, []) // 判断是否处于此段时间范围内 - function judge(nowTime, timeRnge){ + function judge(nowTime, timeRnge, type){ const timeArr = timeRnge.split(",").map(item=>{ const data = item && item.replaceAll('-', '/'); return new Date(data).getTime() }); - return nowTime > timeArr[0] && nowTime < timeArr[1] + return type === "range" ? nowTime > timeArr[0] && nowTime < timeArr[1] : nowTime > timeArr[0] } // 判断时间是否在开源夏令营报名时间内(4月15日~5月20日) @@ -141,7 +149,7 @@ const Glcc = (propsF) => { useEffect(()=>{ // 获取用户课题报名信息(todo:学生报名阶段请求) - false && current_user && current_user.login && getStudentApplyInfo({userId: current_user.user_id}).then(response=>{ + (period === "stuApply" || period === "stuApply1") && current_user && current_user.login && getStudentApplyInfo({userId: current_user.user_id, round: round}).then(response=>{ if(response && response.message === "success"){ // setData(response.data.rows); const data = {}; @@ -152,10 +160,10 @@ const Glcc = (propsF) => { item.passStatus && item.mediumExaminationPass && setStudentRegId(item.studentRegId); }) setApplyTaskId(data); - response.data&&setCancelCount(Number(response.data.cancelCount)); + response.data && setCancelCount(Number(response.data.cancelCount)); } }) - },[studentInfoReset, current_user]) + },[studentInfoReset, current_user, period]) // 申请课题按钮点击函数 function applyTask(id){ @@ -183,11 +191,11 @@ const Glcc = (propsF) => { ( - + )} > {/* 开源夏令营报名页面 */} - {period === 0 && ( @@ -210,14 +218,14 @@ const Glcc = (propsF) => { ( - + )} > {/* 项目/课题列表 */} ( - + )} > @@ -225,7 +233,7 @@ const Glcc = (propsF) => { ( - + )} > @@ -273,7 +281,7 @@ const Glcc = (propsF) => { ( - + )} > @@ -281,7 +289,7 @@ const Glcc = (propsF) => { ( - + )} > diff --git a/src/glcc/openmmlab/projectTab/projectDetail.jsx b/src/glcc/openmmlab/projectTab/projectDetail.jsx index 7178c81d4..8e334f934 100644 --- a/src/glcc/openmmlab/projectTab/projectDetail.jsx +++ b/src/glcc/openmmlab/projectTab/projectDetail.jsx @@ -26,7 +26,7 @@ export default ({ detail, projectId, applyTaskId, isStudentApplyDate, secondStud {info.registrationTaskList && info.registrationTaskList.length > 0 ? info.registrationTaskList.map((item, index)=>{ return
-
{window.location.href=`/glcc/subjects/detail/${item.id}`}}>{item.taskName}
+
{window.location.href=`/glcc/2022/subjects/detail/${item.id}`}}>{item.taskName}
导师姓名:   {item.tutorName}
{item.tutorMail &&
邮箱地址:   {item.tutorMail}
}
diff --git a/src/glcc/openmmlab/sliderRight/index.jsx b/src/glcc/openmmlab/sliderRight/index.jsx index fd9a817e1..7dd8eb961 100644 --- a/src/glcc/openmmlab/sliderRight/index.jsx +++ b/src/glcc/openmmlab/sliderRight/index.jsx @@ -25,7 +25,7 @@ function SliderLeft({list,history}) { // pathname:'/glcc/projects', // state:{projectName:projectName.replace(/ /g,'-')} // }) - window.open(`/glcc/projects?projectName=${projectName.replace(/ /g,'')}`); + window.open(`/glcc/2022/projects?projectName=${projectName.replace(/ /g,'')}`); } return ( diff --git a/src/glcc/project/component/projectDetail.jsx b/src/glcc/project/component/projectDetail.jsx index 5c153bafd..a76eee080 100644 --- a/src/glcc/project/component/projectDetail.jsx +++ b/src/glcc/project/component/projectDetail.jsx @@ -4,13 +4,13 @@ import Nodata from '../../../forge/Nodata'; import { useEffect } from 'react'; import { getProjectById } from '../../api'; -export default ({ detail, projectId, applyTaskId, isStudentApplyDate, secondStudentApplyDate, showTask=true, applyTask, id }) => { +export default ({ detail, projectId, applyTaskId, period, showTask=true, applyTask, id, round }) => { const [info, setInfo] = useState(detail); useEffect(()=>{ if(!detail && projectId){ // 通过项目Id查询项目详情 - getProjectById(projectId).then(response=>{ + getProjectById(projectId, {round}).then(response=>{ if(response && response.message === 'success'){ setInfo(response.data) } @@ -43,9 +43,9 @@ export default ({ detail, projectId, applyTaskId, isStudentApplyDate, secondStud {/* 课题申请时间范围内: 申请课题 */} {/* 第一次报名 */} - {isStudentApplyDate && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && } + {period === "stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && } {/* 第二次报名 锁定状态 */} - {secondStudentApplyDate && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && (item.locked ? : )} + {period === "stuApply1" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && (item.locked ? : )} {/* 查看课题详情按钮 */} diff --git a/src/glcc/project/index.jsx b/src/glcc/project/index.jsx index 13988dfe0..32bbe7315 100644 --- a/src/glcc/project/index.jsx +++ b/src/glcc/project/index.jsx @@ -28,7 +28,10 @@ function Project(propsF) { return(
- +
+ +
学生报名时间: {id === '2023' ? '2023年6月4日-6月21日' : '2022年5月26日-6月24日'}
+
课题列表 项目列表 @@ -54,13 +57,13 @@ function Project(propsF) { ( - + )} > ( - + )} > diff --git a/src/glcc/project/index.scss b/src/glcc/project/index.scss index 8f07e342b..f7bda699d 100644 --- a/src/glcc/project/index.scss +++ b/src/glcc/project/index.scss @@ -226,4 +226,21 @@ border-color: #1140ff; color: #1140ff; } +} +.projectBannerBox{ + position: relative; + .stuApplytimeBox{ + background-image: url('../img/studentProject1.png'); + position: absolute; + color: #FFDC95; + font-size: 20px; + bottom: 28%; + left: 50%; + margin-left: -250px; + width: 500px; + height: 60px; + line-height: 60px; + text-align: center; + background-size: 100% 100%; + } } \ No newline at end of file diff --git a/src/glcc/project/projectList/index.jsx b/src/glcc/project/projectList/index.jsx index 70e1524ce..ab303c2d4 100644 --- a/src/glcc/project/projectList/index.jsx +++ b/src/glcc/project/projectList/index.jsx @@ -7,10 +7,11 @@ import ProjectDetail from '../component/projectDetail'; import bgPng from "../../img/bgPng.png"; import logo from "../../img/logo.png"; import star from "../../img/star.png"; +import Nodata from '../../../forge/Nodata'; const { Search } = Input; // 项目列表 -function ProjectList({ applyTaskId, isStudentApplyDate, location, match, secondStudentApplyDate, applyTask, round, match:{params:{id}}}) { +function ProjectList({ applyTaskId, location, match, applyTask, round, period, match:{params:{id}}}) { let gitlinkLastUrl = match.params.gitlinkLastUrl && match.params.gitlinkLastUrl.replace(/\./g, ''); let openmmlab = location.search && location.search.split('=')[1]; // 输入搜索框 @@ -62,7 +63,7 @@ function ProjectList({ applyTaskId, isStudentApplyDate, location, match, secondS } setLoading(false); }) - }, [keyword]) + }, [keyword, round]) function changeVisible(visible, item) { if (visible) { @@ -84,7 +85,7 @@ function ProjectList({ applyTaskId, isStudentApplyDate, location, match, secondS onVisibleChange={(visible) => { changeVisible(visible, item) }} key={index} placement={(index + 1) % 3 === 0 ? 'bottomRight' : (index + 1) % 3 % 2 === 0 ? 'bottom' : 'bottomLeft'} - content={} + content={} trigger='click' overlayClassName='projectItemPopover' autoAdjustOverflow={false} @@ -101,6 +102,7 @@ function ProjectList({ applyTaskId, isStudentApplyDate, location, match, secondS })}
+ {data && !data.length &&
}
diff --git a/src/glcc/project/taskDetail/index.jsx b/src/glcc/project/taskDetail/index.jsx index 941d895dd..bd678b75a 100644 --- a/src/glcc/project/taskDetail/index.jsx +++ b/src/glcc/project/taskDetail/index.jsx @@ -7,7 +7,7 @@ import './index.scss'; // 课题列表 function TaskDetail(props) { - const {match, location, isStudentApplyDate, secondStudentApplyDate, applyTaskId, applyTask, match:{params:{id}}} = props + const {match, location, period, applyTaskId, applyTask, match:{params:{id}}} = props const taskId = Number(match.params.taskId); const [detail, setDetail] = useState(undefined); @@ -52,9 +52,9 @@ function TaskDetail(props) { {/* 课题申请时间范围内: 申请课题 */} {/* 第一次报名 */} - {isStudentApplyDate && !(applyTaskId && Object.keys(applyTaskId).includes(taskId.toString())) && } + {period==="stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(taskId.toString())) && } {/* 第二次报名 锁定状态 */} - {secondStudentApplyDate && !(applyTaskId && Object.keys(applyTaskId).includes(taskId.toString())) && (detail.locked ? : )} + {period === "stuApply1" && !(applyTaskId && Object.keys(applyTaskId).includes(taskId.toString())) && (detail.locked ? : )}
diff --git a/src/glcc/project/taskList/index.jsx b/src/glcc/project/taskList/index.jsx index a1a017dfa..26f36eb09 100644 --- a/src/glcc/project/taskList/index.jsx +++ b/src/glcc/project/taskList/index.jsx @@ -7,7 +7,7 @@ import bgPng from "../../img/bgPng.png"; const { Search } = Input; // 课题列表 -function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDialog, isStudentApplyDate, secondStudentApplyDate,cancelCount,showNotification, applyTask, round, match:{params:{id}}}) { +function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDialog,cancelCount,showNotification, applyTask, round, match:{params:{id}}, period }) { const [visible, setVisible] = useState(false); const [deleteTaskId, setDeleteTaskId] = useState(undefined); // 输入搜索框 @@ -36,13 +36,13 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial {applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && {window.location.href=`/glcc/student/apply/${item.id}`}}>报名详情} {/* 取消按钮5.26-6.25 */} - {applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && isStudentApplyDate && {deleteItem(item.id)}}>} + {(period === "stuApply" || period === "stuApply1") && applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && {deleteItem(item.id)}}>} {/* 课题申请时间范围内: 申请课题 */} {/* 第一次报名 */} - {isStudentApplyDate && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && {applyTask(item.id)}}>申请课题} + {period === "stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && {applyTask(item.id)}}>申请课题} {/* 第二次报名 锁定状态 */} - {secondStudentApplyDate && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && (item.locked ? 申请课题 : {applyTask(item.id, item.locked)}}>申请课题)} + {period === "stuApply1" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && (item.locked ? 申请课题 : {applyTask(item.id, item.locked)}}>申请课题)}
) }) @@ -71,7 +71,7 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial } const expandRow = (record) => { - return + return } // 展开收起行回调 @@ -90,7 +90,8 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial const id = []; id.push(applyTaskId[deleteTaskId]); const params = { - ids: id + ids: id, + round } cancelTaskApply(params).then(response=>{ if(response && response.message === "success"){ @@ -144,7 +145,7 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial } setLoading(false); }) - }, [keyword, current, pageSize, applyTaskId, apply]) + }, [keyword, current, pageSize, applyTaskId, apply, round]) return (
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', [], - {gradeList.map(item => { return })} )} @@ -463,7 +460,7 @@ function Apply(props) { [{ required: true, message: "请正确输入联系电话" }, { max: 14, message: '超出限制长度14位字符,请重新编辑' }, { pattern: /(^(\d{3,4}-)?\d{7,8})$|([1][3,4,5,6,7,8,9][0-9]{9})/, message: '请正确输入联系电话' }], - { verify("phone") }} className={"disabledInput"} disabled /> + { verify("phone") }} className={editable ? "" : "disabledInput"} disabled={editable ? false : true} /> )} {helper('邮箱地址', '', @@ -473,7 +470,7 @@ function Apply(props) { { required: true, message: "请输入邮箱地址" }, { max: 50, message: '超出限制长度50位字符,请重新编辑' }, ], - { verify("mail") }} className={"disabledInput"} disabled /> + { verify("mail") }} className={editable ? "" : "disabledInput"} disabled={editable ? false : true} /> )}
{helper('学生证明', @@ -488,7 +485,6 @@ function Apply(props) { accept=".png,.jpg,.jpeg" beforeUpload={beforeUpload} onChange={handleChange} - disabled > {imageUrl ? avatar : userApplyInfo && userApplyInfo.proveAttachmentId ?
:
@@ -505,7 +501,7 @@ function Apply(props) {

课题信息({i + 1}) {/* {myTaskList.length > 1 && { deleteTask(i) }}>删除} */}

- {item.status == 1 && item.auditRemark &&
+ {item.status === 1 && item.auditRemark &&
欢迎您报名CCF GitLink开源编程夏令营,感谢您对GLCC项目及课题的关注和支持!本次您的报名信息未通过初审,原因如下:
希望您尽快修改并重新提交报名信息,我们将再次审核,万分感谢!
@@ -518,8 +514,10 @@ function Apply(props) { placeholder="请选择课题名称" dropdownClassName="glcc_select" showSearch - disabled - className={"disabledInput"} + className={!editable || (item.id && item.status !== 1) ? "disabledInput" : ""} + disabled={!editable || (item.id && item.status !== 1)} + // disabled + // className={"disabledInput"} filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) > -1} onBlur={() => { verify("taskId" + i) }} onChange={(val) => { changeTaskItem("taskId", val, i) }} @@ -542,8 +540,9 @@ function Apply(props) { 6、提示:文本框表达内容有限,建议您提供内容的pdf或url链接方式展示更精彩的陈述" onBlur={(e) => { verify("memo" + i); changeTaskItem("memo", e.currentTarget.value, i) }} rows={7} - className={!(isStudentApplyDate && !item.id) ? "memoText disabledInput" : "memoText"} - disabled={!(isStudentApplyDate && !item.id)} /> + className={!editable || (item.id && item.status !== 1) ? "memoText disabledInput" : "memoText"} + disabled={!editable || (item.id && item.status !== 1)} + /> )}
{helper('附件', @@ -562,7 +561,7 @@ function Apply(props) { downloadIcon: , showRemoveIcon: true }} - disabled={!(isStudentApplyDate && !item.id)} + disabled={!editable || (item.id && item.status !== 1)} >
上传自荐书
@@ -573,27 +572,27 @@ function Apply(props) { } { - // myTaskList.length < 2 && + myTaskList.length < 2 && } { - // myTaskList.length >= 2 && 对您而言,哪个课题的优先级更高?注:优先级将决定您申请课题的入选顺序,若申请的2个课题同时通过审核,将以高优先级的课题作为入选标准} - // > - // {getFieldDecorator("enrollFirst", { - // rules: [{ required: true, message: "请选择课题优先级" },] - // })( - // - // 课题一 - // 课题二 - // 课题三 - // - // )} - // + myTaskList.length >= 2 && 对您而言,哪个课题的优先级更高?注:优先级将决定您申请课题的入选顺序,若申请的课题同时通过审核,将以高优先级的课题作为入选标准} + > + {getFieldDecorator("enrollFirst", { + rules: [{ required: true, message: "请选择课题优先级" },] + })( + + 课题一 + 课题二 + {myTaskList.length === 3 && 课题三} + + )} + } - {!studentApplyEnd && - + {(period === "stuApply" || period === "stuApply1") && + }