forked from Gitlink/forgeplus-react
issue
This commit is contained in:
parent
cf361ad002
commit
50d92c2bdd
|
@ -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";
|
||||
|
||||
|
||||
// 任务管理审核
|
||||
|
@ -43,6 +44,8 @@ const Project = Loadable({
|
|||
const Glcc = (propsF) => {
|
||||
// 判断时间是否在开源夏令营报名时间内(4月15日~5月20日)
|
||||
const isGlccApplyDate = Date.parse(new Date()) < 1653062400000;
|
||||
// 刷新用户课题报名信息
|
||||
const [studentInfoReset, setStudentInfoReset] = useState(undefined);
|
||||
|
||||
return (
|
||||
<div className="newMain clearfix">
|
||||
|
@ -51,7 +54,7 @@ const Glcc = (propsF) => {
|
|||
<Route
|
||||
path="/glcc/student/apply/:taskId"
|
||||
render={(props) => (
|
||||
<Student {...propsF} {...props} isGlccApplyDate={isGlccApplyDate}/>
|
||||
<Student {...propsF} {...props} isGlccApplyDate={isGlccApplyDate} setStudentInfoReset={setStudentInfoReset}/>
|
||||
)}
|
||||
></Route>
|
||||
{/* 开源夏令营报名页面 */}
|
||||
|
@ -72,7 +75,7 @@ const Glcc = (propsF) => {
|
|||
<Route
|
||||
path="/glcc/student"
|
||||
render={(props) => (
|
||||
<Project {...propsF} {...props} />
|
||||
<Project {...propsF} {...props} studentInfoReset={studentInfoReset} setStudentInfoReset={setStudentInfoReset}/>
|
||||
)}
|
||||
></Route>
|
||||
{/* 首页 */}
|
||||
|
|
|
@ -20,7 +20,7 @@ const TaskList = Loadable({
|
|||
});
|
||||
|
||||
function Project(propsF) {
|
||||
const {location, current_user, showLoginDialog} = propsF;
|
||||
const {location, current_user, showLoginDialog, studentInfoReset, setStudentInfoReset} = propsF;
|
||||
const {pathname} = location;
|
||||
const isStudentApplyDate = Date.parse(new Date()) > 1653494400000 && Date.parse(new Date()) < 1656086400000;
|
||||
const studentApplyEnd = Date.parse(new Date()) > 1656086400000;
|
||||
|
@ -29,8 +29,6 @@ function Project(propsF) {
|
|||
|
||||
// 用户已报名课题id数组
|
||||
const [applyTaskId, setApplyTaskId] = useState({});
|
||||
// 刷新用户课题报名信息
|
||||
const [studentInfoReset, setStudentInfoReset] = useState(undefined);
|
||||
|
||||
useEffect(()=>{
|
||||
// 获取用户课题报名信息current_user user_id
|
||||
|
|
|
@ -133,7 +133,7 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
|
|||
ids.includes(item.id.toString()) && toFirst(data, index);
|
||||
})
|
||||
setData(response.data.rows);
|
||||
setTotal(response.data.total)
|
||||
setTotal(response.data.total);
|
||||
}
|
||||
setLoading(false);
|
||||
})
|
||||
|
|
|
@ -22,7 +22,7 @@ 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)
|
||||
|
@ -189,6 +189,7 @@ function Apply(props) {
|
|||
studentApplyEdit(params).then(response => {
|
||||
if (response && response.message === "success") {
|
||||
showNotification("修改信息成功");
|
||||
setStudentInfoReset(Math.random());
|
||||
setReload(Math.random());
|
||||
setLoading(false);
|
||||
}
|
||||
|
@ -197,6 +198,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