forked from Gitlink/forgeplus-react
合并列表页修改
This commit is contained in:
commit
e770137773
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -132,4 +132,13 @@ export function auditPassTask(data) {
|
|||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 导师审核结果
|
||||
export function getPassList(params) {
|
||||
return fetch({
|
||||
url: '/api/studentApply/passList',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
|
@ -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 (
|
||||
|
|
@ -104,7 +104,7 @@ function Check({ current_user, showNotification, history }) {
|
|||
dataIndex: 'memo',
|
||||
className: 'taskTableColumns',
|
||||
ellipsis: true,
|
||||
width: '20%',
|
||||
width: '18%',
|
||||
render: (text, record) => {
|
||||
return (
|
||||
<Tooltip title={text}>
|
||||
|
|
@ -124,15 +124,18 @@ function Check({ current_user, showNotification, history }) {
|
|||
title: '操作',
|
||||
dataIndex: 'passStatus',
|
||||
align: 'center',
|
||||
width: '9%',
|
||||
width: '11%',
|
||||
className: "actionColumns taskTableColumns",
|
||||
render: ((text, record, index) => {
|
||||
return (
|
||||
<div className='actionBox'>
|
||||
{
|
||||
text ? <Button disabled={disabledCheck} type="default" onClick={() => { checkStudent(record.id, 0) }}>撤销</Button> :
|
||||
<Button disabled={disabledCheck} type="primary" disabled={havePass} onClick={() => { checkStudent(record.id, 1) }}>通过</Button>
|
||||
}
|
||||
{/* 学生已入选并且锁定 */}
|
||||
{text && record.locked && <Tooltip title="恭喜,该学生已成功入选您的课题!"><Button disabled type="primary">已入选</Button></Tooltip>}
|
||||
{/* 学生已经被其他导师锁定 */}
|
||||
{!text && record.locked && <Tooltip title="此学生已入选其他课题"><Button disabled type="primary">已被选</Button></Tooltip>}
|
||||
{/* 学生未被锁定 */}
|
||||
{!record.locked && (text ? <Button disabled={disabledCheck} type="default" onClick={() => { checkStudent(record.id, 0) }}>撤销</Button> :
|
||||
<Button disabled={disabledCheck || havePass} type="primary" onClick={() => { checkStudent(record.id, 1) }}>通过</Button>)}
|
||||
</div>
|
||||
)
|
||||
})
|
||||
|
|
@ -140,6 +143,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');
|
||||
}
|
||||
|
|
@ -181,11 +187,11 @@ function Check({ current_user, showNotification, history }) {
|
|||
if (props.expanded) {
|
||||
return <a className='actionBox' style={{ marginRight: 8 }} onClick={e => {
|
||||
props.onExpand(props.record, e);
|
||||
}}>更多详情<i className="iconfont icon-changyongtubiao-xianxingdaochu-zhuanqu- font-12 ml5 down mr10"></i></a>
|
||||
}}>更多详情<i className="iconfont icon-changyongtubiao-xianxingdaochu-zhuanqu- font-12 ml5 down"></i></a>
|
||||
} else {
|
||||
return <a className='actionBox' style={{ marginRight: 8 }} onClick={e => {
|
||||
props.onExpand(props.record, e);
|
||||
}}>更多详情<i className="iconfont icon-jiantou9 font-12 ml5 down mr10"></i></a>
|
||||
}}>更多详情<i className="iconfont icon-jiantou9 font-12 ml5 down"></i></a>
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -221,6 +227,7 @@ function Check({ current_user, showNotification, history }) {
|
|||
<div className="info-item">
|
||||
<span className="info-tit">学生证明</span>
|
||||
<img className="info-img"
|
||||
alt=''
|
||||
onClick={() => { setVisible(true); setPicture(record.proveAttachmentId) }}
|
||||
src={`${window.location.href.indexOf('test') > -1 ||
|
||||
window.location.href.indexOf('localhost') > -1
|
||||
|
|
@ -276,8 +283,9 @@ function Check({ current_user, showNotification, history }) {
|
|||
<h4 className="head_tit">审核说明:</h4>
|
||||
<div className="head_content">1、欢迎进入导师审核页!各位导师可查看到您发布课题的全部学生报名信息</div>
|
||||
<div className="head_content">2、您可根据学生报名信息与学生进行邮箱或电话沟通了解学生详细情况,选择满意的学生</div>
|
||||
<div className="head_content">3、每个课题仅允许审核通过一个学生,在审核过程中,您可以随时调整各学生的审核状态</div>
|
||||
<div className="head_content">4、请各位导师在7.1日前完成课题申请的审核,7.1日将根据各导师审核信息,公布各课题学生入选名单</div>
|
||||
<div className="head_content">3、每个课题仅允许审核通过一个学生,在审核过程中,您可以随时调整各学生的审核状态,直到与学生匹配成功</div>
|
||||
<div className="head_content">4、6月28日后,各导师可访问 <a href='/glcc/result'>https://www.gitlink.org.cn/glcc/result</a> 查询匹配结果(需使用导师账号登录)</div>
|
||||
<div className="head_content">5、请各位导师在7月1日前完成课题申请的审核,7月1日凌晨1点平台将根据各导师审核信息,正式公布各课题学生入选名单</div>
|
||||
</div>
|
||||
|
||||
<Tabs className="task-tabs" onChange={(e) => { setTaskId(e) }} activeKey={taskId + ''}>
|
||||
|
|
@ -310,7 +318,6 @@ function Check({ current_user, showNotification, history }) {
|
|||
<Modal
|
||||
visible={visible && picture}
|
||||
title="学生证明"
|
||||
visible={visible}
|
||||
onCancel={() => { setVisible(false) }}
|
||||
onOk={() => { setVisible(false) }}
|
||||
className="picture-modal"
|
||||
|
|
@ -318,6 +325,7 @@ function Check({ current_user, showNotification, history }) {
|
|||
footer={null}
|
||||
>
|
||||
<img
|
||||
alt=''
|
||||
src={`${window.location.href.indexOf('test') > -1 ||
|
||||
window.location.href.indexOf('localhost') > -1
|
||||
? 'https://testforgeplus.trustie.net'
|
||||
|
|
|
|||
|
|
@ -0,0 +1,137 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { Input, Table, Tooltip } from 'antd';
|
||||
import { getPassList, hasAuditRole } 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({current_user, history}) {
|
||||
// 输入搜索框
|
||||
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 1:0').getTime() && new Date().getTime() < new Date('2022-07-01 0:0').getTime();
|
||||
|
||||
useEffect(()=>{
|
||||
// 未到时间
|
||||
if(new Date().getTime() < new Date('2022-06-28 1:0').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 1:0').getTime()) {
|
||||
history.push('/glcc');
|
||||
}
|
||||
})
|
||||
},[])
|
||||
|
||||
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: '12%', ellipsis: true},
|
||||
{ title: '学生专业', dataIndex: 'profession', className:"columnsResult taskName", width: '12%', ellipsis: true, render: (text) => <Tooltip title={text} placement="topLeft"><span className='toolTipSpan'>{text}</span></Tooltip>},
|
||||
{ title: '学生年级', dataIndex: 'grade', className:"columnsResult taskName", width: '10%', ellipsis: true},
|
||||
{ title: '课题导师', dataIndex: 'tutorName', className:"columnsResult", width: '10%', ellipsis: true},
|
||||
{ title: '课题名称', dataIndex: 'taskName', className:"columnsResult", width: '20%', ellipsis: true, render: (text, item) => <Tooltip title={text} placement="topLeft"><span className='toolTipSpan link' onClick={()=>{window.open(`/glcc/subjects/detail/${item.id}?locked=${item.locked}`)}}>{text}</span></Tooltip> },
|
||||
{ title: '项目名称', dataIndex: 'projectName', className:"columnsResult", ellipsis: true, width: '14%', 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} 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));
|
||||
}
|
||||
|
||||
// 改变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 1:0').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={7}
|
||||
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>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default CheckResult;
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
.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;
|
||||
.ant-table-placeholder{
|
||||
background-color: rgba(255, 255, 255, 0.27);
|
||||
border-bottom: none;
|
||||
}
|
||||
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;}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@ import { hasAuditRole } from '../api';
|
|||
import './index.scss';
|
||||
|
||||
export default (props) => {
|
||||
const { current_user, isGlccApplyDate, showNotification, studentApplyStart, history, studentApplyEnd } = props;
|
||||
const { current_user, isGlccApplyDate, showNotification, studentApplyStart, history, secondStudentApplyDate, isStudentApplyDate } = props;
|
||||
// function goToApply() {
|
||||
// if (isGlccApplyDate) {
|
||||
// if (current_user && current_user.login) {
|
||||
|
|
@ -32,6 +32,8 @@ export default (props) => {
|
|||
// }
|
||||
|
||||
const [hasRole, setHhasRole] = useState(false);
|
||||
const resultTime1 = new Date().getTime() > new Date('2022-06-28 1:0').getTime() && new Date().getTime() < new Date('2022-07-01 0:0').getTime();
|
||||
const resultTime2 = new Date().getTime() > new Date('2022-07-01 1:0').getTime();
|
||||
|
||||
useEffect(() => {
|
||||
if (!current_user.user_id) {
|
||||
|
|
@ -48,7 +50,7 @@ export default (props) => {
|
|||
// 学生报名时间
|
||||
if (!studentApplyStart) {
|
||||
showNotification("不在报名时间,报名开始时间为5月26日");
|
||||
} else if(studentApplyEnd) {
|
||||
} else if(!isStudentApplyDate && !secondStudentApplyDate) {
|
||||
showNotification("课题申请时间已截止");
|
||||
} else{
|
||||
history.push("/glcc/subjects");
|
||||
|
|
@ -59,6 +61,10 @@ export default (props) => {
|
|||
history.push("/glcc/mentoradmin");
|
||||
}
|
||||
|
||||
function goToCheckResult(){
|
||||
history.push("/glcc/result");
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="glcc">
|
||||
{/* <Banner /> */}
|
||||
|
|
@ -80,7 +86,7 @@ export default (props) => {
|
|||
</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" />
|
||||
|
|
@ -88,8 +94,16 @@ export default (props) => {
|
|||
</div>
|
||||
<div className="pt6">选择感兴趣的课题,开启您的开源之旅</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>
|
||||
|
|
@ -118,7 +132,7 @@ export default (props) => {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Lightspot isGlccApplyDate={isGlccApplyDate} current_user={current_user} showNotification={showNotification} studentApplyStart={studentApplyStart} studentApplyEnd={studentApplyEnd}/>
|
||||
<Lightspot isGlccApplyDate={isGlccApplyDate} current_user={current_user} showNotification={showNotification} goToStudent={goToStudent}/>
|
||||
<TimerShaft />
|
||||
<Award />
|
||||
<News />
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
flex-direction: column;
|
||||
justify-content: center;
|
||||
width: 355px;
|
||||
|
||||
height: 118px;
|
||||
&:not(:first-child){
|
||||
margin-left: 35px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import { Link } from 'react-router-dom';
|
|||
|
||||
|
||||
function Lightspot(props) {
|
||||
const {current_user, isGlccApplyDate, showNotification, studentApplyStart, studentApplyEnd} = props;
|
||||
const {current_user, isGlccApplyDate, showNotification, goToStudent} = props;
|
||||
|
||||
function goToApply(){
|
||||
if(isGlccApplyDate){
|
||||
|
|
@ -27,17 +27,6 @@ function Lightspot(props) {
|
|||
}
|
||||
}
|
||||
|
||||
function goToStudent(){
|
||||
// 学生报名时间
|
||||
if(!studentApplyStart){
|
||||
showNotification("不在报名时间,报名开始时间为5月26日");
|
||||
} else if(studentApplyEnd) {
|
||||
showNotification("课题申请时间已截止");
|
||||
}else{
|
||||
window.location.href="/glcc/subjects";
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="lightspot">
|
||||
<div className="glcc-content">
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 202 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 202 KiB |
|
|
@ -1,4 +1,4 @@
|
|||
import React from "react";
|
||||
import React, {useState, useEffect} from "react";
|
||||
|
||||
import { Route, Switch } from "react-router-dom";
|
||||
import { withRouter } from "react-router";
|
||||
|
|
@ -11,9 +11,8 @@ import "./index.scss";
|
|||
import Loadable from "react-loadable";
|
||||
import Loading from "../Loading";
|
||||
import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC";
|
||||
import { useState } from "react";
|
||||
import { useEffect } from "react";
|
||||
import { getStudentApplyInfo } from "./api";
|
||||
import { message } from "antd";
|
||||
|
||||
|
||||
// 任务管理审核
|
||||
|
|
@ -57,22 +56,28 @@ const Openmmlab = Loadable({
|
|||
loader: () => import("./openmmlab"),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
// 开源夏令营审核结果页面
|
||||
const Result = Loadable({
|
||||
loader: () => import("./checkResult"),
|
||||
loading: Loading,
|
||||
});
|
||||
const Glcc = (propsF) => {
|
||||
const {current_user} = propsF;
|
||||
const {current_user, showLoginDialog} = propsF;
|
||||
// 判断时间是否在开源夏令营报名时间内(4月15日~5月20日)
|
||||
const isGlccApplyDate = Date.parse(new Date()) < 1653062400000;
|
||||
|
||||
// 学生报名时间new Date().getTime() > new Date('2022-05-26').getTime()
|
||||
// 学生报名时间
|
||||
const studentApplyStart = new Date().getTime() > new Date('2022-05-26').getTime();
|
||||
const isStudentApplyDate = new Date().getTime() > new Date('2022-05-26').getTime() && new Date().getTime() < new Date('2022-06-25 0:0').getTime();
|
||||
const studentApplyEnd = new Date().getTime() > new Date('2022-06-25 0:0').getTime();
|
||||
const secondStudentApplyDate = new Date().getTime() > new Date('2022-06-29 1:0').getTime() && new Date().getTime() < new Date('2022-07-01 0:0').getTime();
|
||||
|
||||
// 用户已报名课题id数组
|
||||
const [applyTaskId, setApplyTaskId] = useState({});
|
||||
// 刷新用户课题报名信息
|
||||
const [studentInfoReset, setStudentInfoReset] = useState(undefined);
|
||||
const [cancelCount,setCancelCount]=useState(0);
|
||||
// 用户是否已经被导师选中
|
||||
const [lockedTaskName, setLockedTaskName] = useState(undefined);
|
||||
|
||||
useEffect(()=>{
|
||||
// 获取用户课题报名信息current_user user_id
|
||||
|
|
@ -82,6 +87,7 @@ const Glcc = (propsF) => {
|
|||
const data = {};
|
||||
response.data && response.data.registrationStudentTaskList.map(item=>{
|
||||
data[item.taskId] = item.id;
|
||||
item.locked && setLockedTaskName(item.taskName);
|
||||
})
|
||||
setApplyTaskId(data);
|
||||
response.data&&setCancelCount(Number(response.data.cancelCount));
|
||||
|
|
@ -89,6 +95,25 @@ const Glcc = (propsF) => {
|
|||
})
|
||||
},[studentInfoReset, current_user])
|
||||
|
||||
// 申请课题按钮点击函数
|
||||
function applyTask(id){
|
||||
// 判断用户是否已经登录
|
||||
if(current_user && current_user.login){
|
||||
// 判断该学生是否已经被某位导师选中
|
||||
if(lockedTaskName){
|
||||
message.error(`由于你已入选 ${lockedTaskName} 课题,无法申请其他课题`);
|
||||
}else if(applyTaskId && Object.keys(applyTaskId).length >= 3){
|
||||
// 判断用户是否已经报名三个课题
|
||||
message.error('最多只能同时报名三个课题');
|
||||
}else{
|
||||
// 跳转到学生报名页
|
||||
window.location.href=`/glcc/student/apply/${id}`;
|
||||
}
|
||||
}else{
|
||||
showLoginDialog();
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="newMain clearfix">
|
||||
<Switch {...propsF}>
|
||||
|
|
@ -123,14 +148,14 @@ const Glcc = (propsF) => {
|
|||
<Route
|
||||
path="/glcc/subjects/detail/:taskId"
|
||||
render={(props) => (
|
||||
<TaskDetail {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} studentApplyEnd={studentApplyEnd} applyTaskId={applyTaskId} />
|
||||
<TaskDetail {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTaskId={applyTaskId} applyTask={applyTask} />
|
||||
)}
|
||||
></Route>
|
||||
{/* 项目/课题列表 */}
|
||||
<Route
|
||||
path="/glcc/projects"
|
||||
render={(props) => (
|
||||
<Project {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} studentApplyEnd={studentApplyEnd} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset}/>
|
||||
<Project {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} applyTask={applyTask}/>
|
||||
)}
|
||||
></Route>
|
||||
|
||||
|
|
@ -138,7 +163,7 @@ const Glcc = (propsF) => {
|
|||
<Route
|
||||
path="/glcc/subjects"
|
||||
render={(props) => (
|
||||
<Project {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} studentApplyEnd={studentApplyEnd} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} cancelCount={cancelCount}/>
|
||||
<Project {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} cancelCount={cancelCount} applyTask={applyTask}/>
|
||||
)}
|
||||
></Route>
|
||||
|
||||
|
|
@ -146,7 +171,15 @@ const Glcc = (propsF) => {
|
|||
<Route
|
||||
path="/glcc/openmmlab"
|
||||
render={(props) => (
|
||||
<Openmmlab {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} studentApplyEnd={studentApplyEnd} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset}/>
|
||||
<Openmmlab {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} applyTask={applyTask}/>
|
||||
)}
|
||||
></Route>
|
||||
|
||||
{/* 审核结果页面 */}
|
||||
<Route
|
||||
path="/glcc/result"
|
||||
render={(props) => (
|
||||
<Result current_user={current_user} history={props.history}/>
|
||||
)}
|
||||
></Route>
|
||||
|
||||
|
|
@ -154,7 +187,7 @@ const Glcc = (propsF) => {
|
|||
<Route
|
||||
path="/glcc"
|
||||
render={(props) => (
|
||||
<Home {...propsF} {...props} studentApplyStart={studentApplyStart} studentApplyEnd={studentApplyEnd}/>
|
||||
<Home {...propsF} {...props} studentApplyStart={studentApplyStart} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate}/>
|
||||
)}
|
||||
></Route>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ const $ = window.$;
|
|||
const { TabPane } = Tabs;
|
||||
|
||||
|
||||
function ProjectTabs({ list, applyTaskId, history, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd }) {
|
||||
function ProjectTabs({ list, applyTaskId, history, current_user, showLoginDialog, isStudentApplyDate, secondStudentApplyDate, applyTask }) {
|
||||
|
||||
useEffect(()=>{
|
||||
setTimeout(()=>{
|
||||
|
|
@ -34,7 +34,7 @@ function ProjectTabs({ list, applyTaskId, history, current_user, showLoginDialog
|
|||
key={i + ''} >
|
||||
<div className="tab_content">
|
||||
<div className="openmmlab_tab_content">
|
||||
<ProjectDetail detail={item} applyTaskId={applyTaskId} current_user={current_user} showLoginDialog={showLoginDialog} isStudentApplyDate={isStudentApplyDate} studentApplyEnd={studentApplyEnd} />
|
||||
<ProjectDetail detail={item} applyTaskId={applyTaskId} current_user={current_user} showLoginDialog={showLoginDialog} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTask={applyTask}/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -3,25 +3,9 @@ import { Button, message, Tooltip } from 'antd';
|
|||
import Nodata from '../../../forge/Nodata';
|
||||
import { getProjectById } from '../../api';
|
||||
|
||||
export default ({ detail, projectId, applyTaskId, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd }) => {
|
||||
export default ({ detail, projectId, applyTaskId, isStudentApplyDate, secondStudentApplyDate, applyTask }) => {
|
||||
const [info, setInfo] = useState(detail);
|
||||
|
||||
// 申请课题按钮点击函数
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(()=>{
|
||||
if(!detail && projectId){
|
||||
// 通过项目Id查询项目详情
|
||||
|
|
@ -42,7 +26,7 @@ export default ({ detail, projectId, applyTaskId, current_user, showLoginDialog,
|
|||
{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/subjects/detail/${item.id}?locked=${item.locked}`}}><Tooltip title={item.taskName}>{item.taskName}</Tooltip></div>
|
||||
<div className='mt15 oneLine leftWidth'>导师姓名: {item.tutorName}</div>
|
||||
{item.tutorMail && <div className='mb15 email oneLine leftWidth'>邮箱地址: <span><Tooltip title={item.tutorMail}>{item.tutorMail}</Tooltip></span></div>}
|
||||
</div>
|
||||
|
|
@ -50,8 +34,17 @@ export default ({ detail, projectId, applyTaskId, current_user, showLoginDialog,
|
|||
<div className="taskDesc">{item.taskDesc}</div>
|
||||
{item.taskUrl && <div className="taskUrl oneLine">课题链接: <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>)}
|
||||
<Button onClick={()=>{window.open(`/glcc/subjects/detail/${item.id}`)}} className='lookDetail'>课题详情</Button>
|
||||
{/* 报名详情按钮 */}
|
||||
{applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && <Button onClick={()=>{window.location.href=`/glcc/student/apply/${item.id}`}} className='lookDetail mr10'>报名详情</Button>}
|
||||
|
||||
{/* 课题申请时间范围内: 申请课题 */}
|
||||
{/* 第一次报名 */}
|
||||
{isStudentApplyDate && !(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>)}
|
||||
|
||||
{/* 查看课题详情按钮 */}
|
||||
<Button onClick={()=>{window.open(`/glcc/subjects/detail/${item.id}?locked=${item.locked}`)}} className='lookDetail'>课题详情</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="right oneLine taskUrl"><span className='taskReward'>¥{item.taskReward}</span></div>
|
||||
|
|
|
|||
|
|
@ -4,27 +4,9 @@ import Nodata from '../../../forge/Nodata';
|
|||
import { useEffect } from 'react';
|
||||
import { getProjectById } from '../../api';
|
||||
|
||||
export default ({ detail, projectId, applyTaskId, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd, showNotification }) => {
|
||||
export default ({ detail, projectId, applyTaskId, isStudentApplyDate, secondStudentApplyDate, showTask=true, applyTask }) => {
|
||||
const [info, setInfo] = useState(detail);
|
||||
|
||||
// 申请课题按钮点击函数
|
||||
function applyTask(id){
|
||||
// 判断用户是否已经登录
|
||||
if(current_user && current_user.login){
|
||||
// 判断用户是否已经报名两个课题
|
||||
if(studentApplyEnd) {
|
||||
showNotification("课题申请时间已截止");
|
||||
}else if(applyTaskId && Object.keys(applyTaskId).length >= 2){
|
||||
message.error('最多只能同时报名两个课题');
|
||||
}else{
|
||||
// 跳转到学生报名页
|
||||
window.location.href=`/glcc/student/apply/${id}`;
|
||||
}
|
||||
}else{
|
||||
showLoginDialog();
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(()=>{
|
||||
if(!detail && projectId){
|
||||
// 通过项目Id查询项目详情
|
||||
|
|
@ -38,16 +20,17 @@ 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项目地址: <a href={info.gitlinkUrl} className='linkUrl' target={"_blank"}>{info.gitlinkUrl}</a></p>
|
||||
<div>项目简介: {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>
|
||||
<div className="taskTitle" onClick={()=>{window.location.href=`/glcc/subjects/detail/${item.id}?locked=${item.locked}`}}><Tooltip title={item.taskName}>{item.taskName}</Tooltip></div>
|
||||
<div className='mt20 oneLine leftWidth'>导师姓名: {item.tutorName}</div>
|
||||
{item.tutorMail && <div className='mb20 email oneLine leftWidth'>邮箱地址: <span><Tooltip title={item.tutorMail}>{item.tutorMail}</Tooltip></span></div>}
|
||||
</div>
|
||||
|
|
@ -55,13 +38,22 @@ export default ({ detail, projectId, applyTaskId, current_user, showLoginDialog,
|
|||
<div className="taskDesc">{item.taskDesc}</div>
|
||||
{item.taskUrl && <div className="taskUrl oneLine">课题链接: <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>)}
|
||||
<Button onClick={()=>{window.open(`/glcc/subjects/detail/${item.id}`)}} className='lookDetail'>课题详情</Button>
|
||||
{/* 报名详情按钮 */}
|
||||
{applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && <Button onClick={()=>{window.location.href=`/glcc/student/apply/${item.id}`}} className='lookDetail mr10'>报名详情</Button>}
|
||||
|
||||
{/* 课题申请时间范围内: 申请课题 */}
|
||||
{/* 第一次报名 */}
|
||||
{isStudentApplyDate && !(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>)}
|
||||
|
||||
{/* 查看课题详情按钮 */}
|
||||
<Button onClick={()=>{window.open(`/glcc/subjects/detail/${item.id}?locked=${item.locked}`)}} 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>
|
||||
)
|
||||
}
|
||||
|
|
@ -20,7 +20,7 @@ const TaskList = Loadable({
|
|||
});
|
||||
|
||||
function Project(propsF) {
|
||||
const {location, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd, applyTaskId, setStudentInfoReset, cancelCount} = propsF;
|
||||
const {location} = propsF;
|
||||
const {pathname} = location;
|
||||
useEffect(()=>{
|
||||
window.scrollTo(0, 0);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import star from "../../img/star.png";
|
|||
const { Search } = Input;
|
||||
|
||||
// 项目列表
|
||||
function ProjectList({ applyTaskId, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd, location, showNotification, match }) {
|
||||
function ProjectList({ applyTaskId, isStudentApplyDate, location, match, secondStudentApplyDate, applyTask }) {
|
||||
let gitlinkLastUrl = match.params.gitlinkLastUrl && match.params.gitlinkLastUrl.replace(/\./g, '');
|
||||
let openmmlab = location.search && location.search.split('=')[1];
|
||||
// 输入搜索框
|
||||
|
|
@ -83,19 +83,14 @@ function ProjectList({ applyTaskId, current_user, showLoginDialog, isStudentAppl
|
|||
onVisibleChange={(visible) => { changeVisible(visible, item) }}
|
||||
key={index}
|
||||
placement={(index + 1) % 3 === 0 ? 'bottomRight' : (index + 1) % 3 % 2 === 0 ? 'bottom' : 'bottomLeft'}
|
||||
content={<ProjectDetail detail={item} applyTaskId={applyTaskId} current_user={current_user}
|
||||
showLoginDialog={showLoginDialog}
|
||||
isStudentApplyDate={isStudentApplyDate}
|
||||
studentApplyEnd={studentApplyEnd}
|
||||
showNotification={showNotification}
|
||||
/>}
|
||||
content={<ProjectDetail detail={item} applyTaskId={applyTaskId} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTask={applyTask}/>}
|
||||
trigger='click'
|
||||
overlayClassName='projectItemPopover'
|
||||
autoAdjustOverflow={false}
|
||||
>
|
||||
<div className={`projectItem ${(index + 1) % 3 === 0 || (index + 1) % 3 % 2 === 0 ? '' : 'firstBox'} ${item.projectName.replace(/ /g, '')} ${item.gitlinkLastUrl.replace(/\./g, '')}`}>
|
||||
<div className="border"></div>
|
||||
{!gitlinkLastUrl && !openmmlab && item.recommendFlag ? <img className="projectLogoStar" src={star} /> : ''}
|
||||
{!gitlinkLastUrl && !openmmlab && item.recommendFlag ? <img className="projectLogoStar" src={star} alt=''/> : ''}
|
||||
<div className="projectLogo">
|
||||
<img className="projectLogoImg" src={item.projectLogoId ? `${main_site_url}/api/attachments/${item.projectLogoId}` : logo} alt='' />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
import React, {useEffect, useState } from 'react';
|
||||
import { Button, message, Spin} from 'antd';
|
||||
import { Button, Spin, Tooltip} from 'antd';
|
||||
import { getTaskById } from '../../api';
|
||||
import bgPng from "../../img/bgPng.png";
|
||||
import '../index.scss';
|
||||
import './index.scss';
|
||||
import { getTaskById } from '../../api';
|
||||
import banner from "../../img/studentProject.png";
|
||||
import bgPng from "../../img/bgPng.png";
|
||||
|
||||
// 课题列表
|
||||
function TaskDetail(props) {
|
||||
const {match, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd, applyTaskId, showNotification} = props
|
||||
const {match, location, isStudentApplyDate, secondStudentApplyDate, applyTaskId, applyTask} = props
|
||||
const taskId = Number(match.params.taskId);
|
||||
const locked = location.search && location.search.split('=')[1] === 'true';
|
||||
const [detail, setDetail] = useState(undefined);
|
||||
|
||||
useEffect(()=>{
|
||||
|
|
@ -20,24 +20,6 @@ function TaskDetail(props) {
|
|||
})
|
||||
},[])
|
||||
|
||||
// 申请课题按钮点击函数
|
||||
function applyTask(id){
|
||||
// 判断用户是否已经登录
|
||||
if(current_user && current_user.login){
|
||||
// 判断用户是否已经报名两个课题
|
||||
if(studentApplyEnd) {
|
||||
showNotification("课题申请时间已截止");
|
||||
} else if(applyTaskId && Object.keys(applyTaskId).length >= 2){
|
||||
message.error('最多只能同时报名两个课题');
|
||||
}else{
|
||||
// 跳转到学生报名页
|
||||
window.location.href=`/glcc/student/apply/${id}`;
|
||||
}
|
||||
}else{
|
||||
showLoginDialog();
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="taskDetailBgBox">
|
||||
{/* <img className="glcc-banner" src={banner} alt=''></img> */}
|
||||
|
|
@ -66,7 +48,14 @@ 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>)}
|
||||
{/* 报名详情按钮 */}
|
||||
{applyTaskId && Object.keys(applyTaskId).includes(taskId.toString()) && <Button onClick={()=>{window.location.href=`/glcc/student/apply/${taskId}`}} className='lookDetail detailBut'>报名详情</Button>}
|
||||
|
||||
{/* 课题申请时间范围内: 申请课题 */}
|
||||
{/* 第一次报名 */}
|
||||
{isStudentApplyDate && !(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())) && (locked ? <Tooltip title={"该课题已有学生入选"}><Button type='primary' className='mr10' disabled>申请课题</Button></Tooltip> : <Button type='primary' className='applyBut mr10' onClick={()=>{applyTask(taskId)}}>申请课题</Button>)}
|
||||
</div>
|
||||
<img src={bgPng} alt='' className='bgPng1'/>
|
||||
<img src={bgPng} alt='' className='bgPng2'/>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import bgPng from "../../img/bgPng.png";
|
|||
const { Search } = Input;
|
||||
|
||||
// 课题列表
|
||||
function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd,cancelCount,showNotification}) {
|
||||
function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDialog, isStudentApplyDate, secondStudentApplyDate,cancelCount,showNotification, applyTask}) {
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [deleteTaskId, setDeleteTaskId] = useState(undefined);
|
||||
// 输入搜索框
|
||||
|
|
@ -24,19 +24,25 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
|
|||
|
||||
const columns = [
|
||||
{ title: '序号', dataIndex: 'index', align: 'center', className:"taskTableColumns", width: '6%', render: (text, item, index) => <span>{(current-1)*pageSize+index + 1}</span> },
|
||||
{ title: '课题名称', dataIndex: 'taskName', className:"taskTableColumns taskName", width: '24%', ellipsis: true, render: (text, item) => <Tooltip title={text} placement="topLeft"><span onClick={()=>{window.open(`/glcc/subjects/detail/${item.id}`)}}>{text}</span></Tooltip> },
|
||||
{ title: '课题名称', dataIndex: 'taskName', className:"taskTableColumns taskName", width: '24%', ellipsis: true, render: (text, item) => <Tooltip title={text} placement="topLeft"><span onClick={()=>{window.open(`/glcc/subjects/detail/${item.id}?locked=${item.locked}`)}}>{text}</span></Tooltip> },
|
||||
{ title: '课题类型', dataIndex: 'projectType', className:"taskTableColumns", width: '12%', ellipsis: true, },
|
||||
{ title: '项目名称', dataIndex: 'projectName', className:"taskTableColumns", width: '24%', ellipsis: true, render: (text) => <Tooltip title={text} placement="topLeft">{text}</Tooltip> },
|
||||
{ title: '课题奖金', dataIndex: 'taskReward', className:"taskTableColumns", ellipsis: true, width: `${isStudentApplyDate || studentApplyEnd ? '10%' : ''}`, render: (text) => <Tooltip title={text} placement="topLeft"><span>{text}</span></Tooltip> },
|
||||
{ title: '课题奖金', dataIndex: 'taskReward', className:"taskTableColumns", ellipsis: true, width: '10%', render: (text) => <Tooltip title={text} placement="topLeft"><span>{text}</span></Tooltip> },
|
||||
{
|
||||
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>
|
||||
<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>)}
|
||||
{/* 报名详情按钮 */}
|
||||
{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>}
|
||||
|
||||
{/* 课题申请时间范围内: 申请课题 */}
|
||||
{/* 第一次报名 */}
|
||||
{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>}
|
||||
{/* 第二次报名 锁定状态 */}
|
||||
{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>)}
|
||||
</div>
|
||||
)
|
||||
})
|
||||
|
|
@ -65,7 +71,7 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
|
|||
}
|
||||
|
||||
const expandRow = (record) => {
|
||||
return <ProjectDetail detail={null} projectId={record.regId} applyTaskId={applyTaskId} current_user={current_user} showLoginDialog={showLoginDialog} isStudentApplyDate={isStudentApplyDate} studentApplyEnd={studentApplyEnd} showNotification={showNotification}/>
|
||||
return <ProjectDetail detail={null} projectId={record.regId} applyTaskId={applyTaskId} current_user={current_user} showLoginDialog={showLoginDialog} isStudentApplyDate={isStudentApplyDate} showNotification={showNotification} secondStudentApplyDate={secondStudentApplyDate} applyTask={applyTask}/>
|
||||
}
|
||||
|
||||
// 展开收起行回调
|
||||
|
|
@ -79,24 +85,6 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
|
|||
setExpandedRowKeys(Array.from(keys));
|
||||
}
|
||||
|
||||
// 申请课题按钮点击函数
|
||||
function applyTask(id){
|
||||
// 判断用户是否已经登录
|
||||
if(current_user && current_user.login){
|
||||
// 判断用户是否已经报名两个课题
|
||||
if(studentApplyEnd) {
|
||||
showNotification("课题申请时间已截止");
|
||||
} else if(applyTaskId && Object.keys(applyTaskId).length >= 2){
|
||||
message.error('最多只能同时报名两个课题');
|
||||
}else{
|
||||
// 跳转到学生报名页
|
||||
window.location.href=`/glcc/student/apply/${id}`;
|
||||
}
|
||||
}else{
|
||||
showLoginDialog();
|
||||
}
|
||||
}
|
||||
|
||||
// 取消课题按钮点击函数
|
||||
function cancelApply(){
|
||||
const id = [];
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@
|
|||
color: #466aff;
|
||||
&:hover{color:#5d7cff !important;}
|
||||
&:active{color:#1140ff !important;}
|
||||
&.disabled .disabled{
|
||||
&:hover, &:active{color:#a4aabb !important;}
|
||||
color:#a4aabb;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
.applyTask, span.applyTask{
|
||||
color:#eb9350;
|
||||
|
|
|
|||
Loading…
Reference in New Issue