合并代码

This commit is contained in:
谢思 2022-06-27 09:26:42 +08:00
commit 23b6708b6e
10 changed files with 60 additions and 32 deletions

35
package-lock.json generated
View File

@ -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": {

View File

@ -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) {
@ -50,7 +50,9 @@ export default (props) => {
//
if (!studentApplyStart) {
showNotification("不在报名时间报名开始时间为5月26日");
} else {
} else if(studentApplyEnd) {
showNotification("课题申请时间已截止");
} else{
history.push("/glcc/subjects");
}
}
@ -130,7 +132,7 @@ export default (props) => {
</div>
</div>
</div>
<Lightspot isGlccApplyDate={isGlccApplyDate} current_user={current_user} showNotification={showNotification} studentApplyStart={studentApplyStart} />
<Lightspot isGlccApplyDate={isGlccApplyDate} current_user={current_user} showNotification={showNotification} studentApplyStart={studentApplyStart} studentApplyEnd={studentApplyEnd}/>
<TimerShaft />
<Award />
<News />

View File

@ -12,7 +12,7 @@ import { Link } from 'react-router-dom';
function Lightspot(props) {
const {current_user, isGlccApplyDate, showNotification, studentApplyStart} = props;
const {current_user, isGlccApplyDate, showNotification, studentApplyStart, studentApplyEnd} = props;
function goToApply(){
if(isGlccApplyDate){
@ -31,6 +31,8 @@ function Lightspot(props) {
//
if(!studentApplyStart){
showNotification("不在报名时间报名开始时间为5月26日");
} else if(studentApplyEnd) {
showNotification("课题申请时间已截止");
}else{
window.location.href="/glcc/subjects";
}

View File

@ -69,8 +69,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({});
@ -166,7 +166,7 @@ const Glcc = (propsF) => {
<Route
path="/glcc"
render={(props) => (
<Home {...propsF} {...props} studentApplyStart={studentApplyStart}/>
<Home {...propsF} {...props} studentApplyStart={studentApplyStart} studentApplyEnd={studentApplyEnd}/>
)}
></Route>

View File

@ -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, showTask=true }) => {
export default ({ detail, projectId, applyTaskId, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd, showNotification, showTask=true }) => {
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{
//

View File

@ -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'

View File

@ -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{
//

View File

@ -35,7 +35,7 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
{applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && <span onClick={()=>{window.location.href=`/glcc/student/apply/${item.id}`}}><i className='iconfont icon-baomingxiangqingicon mr5'></i>报名详情</span>}
{/* {(isStudentApplyDate || studentApplyEnd) && (applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) ? <Fragment>
<span onClick={()=>{window.location.href=`/glcc/student/apply/${item.id}`}}><i className='iconfont icon-baomingxiangqingicon mr5'></i>报名详情</span>
<Tooltip title={"取消申请"}><i className='iconfont icon-shanchuicon3 ml20 cancelApply' onClick={()=>{deleteItem(item.id)}}></i></Tooltip>
{!studentApplyEnd && <Tooltip title={"取消申请"}><i className='iconfont icon-shanchuicon3 ml20 cancelApply' onClick={()=>{deleteItem(item.id)}}></i></Tooltip>}
</Fragment>:isStudentApplyDate && <Fragment>
<span onClick={()=>{applyTask(item.id)}}><i className='iconfont icon-shenqingketiicon applyTask mr5'></i><span className='applyTask'>申请课题</span></span></Fragment>)} */}
</div>
@ -66,7 +66,7 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
}
const expandRow = (record) => {
return <ProjectDetail detail={null} projectId={record.regId} applyTaskId={applyTaskId} current_user={current_user} showLoginDialog={showLoginDialog} isStudentApplyDate={isStudentApplyDate} studentApplyEnd={studentApplyEnd}/>
return <ProjectDetail detail={null} projectId={record.regId} applyTaskId={applyTaskId} current_user={current_user} showLoginDialog={showLoginDialog} isStudentApplyDate={isStudentApplyDate} studentApplyEnd={studentApplyEnd} showNotification={showNotification}/>
}
//
@ -85,7 +85,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{
//

View File

@ -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 ? <img src={imageUrl} alt="avatar" style={{ maxWidth: '100px', maxHeight: '100px' }} /> : userApplyInfo && userApplyInfo.proveAttachmentId ?
<div><img src={`${getUrl()}/api/attachments/${userApplyInfo.proveAttachmentId}`} alt='' style={{ maxWidth: '100px' }} /></div> : <div>
@ -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} />
)}</div>
<div className='introArea'>{helper('附件',
@ -525,6 +526,7 @@ function Apply(props) {
downloadIcon: <i className="iconfont icon-xiazai-icon"></i>,
showRemoveIcon: true
}}
disabled={studentApplyEnd}
>
<div className="glcc_btn">上传自荐书</div>
</Upload>
@ -545,7 +547,7 @@ function Apply(props) {
{getFieldDecorator("enrollFirst", {
rules: [{ required: true, message: "请选择课题优先级" },]
})(
<Radio.Group >
<Radio.Group disabled={studentApplyEnd}>
<Radio value={0}>课题一</Radio>
<Radio value={1}>课题二</Radio>
</Radio.Group>
@ -553,9 +555,9 @@ function Apply(props) {
</Form.Item>
}
{/* <Form.Item className='subInfo introArea'>
{!studentApplyEnd && <Form.Item className='subInfo introArea'>
<Button type="primary" htmlType="submit" className='sub' disabled={!editable}>提交</Button>
</Form.Item> */}
</Form.Item>}
</Form>
</div>
</div>

View File

@ -249,7 +249,7 @@
font-size: 14px;
line-height: 30px;
text-align: center;
cursor: pointer;
cursor: not-allowed;
&:hover {
opacity: 0.8;
}