From f5fb66f1bc07da24703881c6acb65dd3df964081 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Fri, 9 Jun 2023 11:19:24 +0800
Subject: [PATCH 1/5] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E9=A1=B5=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E7=AC=AC=E4=B8=89=E6=96=B9=E7=99=BB=E5=BD=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/modules/loginRegister/Login.jsx | 47 ++++++++++---------
.../loginRegister/LoginRegisterPage.scss | 38 ++++++++-------
src/modules/loginRegister/Register.jsx | 10 ++++
.../loginRegister/component/otherLogin.jsx | 36 ++++++++++++++
4 files changed, 90 insertions(+), 41 deletions(-)
create mode 100644 src/modules/loginRegister/component/otherLogin.jsx
diff --git a/src/modules/loginRegister/Login.jsx b/src/modules/loginRegister/Login.jsx
index f483d1923..614a26545 100644
--- a/src/modules/loginRegister/Login.jsx
+++ b/src/modules/loginRegister/Login.jsx
@@ -2,17 +2,18 @@ import React, { useEffect, useState } from "react";
import { Form, Input, Button, Checkbox , Tooltip } from "antd";
import { Link } from "react-router-dom";
import axios from 'axios';
-import educoderLogo from '../login/educoder.png';
-import qqlogo from '../login/qq@2x.png';
-import WeChatlogo from '../login/WeChat@2x.png';
-import giteelogo from '../login/gitee.png';
-import githublogo from '../login/github.png';
+// import educoderLogo from '../login/educoder.png';
+// import qqlogo from '../login/qq@2x.png';
+// import WeChatlogo from '../login/WeChat@2x.png';
+// import giteelogo from '../login/gitee.png';
+// import githublogo from '../login/github.png';
+import OtherLogin from "./component/otherLogin";
import cookie from 'react-cookies';
import './LoginRegisterPage.scss';
function Login(props){
const [message,setMessage] = useState();
- const [setting, setSetting] = useState(undefined);
+ // const [setting, setSetting] = useState(undefined);
const {form, location, mygetHelmetapi} = props;
const {getFieldDecorator } = form;
const {search} = location;
@@ -21,7 +22,7 @@ function Login(props){
//控制密码输入框在DOM不可见value
clear();
//获取第三方登录平台信息
- setSetting(JSON.parse(localStorage.getItem("chromesetting")));
+ // setSetting(JSON.parse(localStorage.getItem("chromesetting")));
},[])
// 配置网页标题
@@ -121,22 +122,22 @@ function Login(props){
{
- setting && setting.third_party_new && setting.third_party_new.length > 0 ?
-
-
- 快速登录
- {setting.third_party_new.map((item,key)=>{
- return(
-
-
-
-
-
- )
- })
- }
-
- :""
+ // setting && setting.third_party_new && setting.third_party_new.length > 0 ?
+ //
+ //
+ // 快速登录
+ // {setting.third_party_new.map((item,key)=>{
+ // return(
+ //
+ //
+ //
+ //
+ //
+ // )
+ // })
+ // }
+ //
+
}
diff --git a/src/modules/loginRegister/LoginRegisterPage.scss b/src/modules/loginRegister/LoginRegisterPage.scss
index d478e5a60..9d97fc87a 100644
--- a/src/modules/loginRegister/LoginRegisterPage.scss
+++ b/src/modules/loginRegister/LoginRegisterPage.scss
@@ -77,7 +77,7 @@
border-radius: 7px;
font-size: 15px;
top: 50%;
- margin-top: -293px;
+ margin-top: -329px;
.login_register_head{
display: flex;
justify-content: space-between;
@@ -183,23 +183,25 @@
margin-top: -1vh;
}
}
- //第三方登录
- .quick_logon{
- text-align: center;
- .quick_logon_p{
- border-top: 1px solid #979797;
- margin-top: 24px;
- }
- .startlogin{
- position: relative;
- background: #dee1f4;
- display: block;
- width: 90px;
- top: -15px;
- left: 39%;
- font-size: 13px;
- color: #8D8D8D;
- }
+
+ }
+
+ //第三方登录
+ .quick_logon{
+ text-align: center;
+ .quick_logon_p{
+ border-top: 1px solid #979797;
+ margin-top: 24px;
+ }
+ .startlogin{
+ position: relative;
+ background: #dee1f4;
+ display: block;
+ width: 90px;
+ top: -15px;
+ left: 39%;
+ font-size: 13px;
+ color: #8D8D8D;
}
}
diff --git a/src/modules/loginRegister/Register.jsx b/src/modules/loginRegister/Register.jsx
index 970786243..518861992 100644
--- a/src/modules/loginRegister/Register.jsx
+++ b/src/modules/loginRegister/Register.jsx
@@ -4,6 +4,7 @@ import { Link } from "react-router-dom";
import axios from 'axios';
import { setmiyah } from 'educoder';
import './LoginRegisterPage.scss';
+import OtherLogin from "./component/otherLogin";
function Register(props){
const {form, mygetHelmetapi} = props;
@@ -22,11 +23,19 @@ function Register(props){
const [emailGo, setEmailGo] = useState(true);
// 注册类型(手机号/邮箱)
const [registerType, setRegisterType] = useState(0);
+ const [setting, setSetting] = useState(undefined);
const seconds = useRef();
let interval = undefined;
//页面加载完自动聚焦到第一个输入框
// const inputEl = useRef(null);
+
+
+ useEffect(()=>{
+ //获取第三方登录平台信息
+ setSetting(JSON.parse(localStorage.getItem("chromesetting")));
+ },[])
+
// 配置网页标题
useEffect(()=>{
if(mygetHelmetapi){
@@ -343,6 +352,7 @@ function Register(props){
+
)
diff --git a/src/modules/loginRegister/component/otherLogin.jsx b/src/modules/loginRegister/component/otherLogin.jsx
new file mode 100644
index 000000000..28f36cda3
--- /dev/null
+++ b/src/modules/loginRegister/component/otherLogin.jsx
@@ -0,0 +1,36 @@
+import React,{useState ,useEffect} from 'react';
+import { Tooltip } from 'antd';
+import educoderLogo from '../../login/educoder.png';
+import qqlogo from '../../login/qq@2x.png';
+import WeChatlogo from '../../login/WeChat@2x.png';
+import giteelogo from '../../login/gitee.png';
+import githublogo from '../../login/github.png';
+
+function OtherLogin(){
+ const [setting, setSetting] = useState(undefined);
+
+ useEffect(()=>{
+ //获取第三方登录平台信息
+ setSetting(JSON.parse(localStorage.getItem("chromesetting")));
+ },[])
+
+ return(
+ setting && setting.third_party_new && setting.third_party_new.length > 0 ?
+
+
+ 快速登录
+ {setting.third_party_new.map((item,key)=>{
+ return(
+
+
+
+
+
+ )
+ })
+ }
+
+ :""
+ )
+}
+export default OtherLogin;
\ No newline at end of file
From 3141706d8924aef1ec76fc83d856bb8169386c38 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Fri, 9 Jun 2023 14:25:50 +0800
Subject: [PATCH 2/5] =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=B3=A8=E5=86=8C?=
=?UTF-8?q?=E8=B7=B3=E8=BD=AC=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/forge/Head/Header.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js
index 9269faf0d..9c5fabbaf 100644
--- a/src/forge/Head/Header.js
+++ b/src/forge/Head/Header.js
@@ -75,6 +75,9 @@ class NewHeader extends Component {
this.setState({
user: newProps.user
})
+ if(!newProps.user ||(newProps.user && !newProps.user.login)){
+ cookie.remove("login");
+ }
}
educoderlogin = () => {
From f00fdbfdab4fcba38da218f28c112ed5f41a01a3 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Fri, 9 Jun 2023 18:49:30 +0800
Subject: [PATCH 3/5] update
---
src/forge/Head/Header.js | 6 +++---
src/forge/Issues/Component/date.jsx | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js
index 9c5fabbaf..ccd9ba00c 100644
--- a/src/forge/Head/Header.js
+++ b/src/forge/Head/Header.js
@@ -75,9 +75,9 @@ class NewHeader extends Component {
this.setState({
user: newProps.user
})
- if(!newProps.user ||(newProps.user && !newProps.user.login)){
- cookie.remove("login");
- }
+ // if(!newProps.user ||(newProps.user && !newProps.user.login)){
+ // cookie.remove("login");
+ // }
}
educoderlogin = () => {
diff --git a/src/forge/Issues/Component/date.jsx b/src/forge/Issues/Component/date.jsx
index f2e0659e4..7df519fd9 100644
--- a/src/forge/Issues/Component/date.jsx
+++ b/src/forge/Issues/Component/date.jsx
@@ -18,10 +18,10 @@ function Date({name , today , setDate , editFlag},ref){
const refBox = useRef(null);
useEffect(()=>{
- if(!visible){
+ if(!visible && !editFlag &&time){
setDate(time);
}
- },[visible])
+ },[visible,editFlag,time])
useEffect(() => {
From cad1e956cc6b0df030225f8bd2679139c7112ae4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com>
Date: Mon, 12 Jun 2023 10:10:09 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E5=88=A0=E9=99=A42022glcc=E5=9B=BA?=
=?UTF-8?q?=E5=AE=9A=E6=97=B6=E9=97=B4=E5=88=A4=E6=96=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/glcc/check/index.jsx | 14 +++---
src/glcc/home/index.jsx | 31 ++----------
src/glcc/index.jsx | 47 ++++++++-----------
src/glcc/interimReview/result.jsx | 9 +---
src/glcc/interimReview/studentSubmit.jsx | 8 +---
src/glcc/interimReview/tutorReview.jsx | 5 +-
src/glcc/openmmlab/projectTab/index.jsx | 4 +-
.../openmmlab/projectTab/projectDetail.jsx | 6 +--
8 files changed, 39 insertions(+), 85 deletions(-)
diff --git a/src/glcc/check/index.jsx b/src/glcc/check/index.jsx
index 5a7822c02..fea4ce60c 100644
--- a/src/glcc/check/index.jsx
+++ b/src/glcc/check/index.jsx
@@ -143,15 +143,15 @@ function Check({ current_user, showNotification, history }) {
];
useEffect(() => {
- if(new Date().getTime() > new Date('2022/07/01 0:0').getTime()){
- history.push('/403');
- }
- if (!current_user.user_id) {
- history.push('/403');
- }
+ // if(new Date().getTime() > new Date('2022/07/01 0:0').getTime()){
+ // history.push('/403');
+ // }
+ // if (!current_user.user_id) {
+ // history.push('/403');
+ // }
hasAuditRole({ userId: current_user.user_id }).then(res => {
if (!(res && res.message == 'success' && res.data.hasRole)) {
- history.push('/403');
+ // history.push('/403');
}
})
}, [])
diff --git a/src/glcc/home/index.jsx b/src/glcc/home/index.jsx
index 51387b812..2f3620936 100644
--- a/src/glcc/home/index.jsx
+++ b/src/glcc/home/index.jsx
@@ -22,23 +22,9 @@ import './index.scss';
// period: 项目报名阶段("repoApply")
// match:{params:{id=2023}} 注意默认值记得每届修改
export default (props) => {
- const { current_user, isGlccApplyDate, showNotification, studentApplyStart, history, secondStudentApplyDate, isStudentApplyDate, checkedTaskId, checkTime1, checkTime2, checkTime3, round, match:{params:{id=2023}}, period, showLoginDialog, glccSettings, repoPublic} = props;
- function goToApply() {
- if (isGlccApplyDate) {
- if (current_user && current_user.login) {
- window.location.href = "https://wj.qq.com/s2/10175205/e8df/";
- } else {
- window.location.href = "/login?go_page=https://wj.qq.com/s2/10175205/e8df/";
- }
- } else {
- showNotification("不在报名时间,报名时间为4月15日~5月20日");
- window.location.href = "/glcc";
- }
- }
+ const { current_user, history, round, match:{params:{id=2023}}, period, showLoginDialog, glccSettings, repoPublic} = props;
const [hasRole, setHasRole] = useState(false);
- const resultTime1 = new Date().getTime() > new Date('2022/06/28 1:0').getTime() && new Date().getTime() < new Date('2022/07/01 0:0').getTime();
- const resultTime2 = new Date().getTime() > new Date('2022/07/01 12:0').getTime() && new Date().getTime() < new Date('2022/08/12 0:0').getTime();
useEffect(() => {
if (!current_user.user_id) {
@@ -51,17 +37,6 @@ export default (props) => {
})
}, [])
- function goToStudent() {
- // 学生报名时间
- if (!studentApplyStart) {
- showNotification("不在报名时间,报名开始时间为5月26日");
- } else if(!isStudentApplyDate && !secondStudentApplyDate) {
- showNotification("课题申请时间已截止");
- } else{
- history.push("/glcc/subjects");
- }
- }
-
function goToCheck() {
history.push("/glcc/mentoradmin");
}
@@ -145,7 +120,7 @@ export default (props) => {
} */}
{/* 学生结项考核 */}
- {/* {!hasRole && checkTime1 && checkedTaskId &&
+ {/* {!hasRole && checkedTaskId &&
结项考核
@@ -161,7 +136,7 @@ export default (props) => {
导师拟定结项考核结果
} */}
{/* 结项考核结果公示页 */}
- {/* {checkTime3 &&
+ {/* {
考核结果
diff --git a/src/glcc/index.jsx b/src/glcc/index.jsx
index 894f9e9df..c98cbe34e 100644
--- a/src/glcc/index.jsx
+++ b/src/glcc/index.jsx
@@ -88,6 +88,8 @@ const Glcc = (propsF) => {
const [repoPublic, setRepoPublic] = useState(false);
// 是否处于项目/课题补录阶段
const [applyRepo, setApplyRepo] = useState(false);
+ // 导师-学生配对阶段
+ const [isMatching, setIsMatching] = useState(false);
useEffect(()=>{
if(id && id === "2022"){
@@ -106,6 +108,9 @@ const Glcc = (propsF) => {
// 是否处于项目/课题补录阶段
const repoApply1 = res.data.filter(item=>item.name === "repoApply1");
repoApply1[0] && setApplyRepo(judge(nowTime, repoApply1[0].value, "range"))
+ // 是否处于导师-学生配对阶段
+ 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 periodIndex = filterRepoPublic.findIndex(item=>judge(nowTime, item.value, "range"));
@@ -123,20 +128,6 @@ const Glcc = (propsF) => {
return type === "range" ? nowTime > timeArr[0] && nowTime < timeArr[1] : nowTime > timeArr[0]
}
- // 判断时间是否在开源夏令营报名时间内(4月15日~5月20日)
- const isGlccApplyDate = Date.parse(new Date()) < 1653062400000;
-
- // 学生报名时间
- const studentApplyStart = new Date().getTime() > new Date('2022/05/26').getTime();
- const isStudentApplyDate = new Date().getTime() > new Date('2022/05/26').getTime() && new Date().getTime() < new Date('2022/06/25 0:0').getTime();
- const secondStudentApplyDate = new Date().getTime() > new Date('2022/06/29 1:0').getTime() && new Date().getTime() < new Date('2022/06/30 0:0').getTime();
- // 学生结项考核入口可见时间
- const checkTime1 = new Date().getTime() > new Date('2022/10/01 8:0').getTime();
- // 导师结项考核时间
- const checkTime2 = new Date().getTime() > new Date('2022/10/01 8:0').getTime() && new Date().getTime() < new Date('2022/10/24 24:0').getTime();
- // 结项考核结果公示
- const checkTime3 = new Date().getTime() > new Date('2022/10/24 10:0').getTime();
-
// 用户已报名课题id数组
const [applyTaskId, setApplyTaskId] = useState({});
// 刷新用户课题报名信息
@@ -196,7 +187,7 @@ const Glcc = (propsF) => {
{period === "stuApply" &&
(
-
+
)}
>}
{/* 开源夏令营报名页面 */}
@@ -206,20 +197,20 @@ const Glcc = (propsF) => {
)}
>}
- {/* 导师报名课题路由通道 */}
+ {/* 导师报名课题路由通道(补录) */}
{applyRepo &&
(
)}
>}
- {/* 教师审核 */}
-
(
-
+
)}
- >
+ >}
{/* 帮助中心 */}
{
{!(round === 2 && !repoPublic) && (
-
+
)}
>}
@@ -245,7 +236,7 @@ const Glcc = (propsF) => {
{!(round === 2 && !repoPublic) && (
-
+
)}
>}
@@ -253,7 +244,7 @@ const Glcc = (propsF) => {
(
-
+
)}
>
@@ -269,7 +260,7 @@ const Glcc = (propsF) => {
(
-
+
)}
>
@@ -277,7 +268,7 @@ const Glcc = (propsF) => {
(
-
+
)}
>
@@ -285,7 +276,7 @@ const Glcc = (propsF) => {
(
-
+
)}
>
@@ -293,7 +284,7 @@ const Glcc = (propsF) => {
(
-
+
)}
>
@@ -301,7 +292,7 @@ const Glcc = (propsF) => {
(
-
+
)}
>
diff --git a/src/glcc/interimReview/result.jsx b/src/glcc/interimReview/result.jsx
index 32a6e6958..a32c810d5 100644
--- a/src/glcc/interimReview/result.jsx
+++ b/src/glcc/interimReview/result.jsx
@@ -11,7 +11,7 @@ import '../project/index.scss';
const { Search } = Input;
// 课题列表
-function CheckResult({current_user, history, checkTime3, round, id}) {
+function CheckResult({current_user, history, round, id}) {
// 输入搜索框
const [keyword, setKeyword] = useState(undefined);
const [data, setData] = useState([]);
@@ -22,13 +22,6 @@ function CheckResult({current_user, history, checkTime3, round, id}) {
const [loading, setLoading] = useState(false);
const [expandedRowKeys, setExpandedRowKeys] = useState([]);
- useEffect(()=>{
- // 未到时间
- if(!checkTime3){
- history.push('/glcc');
- }
- },[])
-
useEffect(() => {
setLoading(true);
setExpandedRowKeys([]);
diff --git a/src/glcc/interimReview/studentSubmit.jsx b/src/glcc/interimReview/studentSubmit.jsx
index 776e5f3d9..75974551e 100644
--- a/src/glcc/interimReview/studentSubmit.jsx
+++ b/src/glcc/interimReview/studentSubmit.jsx
@@ -9,7 +9,7 @@ import {getMediumTermExamineInfo, submitMedium} from '../api';
import './index.scss';
function StudentSubmit(props){
- const {form, checkedTaskId, checkTime1, studentRegId, history} = props;
+ const {form, checkedTaskId, studentRegId, history} = props;
const {getFieldDecorator, validateFieldsAndScroll } = form;
const [detail, setDetail] = useState(undefined);
const [reload, setReload] = useState(undefined);
@@ -21,12 +21,6 @@ function StudentSubmit(props){
// 学生提醒导师评分时间
const lookTime = new Date().getTime() > new Date('2022/10/15 0:0').getTime() && new Date().getTime() < new Date('2022/10/23 24:0').getTime();
- useEffect(()=>{
- if(!checkTime1){
- history.push("/glcc");
- }
- }, [])
-
useEffect(()=>{
// 查询是否已经提交考核材料
checkedTaskId && getMediumTermExamineInfo(checkedTaskId,{term: 2}).then(res=>{
diff --git a/src/glcc/interimReview/tutorReview.jsx b/src/glcc/interimReview/tutorReview.jsx
index 2df95f08d..0820ce2a5 100644
--- a/src/glcc/interimReview/tutorReview.jsx
+++ b/src/glcc/interimReview/tutorReview.jsx
@@ -11,7 +11,7 @@ const { TabPane } = Tabs;
const { TextArea } = Input;
function TutorReview(props){
- const {form, current_user, showNotification, checkTime2, history} = props;
+ const {form, current_user, showNotification, history} = props;
const {getFieldDecorator, setFieldsValue, validateFieldsAndScroll, resetFields } = form;
const [taskId, setTaskId] = useState();
const [taskList, setTaskList] = useState([]);
@@ -174,7 +174,8 @@ function TutorReview(props){
)}
{wordNum} / 2000
- {checkTime2 &&
+ {/* 导师结项考核时间为true */}
+ {false &&
{(!detail.glccTutorEvaluation || (detail.glccTutorEvaluation && isEdit)) && }
{detail.glccTutorEvaluation && !isEdit && }
}
diff --git a/src/glcc/openmmlab/projectTab/index.jsx b/src/glcc/openmmlab/projectTab/index.jsx
index ba493833f..9dfc1e1ef 100644
--- a/src/glcc/openmmlab/projectTab/index.jsx
+++ b/src/glcc/openmmlab/projectTab/index.jsx
@@ -7,7 +7,7 @@ const $ = window.$;
const { TabPane } = Tabs;
-function ProjectTabs({ list, applyTaskId, history, current_user, showLoginDialog, isStudentApplyDate, secondStudentApplyDate, applyTask }) {
+function ProjectTabs({ list, applyTaskId, history, current_user, showLoginDialog, applyTask }) {
useEffect(()=>{
setTimeout(()=>{
@@ -34,7 +34,7 @@ function ProjectTabs({ list, applyTaskId, history, current_user, showLoginDialog
key={i + ''} >
diff --git a/src/glcc/openmmlab/projectTab/projectDetail.jsx b/src/glcc/openmmlab/projectTab/projectDetail.jsx
index 8e334f934..fd7c0b1dc 100644
--- a/src/glcc/openmmlab/projectTab/projectDetail.jsx
+++ b/src/glcc/openmmlab/projectTab/projectDetail.jsx
@@ -3,7 +3,7 @@ import { Button, message, Tooltip } from 'antd';
import Nodata from '../../../forge/Nodata';
import { getProjectById } from '../../api';
-export default ({ detail, projectId, applyTaskId, isStudentApplyDate, secondStudentApplyDate, applyTask }) => {
+export default ({ detail, projectId, applyTaskId, applyTask }) => {
const [info, setInfo] = useState(detail);
useEffect(()=>{
@@ -39,9 +39,9 @@ export default ({ detail, projectId, applyTaskId, isStudentApplyDate, secondStud
{/* 课题申请时间范围内: 申请课题 */}
{/* 第一次报名 */}
- {isStudentApplyDate && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && }
+ {false && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && }
{/* 第二次报名 锁定状态 */}
- {secondStudentApplyDate && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && (item.locked ? : )}
+ {false && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && (item.locked ? : )}
{/* 查看课题详情按钮 */}
From 9e121bd1bdc488703525740bfa7f35a729374cec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com>
Date: Mon, 12 Jun 2023 17:42:24 +0800
Subject: [PATCH 5/5] =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=AF=BC=E5=B8=88-?=
=?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=8C=B9=E9=85=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/glcc/check/index.jsx | 32 +++++++++-----------------------
src/glcc/home/index.jsx | 31 ++++++++++---------------------
src/glcc/index.jsx | 26 ++++++++++++++++++++------
3 files changed, 39 insertions(+), 50 deletions(-)
diff --git a/src/glcc/check/index.jsx b/src/glcc/check/index.jsx
index fea4ce60c..74ab5162b 100644
--- a/src/glcc/check/index.jsx
+++ b/src/glcc/check/index.jsx
@@ -3,13 +3,13 @@ import { Modal, Table, Tooltip, Breadcrumb, Tabs, Button } from 'antd';
import { Link } from 'react-router-dom';
import moment from 'moment';
import './index.scss';
-import { auditPassTask, getStudentList, getAuditList, hasAuditRole } from '../api';
+import { auditPassTask, getStudentList, getAuditList } from '../api';
import {httpUrl} from '../fetch';
const { TabPane } = Tabs;
-function Check({ current_user, showNotification, history }) {
+function Check({ current_user, showNotification, currentRound }) {
// 输入搜索框
const [data, setData] = useState([]);
@@ -23,8 +23,6 @@ function Check({ current_user, showNotification, history }) {
const [taskId, setTaskId] = useState();
const [havePass, setHavePass] = useState(false);
- const disabledCheck = new Date().getTime() > new Date('2022/07/01 00:00:00').getTime();
-
const columns = [
{
title: '学生姓名',
@@ -134,32 +132,18 @@ function Check({ current_user, showNotification, history }) {
{/* 学生已经被其他导师锁定 */}
{record.locked && record.used && }
{/* 学生未被锁定 */}
- {!record.locked && !record.used && (text ? :
- )}
+ {!record.locked && !record.used && (text ? :
+ )}
)
})
},
];
- useEffect(() => {
- // if(new Date().getTime() > new Date('2022/07/01 0:0').getTime()){
- // history.push('/403');
- // }
- // if (!current_user.user_id) {
- // history.push('/403');
- // }
- hasAuditRole({ userId: current_user.user_id }).then(res => {
- if (!(res && res.message == 'success' && res.data.hasRole)) {
- // history.push('/403');
- }
- })
- }, [])
-
useEffect(() => {
- getAuditList({ userId: current_user.user_id }).then(res => {
- if (res.message == 'success') {
+ getAuditList({ userId: current_user.user_id, round: currentRound }).then(res => {
+ if (res.message === 'success') {
setTaskList(res.data.rows);
res.data.rows.length && setTaskId(res.data.rows[0].id);
} else {
@@ -172,6 +156,7 @@ function Check({ current_user, showNotification, history }) {
auditPassTask({
id,
status,
+ round: currentRound
}).then(res => {
if (res && res.message === 'success') {
showNotification(status ? '已通过该学生课题申请' : '撤销成功')
@@ -264,9 +249,10 @@ function Check({ current_user, showNotification, history }) {
setLoading(true);
const params = {
curPage: 1,
- pageSize: 10000,
+ pageSize: 999,
keyword: '',
taskId,
+ round: currentRound
}
taskId && getStudentList(params).then(res => {
if (res.data && Array.isArray(res.data.rows)) {
diff --git a/src/glcc/home/index.jsx b/src/glcc/home/index.jsx
index 2f3620936..22720eb2f 100644
--- a/src/glcc/home/index.jsx
+++ b/src/glcc/home/index.jsx
@@ -22,25 +22,14 @@ 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} = props;
-
- const [hasRole, setHasRole] = useState(false);
+ const { current_user, history, round, match:{params:{id=2023}}, period, showLoginDialog, glccSettings, repoPublic, showMatchingBut} = props;
useEffect(() => {
if (!current_user.user_id) {
history.push('/403');
}
- hasAuditRole({ userId: current_user.user_id }).then(res => {
- if (res && res.message == 'success' && res.data.hasRole) {
- setHasRole(true);
- }
- })
}, [])
- function goToCheck() {
- history.push("/glcc/mentoradmin");
- }
-
function goToCheckResult(){
history.push("/glcc/result");
}
@@ -110,6 +99,15 @@ export default (props) => {
选择课题,开启您的开源之旅
}
+
+ {/* 导师审核 */}
+ {showMatchingBut && {history.push("/glcc/mentoradmin");}}>
+
+

+
导师审核
+
+
以赛代筛,挖掘高潜力人才
+
}
{/* 6.28.-7.1 审核结果仅对导师可见,7.1之后对所有用户可见*/}
{/* {resultTime2 &&
@@ -143,15 +141,6 @@ export default (props) => {
结项课题考核结果公示
} */}
-
- {/* 导师审核 */}
- {/* {hasRole && new Date().getTime() < new Date('2022/07/01 0:0').getTime() &&
-
-

-
导师审核
-
-
以赛代筛,挖掘高潜力人才
-
} */}
}
{/* */}
diff --git a/src/glcc/index.jsx b/src/glcc/index.jsx
index c98cbe34e..701c1021b 100644
--- a/src/glcc/index.jsx
+++ b/src/glcc/index.jsx
@@ -11,7 +11,7 @@ import "./index.scss";
import Loadable from "react-loadable";
import Loading from "../Loading";
import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC";
-import { getGlccSettings, getStudentApplyInfo } from "./api";
+import { getGlccSettings, getStudentApplyInfo, hasAuditRole } from "./api";
import { message } from "antd";
@@ -78,6 +78,8 @@ const MiddleResult = Loadable({
});
const Glcc = (propsF) => {
const {current_user, showLoginDialog, match:{params:{id}}} = propsF;
+ // 当届
+ const currentRound = 2;
// round:2022届(1) 2023届(2)
const [round, setRound] = useState(2);
// glcc 所处阶段 repoApply(项目报名) stuApply(学生报名阶段)
@@ -98,7 +100,7 @@ const Glcc = (propsF) => {
}, [id])
useEffect(()=>{
// 获取当前glcc配置
- getGlccSettings({round: 2}).then(res=>{
+ getGlccSettings({round: currentRound}).then(res=>{
if(res && res.message === "success"){
setGLccSetting(res.data);
const nowTime = new Date().getTime();
@@ -143,6 +145,18 @@ const Glcc = (propsF) => {
document.title='开源夏令营';
}, [])
+ // 是否为导师身份
+ const [hasRole, setHasRole] = useState(false);
+
+ useEffect(() => {
+ // 登录状态+导师-学生配对阶段
+ current_user && current_user.user_id && isMatching && hasAuditRole({ userId: current_user.user_id, round: currentRound }).then(res => {
+ if (res && res.message === 'success' && res.data.hasRole) {
+ setHasRole(true);
+ }
+ })
+ }, [current_user, isMatching])
+
useEffect(()=>{
// 获取用户课题报名信息(todo:学生报名阶段请求)
(period === "stuApply" || period === "stuApply1") && current_user && current_user.login && getStudentApplyInfo({userId: current_user.user_id, round: round}).then(response=>{
@@ -205,10 +219,10 @@ const Glcc = (propsF) => {
)}
>}
{/* 导师-学生配对阶段 */}
- {isMatching && (
-
+
)}
>}
{/* 帮助中心 */}
@@ -284,7 +298,7 @@ const Glcc = (propsF) => {
(
-
+
)}
>
@@ -292,7 +306,7 @@ const Glcc = (propsF) => {
(
-
+
)}
>