This commit is contained in:
caishi 2023-07-03 11:30:41 +08:00
commit 5feaa9e2a0
28 changed files with 1021 additions and 196 deletions

View File

@ -106,6 +106,7 @@
}
.commentContentBox{
display: flex;
align-items: flex-start;
}
.commentContentRight{
flex: 1;

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({
@ -222,4 +239,13 @@ export function deleteApplyInfo(data) {
method: 'post',
data
});
}
}
// 判断课题是否有学生报名
export async function findStudentTaskByTaskId(params) {
return await fetch({
url: '/api/applyInformation/findStudentTaskByTaskId',
method: 'get',
params: params,
});
}

View File

@ -1,7 +1,7 @@
import React , { useCallback, useEffect , useState } from 'react';
import { Button, Form, Input, Select, Upload, message, Popconfirm } from 'antd';
import {getUploadActionUrl} from 'educoder';
import {applyGlcc, updateApplyGlcc} from '../api';
import {applyGlcc, findStudentTaskByTaskId, updateApplyGlcc} from '../api';
import TextArea from 'antd/lib/input/TextArea';
import { main_site_url } from '../fetch';
import TaskApply from './taskApply';
@ -13,7 +13,7 @@ function EditRepoApplyInfo(props) {
const {form, applyInfo, current_user, round, cateList, setReload, isAddRepo, setIsAddRepo, setIsEdit, setEditRepoCount} = props;
const phonereg = /(^|\s*\+?0?0?86|\D)(1\d{2})[-\s]{0,3}(\d{4})[-\s]{0,3}(\d{4})(?=\D|$)/
const emailreg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/
const {getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll } = form;
const {getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll, getFieldValue } = form;
const [imageUrl, setImageUrl] = useState(undefined);
// loading
const [loading, setLoading] = useState(false);
@ -27,7 +27,7 @@ function EditRepoApplyInfo(props) {
const taskCountArr = []
registrationTaskList.map((item, index)=>{
taskCountArr.push(index+1);
const{taskName, taskUrl, taskDifficulty, taskReward, tutorName, tutorMail, taskDesc, tutorPhone} = item;
const{taskName, taskUrl, taskDifficulty, taskReward, tutorName, tutorMail, taskDesc, tutorPhone, id} = item;
taskInfo[`taskName${index+1}`] = taskName;
taskInfo[`taskUrl${index+1}`] = taskUrl;
taskInfo[`taskDifficulty${index+1}`] = taskDifficulty;
@ -36,6 +36,7 @@ function EditRepoApplyInfo(props) {
taskInfo[`tutorMail${index+1}`] = tutorMail;
taskInfo[`taskDesc${index+1}`] = taskDesc;
taskInfo[`tutorPhone${index+1}`] = tutorPhone;
taskInfo[`taskId${index+1}`] = id;
})
setTaskCount(taskCountArr);
setTimeout(() => {
@ -76,6 +77,7 @@ function EditRepoApplyInfo(props) {
const registrationTaskList = []
taskCount && taskCount.map(item=>{
registrationTaskList.push({
id: values[`taskId${item}`],
taskName: values[`taskName${item}`],
taskUrl: values[`taskUrl${item}`],
taskDifficulty: values[`taskDifficulty${item}`],
@ -157,14 +159,19 @@ function EditRepoApplyInfo(props) {
//
function addTaskApplyForm(){
setTaskCount(taskCount.concat([taskCount.length+1]));
setTaskCount(taskCount.concat([taskCount[taskCount.length-1]+1]));
}
//
function deleteTaskApply(index){
const arr = [...taskCount];
arr.splice(index-1, 1)
setTaskCount(arr);
async function deleteTaskApply(index){
const delTaskId = getFieldValue(`taskId${index}`);
const res = delTaskId ? await findStudentTaskByTaskId({ taskId: delTaskId }) : "newTask";
if((res && res.data && res.data.length)){
message.error("已有学生报名,不允许删除");
}else{
const arr = taskCount.filter(item=>item!== index);
setTaskCount(arr);
}
}
//
@ -267,7 +274,7 @@ function EditRepoApplyInfo(props) {
<div className='taskApplyTitle font-16'>课题信息<span>{index+1}</span>/5)</div>
{index>0 && <Button type="link" onClick={()=>{deleteTaskApply(item)}}><i className='iconfont icon-shanchuicon3 mr5 font-15'></i>删除</Button>}
</FlexAJ>
<TaskApply helper={helper} taskKey={item} phonereg={phonereg} emailreg={emailreg}/>
<TaskApply helper={helper} taskKey={item} phonereg={phonereg} emailreg={emailreg} getFieldDecorator={getFieldDecorator}/>
</div>
})}
{taskCount && taskCount.length<5 && <div>

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

@ -4,7 +4,7 @@ import TextArea from 'antd/lib/input/TextArea';
const Option = Select.Option;
//
function TaskApply(props) {
const {helper, disabled, taskKey, phonereg, emailreg} = props;
const {helper, disabled, taskKey, phonereg, emailreg, getFieldDecorator} = props;
//
const difficultyList = [
{id: 1, name: "低"},
@ -26,6 +26,9 @@ function TaskApply(props) {
return(
<div className="taskApplyForm">
<div className="pt20 glcc_info_form">
<Form.Item label="课题id" hidden>
{getFieldDecorator(`taskId${taskKey}`, {})(<Input/>)}
</Form.Item>
{helper('课题名称',
'',
`taskName${taskKey}`,

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`}>
@ -159,7 +165,7 @@ export default (props) => {
<div></div>
</div>
<div className="intro">OpenMMLab是深度学习时代最完整的计算机视觉开源算法体系自开源以来累计发布了超过20个算法库有超过300个算法2300多个预训练模型所有算法均具备风格统一模型丰富质量高易复现等特点在社区生态上OpenMMLab一直秉持开放认真持续成长的原则积极推动社区建设发展</div>
<div className="goToButBox"><button className="goToBut" onClick={()=>{window.location.href='/glcc/openmmlab'}}>查看详情</button></div>
<div className="goToButBox"><button className="goToBut" onClick={()=>{window.location.href='/glcc/openmmlab/2022'}}>查看详情</button></div>
</div>}
</div>
</div>

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);
}
@ -124,7 +136,8 @@ const Glcc = (propsF) => {
//
function judge(nowTime, timeRnge, type){
const timeArr = timeRnge.split(",").map(item=>{
const data = item && item.replaceAll('-', '/');
// replaceAll
const data = item && item.replace(/-/g,'/');
return new Date(data).getTime()
});
return type === "range" ? nowTime > timeArr[0] && nowTime < timeArr[1] : nowTime > timeArr[0]
@ -132,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);
@ -163,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));
}
})
@ -182,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}`;
@ -198,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}/>
@ -225,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"
@ -235,14 +265,14 @@ const Glcc = (propsF) => {
{!(round === 2 && !repoPublic) && <Route
path="/glcc/:id/subjects/detail/:taskId"
render={(props) => (
<TaskDetail {...propsF} {...props} applyTaskId={applyTaskId} applyTask={applyTask} period={period}/>
<TaskDetail {...propsF} {...props} applyTaskId={applyTaskId} applyTask={applyTask} period={period} round={round} currentRound={currentRound}/>
)}
></Route>}
{/* 项目/课题列表 */}
{!(round === 2 && !repoPublic) && <Route
path="/glcc/:id/projects"
render={(props) => (
<Project period={period} round={round} {...propsF} {...props} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} applyTask={applyTask}/>
<Project period={period} round={round} {...propsF} {...props} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} applyTask={applyTask} currentRound={currentRound}/>
)}
></Route>}
@ -250,23 +280,30 @@ 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}/>
<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"
render={(props) => (
<Openmmlab {...propsF} {...props} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} applyTask={applyTask}/>
)}
></Route>
{/* 审核结果页面 */}
<Route
path="/glcc/result"
render={(props) => (
<Result current_user={current_user} history={props.history}/>
<Openmmlab period={period} {...propsF} {...props} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} applyTask={applyTask}/>
)}
></Route>
@ -298,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>
@ -306,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

@ -9,6 +9,7 @@ import { projectList } from '../api';
import './index.scss';
function Openmmlab(props) {
const {location:{pathname}} = props;
const [list, setList] = useState([]);
@ -19,8 +20,9 @@ function Openmmlab(props) {
useEffect(() => {
const params = {
curPage: 1,
keyword: 'openmmlab',
pageSize: 10000
keyword: 'openmmlab-',
pageSize: 10000,
round: pathname && pathname.endsWith("/2022") ? 1 : 2
}
projectList(params).then(response => {
if (response && response.message === "success") {
@ -40,23 +42,23 @@ function Openmmlab(props) {
<div className="openmmlab_slider openmmlab_main">
<div className="slider_left">
<SliderLeft />
<SliderLeft pathname={pathname}/>
</div>
<div className="slider_right">
<SliderRight list={list} {...props}/>
<SliderRight list={list} {...props} year={pathname.endsWith("/2022") ? "2022" : "2023"}/>
</div>
</div>
</div>
<div className="openmmlab_title">项目精选</div>
<ProjectTabs {...props} list={list} />
<ProjectTabs {...props} list={list} year={pathname.endsWith("/2022") ? "2022" : "2023"}/>
<div className="teachers">
{pathname.endsWith("/2022") && <div className="teachers">
<div className="teachers_tit">
导师一览
</div>
<Teachers />
</div>
</div>}
</div>
)
}

View File

@ -7,7 +7,7 @@ const $ = window.$;
const { TabPane } = Tabs;
function ProjectTabs({ list, applyTaskId, history, current_user, showLoginDialog, applyTask }) {
function ProjectTabs({ list, applyTaskId, history, current_user, showLoginDialog, applyTask, year, period }) {
useEffect(()=>{
setTimeout(()=>{
@ -16,7 +16,6 @@ function ProjectTabs({ list, applyTaskId, history, current_user, showLoginDialog
},(e)=>{
});
},1000)
},[])
return (
@ -34,7 +33,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} applyTask={applyTask}/>
<ProjectDetail detail={item} applyTaskId={applyTaskId} current_user={current_user} showLoginDialog={showLoginDialog} applyTask={applyTask} year={year} period={period}/>
</div>
</div>

View File

@ -1,6 +1,9 @@
.ant-tabs.openmmlab_tab {
background-color: #2c374e;
color: #fff;
.ant-tabs-left-content{
border-left: none;
}
.ant-tabs-bar {
width: calc((100vw - 1200px) / 2 + 216px);
@ -59,7 +62,7 @@
.tab_type {
opacity: .8;
display: block;
width: 72px;
width: 105px;
height: 30px;
border: 1px solid#ffffff;
border-radius: 4px;
@ -85,7 +88,7 @@
}
.openmmlab_tab_content {
width:954px;
height:813px;
// height:813px;
padding: 21px 30px 50px;
// color: rgba(0,0,0,.65);
background-image: url('../../img/openmmlab/tabBackground.png') ;

View File

@ -3,7 +3,7 @@ import { Button, message, Tooltip } from 'antd';
import Nodata from '../../../forge/Nodata';
import { getProjectById } from '../../api';
export default ({ detail, projectId, applyTaskId, applyTask }) => {
export default ({ detail, projectId, applyTaskId, applyTask, year, period }) => {
const [info, setInfo] = useState(detail);
useEffect(()=>{
@ -26,7 +26,7 @@ export default ({ detail, projectId, applyTaskId, applyTask }) => {
{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/2022/subjects/detail/${item.id}`}}><Tooltip title={item.taskName}>{item.taskName}</Tooltip></div>
<div className="taskTitle" onClick={()=>{window.location.href=`/glcc/${year}/subjects/detail/${item.id}`}}><Tooltip title={item.taskName}>{item.taskName}</Tooltip></div>
<div className='mt15 oneLine leftWidth'>导师姓名: &nbsp;&nbsp;{item.tutorName}</div>
{item.tutorMail && <div className='mb15 email oneLine leftWidth'>邮箱地址: &nbsp;&nbsp;<span><Tooltip title={item.tutorMail}>{item.tutorMail}</Tooltip></span></div>}
</div>
@ -35,16 +35,16 @@ export default ({ detail, projectId, applyTaskId, applyTask }) => {
{item.taskUrl && <div className="taskUrl oneLine">课题链接: &nbsp;&nbsp;<a href={item.taskUrl} target={"_blank"}>{item.taskUrl}</a></div>}
<div>
{/* 报名详情按钮 */}
{applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && <Button onClick={()=>{window.location.href=`/glcc/student/apply/${item.id}`}} className='lookDetail mr10'>报名详情</Button>}
{year === "2023" && applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && <Button onClick={()=>{window.location.href=`/glcc/student/apply/${item.id}`}} className='lookDetail mr10'>报名详情</Button>}
{/* 课题申请时间范围内: 申请课题 */}
{/* 第一次报名 */}
{false && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && <Button type='primary' className='applyBut mr10' onClick={()=>{applyTask(item.id)}}>申请课题</Button>}
{year === "2023" && period === "stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && <Button type='primary' className='applyBut mr10' onClick={()=>{applyTask(item.id)}}>申请课题</Button>}
{/* 第二次报名 锁定状态 */}
{false && !(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>)}
{year === "2023" && period === "stuApply1" && !(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}`)}} className='lookDetail'>课题详情</Button>
<Button onClick={()=>{window.open(`/glcc/${year}/subjects/detail/${item.id}`)}} className='lookDetail'>课题详情</Button>
</div>
</div>
<div className="right oneLine taskUrl"><span className='taskReward'>{item.taskReward}</span></div>

View File

@ -62,6 +62,59 @@ const arithmeticArr = [
},
];
const arithmeticArr2023 = [
{
name: "MMEngine算法演示",
describe: "MMEngine 是一个基于 PyTorch 实现的,用于训练深度学习模型的基础库。它为开发人员提供了坚实的工程基础,以此避免在工作流上编写冗余代码。作为 OpenMMLab 所有代码库的训练引擎其在不同研究领域支持了上百个算法。此外MMEngine 也可以用于非 OpenMMLab 项目中。",
source: 'https://www.gitlink.org.cn/api/attachments/422473',
type: 'img',
},
{
name: "MMPreTrain算法演示",
describe: "MMPretrain 是一个全新升级的预训练开源算法框架旨在提供各种强大的预训练主干网络并支持不同的预训练策略。MMPretrain 源自著名的开源项目 MMClassification 和 MMSelfSup并开放一系列新功能。 目前,预训练阶段对于视觉识别至关重要,凭借丰富而强大的预训练模型,我们能够改进各种下游视觉任务。",
type: 'img',
source: 'https://www.gitlink.org.cn/api/attachments/422508'
},
{
name: "MMDetection算法演示",
describe: "MMDetection 是 OpenMMLab 中的通用目标检测算法平台,目前已经支持了 70+ 算法和 500+ 个预训练模型,支持目标检测、实例分割和全景分割。是 OpenMMLab 算法库中的MMDetection3D 和 MMRotate 的核心依赖,为 MMOCR、MMPose 和 MMTracking 提供了检测组件",
source: 'https://www.gitlink.org.cn/api/attachments/388003',
type: 'img',
},
{
name: "MMDetection3D算法演示",
describe: "MMDetection3D 是 OpenMMLab 中的通用 3D 感知算法平台,目前已经支持了室内外多个主流数据集的单模态/多模态 3D 检测和点云分割算法。同时 MMDetection3D 可以无缝使用 MMDetection 中的所有组件,为多模态感知提供了丰富的基础模块",
source: 'https://www.gitlink.org.cn/api/attachments/387953',
type: 'img',
},
{
name: "MMSegmentation算法演示",
describe: "MMSegmentation 是 OpenMMLab 中的语义分割算法工具箱,目前已经支持了 49 个算法600+ 个预训练模型。为语义分割任务的统一实现和模型评估提供了一个框架,并且高质量实现了常用的语义分割方法和数据集。",
source: 'https://www.gitlink.org.cn/api/attachments/422474',
type: 'img',
},
{
name: "MMAction2算法演示",
describe: "MMAction2 是一个基于 PyTorch 的开源工具箱,支持众多视频理解模型,包括动作识别、基于骨架的动作识别、时空动作检测和时间动作定位。 此外,它支持广泛使用的学术数据集,并提供许多有用的工具,帮助用户探索模型和数据集,以及实现高质量的算法。",
source: 'https://www.gitlink.org.cn/api/attachments/422475',
type: 'img',
},
{
name: "MMPose算法演示",
describe: "MMPose 是 OpenMMLab 中的姿态估计算法库,目前已经支持了近 30 个算法和 300+ 预训练模型,涵盖了人体、人脸、人手、动物等多类目标的姿态估计。秉承 OpenMMLab 系列的结构化框架设计MMPose 很适合作为算法复现和创新的平台",
source: 'https://www.gitlink.org.cn/api/attachments/388257.mp4',
type: 'mp4',
img: 'https://www.gitlink.org.cn/api/attachments/388256'
},
{
name: "MMagic算法演示",
describe: "MMagic 是 OpenMMLab 中的图像&视频生成和编辑的开源算法平台,涵盖 GANdiffusion model 多种生成模型,支持 Stable Diffusion 的微调和多种 diffusion 应用。同时支持图像修复、图文生成、3D生成、图像修补、抠图、超分辨率和生成等多种任务。利用 MMagic通过组合不同模块轻松构建自定义的生成模型。",
source: 'https://www.gitlink.org.cn/api/attachments/422478.mp4',
img: 'https://www.gitlink.org.cn/api/attachments/388256',
type: 'mp4',
},
];
let setting = {
infinite: true,
dots: true,
@ -76,11 +129,12 @@ let setting = {
autoplay: true,
arrows: false,
}
function SliderLeft() {
function SliderLeft(props) {
const {pathname} = props;
const arr = pathname.endsWith("/2022") ? arithmeticArr : arithmeticArr2023
return (
<Slider {...setting}>
{arithmeticArr.map(item => {
{arr.map(item => {
return <div className="slider_content" key={item.name}>
<div className={`slider_img ${item.name.split('算法演示')[0]}`} >
{item.type == 'img' && <img src={item.source} />}
@ -97,8 +151,8 @@ function SliderLeft() {
{
item.name === 'MMDetection3D算法演示' && <div className="point">
<div className="point_item">7 个数据集</div>
<div className="point_item">17 种不同算法</div>
<div className="point_item">80+ 个预训练模型</div>
<div className="point_item">{pathname.endsWith("/2022") ? "17" : "30+"} 种不同算法</div>
<div className="point_item">{pathname.endsWith("/2022") ? "80" : "90"}+ 个预训练模型</div>
</div>
}
</div>

View File

@ -90,6 +90,9 @@
// max-height: 100%;
}
}
.MMagic .introduce-video{
max-height: 112%;
}
.MMDetection3D,.MMClassification {
padding:30px 0;

View File

@ -17,15 +17,11 @@ let setting = {
vertical: true,
}
function SliderLeft({list,history}) {
function SliderLeft({list,year}) {
function goDetail(projectName){
// history.push({
// pathname:'/glcc/projects',
// state:{projectName:projectName.replace(/ /g,'-')}
// })
window.open(`/glcc/2022/projects?projectName=${projectName.replace(/ /g,'')}`);
window.open(`/glcc/${year}/projects?projectName=${projectName.replace(/ /g,'')}`);
}
return (

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)
}
@ -39,13 +39,13 @@ export default ({ detail, projectId, applyTaskId, period, showTask=true, applyTa
{item.taskUrl && <div className="taskUrl oneLine">课题链接: &nbsp;&nbsp;<a href={item.taskUrl} target={"_blank"}>{item.taskUrl}</a></div>}
<div>
{/* 报名详情按钮 */}
{applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && <Button onClick={()=>{window.location.href=`/glcc/student/apply/${item.id}`}} className='lookDetail mr10'>报名详情</Button>}
{round === 2 && applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && <Button onClick={()=>{window.location.href=`/glcc/student/apply/${item.id}`}} className='lookDetail mr10'>报名详情</Button>}
{/* 课题申请时间范围内: 申请课题 */}
{/* 第一次报名 */}
{period === "stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && <Button type='primary' className='applyBut mr10' onClick={()=>{applyTask(item.id)}}>申请课题</Button>}
{round === 2 && period === "stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && <Button type='primary' className='applyBut mr10' onClick={()=>{applyTask(item.id)}}>申请课题</Button>}
{/* 第二次报名 锁定状态 */}
{period === "stuApply1" && !(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>)}
{round === 2 && period === "stuApply1" && !(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/${id}/subjects/detail/${item.id}`)}} className='lookDetail'>课题详情</Button>

View File

@ -7,7 +7,7 @@ import './index.scss';
//
function TaskDetail(props) {
const {match, location, period, applyTaskId, applyTask, match:{params:{id}}} = props
const {match, location, period, applyTaskId, applyTask, match:{params:{id}}, currentRound, round} = props
const taskId = Number(match.params.taskId);
const [detail, setDetail] = useState(undefined);
@ -48,13 +48,13 @@ function TaskDetail(props) {
<div className='desc'>{detail.taskDesc}</div>
</div>
{/* 报名详情按钮 */}
{applyTaskId && Object.keys(applyTaskId).includes(taskId.toString()) && <Button onClick={()=>{window.location.href=`/glcc/student/apply/${taskId}`}} className='lookDetail detailBut'>报名详情</Button>}
{round === currentRound && applyTaskId && Object.keys(applyTaskId).includes(taskId.toString()) && <Button onClick={()=>{window.location.href=`/glcc/student/apply/${taskId}`}} className='lookDetail detailBut'>报名详情</Button>}
{/* 课题申请时间范围内: 申请课题 */}
{/* 第一次报名 */}
{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>}
{/* 第二次报名 锁定状态 */}
{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 }) {
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> },
@ -33,16 +35,16 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
return (
<div className='actionBox'>
{/* 报名详情按钮 */}
{applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && <span onClick={()=>{window.location.href=`/glcc/student/apply/${item.id}`}}><i className='iconfont icon-baomingxiangqingicon mr5'></i>报名详情</span>}
{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 */}
{(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>}
{/* 课题申请时间范围内: 申请课题 */}
{/* 第一次报名 */}
{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>}
{/* 第二次报名 锁定状态 */}
{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>)}
{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>