From d839e4aa267f9a4a40615c2db9747526245ea2b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= Date: Wed, 1 Jun 2022 10:06:42 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8A=A5=E5=90=8D?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppConfig.js | 2 +- src/glcc/index.jsx | 6 ++-- src/glcc/project/index.jsx | 8 ++--- src/glcc/project/taskList/index.jsx | 22 ++++++++---- src/glcc/project/taskList/index.scss | 4 +++ src/glcc/student/index.jsx | 36 ++++++++++++++----- src/glcc/student/index.scss | 54 +++++++++++++++++++++------- 7 files changed, 98 insertions(+), 34 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index cd3aca3d..b4107e46 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -25,7 +25,7 @@ if (isDev) { } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : window.location.search.indexOf('debug=s') !== -1 ? 'student' : - window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'student' + window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin' } window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/src/glcc/index.jsx b/src/glcc/index.jsx index b91dfe55..95e9d764 100644 --- a/src/glcc/index.jsx +++ b/src/glcc/index.jsx @@ -62,6 +62,7 @@ const Glcc = (propsF) => { const [applyTaskId, setApplyTaskId] = useState({}); // 刷新用户课题报名信息 const [studentInfoReset, setStudentInfoReset] = useState(undefined); + const [cancelCount,setCancelCount]=useState(0); useEffect(()=>{ // 获取用户课题报名信息current_user user_id @@ -73,6 +74,7 @@ const Glcc = (propsF) => { data[item.taskId] = item.id; }) setApplyTaskId(data); + setCancelCount(Number(response.data.cancelCount)); } }) },[studentInfoReset, current_user]) @@ -104,7 +106,7 @@ const Glcc = (propsF) => { ( - + )} > {/* 项目/课题列表 */} @@ -119,7 +121,7 @@ const Glcc = (propsF) => { ( - + )} > {/* 首页 */} diff --git a/src/glcc/project/index.jsx b/src/glcc/project/index.jsx index c176f61f..a326a93f 100644 --- a/src/glcc/project/index.jsx +++ b/src/glcc/project/index.jsx @@ -20,7 +20,7 @@ const TaskList = Loadable({ }); function Project(propsF) { - const {location, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd, applyTaskId, setStudentInfoReset} = propsF; + const {location, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd, applyTaskId, setStudentInfoReset, cancelCount} = propsF; const {pathname} = location; useEffect(()=>{ window.scrollTo(0, 0); @@ -42,19 +42,19 @@ function Project(propsF) { ( - + )} > ( - + )} > ( - + )} > diff --git a/src/glcc/project/taskList/index.jsx b/src/glcc/project/taskList/index.jsx index 43489f18..98e8780a 100644 --- a/src/glcc/project/taskList/index.jsx +++ b/src/glcc/project/taskList/index.jsx @@ -7,7 +7,7 @@ import bgPng from "../../img/bgPng.png"; const { Search } = Input; // 课题列表 -function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd}) { +function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd,cancelCount,showNotification}) { const [visible, setVisible] = useState(false); const [deleteTaskId, setDeleteTaskId] = useState(undefined); // 输入搜索框 @@ -33,7 +33,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}`}}>报名详情 - {setDeleteTaskId(item.id);setVisible(true)}}> + {deleteItem(item.id)}}> :isStudentApplyDate && {applyTask(item.id)}}>申请课题)}
@@ -42,6 +42,15 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial }, ] + function deleteItem(id){ + if(cancelCount==1){ + showNotification("您的取消报名次数已用光,请联系导师处理相关报名审核信息"); + }else{ + setDeleteTaskId(id); + setVisible(true); + } + } + const customExpandIcon = (props) => { if (props.expanded) { return { @@ -170,16 +179,17 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial {setVisible(false)}} onOk={cancelApply} wrapClassName='cancelApplyTask' > -
!取消申请即删除本次报名记录,确定取消?
-

此操作将永久删除该报名记录,请进行确认以防数据的丢失

+
!确定取消申请此课题?
+

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

) diff --git a/src/glcc/project/taskList/index.scss b/src/glcc/project/taskList/index.scss index 76937b79..d1fcb558 100644 --- a/src/glcc/project/taskList/index.scss +++ b/src/glcc/project/taskList/index.scss @@ -79,6 +79,10 @@ tr:hover .actionColumns .cancelApply{ font-size:14px; margin: 30px 0 30px 86px !important; } + .tipTaskTime{ + font-size: 36px; + color: #df0002; + } .ant-modal-footer{ border-top: none; text-align: center; diff --git a/src/glcc/student/index.jsx b/src/glcc/student/index.jsx index 9ce9c817..00158186 100644 --- a/src/glcc/student/index.jsx +++ b/src/glcc/student/index.jsx @@ -1,5 +1,5 @@ import React, { useCallback, useEffect, useState, Fragment } from 'react'; -import { Breadcrumb, Button, Form, Input, Select, Upload, Cascader, Spin } from 'antd'; +import { Breadcrumb, Button, Form, Input, Select, Upload, Cascader, Spin, Radio } from 'antd'; import { getUploadActionUrl, getUrl, appendFileSizeToUploadFileAll } from 'educoder'; import { locData } from '../../forge/Utils/locData'; import { getStudentApplyInfo, taskList, studentApply, studentApplyEdit } from '../api'; @@ -172,6 +172,9 @@ function Apply(props) { validateFieldsAndScroll((err, values) => { if (!err) { setLoading(true); + if(myTaskList.length===2){ + myTaskList[values.enrollFirst].enrollFirst=true; + } const params = { grade: values.grade, location: Array.isArray(values.location) && values.location.join(), @@ -354,14 +357,14 @@ function Apply(props) { 课题及项目列表 学生报名 -

申请说明:

1、学生报名时间为2022年5月26日-6月24日,请在报名截止时间(北京时间2022年6月24日24点)前提交报名信息。
2、本次GLCC夏令营基于GitLink代码托管平台完成编程任务,若您没有平台账户,请先注册后完成课题申请
3、每位学员最多可申请2个课题,至多有且仅有1个课题可以入选
-
4、建议在提交课题申请,与课题导师邮件沟通,详细了解课题描述、编码任务、技能要求&编程语言、预期产出结果等信息,以便您能够选择最适合的课题
-
5、提交申请后,请耐心等待,我们会在2022年7月1日公布入围结果。如有任何问题,请添加开源夏令营QQ群进行咨询
+
4、提交申请后,每位学员可实时修改自己的报名信息,但仅具有两次取消申请课题的机会,请谨慎选择课题或取消课题
+
5、建议在提交课题申请,与课题导师邮件沟通,详细了解课题描述、编码任务、技能要求&编程语言、预期产出结果等信息,以便您能够选择最适合的课题
+
6、提交申请后,请耐心等待,我们会在2022年7月1日公布入围结果。如有任何问题,请添加开源夏令营QQ群:210174286进行咨询
学生报名 @@ -449,7 +452,9 @@ function Apply(props) { myTaskList.map((item, i) => { return ( -

课题信息({i + 1}/2) {myTaskList.length > 1 && { deleteTask(i) }}>删除}

+

课题信息({i + 1}/2) + {/* {myTaskList.length > 1 && { deleteTask(i) }}>删除} */} +

{helper('课题名称', '', 'taskId' + i, @@ -458,8 +463,8 @@ function Apply(props) { placeholder="请选择课题名称" dropdownClassName="glcc_select" showSearch - disabled={editable ? false : true} - className={editable ? "" : "disabledInput"} + disabled + className={"disabledInput"} filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) > -1} onBlur={() => { verify("taskId" + i) }} onChange={(val) => { changeTaskItem("taskId", val, i) }} @@ -508,7 +513,22 @@ function Apply(props) { } { - myTaskList.length < 2 && + // myTaskList.length < 2 && + } + + { + myTaskList.length === 2 && 对您而言,哪个课题的优先级更高?注:优先级将决定您申请课题的入选顺序,若申请的2个课题同时通过审核,将以高优先级的课题作为入选标准
} + > + {getFieldDecorator("enrollFirst", { + rules: [{ required: true, message: "请选择课题优先级" },] + })( + + 课题一 + 课题二 + + )} + } diff --git a/src/glcc/student/index.scss b/src/glcc/student/index.scss index 6472b01c..c145b5dc 100644 --- a/src/glcc/student/index.scss +++ b/src/glcc/student/index.scss @@ -155,7 +155,6 @@ border: none; color: #202d40; } - } .ant-cascader-picker { background: none; @@ -291,39 +290,68 @@ padding: 9px 11px; line-height: 1.75; } - + + .glcc_info_form .ant-row.ant-form-item.priority { + display: block; + width: 100%; + padding-top:5px; + border-top: 1px dashed #bec5d5; + .ant-col { + width: 100%; + } + .ant-form-item-label { + text-align: left; + } + .note { + color: #ff3838; + font-size: 14px; + } + + .ant-radio-checked::after{ + border: 1px solid #466aff; + } + .ant-radio-checked .ant-radio-inner{ + border-color: #466aff; + } + .ant-radio-inner::after{ + background-color: #466aff; + } + } } .glcc-banner { width: 100%; } -.glcc_select,.ant-cascader-menus.glcc_cascader{ +.glcc_select, +.ant-cascader-menus.glcc_cascader { background-image: linear-gradient(180deg, #eef3ff 0%, #ffffff 100%); border: 1px solid #fff; border-radius: 4px; box-shadow: 0px 0px 12px rgba(203, 220, 255, 0.47); - .ant-select-dropdown-menu-item{ - &:hover{ + .ant-select-dropdown-menu-item { + &:hover { background-color: #e9efff; } } + } -.glcc_select .ant-select-dropdown-menu-item-active:not(.ant-select-dropdown-menu-item-disabled){ +.glcc_select + .ant-select-dropdown-menu-item-active:not(.ant-select-dropdown-menu-item-disabled) { background: #e9efff; } -.glcc_cascader{ - .ant-cascader-menu{ +.glcc_cascader { + .ant-cascader-menu { width: 240px; - &::-webkit-scrollbar-track{ - background-color: #E2E9FF; + &::-webkit-scrollbar-track { + background-color: #e2e9ff; } - &::-webkit-scrollbar-thumb{ - background-color: #BCCCFF; + &::-webkit-scrollbar-thumb { + background-color: #bcccff; } } - .ant-cascader-menu:first-child{ + .ant-cascader-menu:first-child { width: 250px; } } From 56f74c747bccb1c08ba5c68a93de1f5f3d7430c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= Date: Thu, 2 Jun 2022 11:19:43 +0800 Subject: [PATCH 2/3] =?UTF-8?q?glcc=E6=8A=A5=E5=90=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/glcc/index.jsx | 2 +- src/glcc/project/taskList/index.jsx | 9 ++++---- src/glcc/project/taskList/index.scss | 5 ++++- src/glcc/student/index.jsx | 33 +++++++++++++++++++++------- src/glcc/student/index.scss | 29 +++++++++++++++++++----- 5 files changed, 59 insertions(+), 19 deletions(-) diff --git a/src/glcc/index.jsx b/src/glcc/index.jsx index 95e9d764..0078dfcf 100644 --- a/src/glcc/index.jsx +++ b/src/glcc/index.jsx @@ -74,7 +74,7 @@ const Glcc = (propsF) => { data[item.taskId] = item.id; }) setApplyTaskId(data); - setCancelCount(Number(response.data.cancelCount)); + response.data&&setCancelCount(Number(response.data.cancelCount)); } }) },[studentInfoReset, current_user]) diff --git a/src/glcc/project/taskList/index.jsx b/src/glcc/project/taskList/index.jsx index 98e8780a..0622c2f8 100644 --- a/src/glcc/project/taskList/index.jsx +++ b/src/glcc/project/taskList/index.jsx @@ -24,9 +24,10 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial const columns = [ { title: '序号', dataIndex: 'index', align: 'center', className:"taskTableColumns", width: '6%', render: (text, item, index) => {(current-1)*pageSize+index + 1} }, - { title: '课题名称', dataIndex: 'taskName', className:"taskTableColumns taskName", width: '28%', ellipsis: true, render: (text, item) => {window.open(`/glcc/subjects/detail/${item.id}`)}}>{text} }, - { title: '项目名称', dataIndex: 'projectName', className:"taskTableColumns", width: '28%', ellipsis: true, render: (text) => {text} }, - { title: '课题奖金', dataIndex: 'taskReward', className:"taskTableColumns", ellipsis: true, width: `${isStudentApplyDate || studentApplyEnd ? '15%' : ''}`, render: (text) => {text} }, + { title: '课题名称', dataIndex: 'taskName', className:"taskTableColumns taskName", width: '22%', ellipsis: true, render: (text, item) => {window.open(`/glcc/subjects/detail/${item.id}`)}}>{text} }, + { title: '课题类型', dataIndex: 'projectType', className:"taskTableColumns", width: '10%', ellipsis: true, }, + { title: '项目名称', dataIndex: 'projectName', className:"taskTableColumns", width: '22%', ellipsis: true, render: (text) => {text} }, + { title: '课题奖金', dataIndex: 'taskReward', className:"taskTableColumns", ellipsis: true, width: `${isStudentApplyDate || studentApplyEnd ? '18%' : ''}`, render: (text) => {text} }, { title: '操作', dataIndex: 'action', align: 'center', className:"actionColumns taskTableColumns", render: ((text, item, index) => { return ( @@ -43,7 +44,7 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial ] function deleteItem(id){ - if(cancelCount==1){ + if(cancelCount==2){ showNotification("您的取消报名次数已用光,请联系导师处理相关报名审核信息"); }else{ setDeleteTaskId(id); diff --git a/src/glcc/project/taskList/index.scss b/src/glcc/project/taskList/index.scss index d1fcb558..058caf89 100644 --- a/src/glcc/project/taskList/index.scss +++ b/src/glcc/project/taskList/index.scss @@ -77,7 +77,7 @@ tr:hover .actionColumns .cancelApply{ .tipTask{ color:#666666; font-size:14px; - margin: 30px 0 30px 86px !important; + margin: 10px 0 10px 37px!important; } .tipTaskTime{ font-size: 36px; @@ -99,6 +99,9 @@ tr:hover .actionColumns .cancelApply{ color: #df0002;} } } + .ant-btn-default{ + margin-left:43px; + } } } .task.search{ diff --git a/src/glcc/student/index.jsx b/src/glcc/student/index.jsx index 00158186..949e30cc 100644 --- a/src/glcc/student/index.jsx +++ b/src/glcc/student/index.jsx @@ -119,12 +119,17 @@ function Apply(props) { }]); } - initTaskList.push({ - id: item.id, - memo: item.memo, - memoAttachmentId: item.memoAttachmentId, - taskId: item.taskId, - }); + if(item.enrollFirst){ + applyInfo.enrollFirst=i; + } + + initTaskList.push(item); + // initTaskList.push({ + // id: item.id, + // memo: item.memo, + // memoAttachmentId: item.memoAttachmentId, + // taskId: item.taskId, + // }); } setMyTaskList(initTaskList); @@ -172,8 +177,14 @@ function Apply(props) { validateFieldsAndScroll((err, values) => { if (!err) { setLoading(true); - if(myTaskList.length===2){ - myTaskList[values.enrollFirst].enrollFirst=true; + if (myTaskList.length === 2) { + if(values.enrollFirst==1){ + myTaskList[1].enrollFirst = true; + myTaskList[0].enrollFirst = false; + }else{ + myTaskList[1].enrollFirst = false; + myTaskList[0].enrollFirst = true; + } } const params = { grade: values.grade, @@ -450,11 +461,17 @@ function Apply(props) { { myTaskList.map((item, i) => { + console.log(item ) return (

课题信息({i + 1}/2) {/* {myTaskList.length > 1 && { deleteTask(i) }}>删除} */}

+ {item.status == 1 && item.auditRemark &&
+
欢迎您报名CCF GitLink开源编程夏令营,感谢您对GLCC项目及课题的关注和支持!本次您的报名信息未通过初审,原因如下:
+
+
希望您尽快修改并重新提交报名信息,我们将再次审核,万分感谢!
+
} {helper('课题名称', '', 'taskId' + i, diff --git a/src/glcc/student/index.scss b/src/glcc/student/index.scss index c145b5dc..41fa70c0 100644 --- a/src/glcc/student/index.scss +++ b/src/glcc/student/index.scss @@ -294,7 +294,7 @@ .glcc_info_form .ant-row.ant-form-item.priority { display: block; width: 100%; - padding-top:5px; + padding-top: 5px; border-top: 1px dashed #bec5d5; .ant-col { width: 100%; @@ -307,17 +307,37 @@ font-size: 14px; } - .ant-radio-checked::after{ + .ant-radio-checked::after { border: 1px solid #466aff; } - .ant-radio-checked .ant-radio-inner{ + .ant-radio-checked .ant-radio-inner { border-color: #466aff; } - .ant-radio-inner::after{ + .ant-radio-inner::after { background-color: #466aff; } } } +.reject-reason { + width: 100%; + min-height: 45px; + line-height: 42px; + background-color: rgba(242, 216, 216, 0.63); + border: 1px solid #df4c4c; + color: #595e82; + font-size: 15px; + padding-left:22px; + margin-bottom: 30px; + + .icon-shanchudiao{ + position: relative; + top:1px; + color: #e21b1b; + margin-right: 5px; + font-weight: 600; + } +} + .glcc-banner { width: 100%; } @@ -333,7 +353,6 @@ background-color: #e9efff; } } - } .glcc_select .ant-select-dropdown-menu-item-active:not(.ant-select-dropdown-menu-item-disabled) { From bb1b8e6b36e2c1dc51142092adcafe35051a99fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= Date: Thu, 2 Jun 2022 16:12:30 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9glcc=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/glcc/project/taskList/index.jsx | 10 +++++----- src/glcc/student/index.jsx | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/glcc/project/taskList/index.jsx b/src/glcc/project/taskList/index.jsx index 0622c2f8..d3b66f99 100644 --- a/src/glcc/project/taskList/index.jsx +++ b/src/glcc/project/taskList/index.jsx @@ -24,10 +24,10 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial const columns = [ { title: '序号', dataIndex: 'index', align: 'center', className:"taskTableColumns", width: '6%', render: (text, item, index) => {(current-1)*pageSize+index + 1} }, - { title: '课题名称', dataIndex: 'taskName', className:"taskTableColumns taskName", width: '22%', ellipsis: true, render: (text, item) => {window.open(`/glcc/subjects/detail/${item.id}`)}}>{text} }, - { title: '课题类型', dataIndex: 'projectType', className:"taskTableColumns", width: '10%', ellipsis: true, }, - { title: '项目名称', dataIndex: 'projectName', className:"taskTableColumns", width: '22%', ellipsis: true, render: (text) => {text} }, - { title: '课题奖金', dataIndex: 'taskReward', className:"taskTableColumns", ellipsis: true, width: `${isStudentApplyDate || studentApplyEnd ? '18%' : ''}`, render: (text) => {text} }, + { title: '课题名称', dataIndex: 'taskName', className:"taskTableColumns taskName", width: '24%', ellipsis: true, render: (text, item) => {window.open(`/glcc/subjects/detail/${item.id}`)}}>{text} }, + { title: '课题类型', dataIndex: 'projectType', className:"taskTableColumns", width: '12%', ellipsis: true, }, + { title: '项目名称', dataIndex: 'projectName', className:"taskTableColumns", width: '24%', ellipsis: true, render: (text) => {text} }, + { title: '课题奖金', dataIndex: 'taskReward', className:"taskTableColumns", ellipsis: true, width: `${isStudentApplyDate || studentApplyEnd ? '10%' : ''}`, render: (text) => {text} }, { title: '操作', dataIndex: 'action', align: 'center', className:"actionColumns taskTableColumns", render: ((text, item, index) => { return ( @@ -168,7 +168,7 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial columns={columns} dataSource={data} expandedRowRender={expandRow} - expandIconColumnIndex={4} + expandIconColumnIndex={5} expandIconAsCell={false} expandIcon={customExpandIcon} rowKey={'id'} diff --git a/src/glcc/student/index.jsx b/src/glcc/student/index.jsx index 949e30cc..83acdba4 100644 --- a/src/glcc/student/index.jsx +++ b/src/glcc/student/index.jsx @@ -123,6 +123,10 @@ function Apply(props) { applyInfo.enrollFirst=i; } + if(item.status==2){ + item.status==2 + } + initTaskList.push(item); // initTaskList.push({ // id: item.id, @@ -461,7 +465,6 @@ function Apply(props) { { myTaskList.map((item, i) => { - console.log(item ) return (

课题信息({i + 1}/2)