报名结果公示

This commit is contained in:
谢思 2022-06-23 16:20:02 +08:00
parent 08d7971e7c
commit f3c6fdf397
15 changed files with 316 additions and 17 deletions

View File

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

View File

@ -132,4 +132,13 @@ export function auditPassTask(data) {
method: 'post',
data
});
}
// 导师审核结果
export function getPassList(params) {
return fetch({
url: '/api/studentApply/passList',
method: 'get',
params,
});
}

View File

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

View File

@ -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) => <span>{(current-1)*pageSize+index + 1}</span> },
{ 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) => <Tooltip title={text} placement="topLeft"><span className='toolTipSpan link' onClick={()=>{window.open(`/glcc/subjects/detail/${item.id}`)}}>{text}</span></Tooltip> },
{ title: '项目名称', dataIndex: 'projectName', className:"columnsResult", ellipsis: true, width: '26%', render: (text) => <Tooltip title={text} placement="topLeft"><span className='toolTipSpan'>{text}</span></Tooltip> },
{ title: '操作', dataIndex: 'action', align: 'center', className:"columnsResult actionBox"},
]
const customExpandIcon = (props) => {
if (props.expanded) {
return <a className='toolTipSpan link' style={{marginRight: 8 }} onClick={e => {
props.onExpand(props.record, e);
}}><i className='iconfont icon-ketixiangqingicon mr5'></i>项目简介<i className="iconfont icon-changyongtubiao-xianxingdaochu-zhuanqu- font-12 ml5 down mr10"></i></a>
} else {
return <a className='toolTipSpan link' style={{marginRight: 8 }} onClick={e => {
props.onExpand(props.record, e);
}}><i className='iconfont icon-ketixiangqingicon mr5'></i>项目简介<i className="iconfont icon-jiantou9 font-12 ml5 down mr10"></i></a>
}
}
const expandRow = (record) => {
return <ProjectDetail detail={null} projectId={record.regId} applyTaskId={applyTaskId} current_user={current_user} showLoginDialog={showLoginDialog} isStudentApplyDate={isStudentApplyDate} studentApplyEnd={studentApplyEnd} showTask={false}/>
}
//
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 (
<div className="resultListBox">
{time && <img className="resultBanner" src={resultBanner} alt=""></img>}
{new Date().getTime() > new Date('2022-07-01').getTime() && <img className="resultBanner" src={resultBanner2} alt=""></img>}
<div className='bgBox'>
<div className="resultList">
<div className='goBackBox'><a href='/glcc'>开源夏令营 / </a>入选学生名单{time && '预'}公示</div>
<Search className='search' placeholder='请输入学生姓名或课题名称进行搜索' allowClear enterButton onSearch={(value) => { setCurrent(1); setKeyword(value) }} />
<Table
loading={loading}
columns={columns}
dataSource={data}
expandedRowRender={expandRow}
expandIconColumnIndex={5}
expandIconAsCell={false}
expandIcon={customExpandIcon}
rowKey={'id'}
expandedRowKeys={expandedRowKeys}
onExpand={onExpand}
pagination={{current: current, pageSize: pageSize, total: total, showSizeChanger: true, onShowSizeChange:onShowSizeChange, showQuickJumper: true, onChange: changePage}}
className='resultListTable pb30'
/>
</div>
<img src={bgPng} alt='' className='bgPng3'/>
<img src={bgPng} alt='' className='bgPng4'/>
</div>
<Modal
okText="确认"
cancelText="再想想"
okType='default'
title="取消申请"
visible={visible}
onCancel={()=>{setVisible(false)}}
onOk={cancelApply}
wrapClassName='cancelApplyTask'
>
<div className='tilTask mt20'><span className='carefulIcon'>!</span>确定取消申请此课题</div>
<p className='tipTask'>取消申请后将删除此条申请记录你仅有<span className="tipTaskTime"> {2-cancelCount} </span>次取消申请的机会</p>
</Modal>
</div>
)
}
export default CheckResult;

View File

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

View File

