
diff --git a/src/glcc/project/taskList/index.jsx b/src/glcc/project/taskList/index.jsx
index 687b2341..f6d58082 100644
--- a/src/glcc/project/taskList/index.jsx
+++ b/src/glcc/project/taskList/index.jsx
@@ -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);
// 输入搜索框
@@ -17,12 +17,15 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
const [total, setTotal] = useState(0);
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) => index + 1 },
+ { title: '序号', dataIndex: 'index', align: 'center', className:"taskTableColumns", width: '6%', render: (text, item, index) =>
{(current-1)*pageSize+index + 1} },
{ title: '课题名称', dataIndex: 'taskName', className:"taskTableColumns taskName", width: '28%', ellipsis: true, render: (text, item) =>
{window.location.href=item.taskUrl}}>{text} },
{ title: '项目名称', dataIndex: 'projectName', className:"taskTableColumns", width: '28%', ellipsis: true, render: (text) =>
{text} },
- { title: '课题奖金', dataIndex: 'taskReward', className:"taskTableColumns", width: `${isStudentApplyDate || studentApplyEnd ? '15%' : ''}`, render: (text) =>
¥ {text} },
+ { title: '课题奖金', dataIndex: 'taskReward', className:"taskTableColumns", ellipsis: true, width: `${isStudentApplyDate || studentApplyEnd ? '15%' : ''}`, render: (text) =>
{text} },
{
title: '操作', dataIndex: 'action', align: 'center', className:"actionColumns taskTableColumns", render: ((text, item, index) => {
return (
@@ -54,6 +57,17 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
return
}
+ // 展开收起行回调
+ function onExpand(expanded, record){
+ const keys = new Set(expandedRowKeys);
+ if(expanded){
+ keys.add(record.id);
+ }else{
+ keys.delete(record.id);
+ }
+ setExpandedRowKeys(Array.from(keys));
+ }
+
// 申请课题按钮点击函数
function applyTask(id){
// 判断用户是否已经登录
@@ -88,6 +102,7 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
// 改变pagesize
function onShowSizeChange(current, pageSize){
+ setCurrent(1);
setPageSize(pageSize);
}
@@ -104,6 +119,7 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
}
useEffect(() => {
+ setExpandedRowKeys([]);
setLoading(true);
const params = {
curPage: current,
@@ -118,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 (
-
{ setKeyword(value) }} />
+
+
{setApply(e.target.checked)}}>已报名
+
{ setCurrent(1); setKeyword(value) }} />
+
+
tr > .taskTableColumns, .ant-table-tbody > tr > .taskTableColumns{
background-color:#F1F6FF;
@@ -95,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;}
}
\ No newline at end of file
diff --git a/src/glcc/student/index.jsx b/src/glcc/student/index.jsx
index 54cfcf90..05f4dbf4 100644
--- a/src/glcc/student/index.jsx
+++ b/src/glcc/student/index.jsx
@@ -9,7 +9,6 @@ import banner from "../img/banner.png";
import studentSvg from "../img/student.png";
import './index.scss';
import { Link } from 'react-router-dom';
-import { color } from 'echarts/lib/theme/light';
const Option = Select.Option;
const gradeList = [
@@ -22,17 +21,19 @@ const gradeList = [
{ id: '研二', name: '研二' },
{ id: '研三', name: '研三' }];
function Apply(props) {
- const { form, current_user, showNotification, isGlccApplyDate, 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-25').getTime();
+
const { getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll } = form;
const [imageUrl, setImageUrl] = useState(undefined);
const [loading, setLoading] = useState(false);
const [reload, setReload] = useState();
const [userApplyInfo, setUserApplyInfo] = useState(undefined);
- const [editable, setEditable] = useState(true);
+ const [editable, setEditable] = useState(isStudentApplyDate);
const [files, setFiles] = useState([]);
const [files1, setFiles1] = useState([]);
const initTask = {
@@ -43,20 +44,25 @@ function Apply(props) {
const [myTaskList, setMyTaskList] = useState([]);
const [allTaskList, setAllTaskList] = useState([]);
+ // 学生报名时间范围内
+ // 已过学生报名时间
+
useEffect(() => {
// 进入此页面到填写页面
- // setTimeout(()=>{
+ setTimeout(()=>{
let clientWidth = document.body.clientWidth;
let scrollHeight = 500 * clientWidth / 1920;
window.scrollTo(0, scrollHeight);
+ });
+ // window.scrollTo(0, 50);
- if (!isGlccApplyDate) {
+ if (new Date().getTime() < new Date('2022-05-26').getTime()) {
// 不在开源夏令营报名时间之内
- window.location.href = "/glcc";
+ window.location.href = "/glcc/student/2";
} else if (current_user && current_user.login) {
} else {
- window.location.href = "/login?go_page=/glcc";
+ window.location.href = `/login?go_page=/glcc/student/apply/${taskId}`;
}
}, [])
@@ -184,6 +190,7 @@ function Apply(props) {
studentApplyEdit(params).then(response => {
if (response && response.message === "success") {
showNotification("修改信息成功");
+ // setStudentInfoReset(Math.random());
setReload(Math.random());
setLoading(false);
}
@@ -192,6 +199,7 @@ function Apply(props) {
studentApply(params).then(response => {
if (response && response.message === "success") {
showNotification("报名成功");
+ // setStudentInfoReset(Math.random());
setReload(Math.random());
setLoading(false);
}
@@ -255,12 +263,11 @@ function Apply(props) {
// 自荐书上传
function bookChange(info, i) {
if (info.file.status === 'uploading' || info.file.status === "done" || info.file.status === 'removed') {
- setLoading(true);
+ // setLoading(true);
if (info.file.status === "done") {
changeTaskItem('memoAttachmentId', info.fileList[0].response && info.fileList[0].response.data.id, i)
}
if (info.file.status === 'removed') {
- console.log(1111)
changeTaskItem('memoAttachmentId', '', i);
}
console.log(info.fileList);
@@ -271,9 +278,9 @@ function Apply(props) {
}
}
- if (info.file.status === "done" || info.file.status === 'removed') {
- setLoading(false);
- }
+ // if (info.file.status === "done" || info.file.status === 'removed') {
+ // setLoading(false);
+ // }
}
// 支持文件下载
@@ -342,7 +349,7 @@ function Apply(props) {
开源夏令营
- 查看项目
+ 课题及项目列表
学生报名
@@ -385,7 +392,7 @@ function Apply(props) {
{getFieldDecorator("location", {
rules: []
})(
-
+
)}
{helper('所在年级',
@@ -401,7 +408,7 @@ function Apply(props) {
'phone',
[{ required: true, message: "请正确输入联系电话" },
{ max: 14, message: '超出限制长度14位字符,请重新编辑' },
- { pattern: /^(^(\d{3,4}-)?\d{7,8})$|(13[0-9]{9})$/, message: '请正确输入联系电话' }],
+ { pattern: /(^(\d{3,4}-)?\d{7,8})$|([1][3,4,5,6,7,8,9][0-9]{9})/, message: '请正确输入联系电话' }],
{ verify("phone") }} className={editable ? "" : "disabledInput"} disabled={editable ? false : true} />
)}
{helper('邮箱地址',
@@ -419,28 +426,28 @@ function Apply(props) {
'请以图片的形式上传学生证明,大小不超过5M,格式为png、jpg、jpeg',
'proveAttachmentId',
[{ required: true, message: "请正确上传学生证明" }],
- userApplyInfo && userApplyInfo.proveAttachmentId ?
- :
- {imageUrl ?
:
+
+ {imageUrl ?
: userApplyInfo && userApplyInfo.proveAttachmentId ?
+ : }
-
+
)}
{
myTaskList.map((item, i) => {
return (
- 课题信息({i + 1}/2) {myTaskList.length > 1 && { deleteTask(i) }}>删除}
+ 课题信息({i + 1}/2) {myTaskList.length > 1 && { deleteTask(i) }}>删除}
{helper('课题名称',
'',
'taskId' + i,
@@ -458,7 +465,7 @@ function Apply(props) {
)}
{helper('自荐书',
-
自荐书示例:https://forum.gitlink.org.cn/forums/7299/detail
,
+
,
'memo' + i,
[{ required: true, message: "请正确输入自荐书" },
{ max: 500, message: '超出限制长度500位字符,请重新编辑' }],
diff --git a/src/glcc/student/index.scss b/src/glcc/student/index.scss
index b6cc89eb..ecd5dccb 100644
--- a/src/glcc/student/index.scss
+++ b/src/glcc/student/index.scss
@@ -293,7 +293,7 @@
.memoExtra {
margin-top: 12px;
margin-bottom: -10px;
- span {
+ a {
color: #466aff;
}
}
@@ -312,4 +312,26 @@
border: 1px solid #fff;
border-radius: 4px;
box-shadow: 0px 0px 12px rgba(203, 220, 255, 0.47);
+
+ .ant-select-dropdown-menu-item{
+ &:hover{
+ background-color: #e9efff;
+ }
+ }
+}
+.glcc_cascader{
+ .ant-cascader-menu{
+ width: 240px;
+
+ &::-webkit-scrollbar-track{
+ background-color: #E2E9FF;
+ }
+
+ &::-webkit-scrollbar-thumb{
+ background-color: #BCCCFF;
+ }
+ }
+ .ant-cascader-menu:first-child{
+ width: 250px;
+ }
}