保留导师报名通道

This commit is contained in:
谢思 2023-06-06 09:44:58 +08:00
parent 379a02da3a
commit 0ac20c7109
2 changed files with 25 additions and 16 deletions

View File

@ -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

View File

@ -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);
},[])