公示结果页+glcc学生报名页面

This commit is contained in:
谢思 2022-06-27 09:37:27 +08:00
parent 23b6708b6e
commit aa64908ef2
7 changed files with 36 additions and 64 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -158,7 +158,7 @@ const Glcc = (propsF) => {
<Route
path="/glcc/result"
render={(props) => (
<Result/>
<Result current_user={current_user} history={props.history}/>
)}
></Route>

View File

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

View File

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