forked from Gitlink/forgeplus-react
保留导师报名通道
This commit is contained in:
parent
379a02da3a
commit
0ac20c7109
|
|
@ -86,6 +86,8 @@ const Glcc = (propsF) => {
|
|||
const [glccSettings, setGLccSetting] = useState(undefined);
|
||||
// 是否展示项目、课题列表入口
|
||||
const [repoPublic, setRepoPublic] = useState(false);
|
||||
// 是否处于项目/课题补录阶段
|
||||
const [applyRepo, setApplyRepo] = useState(false);
|
||||
|
||||
useEffect(()=>{
|
||||
if(id && id === "2022"){
|
||||
|
|
@ -101,8 +103,11 @@ const Glcc = (propsF) => {
|
|||
// 判断是否展示项目、课题
|
||||
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 repoApply1 = res.data.filter(item=>item.name === "repoApply1");
|
||||
repoApply1[0] && setApplyRepo(judge(nowTime, repoApply1[0].value, "range"))
|
||||
// 过滤掉 项目课题公示时间、项目/课题补录
|
||||
const filterRepoPublic = res.data.filter(item=>["repoPublic", "repoApply1"].indexOf(item.name) === -1);
|
||||
const periodIndex = filterRepoPublic.findIndex(item=>judge(nowTime, item.value, "range"));
|
||||
periodIndex !== -1 && setPeriod(filterRepoPublic[periodIndex].name);
|
||||
}
|
||||
|
|
@ -188,12 +193,12 @@ const Glcc = (propsF) => {
|
|||
<div className="newMain clearfix">
|
||||
<Switch {...propsF}>
|
||||
{/* 学生报名 */}
|
||||
<Route
|
||||
{period === "stuApply" && <Route
|
||||
path="/glcc/student/apply/:taskId"
|
||||
render={(props) => (
|
||||
<Student {...propsF} {...props} round={round} period={period} isGlccApplyDate={isGlccApplyDate} setStudentInfoReset={setStudentInfoReset}/>
|
||||
)}
|
||||
></Route>
|
||||
></Route>}
|
||||
{/* 开源夏令营报名页面 */}
|
||||
{period === "repoApply" && <Route
|
||||
path="/glcc/apply"
|
||||
|
|
@ -201,6 +206,13 @@ const Glcc = (propsF) => {
|
|||
<Apply round={round} {...propsF} {...props}/>
|
||||
)}
|
||||
></Route>}
|
||||
{/* 导师报名课题路由通道 */}
|
||||
{applyRepo && <Route
|
||||
path="/glcc/sign"
|
||||
render={(props) => (
|
||||
<Apply round={round} {...propsF} {...props}/>
|
||||
)}
|
||||
></Route>}
|
||||
{/* 教师审核 */}
|
||||
<Route
|
||||
path="/glcc/mentoradmin"
|
||||
|
|
@ -215,27 +227,27 @@ const Glcc = (propsF) => {
|
|||
<Help {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
{!(round === 2 && !repoPublic) && <Route
|
||||
path="/glcc/:id/subjects/detail/:taskId"
|
||||
render={(props) => (
|
||||
<TaskDetail {...propsF} {...props} applyTaskId={applyTaskId} applyTask={applyTask} period={period}/>
|
||||
)}
|
||||
></Route>
|
||||
></Route>}
|
||||
{/* 项目/课题列表 */}
|
||||
<Route
|
||||
{!(round === 2 && !repoPublic) && <Route
|
||||
path="/glcc/:id/projects"
|
||||
render={(props) => (
|
||||
<Project repoPublic={repoPublic} period={period} round={round} {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} applyTask={applyTask}/>
|
||||
<Project period={period} round={round} {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} applyTask={applyTask}/>
|
||||
)}
|
||||
></Route>
|
||||
></Route>}
|
||||
|
||||
{/* 课题列表 */}
|
||||
<Route
|
||||
{!(round === 2 && !repoPublic) && <Route
|
||||
path="/glcc/:id/subjects"
|
||||
render={(props) => (
|
||||
<Project repoPublic={repoPublic} period={period} round={round} {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} cancelCount={cancelCount} applyTask={applyTask}/>
|
||||
<Project period={period} round={round} {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} cancelCount={cancelCount} applyTask={applyTask}/>
|
||||
)}
|
||||
></Route>
|
||||
></Route>}
|
||||
|
||||
{/* openmmlab列表 */}
|
||||
<Route
|
||||
|
|
|
|||
|
|
@ -20,11 +20,8 @@ const TaskList = Loadable({
|
|||
});
|
||||
|
||||
function Project(propsF) {
|
||||
const {location, match:{params:{id}}, repoPublic, history} = propsF;
|
||||
const {location, match:{params:{id}}} = propsF;
|
||||
const {pathname} = location;
|
||||
if(id==="2023" && !repoPublic){
|
||||
history.push('/glcc')
|
||||
}
|
||||
useEffect(()=>{
|
||||
window.scrollTo(0, 0);
|
||||
},[])
|
||||
|
|
|
|||
Loading…
Reference in New Issue