This commit is contained in:
caishi 2023-05-31 14:58:03 +08:00
commit 18595a4802
17 changed files with 205 additions and 172 deletions

View File

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

View File

@ -74,7 +74,7 @@ function Apply(props) {
{userApplyInfo.length > 0 && <div className='applySuccess mt20 font-15'>您已报名成功可实时修改您的报名信息再次提交请关注夏令营首页新闻公告获得更多活动资讯!</div>}
<div className={`explain`}>
<p className='font-15 c000'>申请说明</p>
<div>1项目报名时间为<span className='c000'>4月29日5月30日</span>请在报名截止时间北京时间<span className='c000'>2022年5月30日24点</span>前提交报名信息</div>
<div>1项目报名时间为<span className='c000'>4月29日5月30日</span>请在报名截止时间北京时间<span className='c000'>2023年5月30日24点</span>前提交报名信息</div>
<div>2本次GLCC夏令营建议使用GitLink为代码托管平台学生基于GitLink上项目完成编程任务同时也欢迎使用其他代码托管平台的项目参与活动目前GLCC只对夏令营期间使用GitLink托管的项目提供部分资金支持</div>
<div>3如果您的项目还未迁移到GitLink上迁移事项请查看<a href='https://forum.gitlink.org.cn/forums/7296/detail' target="_blank" className='link'>迁移说明文档</a>如在迁移过程中遇到问题请加qq群: 1071514693 联系qq群管理员</div>
<div>4提交社区和题目信息后欢迎与组委会联系沟通宣传推广和后续合作工作联系人微信: _TigerWang备注GitLink编程夏令营</div>

View File

@ -19,9 +19,10 @@ import { hasAuditRole } from '../api';
import './index.scss';
// round20221 20232
// 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 && <div className="applyBox">
{/* 项目报名入口 */}
{period === 0 && <a onClick={()=>{gotoCheckLogin(`/glcc/apply`)}} className="apply project" >
{period === "repoApply" && <a onClick={()=>{gotoCheckLogin(`/glcc/apply`)}} className="apply project" >
<div>
<img src={apply1} alt="" className="applyIcon" />
<span className="hover-none"><span className="til">项目报名</span> </span>
@ -116,6 +117,24 @@ export default (props) => {
</div>
<div className="pt6">项目报名开启导师席位虚位以待</div>
</a>}
{/* 查看项目、课题 */}
{repoPublic && <Link to={`/glcc/${id}/projects`} className="apply project" >
<div>
<img src={apply1} alt="" className="applyIcon" />
<span className="hover-none"><span className="til">查看项目</span> </span>
</div>
<div className="pt6">掌握项目课题详细信息</div>
</Link>}
{/* 学生报名6.24结束第一次报名6.29 1:00 - 6.30 24:00第二次报名 */}
{(period === "stuApply" || period === "stuApply1") && <div className="apply" onClick={()=>{gotoCheckLogin(`/glcc/${id}/subjects`)}}>
<div>
<img src={apply2} alt="" className="applyIcon" />
<span className="til">学生报名</span>
</div>
<div className="pt6">选择课题开启您的开源之旅</div>
</div>}
{/* 6.28.-7.1 审核结果仅对导师可见7.1之后对所有用户可见*/}
{/* {resultTime2 && <div className="apply" onClick={goToCheckResult}>
<div>
@ -150,23 +169,6 @@ export default (props) => {
<div className="pt6">结项课题考核结果公示</div>
</Link>} */}
{/* 项目报名 */}
{/* <Link to="/glcc/projects" className="apply project" >
<div>
<img src={apply1} alt="" className="applyIcon" />
<span className="hover-none"><span className="til">查看项目</span> </span>
</div>
<div className="pt6">掌握项目课题详细信息</div>
</Link> */}
{/* 学生报名6.24结束第一次报名6.29 1:00 - 6.30 24:00第二次报名 */}
{/* <div className="apply" onClick={goToStudent}>
<div>
<img src={apply2} alt="" className="applyIcon" />
<span className="til">学生报名</span>
</div>
<div className="pt6">选择课题开启您的开源之旅</div>
</div> */}
{/* 导师审核 */}
{/* {hasRole && new Date().getTime() < new Date('2022/07/01 0:0').getTime() && <div className="apply" onClick={goToCheck}>
<div>
@ -197,7 +199,7 @@ export default (props) => {
</div>}
</div>
</div>
<Lightspot period={period} history={history} current_user={current_user} round={round} showLoginDialog={showLoginDialog}/>
<Lightspot id={id} period={period} history={history} current_user={current_user} round={round} showLoginDialog={showLoginDialog}/>
<TimerShaft round={round} glccSettings={glccSettings}/>
<Award />
<News />

View File

@ -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) {
<div className="teacher-text">
<h3 className="teacher-invite">有兴趣成为GLCC的导师吗</h3>
<div className="teacher-content">想要扩大项目知名度和影响力为开源项目吸引新鲜血液培养长期开发者通过GitLink平台与高校建立连接指导开源新人传授他们的开源文化享受开源的乐趣</div>
{period === 0 && round === 2 ? <div className='applyBut' onClick={goToApply}>立即报名</div> : <div className='applyBut project'><span className='hover-none'>项目报名</span><span className='hover-show'>{period === -1 ? "敬请期待" : "已结束"}</span></div>}
{period === "repoApply" && round === 2 ? <div className='applyBut' onClick={goToApply}>立即报名</div> : <div className='applyBut project'><span className='hover-none'>项目报名</span><span className='hover-show'>已结束</span></div>}
</div>
<div className="teacher-text">
<h3 className="teacher-invite">你是开源新手有兴趣参加GLCC吗</h3>
<div className="teacher-content">想要参与一线开源项目开发熟悉开源社区运作流程接受资深开源软件专家指导获得丰厚奖金和实习机会参加GLCC开启全新的开源之旅</div>
{period === 2 && round === 2 ? <div className='applyBut' onClick={goToApply}>学生报名</div> : <div className='applyBut project'><span className='hover-none'>学生报名</span><span className='hover-show'>{period<2 && round === 2 ? "敬请期待" : "已结束"}</span></div>}
{(period === "stuApply" || period === "stuApply1") && round === 2 ? <div className='applyBut' onClick={goToApply}>学生报名</div> : <div className='applyBut project'><span className='hover-none'>学生报名</span><span className='hover-show'>{period === "repoApply" && round === 2 ? "敬请期待" : "已结束"}</span></div>}
</div>
</div>

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 KiB

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

View File

@ -80,10 +80,12 @@ const Glcc = (propsF) => {
const {current_user, showLoginDialog, match:{params:{id}}} = propsF;
// round20221 20232
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]
}
// 415~520
@ -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) => {
<Route
path="/glcc/student/apply/:taskId"
render={(props) => (
<Student {...propsF} {...props} isGlccApplyDate={isGlccApplyDate} setStudentInfoReset={setStudentInfoReset}/>
<Student {...propsF} {...props} round={round} period={period} isGlccApplyDate={isGlccApplyDate} setStudentInfoReset={setStudentInfoReset}/>
)}
></Route>
{/* 开源夏令营报名页面 */}
{period === 0 && <Route
{period === "repoApply" && <Route
path="/glcc/apply"
render={(props) => (
<Apply round={round} {...propsF} {...props}/>
@ -210,14 +218,14 @@ const Glcc = (propsF) => {
<Route
path="/glcc/:id/subjects/detail/:taskId"
render={(props) => (
<TaskDetail {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTaskId={applyTaskId} applyTask={applyTask} />
<TaskDetail {...propsF} {...props} applyTaskId={applyTaskId} applyTask={applyTask} period={period}/>
)}
></Route>
{/* 项目/课题列表 */}
<Route
path="/glcc/:id/projects"
render={(props) => (
<Project 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>
@ -225,7 +233,7 @@ const Glcc = (propsF) => {
<Route
path="/glcc/:id/subjects"
render={(props) => (
<Project {...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>
@ -273,7 +281,7 @@ const Glcc = (propsF) => {
<Route
path="/glcc/:id"
render={(props) => (
<Home period={period} round={round} {...propsF} {...props} studentApplyStart={studentApplyStart} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} checkedTaskId={checkedTaskId} checkTime1={checkTime1} checkTime2={checkTime2} checkTime3={checkTime3} glccSettings={glccSettings}/>
<Home repoPublic={repoPublic} period={period} round={round} {...propsF} {...props} studentApplyStart={studentApplyStart} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} checkedTaskId={checkedTaskId} checkTime1={checkTime1} checkTime2={checkTime2} checkTime3={checkTime3} glccSettings={glccSettings}/>
)}
></Route>
@ -281,7 +289,7 @@ const Glcc = (propsF) => {
<Route
path="/glcc"
render={(props) => (
<Home period={period} round={round} {...propsF} {...props} studentApplyStart={studentApplyStart} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} checkedTaskId={checkedTaskId} checkTime1={checkTime1} checkTime2={checkTime2} checkTime3={checkTime3} glccSettings={glccSettings}/>
<Home repoPublic={repoPublic} period={period} round={round} {...propsF} {...props} studentApplyStart={studentApplyStart} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} checkedTaskId={checkedTaskId} checkTime1={checkTime1} checkTime2={checkTime2} checkTime3={checkTime3} glccSettings={glccSettings}/>
)}
></Route>

View File

@ -26,7 +26,7 @@ export default ({ detail, projectId, applyTaskId, isStudentApplyDate, secondStud
{info.registrationTaskList && info.registrationTaskList.length > 0 ? info.registrationTaskList.map((item, index)=>{
return <div className='taskItem mt15' key={index}>
<div className="left">
<div className="taskTitle" onClick={()=>{window.location.href=`/glcc/subjects/detail/${item.id}`}}><Tooltip title={item.taskName}>{item.taskName}</Tooltip></div>
<div className="taskTitle" onClick={()=>{window.location.href=`/glcc/2022/subjects/detail/${item.id}`}}><Tooltip title={item.taskName}>{item.taskName}</Tooltip></div>
<div className='mt15 oneLine leftWidth'>导师姓名: &nbsp;&nbsp;{item.tutorName}</div>
{item.tutorMail && <div className='mb15 email oneLine leftWidth'>邮箱地址: &nbsp;&nbsp;<span><Tooltip title={item.tutorMail}>{item.tutorMail}</Tooltip></span></div>}
</div>

View File

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

View File

@ -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())) && <Button type='primary' className='applyBut mr10' onClick={()=>{applyTask(item.id)}}>申请课题</Button>}
{period === "stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && <Button type='primary' className='applyBut mr10' onClick={()=>{applyTask(item.id)}}>申请课题</Button>}
{/* 第二次报名 锁定状态 */}
{secondStudentApplyDate && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && (item.locked ? <Tooltip title={"该课题已有学生入选"}><Button type='primary' className='mr10' disabled>申请课题</Button></Tooltip> : <Button type='primary' className='applyBut mr10' onClick={()=>{applyTask(item.id)}}>申请课题</Button>)}
{period === "stuApply1" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && (item.locked ? <Tooltip title={"该课题已有学生入选"}><Button type='primary' className='mr10' disabled>申请课题</Button></Tooltip> : <Button type='primary' className='applyBut mr10' onClick={()=>{applyTask(item.id)}}>申请课题</Button>)}
{/* 查看课题详情按钮 */}
<Button onClick={()=>{window.open(`/glcc/${id}/subjects/detail/${item.id}`)}} className='lookDetail'>课题详情</Button>

View File

@ -28,7 +28,10 @@ function Project(propsF) {
return(
<div className="glcc_project">
<img className="glcc-banner" src={banner} alt=''></img>
<div className='projectBannerBox'>
<img className="glcc-banner" src={banner} alt=''></img>
<div className='stuApplytimeBox'>学生报名时间: {id === '2023' ? '2023年6月4日-6月21日' : '2022年5月26日-6月24日'}</div>
</div>
<div className='head'>
<Link to={`/glcc/${id}/subjects`} className={!pathname.endsWith('projects') ? 'active' : ''}>课题列表</Link>
<Link to={`/glcc/${id}/projects`} className={pathname.endsWith('projects') ? 'active' : ''}>项目列表</Link>
@ -54,13 +57,13 @@ function Project(propsF) {
<Route
path="/glcc/:id/subjects"
render={(props) => (
<TaskList {...propsF} {...props}/>
<TaskList {...propsF} {...props}/>
)}
></Route>
<Route
path="/glcc/:id/student"
render={(props) => (
<TaskList {...propsF} {...props}/>
<TaskList {...propsF} {...props}/>
)}
></Route>
</Switch>

View File

@ -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%;
}
}

View File

@ -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={<ProjectDetail id={id} detail={item} applyTaskId={applyTaskId} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTask={applyTask}/>}
content={<ProjectDetail id={id} detail={item} applyTaskId={applyTaskId} applyTask={applyTask} period={period} round={round}/>}
trigger='click'
overlayClassName='projectItemPopover'
autoAdjustOverflow={false}
@ -101,6 +102,7 @@ function ProjectList({ applyTaskId, isStudentApplyDate, location, match, secondS
</Popover>
})}
</div>
{data && !data.length && <div style={{paddingBottom: '50px'}}><Nodata _html="暂无数据"/></div>}
</Spin>
</div>
<img src={bgPng} alt='' className='bgPng3' />

View File

@ -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())) && <Button type='primary' className='applyBut detailBut' onClick={()=>{applyTask(taskId)}}>申请课题</Button>}
{period==="stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(taskId.toString())) && <Button type='primary' className='applyBut detailBut' onClick={()=>{applyTask(taskId)}}>申请课题</Button>}
{/* 第二次报名 锁定状态 */}
{secondStudentApplyDate && !(applyTaskId && Object.keys(applyTaskId).includes(taskId.toString())) && (detail.locked ? <Tooltip title={"该课题已有学生入选"}><Button type='primary' className='mr10 detailBut' disabled>申请课题</Button></Tooltip> : <Button type='primary' className='applyBut mr10 detailBut' onClick={()=>{applyTask(taskId)}}>申请课题</Button>)}
{period === "stuApply1" && !(applyTaskId && Object.keys(applyTaskId).includes(taskId.toString())) && (detail.locked ? <Tooltip title={"该课题已有学生入选"}><Button type='primary' className='mr10 detailBut' disabled>申请课题</Button></Tooltip> : <Button type='primary' className='applyBut mr10 detailBut' onClick={()=>{applyTask(taskId)}}>申请课题</Button>)}
</div>
<img src={bgPng} alt='' className='bgPng1'/>
<img src={bgPng} alt='' className='bgPng2'/>

View File

@ -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()) && <span onClick={()=>{window.location.href=`/glcc/student/apply/${item.id}`}}><i className='iconfont icon-baomingxiangqingicon mr5'></i>报名详情</span>}
{/* 取消按钮5.26-6.25 */}
{applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && isStudentApplyDate && <Tooltip title={"取消申请"}><i className='iconfont icon-shanchuicon3 ml20 cancelApply' onClick={()=>{deleteItem(item.id)}}></i></Tooltip>}
{(period === "stuApply" || period === "stuApply1") && applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && <Tooltip title={"取消申请"}><i className='iconfont icon-shanchuicon3 ml20 cancelApply' onClick={()=>{deleteItem(item.id)}}></i></Tooltip>}
{/* 课题申请时间范围内: 申请课题 */}
{/* 第一次报名 */}
{isStudentApplyDate && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && <span onClick={()=>{applyTask(item.id)}}><i className='iconfont icon-shenqingketiicon applyTask mr5'></i><span className='applyTask'>申请课题</span></span>}
{period === "stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && <span onClick={()=>{applyTask(item.id)}}><i className='iconfont icon-shenqingketiicon applyTask mr5'></i><span className='applyTask'>申请课题</span></span>}
{/* 第二次报名 锁定状态 */}
{secondStudentApplyDate && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && (item.locked ? <Tooltip title={"该课题已有学生入选"}><span className='disabled'><i className='iconfont icon-shenqingketiicon mr5 disabled'></i><span className='disabled'>申请课题</span></span></Tooltip> : <span onClick={()=>{applyTask(item.id, item.locked)}}><i className='iconfont icon-shenqingketiicon applyTask mr5'></i><span className='applyTask'>申请课题</span></span>)}
{period === "stuApply1" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && (item.locked ? <Tooltip title={"该课题已有学生入选"}><span className='disabled'><i className='iconfont icon-shenqingketiicon mr5 disabled'></i><span className='disabled'>申请课题</span></span></Tooltip> : <span onClick={()=>{applyTask(item.id, item.locked)}}><i className='iconfont icon-shenqingketiicon applyTask mr5'></i><span className='applyTask'>申请课题</span></span>)}
</div>
)
})
@ -71,7 +71,7 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
}
const expandRow = (record) => {
return <ProjectDetail id={id} detail={null} projectId={record.regId} applyTaskId={applyTaskId} current_user={current_user} showLoginDialog={showLoginDialog} isStudentApplyDate={isStudentApplyDate} showNotification={showNotification} secondStudentApplyDate={secondStudentApplyDate} applyTask={applyTask}/>
return <ProjectDetail id={id} detail={null} projectId={record.regId} applyTaskId={applyTaskId} current_user={current_user} showLoginDialog={showLoginDialog} period={period} showNotification={showNotification} applyTask={applyTask} round={round}/>
}
//
@ -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 (
<div className="taskList listBox">

View File

@ -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)=>{
// registrationStudentTaskListround
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) {
<div className='apply'>
<Breadcrumb className='glcc_breadcrumb font-16'>
<Breadcrumb.Item><Link to="/glcc">开源夏令营</Link></Breadcrumb.Item>
<Breadcrumb.Item><Link to="/glcc/subjects">课题及项目列表</Link></Breadcrumb.Item>
<Breadcrumb.Item><Link to="/glcc/2023/subjects">课题及项目列表</Link></Breadcrumb.Item>
<Breadcrumb.Item style={{ color: '#202D40' }}>学生报名</Breadcrumb.Item>
</Breadcrumb>
<div className="head_introduce">
<h4 className="head_tit">申请说明</h4>
<div className="head_content">1学生报名时间为<span className="head_bold">2022年5月26日-6月24</span>请在报名截止时间北京时间<span className="head_bold">2022年6月24日24点</span>前提交报名信息</div>
<div className="head_content">1学生报名时间为<span className="head_bold">2023年6月4日-6月21</span>请在报名截止时间北京时间<span className="head_bold">2023年6月21日24点</span>前提交报名信息</div>
<div className="head_content">2本次GLCC夏令营基于GitLink代码托管平台完成编程任务若您没有平台账户请先注册后完成课题申请</div>
<div className="head_content">3每位学员最多可申请2个课题至多有且仅有1个课题可以入选</div>
<div className="head_content">4提交申请后每位学员可实时修改自己的报名信息但仅具有两次取消申请课题的机会请谨慎选择课题或取消课题</div>
<div className="head_content">3每位学员最多可申请2个课题有且仅有1个课题可以入选</div>
<div className="head_content">4每个学生有且仅有两次取消申请课题的机会请谨慎选择课题或取消课题</div>
<div className="head_content">5建议在提交课题申请与课题导师邮件沟通详细了解课题描述编码任务技能要求&编程语言预期产出结果等信息以便您能够选择最适合的课题</div>
<div className="head_content">6提交申请后请耐心等待我们会在2022年7月1日公布入围结果如有任何问题请添加开源夏令营QQ群210174286进行咨询</div>
<div className="head_content">6提交申请后请耐心等待我们会在2023年7月1日公布入围结果如有任何问题请添加开源夏令营QQ群210174286进行咨询</div>
</div>
<div className="main-tit">
<img src={studentSvg} alt='' /><span className="tit-text">学生报名</span>
@ -427,33 +424,33 @@ function Apply(props) {
'studentName',
[{ required: true, message: "请正确输入学生姓名" },
{ max: 32, message: '超出限制长度32位字符请重新编辑' }],
<Input placeholder="请输入学生姓名" onBlur={() => { verify("studentName") }} className={"disabledInput"} disabled />
<Input placeholder="请输入学生姓名" onBlur={() => { verify("studentName") }} className={editable ? "" : "disabledInput"} disabled={editable ? false : true} />
)}
{helper('所在高校',
'',
'school',
[{ required: true, message: "请正确输入所在高校" },
{ max: 32, message: '超出限制长度32位字符请重新编辑' }],
<Input placeholder="请输入所在高校" onBlur={() => { verify("school") }} className={"disabledInput"} disabled />
<Input placeholder="请输入所在高校" onBlur={() => { verify("school") }} className={editable ? "" : "disabledInput"} disabled={editable ? false : true}/>
)}
{helper('所学专业',
'',
'profession',
[{ max: 32, message: '超出限制长度32位字符请重新编辑' }],
<Input placeholder="请输入所学专业" onBlur={() => { verify("profession") }} className={"disabledInput"} disabled />
<Input placeholder="请输入所学专业" onBlur={() => { verify("profession") }} className={editable ? "" : "disabledInput"} disabled={editable ? false : true}/>
)}
<Form.Item label="地区">
{getFieldDecorator("location", {
rules: []
})(
<Cascader expandTrigger="hover" popupClassName="glcc_cascader" placeholder="请选择省份城市" options={locData} className={"disabledInput"} disabled />
<Cascader expandTrigger="hover" popupClassName="glcc_cascader" placeholder="请选择省份城市" options={locData} className={editable ? "" : "disabledInput"} disabled={editable ? false : true}/>
)}
</Form.Item>
{helper('所在年级',
'',
'grade',
[],
<Select placeholder="请选择所在年级" className={"disabledInput"} disabled dropdownClassName="glcc_select">
<Select placeholder="请选择所在年级" className={editable ? "" : "disabledInput"} disabled={editable ? false : true} dropdownClassName="glcc_select">
{gradeList.map(item => { return <Option value={item.name} key={item.id}>{item.name}</Option> })}
</Select>
)}
@ -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: '请正确输入联系电话' }],
<Input placeholder="请输入联系电话" onBlur={() => { verify("phone") }} className={"disabledInput"} disabled />
<Input placeholder="请输入联系电话" onBlur={() => { verify("phone") }} className={editable ? "" : "disabledInput"} disabled={editable ? false : true} />
)}
{helper('邮箱地址',
'',
@ -473,7 +470,7 @@ function Apply(props) {
{ required: true, message: "请输入邮箱地址" },
{ max: 50, message: '超出限制长度50位字符请重新编辑' },
],
<Input placeholder="请输入邮箱地址" onBlur={() => { verify("mail") }} className={"disabledInput"} disabled />
<Input placeholder="请输入邮箱地址" onBlur={() => { verify("mail") }} className={editable ? "" : "disabledInput"} disabled={editable ? false : true} />
)}
<div className='introArea update_item'>{helper('学生证明',
@ -488,7 +485,6 @@ function Apply(props) {
accept=".png,.jpg,.jpeg"
beforeUpload={beforeUpload}
onChange={handleChange}
disabled
>
{imageUrl ? <img src={imageUrl} alt="avatar" style={{ maxWidth: '100px', maxHeight: '100px' }} /> : userApplyInfo && userApplyInfo.proveAttachmentId ?
<div><img src={`${getUrl()}/api/attachments/${userApplyInfo.proveAttachmentId}`} alt='' style={{ maxWidth: '100px' }} /></div> : <div>
@ -505,7 +501,7 @@ function Apply(props) {
<h4 className="item-tit">课题信息<span className="item-tit-num">{i + 1}</span>)
{/* {myTaskList.length > 1 && <span className="delete" onClick={() => { deleteTask(i) }}><i className="iconfont icon-shanchu mr5"></i>删除</span>} */}
</h4>
{item.status == 1 && item.auditRemark && <div className="reject-reason">
{item.status === 1 && item.auditRemark && <div className="reject-reason">
<div className="mb5"><i className="iconfont icon-shanchudiao"></i>欢迎您报名CCF GitLink开源编程夏令营感谢您对GLCC项目及课题的关注和支持本次您的报名信息未通过初审原因如下</div>
<div className="mb5 ml20" dangerouslySetInnerHTML={{ __html: item.auditRemark }}></div>
<div className="mb5 ml20">希望您尽快修改并重新提交报名信息我们将再次审核万分感谢</div>
@ -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)}
/>
)}</div>
<div className='introArea'>{helper('附件',
@ -562,7 +561,7 @@ function Apply(props) {
downloadIcon: <i className="iconfont icon-xiazai-icon"></i>,
showRemoveIcon: true
}}
disabled={!(isStudentApplyDate && !item.id)}
disabled={!editable || (item.id && item.status !== 1)}
>
<div className="glcc_btn" >上传自荐书</div>
</Upload>
@ -573,27 +572,27 @@ function Apply(props) {
}
{
// myTaskList.length < 2 && <Button className="add_task" type="primary" onClick={() => { addTask() }}></Button>
myTaskList.length < 2 && <Button className="add_task mb20" type="primary" onClick={() => { addTask() }}>添加课题</Button>
}
{
// myTaskList.length >= 2 && <Form.Item className="priority"
// label={<Fragment><span className="note">2</span></Fragment>}
// >
// {getFieldDecorator("enrollFirst", {
// rules: [{ required: true, message: "" },]
// })(
// <Radio.Group disabled={studentApplyEnd}>
// <Radio value={0}></Radio>
// <Radio value={1}></Radio>
// <Radio value={2}></Radio>
// </Radio.Group>
// )}
// </Form.Item>
myTaskList.length >= 2 && <Form.Item className="priority"
label={<Fragment>对您而言哪个课题的优先级更高<span className="note">优先级将决定您申请课题的入选顺序若申请的课题同时通过审核将以高优先级的课题作为入选标准</span></Fragment>}
>
{getFieldDecorator("enrollFirst", {
rules: [{ required: true, message: "请选择课题优先级" },]
})(
<Radio.Group disabled={editable ? false : true}>
<Radio value={0}>课题一</Radio>
<Radio value={1}>课题二</Radio>
{myTaskList.length === 3 && <Radio value={2}>课题三</Radio>}
</Radio.Group>
)}
</Form.Item>
}
{!studentApplyEnd && <Form.Item className='subInfo introArea'>
<Button type="primary" htmlType="submit" className='sub' disabled={!(editable && !locked)}>提交</Button>
{(period === "stuApply" || period === "stuApply1") && <Form.Item className='subInfo introArea'>
<Button type="primary" htmlType="submit" className='sub' disabled={editable ? false : true}>提交</Button>
</Form.Item>}
</Form>
</div>