forked from Gitlink/forgeplus-react
公示结果页+glcc学生报名页面
This commit is contained in:
parent
23b6708b6e
commit
aa64908ef2
|
@ -31,7 +31,7 @@ function Check({ current_user, showNotification, history }) {
|
|||
className: "taskTableColumns",
|
||||
dataIndex: 'studentName',
|
||||
key: 'studentName',
|
||||
width: '9%',
|
||||
width: '12%',
|
||||
ellipsis: true,
|
||||
render: (text, record) => {
|
||||
return (
|
||||
|
@ -46,7 +46,7 @@ function Check({ current_user, showNotification, history }) {
|
|||
key: 'createdOn',
|
||||
dataIndex: 'createdOn',
|
||||
className: "taskTableColumns",
|
||||
width: '10%',
|
||||
width: '12%',
|
||||
render: (text, record) => {
|
||||
return (
|
||||
text && moment(text).format('YYYY-MM-DD')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { Input, message, Modal, Table, Tooltip } from 'antd';
|
||||
import { cancelTaskApply, getPassList } from '../api';
|
||||
import { Input, Table, Tooltip } from 'antd';
|
||||
import { getPassList, hasAuditRole } from '../api';
|
||||
import ProjectDetail from '../project/component/projectDetail';
|
||||
// 预公示banner
|
||||
import resultBanner from "../img/resultBanner.png";
|
||||
|
@ -12,9 +12,7 @@ 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);
|
||||
function CheckResult({current_user, history}) {
|
||||
// 输入搜索框
|
||||
const [keyword, setKeyword] = useState(undefined);
|
||||
const [data, setData] = useState([]);
|
||||
|
@ -26,6 +24,19 @@ function CheckResult({applyTaskId, setStudentInfoReset, current_user, showLoginD
|
|||
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(()=>{
|
||||
// 未到时间
|
||||
if(new Date().getTime() < new Date('2022-06-28').getTime()){
|
||||
history.push('/glcc');
|
||||
}
|
||||
hasAuditRole({ userId: current_user.user_id }).then(res => {
|
||||
// 7.1之前 普通用户不可以进入此页面
|
||||
if (!(res && res.message == 'success' && res.data.hasRole) && new Date().getTime() < new Date('2022-07-01').getTime()) {
|
||||
history.push('/glcc');
|
||||
}
|
||||
})
|
||||
},[])
|
||||
|
||||
useEffect(() => {
|
||||
setLoading(true);
|
||||
setExpandedRowKeys([]);
|
||||
|
@ -45,8 +56,8 @@ function CheckResult({applyTaskId, setStudentInfoReset, current_user, showLoginD
|
|||
|
||||
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: 'studentName', className:"columnsResult taskName", width: '12%', ellipsis: true},
|
||||
{ title: '课题导师', dataIndex: 'tutorName', className:"columnsResult", width: '12%', 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"},
|
||||
|
@ -65,7 +76,7 @@ function CheckResult({applyTaskId, setStudentInfoReset, current_user, showLoginD
|
|||
}
|
||||
|
||||
const expandRow = (record) => {
|
||||
return <ProjectDetail detail={null} projectId={record.regId} applyTaskId={applyTaskId} current_user={current_user} showLoginDialog={showLoginDialog} isStudentApplyDate={isStudentApplyDate} studentApplyEnd={studentApplyEnd} showTask={false}/>
|
||||
return <ProjectDetail detail={null} projectId={record.regId} showTask={false}/>
|
||||
}
|
||||
|
||||
// 展开收起行回调
|
||||
|
@ -79,38 +90,6 @@ function CheckResult({applyTaskId, setStudentInfoReset, current_user, showLoginD
|
|||
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);
|
||||
|
@ -150,19 +129,6 @@ function CheckResult({applyTaskId, setStudentInfoReset, current_user, showLoginD
|
|||
<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>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -48,6 +48,10 @@
|
|||
margin-top: 20px;
|
||||
background-color:rgba(255, 255, 255, 0.27);
|
||||
border: 1px solid white;
|
||||
.ant-table-placeholder{
|
||||
background-color: rgba(255, 255, 255, 0.27);
|
||||
border-bottom: none;
|
||||
}
|
||||
th.columnsResult{
|
||||
background-color:#DFE8FF;
|
||||
.ant-table-column-title{
|
||||
|
|
|
@ -86,14 +86,14 @@ export default (props) => {
|
|||
</div>
|
||||
<div className="pt6">查看夏令营各项目,掌握项目课题详细信息</div>
|
||||
</Link>
|
||||
{/* 学生报名6.24结束 */}
|
||||
{/* <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>
|
||||
|
|
|
@ -158,7 +158,7 @@ const Glcc = (propsF) => {
|
|||
<Route
|
||||
path="/glcc/result"
|
||||
render={(props) => (
|
||||
<Result/>
|
||||
<Result current_user={current_user} history={props.history}/>
|
||||
)}
|
||||
></Route>
|
||||
|
||||
|
|
|
@ -32,12 +32,13 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
|
|||
title: '操作', dataIndex: 'action', align: 'center', className:"actionColumns taskTableColumns", render: ((text, item, index) => {
|
||||
return (
|
||||
<div className='actionBox'>
|
||||
{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>
|
||||
{/* {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>
|
||||
{!studentApplyEnd && <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>
|
||||
)
|
||||
})
|
||||
|
|
|
@ -555,9 +555,10 @@ function Apply(props) {
|
|||
</Form.Item>
|
||||
}
|
||||
|
||||
{!studentApplyEnd && <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>
|
||||
|
|
Loading…
Reference in New Issue