From aa64908ef27a943df7d5c345bdac3ab7f58950a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Mon, 27 Jun 2022 09:37:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E7=A4=BA=E7=BB=93=E6=9E=9C=E9=A1=B5+g?= =?UTF-8?q?lcc=E5=AD=A6=E7=94=9F=E6=8A=A5=E5=90=8D=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/glcc/check/index.jsx | 4 +- src/glcc/checkResult/index.jsx | 72 ++++++++--------------------- src/glcc/checkResult/index.scss | 4 ++ src/glcc/home/index.jsx | 6 +-- src/glcc/index.jsx | 2 +- src/glcc/project/taskList/index.jsx | 7 +-- src/glcc/student/index.jsx | 5 +- 7 files changed, 36 insertions(+), 64 deletions(-) diff --git a/src/glcc/check/index.jsx b/src/glcc/check/index.jsx index 2eeea262..3d9ab90e 100644 --- a/src/glcc/check/index.jsx +++ b/src/glcc/check/index.jsx @@ -31,7 +31,7 @@ function Check({ current_user, showNotification, history }) { className: "taskTableColumns", dataIndex: 'studentName', key: 'studentName', - width: '9%', + width: '12%', ellipsis: true, render: (text, record) => { return ( @@ -46,7 +46,7 @@ function Check({ current_user, showNotification, history }) { key: 'createdOn', dataIndex: 'createdOn', className: "taskTableColumns", - width: '10%', + width: '12%', render: (text, record) => { return ( text && moment(text).format('YYYY-MM-DD') diff --git a/src/glcc/checkResult/index.jsx b/src/glcc/checkResult/index.jsx index 1108a8bc..2bf33a41 100644 --- a/src/glcc/checkResult/index.jsx +++ b/src/glcc/checkResult/index.jsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; -import { Input, message, Modal, Table, Tooltip } from 'antd'; -import { cancelTaskApply, getPassList } from '../api'; +import { Input, Table, Tooltip } from 'antd'; +import { getPassList, hasAuditRole } from '../api'; import ProjectDetail from '../project/component/projectDetail'; // 预公示banner import resultBanner from "../img/resultBanner.png"; @@ -12,9 +12,7 @@ import '../project/index.scss'; const { Search } = Input; // 课题列表 -function CheckResult({applyTaskId, setStudentInfoReset, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd,cancelCount,showNotification}) { - const [visible, setVisible] = useState(false); - const [deleteTaskId, setDeleteTaskId] = useState(undefined); +function CheckResult({current_user, history}) { // 输入搜索框 const [keyword, setKeyword] = useState(undefined); const [data, setData] = useState([]); @@ -26,6 +24,19 @@ function CheckResult({applyTaskId, setStudentInfoReset, current_user, showLoginD const [expandedRowKeys, setExpandedRowKeys] = useState([]); const time = new Date().getTime() > new Date('2022-06-28').getTime() && new Date().getTime() < new Date('2022-07-01').getTime(); + useEffect(()=>{ + // 未到时间 + if(new Date().getTime() < new Date('2022-06-28').getTime()){ + history.push('/glcc'); + } + hasAuditRole({ userId: current_user.user_id }).then(res => { + // 7.1之前 普通用户不可以进入此页面 + if (!(res && res.message == 'success' && res.data.hasRole) && new Date().getTime() < new Date('2022-07-01').getTime()) { + history.push('/glcc'); + } + }) + },[]) + useEffect(() => { setLoading(true); setExpandedRowKeys([]); @@ -45,8 +56,8 @@ function CheckResult({applyTaskId, setStudentInfoReset, current_user, showLoginD const columns = [ { title: '序号', dataIndex: 'index', align: 'center', className:"columnsResult", width: '6%', render: (text, item, index) => {(current-1)*pageSize+index + 1} }, - { title: '入选学生', dataIndex: 'studentName', className:"columnsResult taskName", width: '10%', ellipsis: true}, - { title: '课题导师', dataIndex: 'tutorName', className:"columnsResult", width: '10%', ellipsis: true}, + { title: '入选学生', dataIndex: 'studentName', className:"columnsResult taskName", width: '12%', ellipsis: true}, + { title: '课题导师', dataIndex: 'tutorName', className:"columnsResult", width: '12%', ellipsis: true}, { title: '课题名称', dataIndex: 'taskName', className:"columnsResult", width: '26%', ellipsis: true, render: (text, item) => {window.open(`/glcc/subjects/detail/${item.id}`)}}>{text} }, { title: '项目名称', dataIndex: 'projectName', className:"columnsResult", ellipsis: true, width: '26%', render: (text) => {text} }, { title: '操作', dataIndex: 'action', align: 'center', className:"columnsResult actionBox"}, @@ -65,7 +76,7 @@ function CheckResult({applyTaskId, setStudentInfoReset, current_user, showLoginD } const expandRow = (record) => { - return + return } // 展开收起行回调 @@ -79,38 +90,6 @@ function CheckResult({applyTaskId, setStudentInfoReset, current_user, showLoginD setExpandedRowKeys(Array.from(keys)); } - // 申请课题按钮点击函数 - function applyTask(id){ - // 判断用户是否已经登录 - if(current_user && current_user.login){ - // 判断用户是否已经报名两个课题 - if(applyTaskId && Object.keys(applyTaskId).length >= 2){ - message.error('最多只能同时报名两个课题'); - }else{ - // 跳转到学生报名页 - window.location.href=`/glcc/student/apply/${id}`; - } - }else{ - showLoginDialog(); - } - } - - // 取消课题按钮点击函数 - function cancelApply(){ - const id = []; - id.push(applyTaskId[deleteTaskId]); - const params = { - ids: id - } - cancelTaskApply(params).then(response=>{ - if(response && response.message === "success"){ - setVisible(false); - setStudentInfoReset(Math.random()); - message.success('取消成功'); - } - }) - } - // 改变pagesize function onShowSizeChange(current, pageSize){ window.scrollTo(0, 0); @@ -150,19 +129,6 @@ function CheckResult({applyTaskId, setStudentInfoReset, current_user, showLoginD - {setVisible(false)}} - onOk={cancelApply} - wrapClassName='cancelApplyTask' - > -
!确定取消申请此课题?
-

取消申请后将删除此条申请记录。你仅有 {2-cancelCount} 次取消申请的机会

-
) } diff --git a/src/glcc/checkResult/index.scss b/src/glcc/checkResult/index.scss index 2b404a15..1824f859 100644 --- a/src/glcc/checkResult/index.scss +++ b/src/glcc/checkResult/index.scss @@ -48,6 +48,10 @@ margin-top: 20px; background-color:rgba(255, 255, 255, 0.27); border: 1px solid white; + .ant-table-placeholder{ + background-color: rgba(255, 255, 255, 0.27); + border-bottom: none; + } th.columnsResult{ background-color:#DFE8FF; .ant-table-column-title{ diff --git a/src/glcc/home/index.jsx b/src/glcc/home/index.jsx index c6741840..4ea730cd 100644 --- a/src/glcc/home/index.jsx +++ b/src/glcc/home/index.jsx @@ -86,14 +86,14 @@ export default (props) => {
查看夏令营各项目,掌握项目课题详细信息
- {/* 学生报名6.24结束 */} - {/*
+ {/* 学生报名6.24结束记得注释 */} +
学生报名
选择感兴趣的课题,开启您的开源之旅
-
*/} +
{/* 6.28.-7.1 审核结果仅对导师可见,7.1之后对所有用户可见*/} {((resultTime1 && hasRole) || resultTime2) &&
diff --git a/src/glcc/index.jsx b/src/glcc/index.jsx index b4526114..6ffabac6 100644 --- a/src/glcc/index.jsx +++ b/src/glcc/index.jsx @@ -158,7 +158,7 @@ const Glcc = (propsF) => { ( - + )} > diff --git a/src/glcc/project/taskList/index.jsx b/src/glcc/project/taskList/index.jsx index 0ed2be08..71898e3c 100644 --- a/src/glcc/project/taskList/index.jsx +++ b/src/glcc/project/taskList/index.jsx @@ -32,12 +32,13 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial title: '操作', dataIndex: 'action', align: 'center', className:"actionColumns taskTableColumns", render: ((text, item, index) => { return (
- {applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && {window.location.href=`/glcc/student/apply/${item.id}`}}>报名详情} - {/* {(isStudentApplyDate || studentApplyEnd) && (applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) ? + {/* {applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && {window.location.href=`/glcc/student/apply/${item.id}`}}>报名详情} */} + {/* 记得注释 放开上一行 */} + {(isStudentApplyDate || studentApplyEnd) && (applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) ? {window.location.href=`/glcc/student/apply/${item.id}`}}>报名详情 {!studentApplyEnd && {deleteItem(item.id)}}>} :isStudentApplyDate && - {applyTask(item.id)}}>申请课题)} */} + {applyTask(item.id)}}>申请课题)}
) }) diff --git a/src/glcc/student/index.jsx b/src/glcc/student/index.jsx index d0b0ac14..5b79caf5 100644 --- a/src/glcc/student/index.jsx +++ b/src/glcc/student/index.jsx @@ -555,9 +555,10 @@ function Apply(props) { } - {!studentApplyEnd && + {/* 记得注释 */} + - } +