merge gitlink

This commit is contained in:
caishi 2023-07-07 17:50:13 +08:00
commit e8ed1a7d7c
23 changed files with 2346 additions and 1590 deletions

2888
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -34,7 +34,7 @@ $primary-color:#466aff;
text-align: center;
}
}
.contentBox{
.contentForm{
padding:20px 20px 0px 20px;
& > div{
margin-bottom: 20px;

View File

@ -76,7 +76,7 @@ function Team(props){
</div>
{
list && list.length > 0 ?
<div className="contentBox">
<div className="contentForm">
{
list.map((item,key)=>{
return(

View File

@ -45,8 +45,7 @@ export function studentApplyEdit(data) {
});
}
// 获取当前学生用户报名信息
// 课题列表
// 项目列表
export function projectList(params) {
return fetch({
url: `/api/applyInformation/list`,
@ -55,6 +54,15 @@ export function projectList(params) {
});
}
// 0元项目列表
export function freeProjectList(params) {
return fetch({
url: `/api/applyInformation/projectListFor0`,
method: 'get',
params
});
}
// 课题列表
export function taskList(params) {
return fetch({
@ -64,6 +72,15 @@ export function taskList(params) {
});
}
// 0元课题列表
export function freeTaskList(params) {
return fetch({
url: `/api/applyInformation/taskListFor0`,
method: 'get',
params
});
}
// 项目id查询项目详情
export function getProjectById(id, params) {
return fetch({

View File

@ -75,7 +75,7 @@ function Apply(props) {
<div className={`explain`}>
<p className='font-15 c000'>申请说明</p>
<div>1项目报名时间为<span className='c000'>4月29日5月30日</span>请在报名截止时间北京时间<span className='c000'>2023年5月30日24点</span>前提交报名信息</div>
<div>2本次GLCC夏令营建议使用GitLink为代码托管平台学生基于GitLink上项目完成编程任务同时也欢迎使用其他代码托管平台的项目参与活动目前GLCC只对夏令营期间使用GitLink托管的项目提供部分金支持</div>
<div>2本次GLCC夏令营建议使用GitLink为代码托管平台学生基于GitLink上项目完成编程任务同时也欢迎使用其他代码托管平台的项目参与活动目前GLCC只对夏令营期间使用GitLink托管的项目提供部分金支持</div>
<div>3如果您的项目还未迁移到GitLink上迁移事项请查看<a href='https://forum.gitlink.org.cn/forums/7296/detail' target="_blank" className='link'>迁移说明文档</a>如在迁移过程中遇到问题请加qq群: 1071514693 联系qq群管理员</div>
<div>4提交社区和题目信息后欢迎与组委会联系沟通宣传推广和后续合作工作联系人微信: _TigerWang备注GitLink编程夏令营</div>
<div><span className='c000'>5奖金默认由项目方支持请根据课题难度设定金额若您可能无法支撑本课题奖金GLCC组委会将进行资助评审择优资助如未获得资助将下线该课题</span></div>

View File

@ -131,9 +131,9 @@ function Check({ current_user, showNotification, currentRound }) {
{record.locked && !record.used && <Tooltip title="恭喜,该学生已成功入选您的课题!"><Button disabled type="primary" className='greenColBor'>已入选</Button></Tooltip>}
{/* 学生已经被其他导师锁定 */}
{record.locked && record.used && <Tooltip title="此学生已入选其他课题"><Button disabled type="primary" className='redColBor'>已被选</Button></Tooltip>}
{/* 学生未被锁定 */}
{!record.locked && !record.used && (text ? <Button type="default" onClick={() => { checkStudent(record.id, 0) }}>撤销</Button> :
<Button disabled={havePass} type="primary" onClick={() => { checkStudent(record.id, 1) }}>通过</Button>)}
{/* 导师邮箱与系统绑定邮箱进行判断 + 学生未被锁定 */}
{record.tutorMail === current_user.email && (!record.locked && !record.used && (text ? <Button type="default" onClick={() => { checkStudent(record.id, 0) }}>撤销</Button> :
<Button disabled={havePass} type="primary" onClick={() => { checkStudent(record.id, 1) }}>通过</Button>))}
</div>
)
})

View File

@ -2,8 +2,6 @@ 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";
@ -12,7 +10,7 @@ import '../project/index.scss';
const { Search } = Input;
//
function CheckResult({current_user, history}) {
function CheckResult({current_user, history, round}) {
//
const [keyword, setKeyword] = useState(undefined);
const [data, setData] = useState([]);
@ -22,7 +20,6 @@ function CheckResult({current_user, history}) {
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(()=>{
//
@ -44,6 +41,7 @@ function CheckResult({current_user, history}) {
curPage: current,
keyword,
pageSize,
round
}
getPassList(params).then(response => {
if (response && response.message === "success") {
@ -58,9 +56,9 @@ function CheckResult({current_user, history}) {
{ 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: 'school', className:"columnsResult taskName", width: '12%', ellipsis: true,render: (text) => <Tooltip title={text} placement="topLeft"><span className='toolTipSpan'>{text}</span></Tooltip>},
{ 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: 'profession', className:"columnsResult taskName", width: '12%', ellipsis: true, render: (text) => <Tooltip title={text} placement="topLeft"><span className='toolTipSpan'>{text || '-'}</span></Tooltip>},
{ 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.taskId}`)}}>{text}</span></Tooltip> },
{ 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/2023/subjects/detail/${item.taskId}`)}}>{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"},
]
@ -107,11 +105,10 @@ function CheckResult({current_user, history}) {
return (
<div className="resultListBox">
{time && <img className="resultBanner" src={resultBanner} alt=""></img>}
{new Date().getTime() > new Date('2022/07/01 12:0').getTime() && <img className="resultBanner" src={resultBanner2} alt=""></img>}
<img className="resultBanner" src={resultBanner2} alt=""></img>
<div className='bgBox'>
<div className="resultList">
<div className='goBackBox'><a href='/glcc'>开源夏令营 / </a>入选学生名单{time && '预'}公示</div>
<div className='goBackBox'><a href='/glcc'>开源夏令营 / </a>入选学生名单公示</div>
<Search className='search' placeholder='请输入学生姓名或课题名称进行搜索' allowClear enterButton onSearch={(value) => { setCurrent(1); setKeyword(value) }} />
<Table
loading={loading}

View File

@ -0,0 +1,47 @@
import React, { useState } from 'react';
import { Button, Tooltip } from 'antd';
import Nodata from '../../../forge/Nodata';
import { useEffect } from 'react';
import { getProjectById } from '../../api';
export default ({ detail, projectId }) => {
const [info, setInfo] = useState(detail);
useEffect(()=>{
if(!detail && projectId){
// Id
getProjectById(projectId, {round: 2, isFree: true}).then(response=>{
if(response && response.message === 'success'){
setInfo(response.data)
}
})
}
},[detail])
return (
info ? <div className={`projectDetailBox ${detail ? '':'byTask'}`}>
<div className={`projectDetailHead`}>
<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 ? info.registrationTaskList.map((item, index)=>{
return <div className='taskItem mt20' key={index}>
<div className="left">
<div className="taskTitle"><Tooltip title={item.taskName}>{item.taskName}</Tooltip></div>
<div className='mt20 oneLine leftWidth'>导师姓名: &nbsp;&nbsp;{item.tutorName}</div>
{item.tutorMail && <div className='mb20 email oneLine leftWidth'>邮箱地址: &nbsp;&nbsp;<span><Tooltip title={item.tutorMail}>{item.tutorMail}</Tooltip></span></div>}
</div>
<div className="center">
<div className="taskDesc"><Tooltip title={item.taskDesc}>{item.taskDesc}</Tooltip></div>
{item.taskUrl && <div className="taskUrl oneLine">课题链接: &nbsp;&nbsp;<a href={item.taskUrl} target={"_blank"}>{item.taskUrl}</a></div>}
<div></div>
</div>
<div className="right oneLine taskUrl"><span className='taskReward'>{item.taskReward}</span></div>
</div>
}) : <Nodata _html="课题暂无数据" small={true}/>}
</div>: <div className="projectDetailBox nodata"><Nodata _html="暂无数据" small={true}/></div>
)
}

View File

@ -0,0 +1,66 @@
import React from 'react';
import { Spin } from 'antd';
import { Route, Switch } from "react-router-dom";
import banner from "../img/studentProject2.png";
import './index.scss';
import Loadable from "react-loadable";
import Loading from "../../Loading";
import { Link } from 'react-router-dom';
import { useEffect } from 'react';
//
const ProjectList = Loadable({
loader: () => import("./projectList"),
loading: Loading,
});
//
const TaskList = Loadable({
loader: () => import("./taskList"),
loading: Loading,
});
function FreeProject(propsF) {
const {location: {pathname}} = propsF;
useEffect(()=>{
window.scrollTo(0, 0);
},[])
console.log('FreeProject');
return(
<div className="glcc_project">
<div className='projectBannerBox'>
<img className="glcc-banner" src={banner} alt=''></img>
</div>
<div className='head'>
<Link to={`/glcc/freesubject`} className={!pathname.endsWith('freeproject') ? 'active' : ''}>课题列表</Link>
<Link to={`/glcc/freeproject`} className={pathname.endsWith('freeproject') ? 'active' : ''}>项目列表</Link>
</div>
<div className='gobackBox'>
<a href={`/glcc`}>开源夏令营 / </a>
无奖金课题及项目列表
</div>
<div className="head_introduce mt30 mb30">
<h4 className="head_tit">申请说明</h4>
<div className="head_content">1参与GitLink编程夏令营无奖金项目的同学<span className='head_bold'>请通过邮件或电话与课题导师直接沟通并根据导师课题要求完成课题无需在GLCC平台报名课题</span></div>
<div className="head_content">2参与GitLink编程夏令营无奖金项目的同学如完成课题并经导师评定通过将会在GLCC官网进行公示无奖金奖励</div>
<div className="head_content">3活动最终解释权归GLCC所有</div>
</div>
<Spin spinning={false}>
<Switch {...propsF}>
<Route
path="/glcc/freeproject"
render={(props) => (
<ProjectList {...propsF} {...props}/>
)}
></Route>
<Route
path="/glcc/freesubject"
render={(props) => (
<TaskList {...propsF} {...props}/>
)}
></Route>
</Switch>
</Spin>
</div>
)
}
export default FreeProject;

View File

@ -0,0 +1,229 @@
.glcc_project{
background-color: #ebf2ff;
.head{
background-color:rgba(188, 208, 255, 0.27);
border:1px solid #ffffff;
text-align: center;
a{
padding: 18px 20px 20px;
display: inline-block;
color: #273778;
font-size: 18px;
font-weight:700;
line-height: 30px;
&.active{
border-bottom: 1px solid #5474df;;
}
&:last-child{
margin-left: 40px;
}
}
}
.gobackBox{
width: 1200px;
margin: 0 auto;
padding: 25px 0 12px;
color: #202d40;
font-size: 16px;
border-bottom: 1px dashed #bec5d5;
a{
color:#a4aabb;
}
}
.listBox{
background-image:linear-gradient(180deg,#ebf2ff 0%,#ebf2ff 43.09%,#f3f4f8 100%);
position: relative;
.bgPng3, .bgPng4{
width: 146px;
position: absolute;
z-index: 0;
top: 162px;
left: 100px;
}
.bgPng4{
top: 450px;
left: auto;
right: 310px;
}
}
}
.glcc-banner {
width: 100%;
}
// 项目详情框
.projectDetailBox{
&.byTask{
background-image:linear-gradient(180deg,#f1f5ff 0%,#ffffff 100%);
border:1px solid #ffffff;
border-radius:4px;
box-shadow:0px 0px 10px rgba(100, 141, 255, 0.2);
padding: 30px 30px 50px;
.taskItem{
.center{
width: 640px;
}
}
}
&.nodata{width: 200px;}
font-size:15px;
line-height:30px;
.projectDetailHead{
color:#465474;
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;
font-size:20px;
}
.type{
display: inline-block;
border:1px solid #6680bb;
border-radius:4px;
margin-left: 12px;
padding: 4px 6px;
line-height: 26px;
}
.linkUrl{
color: #466aff;
}
}
.taskItem {
display: flex;
justify-content: space-between;
border:1px solid #ffffff;
&:hover{ box-shadow: 0px 0px 12px rgba(71, 105, 198, 0.4);}
.oneLine{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.left{
width: 316px;
background-image: url('../img/projectDetailTaskBg.png');
background-size: 100% 100%;
padding: 22px 20px;
color:#25304a;
.taskTitle{
color:#1834a7;
font-size:18px;
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
}
.email span{color:#466aff;}
.leftWidth{width: 270px;}
}
.center{
width: 665px;
text-align: left;
padding: 20px;
display: flex;
flex-direction: column;
justify-content: space-between;
.taskDesc{
color:#6b6b6b;
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
}
.taskUrl{
color:#465474;
font-size:16px;
line-height: 28px;
margin-bottom: 5px;
a{color:#466aff;}
}
.applyBut{
background-color:#466aff;
border-color: #466aff;
&:hover{background-color:#5d7cff;}
&:focus{background-color:#1140ff;}
}
.taskReward{color:#ff8800;}
}
.right{
margin-top: 35px;
padding-right: 10px;
width: 120px;
font-weight:700;
color:#ff8800;
font-size:24px;
}
}
}
.ant-popover.projectItemPopover{
width: 1200px;
z-index: 1000;
.ant-popover-content .ant-popover-arrow{
border-width: 12px;
}
}
.projectItemPopover .ant-popover-inner{
transform: translateY(8px);
background-image:linear-gradient(180deg,#f1f5ff 0%,#ffffff 100%);
border:1px solid #ffffff;
border-radius:4px;
box-shadow:0px 0px 10px rgba(100, 141, 255, 0.2);
.ant-popover-inner-content{
padding: 30px 30px 50px;
}
}
.lookDetail{
border-color: #466aff;
color: #466aff;
&:hover{
border-color: #5d7cff;
color: #5d7cff;
}
&:focus{
border-color: #1140ff;
color: #1140ff;
}
}
.projectBannerBox{
position: relative;
.stuApplytimeBox{
background-image: url('../img/studentProject1.png');
position: absolute;
color: #FFDC95;
font-size: 20px;
bottom: 28%;
left: 50%;
margin-left: -250px;
width: 500px;
height: 60px;
line-height: 60px;
text-align: center;
background-size: 100% 100%;
}
}
.head_introduce {
width: 1200px;
margin: 0 auto;
background: #e4edff;
padding: 20px;
}
.head_tit {
color: #000000;
font-size: 15px;
line-height: 2;
}
.head_content {
color: #6c7283;
font-size: 14px;
line-height: 38px;
}
.head_bold {
font-weight: 700;
color: #333;
}

View File

@ -0,0 +1,75 @@
import React, { useEffect, useState } from 'react';
import { Input, Popover, Spin } from 'antd';
import { main_site_url } from '../../fetch';
import './index.scss';
import { freeProjectList, projectList } from '../../api';
import ProjectDetail from '../component/projectDetail';
import bgPng from "../../img/bgPng.png";
import logo from "../../img/logo.png";
import star from "../../img/star.png";
import Nodata from '../../../forge/Nodata';
const { Search } = Input;
//
function ProjectList() {
const [data, setData] = useState([]);
const [loading, setLoading] = useState(false);
useEffect(() => {
setLoading(true);
const params = {
curPage: 1,
pageSize: 10000,
round: 2
}
freeProjectList(params).then(response => {
if (response && response.message === "success") {
setData(response.data.rows);
}
setLoading(false);
})
}, [])
// taskList
function changeVisible(visible, item) {
if (visible) {
let height = document.documentElement.clientWidth / 1920 * 500 + 70 + document.querySelector(`.${item.gitlinkLastUrl}`).offsetTop + item.registrationTaskList.length * 320;
document.querySelector('#taskList').style.height = height + 'px';
} else {
document.querySelector('#taskList').style.height = 'auto';
}
}
return (
<div id="taskList" className="taskList listBox">
<Spin spinning={loading}>
<div className='projectListBox'>
{data && data.map((item, index) => {
return <Popover
onVisibleChange={(visible) => { changeVisible(visible, item) }}
key={index}
placement={(index + 1) % 3 === 0 ? 'bottomRight' : (index + 1) % 3 % 2 === 0 ? 'bottom' : 'bottomLeft'}
content={<ProjectDetail detail={item}/>}
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}`}>
<div className="border"></div>
<div className="projectLogo">
<img className="projectLogoImg" src={item.projectLogoId ? `${main_site_url}/api/attachments/${item.projectLogoId}` : logo} alt='' />
</div>
<div className="title">{item.projectName}</div>
<div className="intro">{item.projectIntro}</div>
</div>
</Popover>
})}
</div>
{data && !data.length && <div style={{paddingBottom: '50px'}}><Nodata _html="暂无数据"/></div>}
</Spin>
<img src={bgPng} alt='' className='bgPng3' />
<img src={bgPng} alt='' className='bgPng4' />
</div>
)
}
export default ProjectList;

View File

@ -0,0 +1,85 @@
.projectListBox{
width: 1200px;
margin: 0 auto;
position: relative;
z-index: 1;
display: flex;
flex-wrap: wrap;
// justify-content: space-between;
.projectItem{
position: relative;
width: 30%;
background-image: linear-gradient(180deg,rgba(232, 237, 255, 0.85) 0%,rgba(255, 255, 255, 0.85) 100%);
border: 1px solid;
border-color: #ffffff;
border-radius: 4px;
box-shadow:0px 0px 8px rgba(93, 131, 255, 0.26);
text-align: center;
margin-bottom: 50px;
background-image: url('../../img/projectBg.png');
background-size: 100% 100%;
margin-left: 5%;
&.firstBox{
margin-left: 0;
}
&:hover{
cursor: pointer;
background-image: none;
// #E8EDFF#FFFFFF85%
background-image: linear-gradient(180deg,rgba(232, 237, 255, 0.85) 0%,rgba(255, 255, 255, 0.85) 100%);
}
.border{
height: 5px;
background-color:#657edf;
border-radius:2px 2px 0px 0px;
}
.projectLogoStar{
position: absolute;
top:30px;
right: 130px;
width: 28px;
z-index: 10;
transform: rotate(46deg);
}
.projectLogo{
position: relative;
width: 100px;
height: 100px;
border: 1px solid #fff;
background-color: #fff;
border-radius: 50%;
text-align: center;
overflow: hidden;
margin: 25px auto 10px;
line-height: 95px;
.projectLogoImg{
width: 100%;
// height: 100%;
// display: block;
}
}
.title{
color:#2a51bf;
font-size:17px;
line-height:30px;
margin-bottom: 15px;
padding: 0 50px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.intro{
color:#4f5d84;
font-size:15px;
margin-bottom: 15px;
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
text-align: left;
padding: 0 14px;
}
}
}

View File

@ -0,0 +1,106 @@
import React, { useEffect, useState } from 'react';
import { Table, Tooltip } from 'antd';
import './index.scss';
import { freeTaskList, taskList } from '../../api';
import ProjectDetail from '../component/projectDetail';
import bgPng from "../../img/bgPng.png";
//
function TaskList() {
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 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: '28%', ellipsis: true, render: (text, item) => <Tooltip title={text} placement="topLeft"><span>{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: '10%', render: (text) => <Tooltip title={text} placement="topLeft"><span>{text}</span></Tooltip> },
{ title: '操作', dataIndex: 'action', align: 'center', className:"actionColumns taskTableColumns"},
]
const customExpandIcon = (props) => {
if (props.expanded) {
return <a className='actionBox' 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='actionBox' 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}/>
}
//
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);
}
useEffect(() => {
setExpandedRowKeys([]);
setLoading(true);
const params = {
curPage: current,
pageSize,
round: 2
}
freeTaskList(params).then(response => {
if (response && response.message === "success") {
setData(response.data.rows);
setTotal(response.data.total);
}
setLoading(false);
})
}, [current, pageSize])
return (
<div className="taskList listBox">
<div className="listTable">
<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}}
/>
</div>
<img src={bgPng} alt='' className='bgPng3'/>
<img src={bgPng} alt='' className='bgPng4'/>
</div>
)
}
export default TaskList;

View File

@ -0,0 +1,116 @@
.taskList{
padding-bottom: 50px;
.ant-table{
border: 1px solid white;
}
.ant-pagination-item-active, .ant-pagination-item:hover, .ant-pagination-next:not(.ant-pagination-disabled) .ant-pagination-item-link:hover, .ant-select-selection:hover, .ant-pagination-options-quick-jumper:hover input{
border-color: #466aff;
a{color: #466aff;}
}
.ant-pagination-disabled .ant-pagination-item-link:hover .anticon{
color: rgba(0, 0, 0, 0.25);
}
.listTable{
width: 1200px;
margin: 0 auto;
position: relative;
z-index: 1;
}
}
.taskTableColumns span div span{
font-size: 16px;
font-weight:700;
color:#273778;
}
.taskTableColumns span{
font-size: 15px;
color: #353f5e;
}
.ant-table-tbody .taskTableColumns.taskName span{
color: #2545c9;
}
.ant-table-thead > tr > .taskTableColumns, .ant-table-tbody > tr > .taskTableColumns{
background-color:#F1F6FF;
border-bottom: 1px dashed #bec5d5;
}
.ant-table-tbody > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > .taskTableColumns{
background-color:#fbfbfc;
}
.actionColumns{
display: flex;
.actionBox, .actionBox span{
cursor: pointer;
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;
&:hover{color: #FFB074 !important;}
&:active{color:#D66A17 !important;}
}
.cancelApply{visibility: hidden;}
}
tr:hover .actionColumns .cancelApply{
visibility: visible;
color: #E31E1E;
}
.cancelApplyTask{
.ant-modal-close{top: 0px !important;}
.ant-modal-header{
padding: 8px 20px;
background-color: #e9edff;
.ant-modal-title{text-align: left;}
}
.carefulIcon{
width: 36px;
height: 36px;
background: #ca0002;
display: inline-block;
border-radius: 50%;
text-align: center;
line-height: 36px;
font-size: 18px;
color: white;
margin-right: 15px;
}
.tilTask{
color:#333333;
font-size:16px;
margin-left: 35px;
}
.tipTask{
color:#666666;
font-size:14px;
margin: 10px 0 10px 37px!important;
}
.tipTaskTime{
font-size: 36px;
color: #df0002;
}
.ant-modal-footer{
border-top: none;
text-align: center;
padding-bottom: 50px;
.ant-btn{
&.ant-btn-default{
color: #df0002;
}
&:hover{
border-color: #466aff;
color: #466aff;
&.ant-btn-default{
border-color: #df0002;
color: #df0002;}
}
}
.ant-btn-default{
margin-left:43px;
}
}
}

View File

@ -22,7 +22,7 @@ import './index.scss';
// period: "repoApply"
// match:{params:{id=2023}}
export default (props) => {
const { current_user, history, round, match:{params:{id=2023}}, period, showLoginDialog, glccSettings, repoPublic, showMatchingBut} = props;
const { current_user, history, round, match:{params:{id=2023}}, period, showLoginDialog, glccSettings, repoPublic, showMatchingBut, isResultPublic} = props;
useEffect(() => {
if (!current_user.user_id) {
@ -30,10 +30,6 @@ export default (props) => {
}
}, [])
function goToCheckResult(){
history.push("/glcc/result");
}
//
function gotoCheckLogin(url){
if(current_user && current_user.login){
@ -86,11 +82,20 @@ export default (props) => {
{repoPublic && <Link to={`/glcc/${id}/projects`} className="apply project" >
<div>
<img src={apply1} alt="" className="applyIcon" />
<span className="hover-none"><span className="til">查看项目</span> </span>
<span className="hover-none"><span className="til">有奖金项目</span> </span>
</div>
<div className="pt6">掌握项目课题详细信息</div>
</Link>}
{/* 0元项目 */}
<Link to={`/glcc/freeproject`} className="apply project" >
<div>
<img src={apply1} alt="" className="applyIcon" />
<span className="hover-none"><span className="til">无奖金项目</span> </span>
</div>
<div className="pt6">欢迎广大学生踊跃参与</div>
</Link>
{/* 学生报名6.24结束第一次报名6.29 1:00 - 6.30 24:00第二次报名 */}
{(period === "stuApply" || period === "stuApply1") && <div className="apply" onClick={()=>{gotoCheckLogin(`/glcc/${id}/subjects`)}}>
<div>
@ -108,14 +113,15 @@ export default (props) => {
</div>
<div className="pt6">以赛代筛挖掘高潜力人才</div>
</div>}
{/* 6.28.-7.1 审核结果仅对导师可见7.1之后对所有用户可见*/}
{/* {resultTime2 && <div className="apply" onClick={goToCheckResult}>
{/* 学生-课题匹配结果公示 */}
{isResultPublic && <div className="apply" onClick={()=>{history.push("/glcc/result");}}>
<div>
<img src={apply2} alt="" className="applyIcon" />
<span className="til">名单{resultTime1 ? '预' : ''}公示</span>
<span className="til">名单公示</span>
</div>
<div className="pt6">查看各课题入选学生名单</div>
</div>} */}
</div>}
{/* 学生结项考核 */}
{/* {!hasRole && checkedTaskId && <Link className="apply" to={`/glcc/submission`}>

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

View File

@ -46,6 +46,12 @@ const Project = Loadable({
loader: () => import("./project"),
loading: Loading,
});
// 0
const FreeProject = Loadable({
loader: () => import("./freeProject"),
loading: Loading,
});
//
const TaskDetail = Loadable({
loader: () => import("./project/taskDetail"),
@ -92,6 +98,9 @@ const Glcc = (propsF) => {
const [applyRepo, setApplyRepo] = useState(false);
// -
const [isMatching, setIsMatching] = useState(false);
// -
const [isResultPublic, setIsResultPublic] = useState(false);
console.log('isResultPublic', isResultPublic);
useEffect(()=>{
if(id && id === "2022"){
@ -113,8 +122,11 @@ const Glcc = (propsF) => {
// -
const matching = res.data.filter(item=>item.name === "matching");
matching[0] && setIsMatching(judge(nowTime, matching[0].value, "range"))
// /
const filterRepoPublic = res.data.filter(item=>["repoPublic", "repoApply1"].indexOf(item.name) === -1);
// -
const resultPublic = res.data.filter(item=>item.name === "stuPublic");
resultPublic[0] && setIsResultPublic(judge(nowTime, resultPublic[0].value, "range"))
//
const filterRepoPublic = res.data.filter(item=>["repoPublic", "repoApply1", "matching", "stuPublic"].indexOf(item.name) === -1);
const periodIndex = filterRepoPublic.findIndex(item=>judge(nowTime, item.value, "range"));
periodIndex !== -1 && setPeriod(filterRepoPublic[periodIndex].name);
}
@ -133,6 +145,8 @@ const Glcc = (propsF) => {
// id
const [applyTaskId, setApplyTaskId] = useState({});
// idsubround: 1
const [apply1TaskId, setApply1TaskId] = useState({});
//
const [studentInfoReset, setStudentInfoReset] = useState(undefined);
const [cancelCount,setCancelCount]=useState(0);
@ -164,13 +178,19 @@ const Glcc = (propsF) => {
if(response && response.message === "success"){
// setData(response.data.rows);
const data = {};
const data1 = {};
response.data && response.data.registrationStudentTaskList.map(item=>{
data[item.taskId] = item.id;
item.locked && setLockedTaskName(item.taskName);
item.passStatus && item.mediumExaminationPass && setCheckedTaskId(item.taskId);
item.passStatus && item.mediumExaminationPass && setStudentRegId(item.studentRegId);
//
if(item.subRound === 1){
data1[item.taskId] = item.id;
}
})
setApplyTaskId(data);
setApply1TaskId(data1);
response.data && setCancelCount(Number(response.data.cancelCount));
}
})
@ -183,9 +203,9 @@ const Glcc = (propsF) => {
//
if(lockedTaskName){
message.error(`由于你已入选 ${lockedTaskName} 课题,无法申请其他课题`);
}else if(applyTaskId && Object.keys(applyTaskId).length >= 2){
}else if(apply1TaskId && Object.keys(apply1TaskId).length >= 2){
//
message.error('最多只能同时报名两个课题');
message.error('超出可报名课题数量上限');
}else{
//
window.location.href=`/glcc/student/apply/${id}`;
@ -199,7 +219,7 @@ const Glcc = (propsF) => {
<div className="newMain clearfix">
<Switch {...propsF}>
{/* 学生报名 */}
{period === "stuApply" && <Route
{(period === "stuApply" || period === "stuApply1") && <Route
path="/glcc/student/apply/:taskId"
render={(props) => (
<Student {...propsF} {...props} round={round} period={period} setStudentInfoReset={setStudentInfoReset}/>
@ -226,6 +246,15 @@ const Glcc = (propsF) => {
<Check {...propsF} {...props} currentRound={currentRound}/>
)}
></Route>}
{/* 导师-学生配对结果公示页面 */}
{isResultPublic && <Route
path="/glcc/result"
render={(props) => (
<Result current_user={current_user} history={props.history} round={round}/>
)}
></Route>}
{/* 帮助中心 */}
<Route
path="/glcc/help"
@ -251,10 +280,25 @@ const Glcc = (propsF) => {
{!(round === 2 && !repoPublic) && <Route
path="/glcc/:id/subjects"
render={(props) => (
<Project period={period} round={round} {...propsF} {...props} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} cancelCount={cancelCount} applyTask={applyTask} currentRound={currentRound}/>
<Project period={period} round={round} {...propsF} {...props} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} cancelCount={cancelCount} applyTask={applyTask} currentRound={currentRound} lockedTaskName={lockedTaskName}/>
)}
></Route>}
{/* 0元项目/课题列表 */}
<Route
path="/glcc/freesubject"
render={(props) => (
<FreeProject {...propsF} {...props}/>
)}
></Route>
<Route
path="/glcc/freeproject"
render={(props) => (
<FreeProject {...propsF} {...props}/>
)}
></Route>
{/* openmmlab列表 */}
<Route
path="/glcc/openmmlab"
@ -263,14 +307,6 @@ const Glcc = (propsF) => {
)}
></Route>
{/* 审核结果页面 */}
<Route
path="/glcc/result"
render={(props) => (
<Result current_user={current_user} history={props.history}/>
)}
></Route>
{/* 中期审核-结果公示 */}
<Route
path="/glcc/:id/final/result"
@ -299,7 +335,7 @@ const Glcc = (propsF) => {
<Route
path="/glcc/:id"
render={(props) => (
<Home repoPublic={repoPublic} period={period} round={round} {...propsF} {...props} checkedTaskId={checkedTaskId} glccSettings={glccSettings} showMatchingBut={isMatching && hasRole}/>
<Home repoPublic={repoPublic} period={period} round={round} {...propsF} {...props} checkedTaskId={checkedTaskId} glccSettings={glccSettings} showMatchingBut={isMatching && hasRole} isResultPublic={isResultPublic}/>
)}
></Route>
@ -307,7 +343,7 @@ const Glcc = (propsF) => {
<Route
path="/glcc"
render={(props) => (
<Home repoPublic={repoPublic} period={period} round={round} {...propsF} {...props} checkedTaskId={checkedTaskId} glccSettings={glccSettings} showMatchingBut={isMatching && hasRole}/>
<Home repoPublic={repoPublic} period={period} round={round} {...propsF} {...props} checkedTaskId={checkedTaskId} glccSettings={glccSettings} showMatchingBut={isMatching && hasRole} isResultPublic={isResultPublic}/>
)}
></Route>

View File

@ -10,7 +10,7 @@ export default ({ detail, projectId, applyTaskId, period, showTask=true, applyTa
useEffect(()=>{
if(!detail && projectId){
// Id
getProjectById(projectId, {round}).then(response=>{
getProjectById(projectId, {round, isFree: false}).then(response=>{
if(response && response.message === 'success'){
setInfo(response.data)
}

View File

@ -52,9 +52,9 @@ function TaskDetail(props) {
{/* 课题申请时间范围内: 申请课题 */}
{/* 第一次报名 */}
{round === currentRound && period==="stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(taskId.toString())) && <Button type='primary' className='applyBut detailBut' onClick={()=>{applyTask(taskId)}}>申请课题</Button>}
{detail.taskReward > 0 && round === currentRound && period==="stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(taskId.toString())) && <Button type='primary' className='applyBut detailBut' onClick={()=>{applyTask(taskId)}}>申请课题</Button>}
{/* 第二次报名 锁定状态 */}
{round === currentRound && period === "stuApply1" && !(applyTaskId && Object.keys(applyTaskId).includes(taskId.toString())) && (detail.locked ? <Tooltip title={"该课题已有学生入选"}><Button type='primary' className='mr10 detailBut' disabled>申请课题</Button></Tooltip> : <Button type='primary' className='applyBut mr10 detailBut' onClick={()=>{applyTask(taskId)}}>申请课题</Button>)}
{detail.taskReward > 0 && round === currentRound && period === "stuApply1" && !(applyTaskId && Object.keys(applyTaskId).includes(taskId.toString())) && (detail.locked ? <Tooltip title={"该课题已有学生入选"}><Button type='primary' className='mr10 detailBut' disabled>申请课题</Button></Tooltip> : <Button type='primary' className='applyBut mr10 detailBut' onClick={()=>{applyTask(taskId)}}>申请课题</Button>)}
</div>
<img src={bgPng} alt='' className='bgPng1'/>
<img src={bgPng} alt='' className='bgPng2'/>

View File

@ -7,7 +7,7 @@ import bgPng from "../../img/bgPng.png";
const { Search } = Input;
//
function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDialog,cancelCount,showNotification, applyTask, round, match:{params:{id}}, period, currentRound }) {
function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDialog,cancelCount,showNotification, applyTask, round, match:{params:{id}}, period, currentRound, lockedTaskName }) {
const [visible, setVisible] = useState(false);
const [deleteTaskId, setDeleteTaskId] = useState(undefined);
//
@ -21,6 +21,8 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
const [expandedRowKeys, setExpandedRowKeys] = useState([]);
//
const [apply, setApply] = useState(false);
//
const [isAvailable, setIsAvailable] = useState(false);
const columns = [
{ title: '序号', dataIndex: 'index', align: 'center', className:"taskTableColumns", width: '6%', render: (text, item, index) => <span>{(current-1)*pageSize+index + 1}</span> },
@ -35,13 +37,13 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
{/* 报名详情按钮 */}
{round === currentRound && 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 */}
{round === currentRound && (period === "stuApply" || period === "stuApply1") && applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && <Tooltip title={"取消申请"}><i className='iconfont icon-shanchuicon3 ml20 cancelApply' onClick={()=>{deleteItem(item.id)}}></i></Tooltip>}
{/* 取消按钮 */}
{round === currentRound && (period === "stuApply" || period === "stuApply1") && applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && !lockedTaskName && <Tooltip title={"取消申请"}><i className='iconfont icon-shanchuicon3 ml20 cancelApply' onClick={()=>{deleteItem(item.id)}}></i></Tooltip>}
{/* 课题申请时间范围内: 申请课题 */}
{/* 第一次报名 */}
{round === currentRound && period === "stuApply" && !(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>}
{/* 第二次报名 锁定状态 */}
{/* 补录阶段 锁定状态 */}
{round === currentRound && period === "stuApply1" && !(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>
)
@ -130,13 +132,22 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
keyword,
pageSize,
userId: apply ? current_user.user_id : '',
round
round,
locked: isAvailable ? false : undefined
}
console.log('params', params);
taskList(params).then(response => {
if (response && response.message === "success") {
const data = response.data.rows;
if(period === "stuApply1"){
//
const applyIds = data.filter(item=>!item.locked).map(item=>item.id);
data.map((item, index)=>{
applyIds.includes(item.id) && toFirst(data, index);
})
}
// task
const ids = Object.keys(applyTaskId);
const data = response.data.rows;
data.map((item, index)=>{
ids.includes(item.id.toString()) && toFirst(data, index);
})
@ -145,13 +156,16 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
}
setLoading(false);
})
}, [keyword, current, pageSize, applyTaskId, apply, round])
}, [keyword, current, pageSize, applyTaskId, apply, round, isAvailable])
return (
<div className="taskList listBox">
<div className="list">
<div className='search task'>
{round === 2 && current_user && current_user.login ? <Checkbox onChange={(e)=>{setCurrent(1);setApply(e.target.checked)}}>已报名</Checkbox> : <div></div>}
<div>
{round === 2 && current_user && current_user.login ? <Checkbox onChange={(e)=>{setCurrent(1);setApply(e.target.checked)}}>已报名</Checkbox> : <div></div>}
{round === 2 && period === "stuApply1" && <Checkbox onChange={(e)=>{setCurrent(1);setIsAvailable(e.target.checked)}}>可申请课题</Checkbox>}
</div>
<Search className='taskSearch' placeholder='请输入课题/项目名称进行搜索' allowClear enterButton onSearch={(value) => { setCurrent(1); setKeyword(value) }} />
<div></div>
</div>

View File

@ -24,21 +24,18 @@ const gradeList = [
{ id: '博士及以上', name: '博士及以上' }
];
function Apply(props) {
const { form, current_user, showNotification, match, history, setStudentInfoReset, period, round } = props;
const { form, current_user, showNotification, match, setStudentInfoReset, period, round } = props;
const taskId = Number(match.params.taskId);
//
// current_user && (current_user.user_id = 6)
// current_user && (current_user.userName = "使")
const { getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll } = form;
const [imageUrl, setImageUrl] = useState(undefined);
const [loading, setLoading] = useState(false);
const [reload, setReload] = useState();
const [locked, setLocked] = useState(true);
const [locked, setLocked] = useState(false);
const [userApplyInfo, setUserApplyInfo] = useState(undefined);
const [editable, setEditable] = useState(false);
const [files, setFiles] = useState([]);
const [files1, setFiles1] = useState([]);
const [files2, setFiles2] = useState([]);
const [fileList, setFileList] = useState([]);
//
const [taskCount, setTaskCount] = useState(0);
const initTask = {
taskId,
memo: '',
@ -96,32 +93,21 @@ function Apply(props) {
if (data.registrationStudentTaskList.length) {
let initTaskList = [];
let lockedCurrent = false;
const fileListInit = [];
for (const [i, item] of data.registrationStudentTaskList.entries()) {
applyInfo['memo' + i] = item.memo;
applyInfo['taskId' + i] = item.taskId;
applyInfo['memoAttachmentId' + i] = item.memoAttachmentId;
if (item.locked && item.passStatus) {
applyInfo['subRound' + i] = item.subRound;
if (item.locked) {
lockedCurrent = item.locked;
}
if (i == 0) {
item.memoAttachment && setFiles([{
name: item.memoAttachment && item.memoAttachment.fileName || '已上传文件',
id: item.memoAttachmentId,
uid: item.memoAttachmentId
}]);
} else if(i==1) {
item.memoAttachment && setFiles1([{
name: item.memoAttachment && item.memoAttachment.fileName || '已上传文件',
id: item.memoAttachmentId,
uid: item.memoAttachmentId,
}]);
} else {
item.memoAttachment && setFiles2([{
name: item.memoAttachment && item.memoAttachment.fileName || '已上传文件',
id: item.memoAttachmentId,
uid: item.memoAttachmentId,
}]);
}
fileListInit.push(item.memoAttachment ? [{
name: item.memoAttachment.fileName || '已上传文件',
id: item.memoAttachmentId,
uid: item.memoAttachmentId
}]: undefined)
setFileList(fileListInit);
if (item.enrollFirst) {
applyInfo.enrollFirst = i;
@ -140,17 +126,18 @@ function Apply(props) {
// });
}
setMyTaskList(initTaskList);
// let idArr= data.registrationStudentTaskList.map(i=>{return i.id});
// if(idArr.length===3){lockedCurrent=true;}
// setLocked(lockedCurrent);
// 3idid
setLocked(lockedCurrent);
// subRound0
const length = data.registrationStudentTaskList.filter(item=>item.subRound === 1).length
setTaskCount(length);
// 2idid
let taskIdArr=data.registrationStudentTaskList.map(i=>{return i.taskId});
if (!lockedCurrent && data.registrationStudentTaskList.length < 3 && !taskIdArr.includes(taskId)) {
addTask(data.registrationStudentTaskList);
setLocked(false);
if (!lockedCurrent && length < 2 && !taskIdArr.includes(taskId)) {
addTask(length, data.registrationStudentTaskList);
}
} else {
// glcc
setTaskCount(1);
//
new Promise((resove) => {
setMyTaskList(() => {
@ -164,6 +151,8 @@ function Apply(props) {
setFieldsValue(applyInfo);
setUserApplyInfo(response.data);
} else {
// glcc
setTaskCount(1);
//
new Promise((resove) => {
setMyTaskList(() => {
@ -201,7 +190,8 @@ function Apply(props) {
// registrationStudentTaskListround
item.round = round;
//
item.enrollFirst = index === enrollFirst
item.enrollFirst = index === enrollFirst;
item.subRound= values[`subRound${index}`] === 0 ? 0 : 1;
})
}
const params = {
@ -308,18 +298,10 @@ function Apply(props) {
if (info.file.status === 'removed') {
changeTaskItem('memoAttachmentId', '', i);
}
if (i==1) {
setFiles1(appendFileSizeToUploadFileAll(info.fileList).slice(-1));
}else if (i==2) {
setFiles2(appendFileSizeToUploadFileAll(info.fileList).slice(-1));
} else {
setFiles(appendFileSizeToUploadFileAll(info.fileList).slice(-1));
}
const fileListInit = [...fileList];
fileListInit[i] = appendFileSizeToUploadFileAll(info.fileList).slice(-1);
setFileList(fileListInit);
}
// if (info.file.status === "done" || info.file.status === 'removed') {
// setLoading(false);
// }
}
//
@ -328,7 +310,8 @@ function Apply(props) {
window.open(`${httpUrl}/busiAttachments/download/${fileId}`);
}
function addTask(List) {
function addTask(count, List) {
setTaskCount(1 + count);
let taskListNew = List ? [...List] : [...myTaskList];
if (taskId != taskListNew[0].taskId) {
taskListNew.push(initTask);
@ -346,33 +329,6 @@ function Apply(props) {
}
}
function deleteTask(i) {
let taskListNew = myTaskList.slice();
let reWriteInfo;
if (i) {
reWriteInfo = {
taskId1: '',
memo1: '',
memoAttachmentId1: ''
}
setFiles1([]);
} else {
reWriteInfo = {
taskId0: taskListNew[1].taskId,
memo0: taskListNew[1].memo,
memoAttachmentId0: taskListNew[1].memoAttachmentId,
taskId1: '',
memo1: '',
memoAttachmentId1: ''
}
setFiles(files1);
setFiles1([]);
}
taskListNew.splice(i, 1);
setMyTaskList(taskListNew);
setFieldsValue(reWriteInfo);
}
function changeTaskItem(field, val, i) {
let taskListNew = [...myTaskList];
@ -489,13 +445,15 @@ function Apply(props) {
return (
<Fragment key={item.taskId + '' + i}>
<h4 className="item-tit">课题信息<span className="item-tit-num">{i + 1}</span>)
{/* {myTaskList.length > 1 && <span className="delete" onClick={() => { deleteTask(i) }}><i className="iconfont icon-shanchu mr5"></i>删除</span>} */}
</h4>
{item.status === 1 && item.auditRemark && <div className="reject-reason">
<div className="mb5"><i className="iconfont icon-shanchudiao"></i>欢迎您报名CCF GitLink开源编程夏令营感谢您对GLCC项目及课题的关注和支持本次您的报名信息未通过初审原因如下</div>
<div className="mb5 ml20" dangerouslySetInnerHTML={{ __html: item.auditRemark }}></div>
<div className="mb5 ml20">希望您尽快修改并重新提交报名信息我们将再次审核万分感谢</div>
</div>}
<Form.Item label="subRound" hidden>
{getFieldDecorator(`subRound${i}`, {})(<Input/>)}
</Form.Item>
{helper('课题名称',
'',
'taskId' + i,
@ -504,18 +462,16 @@ function Apply(props) {
placeholder="请选择课题名称"
dropdownClassName="glcc_select"
showSearch
className={!editable || (item.id && item.status !== 1) ? "disabledInput" : ""}
disabled={!editable || (item.id && item.status !== 1)}
// disabled
// className={"disabledInput"}
className={!editable || (item.id && item.status !== 1) || item.subRound === 0 ? "disabledInput" : ""}
disabled={!editable || (item.id && item.status !== 1) || item.subRound === 0}
filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) > -1}
onBlur={() => { verify("taskId" + i) }}
onChange={(val) => { changeTaskItem("taskId", val, i) }}
>
{allTaskList.map(item => { return <Option value={item.id} disabled={chooseArr.includes(item.id)} key={item.id + ''}>{item.taskName}</Option> })}
{allTaskList.map(item => { return <Option value={item.id} disabled={chooseArr.includes(item.id) || item.locked} key={item.id + ''}>{item.taskName}</Option> })}
</Select>
)}
{item.locked && item.passStatus && <div className="task-checked"><i className='iconfont icon-chenggongicon'></i>您已通过审核成功入选该课题</div>}
{item.locked && <div className="task-checked"><i className='iconfont icon-chenggongicon'></i>您已通过审核成功入选该课题</div>}
<div className='introArea'>{helper('自荐书',
<div className="memoExtra">如何写课题申请书<a href="https://forum.gitlink.org.cn/forums/7299/detail" target="_black">https://forum.gitlink.org.cn/forums/7299/detail</a></div>,
'memo' + i,
@ -540,9 +496,8 @@ function Apply(props) {
'memoAttachmentId' + i,
[],
<Upload
// action={getUploadActionUrl()}
action={httpUrl + `/busiAttachments/upload`}
fileList={i ? i == 1 ? files1 : files2 : files}
fileList={fileList[i]}
onChange={(info) => { bookChange(info, i) }}
onDownload={download}
beforeUpload={beforeUpload2}
@ -561,9 +516,7 @@ function Apply(props) {
})
}
{
myTaskList.length < 2 && <Button className="add_task mb20" type="primary" onClick={() => { addTask() }}>添加课题</Button>
}
{taskCount < 2 && !locked && <Button className="add_task mb20" type="primary" onClick={() => { addTask(taskCount) }}>添加课题</Button>}
{
myTaskList.length >= 2 && <Form.Item className="priority"
@ -573,9 +526,9 @@ function Apply(props) {
rules: [{ required: true, message: "请选择课题优先级" },]
})(
<Radio.Group disabled={editable ? false : true}>
<Radio value={0}>课题一</Radio>
<Radio value={1}>课题二</Radio>
{myTaskList.length === 3 && <Radio value={2}>课题三</Radio>}
{myTaskList.map((item, index) =>{
return <Radio value={index}>课题{index+1}</Radio>
})}
</Radio.Group>
)}
</Form.Item>

View File

@ -71,4 +71,13 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.editormd-editing{
border: 1px solid #ddd;
padding-bottom: 1px;
}
.editormd-editing .editormd{
border: none;
margin:0px auto;
overflow: unset;
}

View File

@ -120,7 +120,7 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
// 请求issues接口获取全部可quote的issue列表
function getIssueList(keyword){
axios.get(`/v1/${owner}/${projectsId}/issues`,{params:{
only_name:true,keyword,sort_direction:"desc",sort_by:"issues.created_on"
only_name:true,keyword,sort_direction:"desc",sort_by:"issues.created_on",limit:500,page:1
}}).then(result=>{
if(result){
!keyword && setIssues(result.data.issues);