@ -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 (
<div className="glcc">
{/* <Banner /> */}
@ -78,16 +84,24 @@ export default (props) => {
</div>
<div className="pt6">查看夏令营各项目掌握项目课题详细信息</div>
</Link>
{/* 学生报名 */}
<div className="apply" onClick={goToStudent}>
{/* 学生报名6.24结束 */}
{/* <div className="apply" onClick={goToStudent}>
<div>
<img src={apply2} alt="" className="applyIcon" />
<span className="til">学生报名</span>
</div>
<div className="pt6">选择感兴趣的课题开启您的开源之旅</div>
</div>
</div> */}
{/* 6.28.-7.1 审核结果仅对导师可见7.1之后对所有用户可见*/}
{((resultTime1 && hasRole) || resultTime2) && <div className="apply" onClick={goToCheckResult}>
<div>
<img src={apply2} alt="" className="applyIcon" />
<span className="til">名单{resultTime1 && '预'}公示</span>
</div>
<div className="pt6">查看各课题入选学生名单</div>
</div>}
{/* 导师审核 */}
{hasRole && <div className="apply" onClick={goToCheck}>
{hasRole && new Date().getTime() < new Date('2022-07-01').getTime() && <div className="apply" onClick={goToCheck}>
<div>
<img src={teacher} alt="" className="applyIcon" />
<span className="til">导师审核</span>

View File

@ -42,7 +42,7 @@
flex-direction: column;
justify-content: center;
width: 355px;
height: 118px;
&:not(:first-child){
margin-left: 35px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

View File

@ -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;
// 415~520
@ -150,6 +154,14 @@ const Glcc = (propsF) => {
)}
></Route>
{/* 审核结果页面 */}
<Route
path="/glcc/result"
render={(props) => (
<Result/>
)}
></Route>
{/* 首页 */}
<Route
path="/glcc"

View File

@ -4,7 +4,7 @@ import Nodata from '../../../forge/Nodata';
import { useEffect } from 'react';
import { getProjectById } from '../../api';
export default ({ detail, projectId, applyTaskId, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd }) => {
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 ? <div className={`projectDetailBox ${detail ? '':'byTask'}`}>
<div className="projectDetailHead">
<div className={`projectDetailHead ${showTask? '' : 'byResult'}`}>
<span className='name'>{info.projectName}</span>
{info.projectType && <span className='type'>{info.projectType}</span>}
<p>GitLink项目地址:&nbsp;&nbsp;<a href={info.gitlinkUrl} className='linkUrl' target={"_blank"}>{info.gitlinkUrl}</a></p>
<div>项目简介:&nbsp;&nbsp;{info.projectIntro}</div>
</div>
{info.registrationTaskList && info.registrationTaskList.length > 0 ? info.registrationTaskList.map((item, index)=>{
{/* 从项目、课题列表展开的显示课题列表,结果公示页展开的不显示课题列表 */}
{showTask && (info.registrationTaskList && info.registrationTaskList.length > 0 ? info.registrationTaskList.map((item, index)=>{
return <div className='taskItem mt20' 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>
@ -53,13 +54,14 @@ export default ({ detail, projectId, applyTaskId, current_user, showLoginDialog,
<div className="taskDesc">{item.taskDesc}</div>
{item.taskUrl && <div className="taskUrl oneLine">课题链接: &nbsp;&nbsp;<a href={item.taskUrl} target={"_blank"}>{item.taskUrl}</a></div>}
<div>
{(isStudentApplyDate || studentApplyEnd) && (applyTaskId && item.id && Object.keys(applyTaskId).includes(item.id.toString()) ? <Button onClick={()=>{window.location.href=`/glcc/student/apply/${item.id}`}} className='lookDetail mr10'>报名详情</Button> : isStudentApplyDate && <Button type='primary' className='applyBut mr10' onClick={()=>{applyTask(item.id)}}>申请课题</Button>)}
{/* {(isStudentApplyDate || studentApplyEnd) && (applyTaskId && item.id && Object.keys(applyTaskId).includes(item.id.toString()) ? <Button onClick={()=>{window.location.href=`/glcc/student/apply/${item.id}`}} className='lookDetail mr10'>报名详情</Button> : isStudentApplyDate && <Button type='primary' className='applyBut mr10' onClick={()=>{applyTask(item.id)}}>申请课题</Button>)} */}
{applyTaskId && item.id && Object.keys(applyTaskId).includes(item.id.toString()) && <Button onClick={()=>{window.location.href=`/glcc/student/apply/${item.id}`}} className='lookDetail mr10'>报名详情</Button>}
<Button onClick={()=>{window.open(`/glcc/subjects/detail/${item.id}`)}} className='lookDetail'>课题详情</Button>
</div>
</div>
<div className="right oneLine taskUrl"><span className='taskReward'>{item.taskReward}</span></div>
</div>
}) : <Nodata _html="课题暂无数据" small={true}/>}
}) : <Nodata _html="课题暂无数据" small={true}/>)}
</div>: <div className="projectDetailBox nodata"><Nodata _html="暂无数据" small={true}/></div>
)
}

View File

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

View File

@ -64,7 +64,8 @@ function TaskDetail(props) {
<div><span className='smallTil'>课题简介</span></div>
<div className='desc'>{detail.taskDesc}</div>
</div>
{(isStudentApplyDate || studentApplyEnd) && (applyTaskId && taskId && Object.keys(applyTaskId).includes(taskId.toString()) ? <Button onClick={()=>{window.location.href=`/glcc/student/apply/${taskId}`}} className='lookDetail detailBut'>报名详情</Button> : isStudentApplyDate && <Button type='primary' className='applyBut detailBut' onClick={()=>{applyTask(taskId)}}>申请课题</Button>)}
{/* {(isStudentApplyDate || studentApplyEnd) && (applyTaskId && taskId && Object.keys(applyTaskId).includes(taskId.toString()) ? <Button onClick={()=>{window.location.href=`/glcc/student/apply/${taskId}`}} className='lookDetail detailBut'>报名详情</Button> : isStudentApplyDate && <Button type='primary' className='applyBut detailBut' onClick={()=>{applyTask(taskId)}}>申请课题</Button>)} */}
{applyTaskId && taskId && Object.keys(applyTaskId).includes(taskId.toString()) && <Button onClick={()=>{window.location.href=`/glcc/student/apply/${taskId}`}} className='lookDetail detailBut'>报名详情</Button>}
</div>
<img src={bgPng} alt='' className='bgPng1'/>
<img src={bgPng} alt='' className='bgPng2'/>

View File

@ -32,11 +32,12 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
title: '操作', dataIndex: 'action', align: 'center', className:"actionColumns taskTableColumns", render: ((text, item, index) => {
return (
<div className='actionBox'>
{(isStudentApplyDate || studentApplyEnd) && (applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) ? <Fragment>
{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>}
{/* {(isStudentApplyDate || studentApplyEnd) && (applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) ? <Fragment>
<span onClick={()=>{window.location.href=`/glcc/student/apply/${item.id}`}}><i className='iconfont icon-baomingxiangqingicon mr5'></i>报名详情</span>
<Tooltip title={"取消申请"}><i className='iconfont icon-shanchuicon3 ml20 cancelApply' onClick={()=>{deleteItem(item.id)}}></i></Tooltip>
</Fragment>:isStudentApplyDate && <Fragment>
<span onClick={()=>{applyTask(item.id)}}><i className='iconfont icon-shenqingketiicon applyTask mr5'></i><span className='applyTask'>申请课题</span></span></Fragment>)}
<span onClick={()=>{applyTask(item.id)}}><i className='iconfont icon-shenqingketiicon applyTask mr5'></i><span className='applyTask'>申请课题</span></span></Fragment>)} */}
</div>
)
})

View File

@ -553,9 +553,9 @@ function Apply(props) {
</Form.Item>
}
<Form.Item className='subInfo introArea'>
{/* <Form.Item className='subInfo introArea'>
<Button type="primary" htmlType="submit" className='sub' disabled={!editable}>提交</Button>
</Form.Item>
</Form.Item> */}
</Form>
</div>
</div>