forked from Gitlink/forgeplus-react
Merge pull request 'glcc issue' (#379) from tongChong/forgeplus-react:feature_GLCC into gitlink_server
This commit is contained in:
commit
6b987f980b
|
@ -80,3 +80,12 @@ export function cancelTaskApply(data) {
|
|||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 学生报名课题列表
|
||||
export function studentApplyList(params) {
|
||||
return fetch({
|
||||
url: `/api/studentApply/list`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
|
@ -28,6 +28,14 @@ export default (props) => {
|
|||
}
|
||||
}
|
||||
|
||||
function goToStudent(){
|
||||
// 学生报名时间
|
||||
const studentApply = Date.parse(new Date()) > 1653494400000;
|
||||
if(!studentApply){
|
||||
showNotification("不在报名时间,报名开始时间为5月26日");
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="glcc">
|
||||
{/* <Banner /> */}
|
||||
|
@ -50,7 +58,7 @@ export default (props) => {
|
|||
<div className="pt6">项目报名开启,导师席位虚位以待</div>
|
||||
</div>
|
||||
{/* 学生报名 */}
|
||||
<div className="apply" onClick={()=>{window.location.href="/glcc/student/2"}}>
|
||||
<div className="apply" onClick={goToStudent}>
|
||||
<div>
|
||||
<img src={apply2} alt="" className="applyIcon"/>
|
||||
<span className="til">学生报名</span> >
|
||||
|
|
|
@ -27,6 +27,14 @@ function Lightspot(props) {
|
|||
}
|
||||
}
|
||||
|
||||
function goToStudent(){
|
||||
// 学生报名时间
|
||||
const studentApply = Date.parse(new Date()) > 1653494400000;
|
||||
if(!studentApply){
|
||||
showNotification("不在报名时间,报名开始时间为5月26日");
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="lightspot">
|
||||
<div className="glcc-content">
|
||||
|
@ -44,7 +52,7 @@ function Lightspot(props) {
|
|||
<h3 className="teacher-invite">你是开源新手,有兴趣参加GLCC吗?</h3>
|
||||
<div className="teacher-content">想要参与一线开源项目开发,熟悉开源社区运作流程,接受资深开源软件专家指导,获得丰厚奖金和实习机会。参加GLCC,开启全新的开源之旅。</div>
|
||||
{/* <Link className='applyBut' to={isGlccApplyDate ? current_user && current_user.login ? 'https://wj.qq.com/s2/10175205/e8df/' : '/login?go_page=/glcc/apply' : '/glcc'} onClick={()=>{!isGlccApplyDate && showNotification("不在报名时间,报名时间为4月15日~5月20日")}}>立即报名</Link> */}
|
||||
<div className='applyBut' onClick={()=>{window.location.href="/glcc/student/2"}}>学生报名</div>
|
||||
<div className='applyBut' onClick={goToStudent}>学生报名</div>
|
||||
</div>
|
||||
{/* <img className="teacher-img" src={teacherImg} alt=''></img> */}
|
||||
</div>
|
||||
|
|
|
@ -11,6 +11,7 @@ import "./index.scss";
|
|||
import Loadable from "react-loadable";
|
||||
import Loading from "../Loading";
|
||||
import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC";
|
||||
import { useState } from "react";
|
||||
|
||||
|
||||
// 任务管理审核
|
||||
|
@ -72,7 +73,7 @@ const Glcc = (propsF) => {
|
|||
<Route
|
||||
path="/glcc/student"
|
||||
render={(props) => (
|
||||
<Project {...propsF} {...props} />
|
||||
<Project {...propsF} {...props}/>
|
||||
)}
|
||||
></Route>
|
||||
{/* 首页 */}
|
||||
|
|
|
@ -50,11 +50,11 @@ export default ({ detail, projectId, applyTaskId, current_user, showLoginDialog,
|
|||
<div className='mb20 email oneLine leftWidth'>邮箱地址: <span>{item.tutorMail}</span></div>
|
||||
</div>
|
||||
<div className="center">
|
||||
<div className="taskDesc">{item.taskDesc}</div>
|
||||
<div className="taskUrl">课题链接: <span><a href={info.gitlinkUrl}>{item.taskUrl}</a></span></div>
|
||||
<div className="taskDesc"> {item.taskDesc}</div>
|
||||
<div className="right oneLine taskUrl mt5">奖金: <span className='taskReward'>{item.taskReward}</span></div>
|
||||
{item.taskUrl && <div className="taskUrl">课题链接: <span><a href={info.taskUrl}>{item.taskUrl}</a></span></div>}
|
||||
<div>{(isStudentApplyDate || studentApplyEnd) && (applyTaskId && item.id && Object.keys(applyTaskId).includes(item.id.toString()) ? <Button onClick={()=>{window.location.href=`/glcc/student/apply/${item.id}`}} className='lookDetail'>报名详情</Button> : isStudentApplyDate && <Button type='primary' className='applyBut' onClick={()=>{applyTask(item.id)}}>申请课题</Button>)}</div>
|
||||
</div>
|
||||
<div className="right oneLine">¥ {item.taskReward}</div>
|
||||
</div>
|
||||
}) : <Nodata _html="课题暂无数据" small={true}/>}
|
||||
</div>: <div className="projectDetailBox nodata"><Nodata _html="暂无数据" small={true}/></div>
|
||||
|
|
|
@ -67,7 +67,7 @@ function Project(propsF) {
|
|||
<Route
|
||||
path="/glcc/student/2"
|
||||
render={(props) => (
|
||||
<TaskList applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} current_user={current_user} showLoginDialog={showLoginDialog} isStudentApplyDate={isStudentApplyDate} studentApplyEnd={studentApplyEnd}/>
|
||||
<TaskList applyTaskId={applyTaskId} studentInfoReset={studentInfoReset} setStudentInfoReset={setStudentInfoReset} current_user={current_user} showLoginDialog={showLoginDialog} isStudentApplyDate={isStudentApplyDate} studentApplyEnd={studentApplyEnd}/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
|
|
|
@ -39,6 +39,13 @@
|
|||
width: 40%;
|
||||
margin: 0 auto;
|
||||
padding: 25px 0 40px;
|
||||
&.task{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
.ant-input-group-wrapper{width: 40%;}
|
||||
}
|
||||
}
|
||||
.search .ant-btn, .search .ant-input{
|
||||
height: 48px;
|
||||
|
@ -130,7 +137,7 @@
|
|||
.leftWidth{width: 270px;}
|
||||
}
|
||||
.center{
|
||||
width: 650px;
|
||||
// width: 650px;
|
||||
text-align: left;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
|
@ -142,6 +149,8 @@
|
|||
.taskUrl{
|
||||
color:#465474;
|
||||
font-size:16px;
|
||||
line-height: 28px;
|
||||
margin-bottom: 5px;
|
||||
a{color:#466aff;}
|
||||
}
|
||||
.applyBut{
|
||||
|
@ -150,14 +159,15 @@
|
|||
&:hover{background-color:#5d7cff;}
|
||||
&:focus{background-color:#1140ff;}
|
||||
}
|
||||
.taskReward{color:#ff8800;}
|
||||
}
|
||||
.right{
|
||||
min-width: 150px;
|
||||
font-weight:700;
|
||||
color:#ff8800;
|
||||
font-size:24px;
|
||||
padding: 30px 30px 0 0;
|
||||
}
|
||||
// .right{
|
||||
// min-width: 150px;
|
||||
// font-weight:700;
|
||||
// color:#ff8800;
|
||||
// font-size:24px;
|
||||
// padding: 30px 30px 0 0;
|
||||
// }
|
||||
}
|
||||
}
|
||||
.projectItemPopover{
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import React, { Fragment, useEffect, useState } from 'react';
|
||||
import { Input, message, Modal, Table, Tooltip } from 'antd';
|
||||
import { Checkbox, Input, message, Modal, Table, Tooltip } from 'antd';
|
||||
import './index.scss';
|
||||
import { cancelTaskApply, taskList } from '../../api';
|
||||
import { cancelTaskApply, taskList, studentApplyList } from '../../api';
|
||||
import ProjectDetail from '../component/projectDetail';
|
||||
const { Search } = Input;
|
||||
|
||||
// 课题列表
|
||||
function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd}) {
|
||||
function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd, studentInfoReset}) {
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [deleteTaskId, setDeleteTaskId] = useState(undefined);
|
||||
// 输入搜索框
|
||||
|
@ -18,12 +18,14 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
|
|||
const [pageSize, setPageSize] = useState(20);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [expandedRowKeys, setExpandedRowKeys] = useState([]);
|
||||
// 已报名
|
||||
const [apply, setApply] = useState(false);
|
||||
|
||||
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 onClick={()=>{window.location.href=item.taskUrl}}>{text}</span></Tooltip> },
|
||||
{ title: '项目名称', dataIndex: 'projectName', className:"taskTableColumns", width: '28%', ellipsis: true, render: (text) => <Tooltip title={text} placement="topLeft">{text}</Tooltip> },
|
||||
{ title: '课题奖金', dataIndex: 'taskReward', className:"taskTableColumns", width: `${isStudentApplyDate || studentApplyEnd ? '15%' : ''}`, render: (text) => <span>¥ {text}</span> },
|
||||
{ title: '课题奖金', dataIndex: 'taskReward', className:"taskTableColumns", ellipsis: true, width: `${isStudentApplyDate || studentApplyEnd ? '15%' : ''}`, render: (text) => <Tooltip title={text} placement="topLeft"><span>{text}</span></Tooltip> },
|
||||
{
|
||||
title: '操作', dataIndex: 'action', align: 'center', className:"actionColumns taskTableColumns", render: ((text, item, index) => {
|
||||
return (
|
||||
|
@ -132,17 +134,36 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
|
|||
data.map((item, index)=>{
|
||||
ids.includes(item.id.toString()) && toFirst(data, index);
|
||||
})
|
||||
setData(response.data.rows);
|
||||
setTotal(response.data.total)
|
||||
setData(data);
|
||||
setTotal(response.data.total);
|
||||
}
|
||||
setLoading(false);
|
||||
})
|
||||
}, [keyword, current, pageSize])
|
||||
}, [keyword, current, pageSize, applyTaskId])
|
||||
|
||||
useEffect(()=>{
|
||||
// if(apply){
|
||||
// // 判断用户是否已经登录
|
||||
// if(current_user && current_user.login){
|
||||
// apply && studentApplyList().then(response => {
|
||||
// if (response && response.message === "success") {
|
||||
// console.log(response);
|
||||
// }
|
||||
// })
|
||||
// }else{
|
||||
// showLoginDialog();
|
||||
// }
|
||||
// }
|
||||
},[apply])
|
||||
|
||||
return (
|
||||
<div className="taskList listBox">
|
||||
<div className="list">
|
||||
<div className='search'><Search placeholder='请输入课题名称进行搜索' allowClear enterButton onSearch={(value) => { setCurrent(1); setKeyword(value) }} /></div>
|
||||
<div className='search task'>
|
||||
<Checkbox onChange={(e)=>{setApply(e.target.checked)}}>已报名</Checkbox>
|
||||
<Search className='taskSearch' placeholder='请输入课题名称进行搜索' allowClear enterButton onSearch={(value) => { setCurrent(1); setKeyword(value) }} />
|
||||
<div></div>
|
||||
</div>
|
||||
<Table
|
||||
loading={loading}
|
||||
columns={columns}
|
||||
|
|
|
@ -96,4 +96,15 @@ tr:hover .actionColumns .cancelApply{
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.task.search{
|
||||
.ant-checkbox-wrapper:hover .ant-checkbox-inner, .ant-checkbox:hover .ant-checkbox-inner, .ant-checkbox-input:focus + .ant-checkbox-inner{border-color: #466aff;}
|
||||
.ant-checkbox-checked{
|
||||
.ant-checkbox-inner {
|
||||
background-color: #466aff;
|
||||
}
|
||||
}
|
||||
.ant-checkbox::selection{border-color: #466aff;}
|
||||
.ant-checkbox-input::after{border:1px solid #466aff;}
|
||||
.ant-checkbox-checked::after{border:1px solid #466aff;}
|
||||
}
|
|
@ -21,12 +21,12 @@ const gradeList = [
|
|||
{ id: '研二', name: '研二' },
|
||||
{ id: '研三', name: '研三' }];
|
||||
function Apply(props) {
|
||||
const { form, current_user, showNotification, match } = props;
|
||||
const { form, current_user, showNotification, match, setStudentInfoReset } = props;
|
||||
const taskId = Number(match.params.taskId);
|
||||
// 可用于开发时不同账号报名
|
||||
// current_user && (current_user.user_id = 6)
|
||||
// current_user && (current_user.userName = "创新使者")
|
||||
const isStudentApplyDate = new Date().getTime() > new Date('2022-05-26').getTime() && new Date().getTime() < new Date('2022-06-26').getTime();
|
||||
const isStudentApplyDate = new Date().getTime() > new Date('2022-05-26').getTime() && new Date().getTime() < new Date('2022-06-25').getTime();
|
||||
|
||||
const { getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll } = form;
|
||||
const [imageUrl, setImageUrl] = useState(undefined);
|
||||
|
@ -190,6 +190,7 @@ function Apply(props) {
|
|||
studentApplyEdit(params).then(response => {
|
||||
if (response && response.message === "success") {
|
||||
showNotification("修改信息成功");
|
||||
// setStudentInfoReset(Math.random());
|
||||
setReload(Math.random());
|
||||
setLoading(false);
|
||||
}
|
||||
|
@ -198,6 +199,7 @@ function Apply(props) {
|
|||
studentApply(params).then(response => {
|
||||
if (response && response.message === "success") {
|
||||
showNotification("报名成功");
|
||||
// setStudentInfoReset(Math.random());
|
||||
setReload(Math.random());
|
||||
setLoading(false);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue