diff --git a/src/AppConfig.js b/src/AppConfig.js index cd3aca3d..b4107e46 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -25,7 +25,7 @@ if (isDev) { } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : window.location.search.indexOf('debug=s') !== -1 ? 'student' : - window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'student' + window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin' } window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/src/glcc/api.js b/src/glcc/api.js index 8c1a13fd..61a02bab 100644 --- a/src/glcc/api.js +++ b/src/glcc/api.js @@ -132,4 +132,13 @@ export function auditPassTask(data) { method: 'post', data }); +} + +// 导师审核结果 +export function getPassList(params) { + return fetch({ + url: '/api/studentApply/passList', + method: 'get', + params, + }); } \ No newline at end of file diff --git a/src/glcc/check/index.jsx b/src/glcc/check/index.jsx index 5b66e803..2eeea262 100644 --- a/src/glcc/check/index.jsx +++ b/src/glcc/check/index.jsx @@ -140,6 +140,9 @@ function Check({ current_user, showNotification, history }) { ]; useEffect(() => { + if(new Date().getTime() > new Date('2022-07-01').getTime()){ + history.push('/403'); + } if (!current_user.user_id) { history.push('/403'); } diff --git a/src/glcc/checkResult/index.jsx b/src/glcc/checkResult/index.jsx new file mode 100644 index 00000000..1108a8bc --- /dev/null +++ b/src/glcc/checkResult/index.jsx @@ -0,0 +1,169 @@ +import React, { useEffect, useState } from 'react'; +import { Input, message, Modal, Table, Tooltip } from 'antd'; +import { cancelTaskApply, getPassList } from '../api'; +import ProjectDetail from '../project/component/projectDetail'; +// 预公示banner +import resultBanner from "../img/resultBanner.png"; +// 公示banner +import resultBanner2 from "../img/resultBanner2.png"; +import bgPng from "../img/bgPng.png"; +import './index.scss'; +import '../project/index.scss'; +const { Search } = Input; + +// 课题列表 +function CheckResult({applyTaskId, setStudentInfoReset, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd,cancelCount,showNotification}) { + const [visible, setVisible] = useState(false); + const [deleteTaskId, setDeleteTaskId] = useState(undefined); + // 输入搜索框 + const [keyword, setKeyword] = useState(undefined); + const [data, setData] = useState([]); + // table + const [current, setCurrent] = useState(1); + const [total, setTotal] = useState(0); + const [pageSize, setPageSize] = useState(20); + const [loading, setLoading] = useState(false); + const [expandedRowKeys, setExpandedRowKeys] = useState([]); + const time = new Date().getTime() > new Date('2022-06-28').getTime() && new Date().getTime() < new Date('2022-07-01').getTime(); + + useEffect(() => { + setLoading(true); + setExpandedRowKeys([]); + const params = { + curPage: current, + keyword, + pageSize, + } + getPassList(params).then(response => { + if (response && response.message === "success") { + setData(response.data.rows); + setTotal(response.data.total); + } + setLoading(false); + }) + }, [keyword, current, pageSize]) + + const columns = [ + { title: '序号', dataIndex: 'index', align: 'center', className:"columnsResult", width: '6%', render: (text, item, index) => {(current-1)*pageSize+index + 1} }, + { title: '入选学生', dataIndex: 'studentName', className:"columnsResult taskName", width: '10%', ellipsis: true}, + { title: '课题导师', dataIndex: 'tutorName', className:"columnsResult", width: '10%', ellipsis: true}, + { title: '课题名称', dataIndex: 'taskName', className:"columnsResult", width: '26%', ellipsis: true, render: (text, item) => {window.open(`/glcc/subjects/detail/${item.id}`)}}>{text} }, + { title: '项目名称', dataIndex: 'projectName', className:"columnsResult", ellipsis: true, width: '26%', render: (text) => {text} }, + { title: '操作', dataIndex: 'action', align: 'center', className:"columnsResult actionBox"}, + ] + + const customExpandIcon = (props) => { + if (props.expanded) { + return { + props.onExpand(props.record, e); + }}>项目简介 + } else { + return { + props.onExpand(props.record, e); + }}>项目简介 + } + } + + const expandRow = (record) => { + return + } + + // 展开收起行回调 + function onExpand(expanded, record){ + const keys = new Set(expandedRowKeys); + if(expanded){ + keys.add(record.id); + }else{ + keys.delete(record.id); + } + setExpandedRowKeys(Array.from(keys)); + } + + // 申请课题按钮点击函数 + function applyTask(id){ + // 判断用户是否已经登录 + if(current_user && current_user.login){ + // 判断用户是否已经报名两个课题 + if(applyTaskId && Object.keys(applyTaskId).length >= 2){ + message.error('最多只能同时报名两个课题'); + }else{ + // 跳转到学生报名页 + window.location.href=`/glcc/student/apply/${id}`; + } + }else{ + showLoginDialog(); + } + } + + // 取消课题按钮点击函数 + function cancelApply(){ + const id = []; + id.push(applyTaskId[deleteTaskId]); + const params = { + ids: id + } + cancelTaskApply(params).then(response=>{ + if(response && response.message === "success"){ + setVisible(false); + setStudentInfoReset(Math.random()); + message.success('取消成功'); + } + }) + } + + // 改变pagesize + function onShowSizeChange(current, pageSize){ + window.scrollTo(0, 0); + setCurrent(1); + setPageSize(pageSize); + } + + // 切换页数 + function changePage(page, pageSize){ + window.scrollTo(0, 0); + setCurrent(page); + } + + return ( +
+ {time && } + {new Date().getTime() > new Date('2022-07-01').getTime() && } +
+
+
开源夏令营 / 入选学生名单{time && '预'}公示
+ { setCurrent(1); setKeyword(value) }} /> + + + + + + {setVisible(false)}} + onOk={cancelApply} + wrapClassName='cancelApplyTask' + > +
!确定取消申请此课题?
+

