diff --git a/package-lock.json b/package-lock.json index 391406a7..7c2d8414 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1284,7 +1284,7 @@ }, "axios": { "version": "0.24.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz", + "resolved": "http://173.15.15.82:8081/repository/npm-all/axios/-/axios-0.24.0.tgz", "integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==", "requires": { "follow-redirects": "^1.14.4" @@ -7215,12 +7215,14 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "optional": true }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -7235,17 +7237,20 @@ "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "optional": true }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "optional": true }, "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -7362,7 +7367,8 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "optional": true }, "ini": { "version": "1.3.5", @@ -7374,6 +7380,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -7388,6 +7395,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -7395,12 +7403,14 @@ "minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "optional": true }, "minipass": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -7419,6 +7429,7 @@ "version": "0.5.3", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", + "optional": true, "requires": { "minimist": "^1.2.5" } @@ -7480,7 +7491,8 @@ "npm-normalize-package-bin": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", - "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==" + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "optional": true }, "npm-packlist": { "version": "1.4.8", @@ -7508,7 +7520,8 @@ "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "optional": true }, "object-assign": { "version": "4.1.1", @@ -7520,6 +7533,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "optional": true, "requires": { "wrappy": "1" } @@ -7633,6 +7647,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -15991,7 +16006,7 @@ }, "save-dev": { "version": "0.0.1-security", - "resolved": "https://registry.npmjs.org/save-dev/-/save-dev-0.0.1-security.tgz", + "resolved": "http://173.15.15.82:8081/repository/npm-all/save-dev/-/save-dev-0.0.1-security.tgz", "integrity": "sha512-k6knZTDNK8PKKbIqnvxiOveJinuw2LcQjqDoaorZWP9M5AR2EPsnpDeSbeoZZ0pHr5ze1uoaKdK8NBGQrJ34Uw==" }, "sax": { diff --git a/src/glcc/home/index.jsx b/src/glcc/home/index.jsx index 91e5ac8e..fa7d78c7 100644 --- a/src/glcc/home/index.jsx +++ b/src/glcc/home/index.jsx @@ -17,7 +17,7 @@ import { hasAuditRole } from '../api'; import './index.scss'; export default (props) => { - const { current_user, isGlccApplyDate, showNotification, studentApplyStart, history } = props; + const { current_user, isGlccApplyDate, showNotification, studentApplyStart, history, studentApplyEnd } = props; // function goToApply() { // if (isGlccApplyDate) { // if (current_user && current_user.login) { @@ -48,7 +48,9 @@ export default (props) => { // 学生报名时间 if (!studentApplyStart) { showNotification("不在报名时间,报名开始时间为5月26日"); - } else { + } else if(studentApplyEnd) { + showNotification("课题申请时间已截止"); + } else{ history.push("/glcc/subjects"); } } diff --git a/src/glcc/index.jsx b/src/glcc/index.jsx index e4e8fc32..fbc3d20f 100644 --- a/src/glcc/index.jsx +++ b/src/glcc/index.jsx @@ -65,8 +65,8 @@ const Glcc = (propsF) => { // 学生报名时间new Date().getTime() > new Date('2022-05-26').getTime() 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').getTime(); - const studentApplyEnd = new Date().getTime() > new Date('2022-06-25').getTime(); + const isStudentApplyDate = new Date().getTime() > new Date('2022-05-26').getTime() && new Date().getTime() < new Date('2022-06-25 0:0').getTime(); + const studentApplyEnd = new Date().getTime() > new Date('2022-06-25 0:0').getTime(); // 用户已报名课题id数组 const [applyTaskId, setApplyTaskId] = useState({}); @@ -154,7 +154,7 @@ const Glcc = (propsF) => { ( - + )} > diff --git a/src/glcc/project/component/projectDetail.jsx b/src/glcc/project/component/projectDetail.jsx index f9745a0b..a9d4beb6 100644 --- a/src/glcc/project/component/projectDetail.jsx +++ b/src/glcc/project/component/projectDetail.jsx @@ -4,7 +4,7 @@ import Nodata from '../../../forge/Nodata'; import { useEffect } from 'react'; import { getProjectById } from '../../api'; -export default ({ detail, projectId, applyTaskId, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd }) => { +export default ({ detail, projectId, applyTaskId, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd, showNotification }) => { const [info, setInfo] = useState(detail); // 申请课题按钮点击函数 @@ -12,7 +12,9 @@ export default ({ detail, projectId, applyTaskId, current_user, showLoginDialog, // 判断用户是否已经登录 if(current_user && current_user.login){ // 判断用户是否已经报名两个课题 - if(applyTaskId && Object.keys(applyTaskId).length >= 2){ + if(studentApplyEnd) { + showNotification("课题申请时间已截止"); + }else if(applyTaskId && Object.keys(applyTaskId).length >= 2){ message.error('最多只能同时报名两个课题'); }else{ // 跳转到学生报名页 diff --git a/src/glcc/project/projectList/index.jsx b/src/glcc/project/projectList/index.jsx index b11ee9f0..19d9fd30 100644 --- a/src/glcc/project/projectList/index.jsx +++ b/src/glcc/project/projectList/index.jsx @@ -10,7 +10,7 @@ import star from "../../img/star.png"; const { Search } = Input; // 项目列表 -function ProjectList({ applyTaskId, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd, location, history, match }) { +function ProjectList({ applyTaskId, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd, location, showNotification, match }) { let gitlinkLastUrl = match.params.gitlinkLastUrl && match.params.gitlinkLastUrl.replace(/\./g, ''); let openmmlab = location.search && location.search.split('=')[1]; // 输入搜索框 @@ -87,6 +87,7 @@ function ProjectList({ applyTaskId, current_user, showLoginDialog, isStudentAppl showLoginDialog={showLoginDialog} isStudentApplyDate={isStudentApplyDate} studentApplyEnd={studentApplyEnd} + showNotification={showNotification} />} trigger='click' overlayClassName='projectItemPopover' diff --git a/src/glcc/project/taskDetail/index.jsx b/src/glcc/project/taskDetail/index.jsx index 39222459..20d8b44d 100644 --- a/src/glcc/project/taskDetail/index.jsx +++ b/src/glcc/project/taskDetail/index.jsx @@ -8,7 +8,7 @@ import bgPng from "../../img/bgPng.png"; // 课题列表 function TaskDetail(props) { - const {match, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd, applyTaskId} = props + const {match, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd, applyTaskId, showNotification} = props const taskId = Number(match.params.taskId); const [detail, setDetail] = useState(undefined); @@ -25,7 +25,9 @@ function TaskDetail(props) { // 判断用户是否已经登录 if(current_user && current_user.login){ // 判断用户是否已经报名两个课题 - if(applyTaskId && Object.keys(applyTaskId).length >= 2){ + if(studentApplyEnd) { + showNotification("课题申请时间已截止"); + } else if(applyTaskId && Object.keys(applyTaskId).length >= 2){ message.error('最多只能同时报名两个课题'); }else{ // 跳转到学生报名页 diff --git a/src/glcc/project/taskList/index.jsx b/src/glcc/project/taskList/index.jsx index d3b66f99..3a205e1a 100644 --- a/src/glcc/project/taskList/index.jsx +++ b/src/glcc/project/taskList/index.jsx @@ -34,7 +34,7 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
{(isStudentApplyDate || studentApplyEnd) && (applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) ? {window.location.href=`/glcc/student/apply/${item.id}`}}>报名详情 - {deleteItem(item.id)}}> + {!studentApplyEnd && {deleteItem(item.id)}}>} :isStudentApplyDate && {applyTask(item.id)}}>申请课题)}
@@ -65,7 +65,7 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial } const expandRow = (record) => { - return + return } // 展开收起行回调 @@ -84,7 +84,9 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial // 判断用户是否已经登录 if(current_user && current_user.login){ // 判断用户是否已经报名两个课题 - if(applyTaskId && Object.keys(applyTaskId).length >= 2){ + if(studentApplyEnd) { + showNotification("课题申请时间已截止"); + } else if(applyTaskId && Object.keys(applyTaskId).length >= 2){ message.error('最多只能同时报名两个课题'); }else{ // 跳转到学生报名页 diff --git a/src/glcc/student/index.jsx b/src/glcc/student/index.jsx index fdb47d7c..d0b0ac14 100644 --- a/src/glcc/student/index.jsx +++ b/src/glcc/student/index.jsx @@ -28,8 +28,8 @@ function Apply(props) { // 可用于开发时不同账号报名 // 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 isStudentApplyDate = new Date().getTime() > new Date('2022-05-26').getTime() && new Date().getTime() < new Date('2022-06-25 0:0').getTime(); + const studentApplyEnd = new Date().getTime() > new Date('2022-06-25 0:0').getTime(); const { getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll } = form; const [imageUrl, setImageUrl] = useState(undefined); const [loading, setLoading] = useState(false); @@ -456,6 +456,7 @@ function Apply(props) { accept=".png,.jpg,.jpeg" beforeUpload={beforeUpload} onChange={handleChange} + disabled={studentApplyEnd} > {imageUrl ? avatar : userApplyInfo && userApplyInfo.proveAttachmentId ?
:
@@ -506,7 +507,7 @@ function Apply(props) { 4、课题实施规划:课题实施拆解、工作规划以及时间安排; 5、个人简介:编程技能、过往经验; 6、提示:文本框表达内容有限,建议您提供内容的pdf或url链接方式展示更精彩的陈述" - onBlur={(e) => { verify("memo" + i); changeTaskItem("memo", e.currentTarget.value, i) }} rows={7} className={editable ? "memoText" : "memoText disabledInput"} /> + onBlur={(e) => { verify("memo" + i); changeTaskItem("memo", e.currentTarget.value, i) }} rows={7} className={editable ? "memoText disabledInput" : "memoText disabledInput"} disabled={studentApplyEnd} /> )}
{helper('附件', @@ -525,6 +526,7 @@ function Apply(props) { downloadIcon: , showRemoveIcon: true }} + disabled={studentApplyEnd} >
上传自荐书
@@ -545,7 +547,7 @@ function Apply(props) { {getFieldDecorator("enrollFirst", { rules: [{ required: true, message: "请选择课题优先级" },] })( - + 课题一 课题二 @@ -553,9 +555,9 @@ function Apply(props) { } - + {!studentApplyEnd && - + }
diff --git a/src/glcc/student/index.scss b/src/glcc/student/index.scss index 41fa70c0..4054a05a 100644 --- a/src/glcc/student/index.scss +++ b/src/glcc/student/index.scss @@ -249,7 +249,7 @@ font-size: 14px; line-height: 30px; text-align: center; - cursor: pointer; + cursor: not-allowed; &:hover { opacity: 0.8; }