Merge remote-tracking branch 'upstream/gitlink_server' into feature-kaixin
This commit is contained in:
commit
65f8e26e94
|
|
@ -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 = () => {
|
||||
|
|
|
|||
|
|
@ -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(() => {
|
||||
|
|
|
|||
|
|
@ -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 && <Tooltip title="此学生已入选其他课题"><Button disabled type="primary" className='redColBor'>已被选</Button></Tooltip>}
|
||||
{/* 学生未被锁定 */}
|
||||
{!record.locked && !record.used && (text ? <Button disabled={disabledCheck} type="default" onClick={() => { checkStudent(record.id, 0) }}>撤销</Button> :
|
||||
<Button disabled={disabledCheck || havePass} type="primary" onClick={() => { checkStudent(record.id, 1) }}>通过</Button>)}
|
||||
{!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>
|
||||
)
|
||||
})
|
||||
},
|
||||
];
|
||||
|
||||
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)) {
|
||||
|
|
|
|||
|
|
@ -22,50 +22,14 @@ 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 [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();
|
||||
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 goToStudent() {
|
||||
// 学生报名时间
|
||||
if (!studentApplyStart) {
|
||||
showNotification("不在报名时间,报名开始时间为5月26日");
|
||||
} else if(!isStudentApplyDate && !secondStudentApplyDate) {
|
||||
showNotification("课题申请时间已截止");
|
||||
} else{
|
||||
history.push("/glcc/subjects");
|
||||
}
|
||||
}
|
||||
|
||||
function goToCheck() {
|
||||
history.push("/glcc/mentoradmin");
|
||||
}
|
||||
|
||||
function goToCheckResult(){
|
||||
history.push("/glcc/result");
|
||||
}
|
||||
|
|
@ -135,6 +99,15 @@ export default (props) => {
|
|||
</div>
|
||||
<div className="pt6">选择课题,开启您的开源之旅</div>
|
||||
</div>}
|
||||
|
||||
{/* 导师审核 */}
|
||||
{showMatchingBut && <div className="apply" onClick={()=>{history.push("/glcc/mentoradmin");}}>
|
||||
<div>
|
||||
<img src={teacher} alt="" className="applyIcon" />
|
||||
<span className="til">导师审核</span>
|
||||
</div>
|
||||
<div className="pt6">以赛代筛,挖掘高潜力人才</div>
|
||||
</div>}
|
||||
{/* 6.28.-7.1 审核结果仅对导师可见,7.1之后对所有用户可见*/}
|
||||
{/* {resultTime2 && <div className="apply" onClick={goToCheckResult}>
|
||||
<div>
|
||||
|
|
@ -145,7 +118,7 @@ export default (props) => {
|
|||
</div>} */}
|
||||
|
||||
{/* 学生结项考核 */}
|
||||
{/* {!hasRole && checkTime1 && checkedTaskId && <Link className="apply" to={`/glcc/submission`}>
|
||||
{/* {!hasRole && checkedTaskId && <Link className="apply" to={`/glcc/submission`}>
|
||||
<div>
|
||||
<img src={img1} alt="" className="applyIcon" />
|
||||
<span className="til">结项考核</span>
|
||||
|
|
@ -161,22 +134,13 @@ export default (props) => {
|
|||
<div className="pt6">导师拟定结项考核结果</div>
|
||||
</Link>} */}
|
||||
{/* 结项考核结果公示页 */}
|
||||
{/* {checkTime3 && <Link className="apply" to={`/glcc/final/result`}>
|
||||
{/* {<Link className="apply" to={`/glcc/final/result`}>
|
||||
<div>
|
||||
<img src={img1} alt="" className="applyIcon" />
|
||||
<span className="til">考核结果</span>
|
||||
</div>
|
||||
<div className="pt6">结项课题考核结果公示</div>
|
||||
</Link>} */}
|
||||
|
||||
{/* 导师审核 */}
|
||||
{/* {hasRole && new Date().getTime() < new Date('2022/07/01 0:0').getTime() && <div className="apply" onClick={goToCheck}>
|
||||
<div>
|
||||
<img src={teacher} alt="" className="applyIcon" />
|
||||
<span className="til">导师审核</span>
|
||||
</div>
|
||||
<div className="pt6">以赛代筛,挖掘高潜力人才</div>
|
||||
</div>} */}
|
||||
</div>}
|
||||
{/* </div> */}
|
||||
<div className="introduce">
|
||||
|
|
|
|||
|
|
@ -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(学生报名阶段)
|
||||
|
|
@ -88,6 +90,8 @@ const Glcc = (propsF) => {
|
|||
const [repoPublic, setRepoPublic] = useState(false);
|
||||
// 是否处于项目/课题补录阶段
|
||||
const [applyRepo, setApplyRepo] = useState(false);
|
||||
// 导师-学生配对阶段
|
||||
const [isMatching, setIsMatching] = useState(false);
|
||||
|
||||
useEffect(()=>{
|
||||
if(id && id === "2022"){
|
||||
|
|
@ -96,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();
|
||||
|
|
@ -106,6 +110,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 +130,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({});
|
||||
// 刷新用户课题报名信息
|
||||
|
|
@ -152,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=>{
|
||||
|
|
@ -196,7 +201,7 @@ const Glcc = (propsF) => {
|
|||
{period === "stuApply" && <Route
|
||||
path="/glcc/student/apply/:taskId"
|
||||
render={(props) => (
|
||||
<Student {...propsF} {...props} round={round} period={period} isGlccApplyDate={isGlccApplyDate} setStudentInfoReset={setStudentInfoReset}/>
|
||||
<Student {...propsF} {...props} round={round} period={period} setStudentInfoReset={setStudentInfoReset}/>
|
||||
)}
|
||||
></Route>}
|
||||
{/* 开源夏令营报名页面 */}
|
||||
|
|
@ -206,20 +211,20 @@ const Glcc = (propsF) => {
|
|||
<Apply round={round} {...propsF} {...props}/>
|
||||
)}
|
||||
></Route>}
|
||||
{/* 导师报名课题路由通道 */}
|
||||
{/* 导师报名课题路由通道(补录) */}
|
||||
{applyRepo && <Route
|
||||
path="/glcc/sign"
|
||||
render={(props) => (
|
||||
<Apply round={round} {...propsF} {...props}/>
|
||||
)}
|
||||
></Route>}
|
||||
{/* 教师审核 */}
|
||||
<Route
|
||||
{/* 导师-学生配对阶段 */}
|
||||
{isMatching && hasRole && <Route
|
||||
path="/glcc/mentoradmin"
|
||||
render={(props) => (
|
||||
<Check {...propsF} {...props} isGlccApplyDate={isGlccApplyDate}/>
|
||||
<Check {...propsF} {...props} currentRound={currentRound}/>
|
||||
)}
|
||||
></Route>
|
||||
></Route>}
|
||||
{/* 帮助中心 */}
|
||||
<Route
|
||||
path="/glcc/help"
|
||||
|
|
@ -237,7 +242,7 @@ const Glcc = (propsF) => {
|
|||
{!(round === 2 && !repoPublic) && <Route
|
||||
path="/glcc/:id/projects"
|
||||
render={(props) => (
|
||||
<Project period={period} round={round} {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} applyTask={applyTask}/>
|
||||
<Project period={period} round={round} {...propsF} {...props} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} applyTask={applyTask}/>
|
||||
)}
|
||||
></Route>}
|
||||
|
||||
|
|
@ -245,7 +250,7 @@ const Glcc = (propsF) => {
|
|||
{!(round === 2 && !repoPublic) && <Route
|
||||
path="/glcc/:id/subjects"
|
||||
render={(props) => (
|
||||
<Project period={period} round={round} {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} cancelCount={cancelCount} applyTask={applyTask}/>
|
||||
<Project period={period} round={round} {...propsF} {...props} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} cancelCount={cancelCount} applyTask={applyTask}/>
|
||||
)}
|
||||
></Route>}
|
||||
|
||||
|
|
@ -253,7 +258,7 @@ const Glcc = (propsF) => {
|
|||
<Route
|
||||
path="/glcc/openmmlab"
|
||||
render={(props) => (
|
||||
<Openmmlab {...propsF} {...props} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} applyTask={applyTask}/>
|
||||
<Openmmlab {...propsF} {...props} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} applyTask={applyTask}/>
|
||||
)}
|
||||
></Route>
|
||||
|
||||
|
|
@ -269,7 +274,7 @@ const Glcc = (propsF) => {
|
|||
<Route
|
||||
path="/glcc/:id/final/result"
|
||||
render={(props) => (
|
||||
<MiddleResult id={id} round={round} current_user={current_user} history={props.history} checkTime3={checkTime3}/>
|
||||
<MiddleResult id={id} round={round} current_user={current_user} history={props.history}/>
|
||||
)}
|
||||
></Route>
|
||||
|
||||
|
|
@ -277,7 +282,7 @@ const Glcc = (propsF) => {
|
|||
<Route
|
||||
path="/glcc/submission"
|
||||
render={(props) => (
|
||||
<StudentSubmit current_user={current_user} history={props.history} checkedTaskId={checkedTaskId} checkTime1={checkTime1} studentRegId={studentRegId}/>
|
||||
<StudentSubmit current_user={current_user} history={props.history} checkedTaskId={checkedTaskId} studentRegId={studentRegId}/>
|
||||
)}
|
||||
></Route>
|
||||
|
||||
|
|
@ -285,7 +290,7 @@ const Glcc = (propsF) => {
|
|||
<Route
|
||||
path="/glcc/final/examination"
|
||||
render={(props) => (
|
||||
<TutorReview current_user={current_user} history={props.history} checkTime2={checkTime2}/>
|
||||
<TutorReview current_user={current_user} history={props.history} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
|
|
@ -293,7 +298,7 @@ const Glcc = (propsF) => {
|
|||
<Route
|
||||
path="/glcc/:id"
|
||||
render={(props) => (
|
||||
<Home repoPublic={repoPublic} period={period} round={round} {...propsF} {...props} studentApplyStart={studentApplyStart} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} checkedTaskId={checkedTaskId} checkTime1={checkTime1} checkTime2={checkTime2} checkTime3={checkTime3} glccSettings={glccSettings}/>
|
||||
<Home repoPublic={repoPublic} period={period} round={round} {...propsF} {...props} checkedTaskId={checkedTaskId} glccSettings={glccSettings} showMatchingBut={isMatching && hasRole}/>
|
||||
)}
|
||||
></Route>
|
||||
|
||||
|
|
@ -301,7 +306,7 @@ const Glcc = (propsF) => {
|
|||
<Route
|
||||
path="/glcc"
|
||||
render={(props) => (
|
||||
<Home repoPublic={repoPublic} period={period} round={round} {...propsF} {...props} studentApplyStart={studentApplyStart} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} checkedTaskId={checkedTaskId} checkTime1={checkTime1} checkTime2={checkTime2} checkTime3={checkTime3} glccSettings={glccSettings}/>
|
||||
<Home repoPublic={repoPublic} period={period} round={round} {...propsF} {...props} checkedTaskId={checkedTaskId} glccSettings={glccSettings} showMatchingBut={isMatching && hasRole}/>
|
||||
)}
|
||||
></Route>
|
||||
|
||||
|
|
|
|||
|
|
@ -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([]);
|
||||
|
|
|
|||
|
|
@ -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=>{
|
||||
|
|
|
|||
|
|
@ -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){
|
|||
)}
|
||||
<div className="wordNum">{wordNum} / 2000</div>
|
||||
</div>
|
||||
{checkTime2 && <Form.Item className="referItem oneCont">
|
||||
{/* 导师结项考核时间为true */}
|
||||
{false && <Form.Item className="referItem oneCont">
|
||||
{(!detail.glccTutorEvaluation || (detail.glccTutorEvaluation && isEdit)) && <Button style={{width: '100px', height: '36px'}} className="mt20" type="primary" htmlType="submit" disabled={disabled}>{detail.glccTutorEvaluation ? '保存' : '提交'}</Button>}
|
||||
{detail.glccTutorEvaluation && !isEdit && <Button style={{width: '100px', height: '36px'}} className="mt20" type="primary" onClick={()=>{setIsEdit(true);setDisabled(false);}}>修改</Button>}
|
||||
</Form.Item>}
|
||||
|
|
|
|||
|
|
@ -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 + ''} >
|
||||
<div className="tab_content">
|
||||
<div className="openmmlab_tab_content">
|
||||
<ProjectDetail detail={item} applyTaskId={applyTaskId} current_user={current_user} showLoginDialog={showLoginDialog} isStudentApplyDate={isStudentApplyDate} secondStudentApplyDate={secondStudentApplyDate} applyTask={applyTask}/>
|
||||
<ProjectDetail detail={item} applyTaskId={applyTaskId} current_user={current_user} showLoginDialog={showLoginDialog} applyTask={applyTask}/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -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())) && <Button type='primary' className='applyBut mr10' onClick={()=>{applyTask(item.id)}}>申请课题</Button>}
|
||||
{false && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && <Button type='primary' className='applyBut mr10' onClick={()=>{applyTask(item.id)}}>申请课题</Button>}
|
||||
{/* 第二次报名 锁定状态 */}
|
||||
{secondStudentApplyDate && !(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>)}
|
||||
{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>)}
|
||||
|
||||
{/* 查看课题详情按钮 */}
|
||||
<Button onClick={()=>{window.open(`/glcc/subjects/detail/${item.id}`)}} className='lookDetail'>课题详情</Button>
|
||||
|
|
|
|||
|
|
@ -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){
|
|||
</Form>
|
||||
|
||||
{
|
||||
setting && setting.third_party_new && setting.third_party_new.length > 0 ?
|
||||
<p className="quick_logon">
|
||||
<p className="quick_logon_p"></p>
|
||||
<span className={"startlogin"}> 快速登录 </span>
|
||||
{setting.third_party_new.map((item,key)=>{
|
||||
return(
|
||||
<a href={`${item.url}`} className="ml15 mr15">
|
||||
<Tooltip title={`使用${item.name === "qq" ? "QQ":item.name === "wechat" ? "微信" : item.name}账号登录`}>
|
||||
<img src={item.name === "educoder" ? educoderLogo : item.name === "qq" ? qqlogo : item.name === "wechat" ? WeChatlogo : item.name === "gitee" ? giteelogo : item.name === "github" ? githublogo : ""} width="46px" alt={`${item.name}登录`}/>
|
||||
</Tooltip>
|
||||
</a>
|
||||
)
|
||||
})
|
||||
}
|
||||
</p>
|
||||
:""
|
||||
// setting && setting.third_party_new && setting.third_party_new.length > 0 ?
|
||||
// <p className="quick_logon">
|
||||
// <p className="quick_logon_p"></p>
|
||||
// <span className={"startlogin"}> 快速登录 </span>
|
||||
// {setting.third_party_new.map((item,key)=>{
|
||||
// return(
|
||||
// <a href={`${item.url}`} className="ml15 mr15">
|
||||
// <Tooltip title={`使用${item.name === "qq" ? "QQ":item.name === "wechat" ? "微信" : item.name}账号登录`}>
|
||||
// <img src={item.name === "educoder" ? educoderLogo : item.name === "qq" ? qqlogo : item.name === "wechat" ? WeChatlogo : item.name === "gitee" ? giteelogo : item.name === "github" ? githublogo : ""} width="46px" alt={`${item.name}登录`}/>
|
||||
// </Tooltip>
|
||||
// </a>
|
||||
// )
|
||||
// })
|
||||
// }
|
||||
// </p>
|
||||
<OtherLogin />
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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){
|
|||
</Form.Item>
|
||||
<Button type="primary" htmlType="submit" className="login_register_cofBut" onClick={handleSubmit}>注册</Button>
|
||||
</Form>
|
||||
<OtherLogin />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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 ?
|
||||
<p className="quick_logon">
|
||||
<p className="quick_logon_p"></p>
|
||||
<span className={"startlogin"}> 快速登录 </span>
|
||||
{setting.third_party_new.map((item,key)=>{
|
||||
return(
|
||||
<a href={`${item.url}`} className="ml15 mr15">
|
||||
<Tooltip title={`使用${item.name === "qq" ? "QQ":item.name === "wechat" ? "微信" : item.name}账号登录`}>
|
||||
<img src={item.name === "educoder" ? educoderLogo : item.name === "qq" ? qqlogo : item.name === "wechat" ? WeChatlogo : item.name === "gitee" ? giteelogo : item.name === "github" ? githublogo : ""} width="46px" alt={`${item.name}登录`}/>
|
||||
</Tooltip>
|
||||
</a>
|
||||
)
|
||||
})
|
||||
}
|
||||
</p>
|
||||
:""
|
||||
)
|
||||
}
|
||||
export default OtherLogin;
|
||||
Loading…
Reference in New Issue