取消申请后将删除此条申请记录。你仅有 {2-cancelCount} 次取消申请的机会

+
+ + ) +} +export default CheckResult; \ No newline at end of file diff --git a/src/glcc/checkResult/index.scss b/src/glcc/checkResult/index.scss new file mode 100644 index 00000000..2b404a15 --- /dev/null +++ b/src/glcc/checkResult/index.scss @@ -0,0 +1,84 @@ +.resultListBox{ + background-image:linear-gradient(180deg,#e9f0ff 0%,#dee8ff 51.87%,#f3f4f8 100%); + .bgBox{ + padding-bottom: 115px; + position: relative; + .bgPng3, .bgPng4{ + width: 146px; + position: absolute; + z-index: 0; + top: 210px; + left: 150px; + } + .bgPng4{ + top: 450px; + left: auto; + right: 310px; + } + } + .resultBanner{ + width: 100%; + } + .resultList{ + width: 1200px; + margin: 0 auto; + position: relative; + z-index: 1; + } + .goBackBox{ + padding: 25px 0 8px; + color: #202d40; + font-size: 16px; + border-bottom: 1px dashed #bec5d5; + margin-bottom: 20px; + a{ + color:#a4aabb; + } + } + .search{ + width:509px; + height:48px; + display: block; + margin: 0 auto; + .ant-input-search-button{ + height:48px; + } + } + .resultListTable{ + margin-top: 20px; + background-color:rgba(255, 255, 255, 0.27); + border: 1px solid white; + th.columnsResult{ + background-color:#DFE8FF; + .ant-table-column-title{ + font-weight:700; + color:#273778; + font-size:16px; + } + &.actionBox .ant-table-column-title{ + visibility: hidden; + } + } + td.columnsResult{ + background-color: #ECF2FF; + border-bottom: 1px dashed #bec5d5; + font-size: 15px; + color:#353f5e; + } + tr:hover td.columnsResult{ + background-color:#fbfbfc; + } + .ant-pagination{ + margin: 26px 20px 0 0; + } + } + .toolTipSpan{ + cursor: default; + &.link{ + color: #2545c9; + cursor: pointer; + &:hover{color:#5d7cff;} + &:active{color: #1140ff;} + } + } +} \ No newline at end of file diff --git a/src/glcc/home/index.jsx b/src/glcc/home/index.jsx index 91e5ac8e..dba2cb42 100644 --- a/src/glcc/home/index.jsx +++ b/src/glcc/home/index.jsx @@ -32,6 +32,8 @@ export default (props) => { // } const [hasRole, setHhasRole] = useState(false); + const resultTime1 = new Date().getTime() > new Date('2022-06-28').getTime() && new Date().getTime() < new Date('2022-07-01').getTime(); + const resultTime2 = new Date().getTime() > new Date('2022-07-01').getTime(); useEffect(() => { if (!current_user.user_id) { @@ -57,6 +59,10 @@ export default (props) => { history.push("/glcc/mentoradmin"); } + function goToCheckResult(){ + history.push("/glcc/result"); + } + return (
{/* */} @@ -78,16 +84,24 @@ export default (props) => {
查看夏令营各项目,掌握项目课题详细信息
- {/* 学生报名 */} -
+ {/* 学生报名6.24结束 */} + {/*
学生报名
选择感兴趣的课题,开启您的开源之旅
-
+
*/} + {/* 6.28.-7.1 审核结果仅对导师可见,7.1之后对所有用户可见*/} + {((resultTime1 && hasRole) || resultTime2) &&
+
+ + 名单{resultTime1 && '预'}公示 +
+
查看各课题入选学生名单
+
} {/* 导师审核 */} - {hasRole &&
+ {hasRole && new Date().getTime() < new Date('2022-07-01').getTime() &&
导师审核 diff --git a/src/glcc/home/index.scss b/src/glcc/home/index.scss index 3b70fbd8..a23775ab 100644 --- a/src/glcc/home/index.scss +++ b/src/glcc/home/index.scss @@ -42,7 +42,7 @@ flex-direction: column; justify-content: center; width: 355px; - + height: 118px; &:not(:first-child){ margin-left: 35px; } diff --git a/src/glcc/img/resultBanner.png b/src/glcc/img/resultBanner.png new file mode 100644 index 00000000..e589b239 Binary files /dev/null and b/src/glcc/img/resultBanner.png differ diff --git a/src/glcc/img/resultBanner2.png b/src/glcc/img/resultBanner2.png new file mode 100644 index 00000000..e3f598e1 Binary files /dev/null and b/src/glcc/img/resultBanner2.png differ diff --git a/src/glcc/index.jsx b/src/glcc/index.jsx index e4e8fc32..d82d56b6 100644 --- a/src/glcc/index.jsx +++ b/src/glcc/index.jsx @@ -57,7 +57,11 @@ const Openmmlab = Loadable({ loader: () => import("./openmmlab"), loading: Loading, }); - +// 开源夏令营审核结果页面 +const Result = Loadable({ + loader: () => import("./checkResult"), + loading: Loading, +}); const Glcc = (propsF) => { const {current_user} = propsF; // 判断时间是否在开源夏令营报名时间内(4月15日~5月20日) @@ -150,6 +154,14 @@ const Glcc = (propsF) => { )} > + {/* 审核结果页面 */} + ( + + )} + > + {/* 首页 */} { +export default ({ detail, projectId, applyTaskId, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd, showTask=true }) => { const [info, setInfo] = useState(detail); // 申请课题按钮点击函数 @@ -36,13 +36,14 @@ export default ({ detail, projectId, applyTaskId, current_user, showLoginDialog, return ( info ?
-
+
{info.projectName} {info.projectType && {info.projectType}}

GitLink项目地址:  {info.gitlinkUrl}

项目简介:  {info.projectIntro}
- {info.registrationTaskList && info.registrationTaskList.length > 0 ? info.registrationTaskList.map((item, index)=>{ + {/* 从项目、课题列表展开的显示课题列表,结果公示页展开的不显示课题列表 */} + {showTask && (info.registrationTaskList && info.registrationTaskList.length > 0 ? info.registrationTaskList.map((item, index)=>{ return
{window.location.href=`/glcc/subjects/detail/${item.id}`}}>{item.taskName}
@@ -53,13 +54,14 @@ export default ({ detail, projectId, applyTaskId, current_user, showLoginDialog,
{item.taskDesc}
{item.taskUrl &&
课题链接:   {item.taskUrl}
}
- {(isStudentApplyDate || studentApplyEnd) && (applyTaskId && item.id && Object.keys(applyTaskId).includes(item.id.toString()) ? : isStudentApplyDate && )} + {/* {(isStudentApplyDate || studentApplyEnd) && (applyTaskId && item.id && Object.keys(applyTaskId).includes(item.id.toString()) ? : isStudentApplyDate && )} */} + {applyTaskId && item.id && Object.keys(applyTaskId).includes(item.id.toString()) && }
¥{item.taskReward}
- }) : } + }) : )}
:
) } \ No newline at end of file diff --git a/src/glcc/project/index.scss b/src/glcc/project/index.scss index 7bb5ca0f..8f07e342 100644 --- a/src/glcc/project/index.scss +++ b/src/glcc/project/index.scss @@ -108,6 +108,10 @@ padding-bottom: 12px; border-bottom: 1px dashed #bec5d5; line-height: 36px; + &.byResult{ + margin: -15px -10px -40px; + border-bottom: none; + } .name{ font-weight:700; color:#3753c5; diff --git a/src/glcc/project/taskDetail/index.jsx b/src/glcc/project/taskDetail/index.jsx index 39222459..607c7abc 100644 --- a/src/glcc/project/taskDetail/index.jsx +++ b/src/glcc/project/taskDetail/index.jsx @@ -64,7 +64,8 @@ function TaskDetail(props) {
课题简介
{detail.taskDesc}
- {(isStudentApplyDate || studentApplyEnd) && (applyTaskId && taskId && Object.keys(applyTaskId).includes(taskId.toString()) ? : isStudentApplyDate && )} + {/* {(isStudentApplyDate || studentApplyEnd) && (applyTaskId && taskId && Object.keys(applyTaskId).includes(taskId.toString()) ? : isStudentApplyDate && )} */} + {applyTaskId && taskId && Object.keys(applyTaskId).includes(taskId.toString()) && }
diff --git a/src/glcc/project/taskList/index.jsx b/src/glcc/project/taskList/index.jsx index d3b66f99..ed72ba40 100644 --- a/src/glcc/project/taskList/index.jsx +++ b/src/glcc/project/taskList/index.jsx @@ -32,11 +32,12 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial title: '操作', dataIndex: 'action', align: 'center', className:"actionColumns taskTableColumns", render: ((text, item, index) => { return (
- {(isStudentApplyDate || studentApplyEnd) && (applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) ? + {applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && {window.location.href=`/glcc/student/apply/${item.id}`}}>报名详情} + {/* {(isStudentApplyDate || studentApplyEnd) && (applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) ? {window.location.href=`/glcc/student/apply/${item.id}`}}>报名详情 {deleteItem(item.id)}}> :isStudentApplyDate && - {applyTask(item.id)}}>申请课题)} + {applyTask(item.id)}}>申请课题)} */}
) }) diff --git a/src/glcc/student/index.jsx b/src/glcc/student/index.jsx index fdb47d7c..a548fce5 100644 --- a/src/glcc/student/index.jsx +++ b/src/glcc/student/index.jsx @@ -553,9 +553,9 @@ function Apply(props) { } - + {/* - + */}