From 105d33e63c50538ef8478e1361025f825384f5fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com>
Date: Wed, 5 Jun 2024 09:17:25 +0800
Subject: [PATCH] =?UTF-8?q?glcc=E5=AD=A6=E7=94=9F=E6=8A=A5=E5=90=8D?=
=?UTF-8?q?=E9=98=B6=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/glcc/api.js | 3 +
src/glcc/apply/editInfo.jsx | 11 ++--
src/glcc/apply/index.jsx | 8 +--
src/glcc/apply/repoInfo.jsx | 6 +-
src/glcc/check/index.jsx | 16 ++---
src/glcc/index.jsx | 14 ++---
src/glcc/project/component/projectDetail.jsx | 8 +--
src/glcc/project/taskDetail/index.jsx | 8 +--
src/glcc/project/taskList/index.jsx | 6 +-
src/glcc/student/index.jsx | 65 +++++++++++---------
10 files changed, 79 insertions(+), 66 deletions(-)
diff --git a/src/glcc/api.js b/src/glcc/api.js
index 7b25151c8..bfce5cc17 100644
--- a/src/glcc/api.js
+++ b/src/glcc/api.js
@@ -4,6 +4,9 @@ import fetch from './fetch';
export const currentRound = 3;
export const rewardMoney = "现金奖励"
export const rewardSettingRound = 3;
+export const yearByRound = {
+ 3: 2024
+}
// 获取当前用户项目报名信息(项目、课题)
export function getUserApplyInfo(params) {
diff --git a/src/glcc/apply/editInfo.jsx b/src/glcc/apply/editInfo.jsx
index 4c1ea722a..c62fca6f7 100644
--- a/src/glcc/apply/editInfo.jsx
+++ b/src/glcc/apply/editInfo.jsx
@@ -1,7 +1,7 @@
import React , { useCallback, useEffect , useState } from 'react';
import { Button, Form, Input, Select, Upload, message, Popconfirm, Checkbox, Icon, Tooltip } from 'antd';
import {getUploadActionUrl} from 'educoder';
-import {applyGlcc, findStudentTaskByTaskId, updateApplyGlcc} from '../api';
+import {applyGlcc, currentRound, findStudentTaskByTaskId, updateApplyGlcc} from '../api';
import TextArea from 'antd/lib/input/TextArea';
import { main_site_url } from '../fetch';
import TaskApply from './taskApply';
@@ -10,7 +10,7 @@ import { FlexAJ } from '../../forge/Component/layout';
const Option = Select.Option;
// 编辑项目、课题报名信息
function EditRepoApplyInfo(props) {
- const {form, applyInfo, current_user, round, cateList, setReload, isAddRepo, setIsAddRepo, setIsEdit, setEditRepoCount, rewardList} = props;
+ const {form, applyInfo, current_user, cateList, setReload, isAddRepo, setIsAddRepo, setIsEdit, setEditRepoCount, rewardList} = props;
const phonereg = /(^|\s*\+?0?0?86|\D)(1\d{2})[-\s]{0,3}(\d{4})[-\s]{0,3}(\d{4})(?=\D|$)/
const emailreg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/
const {getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll, getFieldValue, resetFields } = form;
@@ -99,15 +99,16 @@ function EditRepoApplyInfo(props) {
tutorAddress: values[`tutorAddress${item}`],
taskDesc: values[`taskDesc${item}`],
tutorPhone: values[`tutorPhone${item}`],
- round
+ round: currentRound
})
})
const {projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, contactMail, joinCooperativeCommunity=false} = values;
const params ={
- projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, registrationTaskList, round, contactMail, joinCooperativeCommunity,
+ projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, registrationTaskList, contactMail, joinCooperativeCommunity,
projectLogoId: values.logo.file.response.id+"",
userId: current_user.user_id,
- userName: current_user.username
+ userName: current_user.username,
+ round: currentRound
}
setLoading(true);
if(applyInfo){
diff --git a/src/glcc/apply/index.jsx b/src/glcc/apply/index.jsx
index 118c85486..2e9896bfd 100644
--- a/src/glcc/apply/index.jsx
+++ b/src/glcc/apply/index.jsx
@@ -10,7 +10,7 @@ import './index.scss';
import { FlexAJ } from '../../forge/Component/layout';
// 项目、课题报名
function Apply(props) {
- const {current_user, round, glccSettings} = props;
+ const {current_user, glccSettings} = props;
const [reload, setReload] = useState(undefined);
const [cateList, setCateList] = useState([]);
const [userApplyInfo, setUserApplyInfo] = useState([]);
@@ -46,7 +46,7 @@ function Apply(props) {
useEffect(()=>{
// 获取当前用户报名信息
- current_user && round && getUserApplyInfo({userId: current_user.user_id, round}).then(response=>{
+ current_user && getUserApplyInfo({userId: current_user.user_id, round: currentRound}).then(response=>{
if(response && response.message === "success"){
setUserApplyInfo(response.data);
}
@@ -95,9 +95,9 @@ function Apply(props) {
{userApplyInfo.length > 0 && 添加项目}
{userApplyInfo.length > 0 &&
- {userApplyInfo.map((item, index)=>
{setReload(Math.random())}} isAddRepo={isAddRepo} editRepoCount={editRepoCount} setEditRepoCount={setEditRepoCount} repoCount={userApplyInfo.length} scrollToEdit={scrollToEdit} rewardList={rewardList}/>
)}
+ {userApplyInfo.map((item, index)=>
{setReload(Math.random())}} isAddRepo={isAddRepo} editRepoCount={editRepoCount} setEditRepoCount={setEditRepoCount} repoCount={userApplyInfo.length} scrollToEdit={scrollToEdit} rewardList={rewardList}/>
)}
}
- {(!userApplyInfo.length || isAddRepo) && {setReload(Math.random())}} rewardList={rewardList}/>}
+ {(!userApplyInfo.length || isAddRepo) && {setReload(Math.random())}} rewardList={rewardList}/>}
)
diff --git a/src/glcc/apply/repoInfo.jsx b/src/glcc/apply/repoInfo.jsx
index b45ad0d01..95a57f1e0 100644
--- a/src/glcc/apply/repoInfo.jsx
+++ b/src/glcc/apply/repoInfo.jsx
@@ -4,7 +4,7 @@ import EditInfo from "./editInfo";
import { FlexAJ } from "../../forge/Component/layout";
import { main_site_url } from "../fetch";
import './index.scss';
-import { deleteApplyInfo, rewardMoney } from "../api";
+import { currentRound, deleteApplyInfo, rewardMoney } from "../api";
// 项目、课题信息展示
function RepoInfo(props) {
const {applyInfo:{id, projectLogoId, projectName, projectType, contactName, contactPhone, contactMail, gitlinkUrl, projectIntro, registrationTaskList}, setReload, editRepoCount, setEditRepoCount, repoCount, isAddRepo, scrollToEdit} = props;
@@ -26,7 +26,7 @@ function RepoInfo(props) {
// 删除项目
function deleteBut(){
- deleteApplyInfo({ids: [id], round: 2}).then(res=>{
+ deleteApplyInfo({ids: [id], round: currentRound}).then(res=>{
message.success("删除成功");
setReload();
})
@@ -34,7 +34,7 @@ function RepoInfo(props) {
// 课题信息展示
const showTask = (task) => {
- const {id, taskDifficulty, taskName, taskReward, tutorName, tutorPhone, tutorMail, taskDesc, taskUrl, settingRewardValue, settingRewardRemark} = task;
+ const {id, taskDifficulty, taskName, tutorName, tutorPhone, tutorMail, taskDesc, taskUrl, settingRewardValue, settingRewardRemark} = task;
return
diff --git a/src/glcc/check/index.jsx b/src/glcc/check/index.jsx
index 76c10ff71..9593f7a10 100644
--- a/src/glcc/check/index.jsx
+++ b/src/glcc/check/index.jsx
@@ -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 } from '../api';
+import { auditPassTask, getStudentList, getAuditList, currentRound, formatParsedResult } from '../api';
import {httpUrl} from '../fetch';
const { TabPane } = Tabs;
-function Check({ current_user, showNotification, currentRound }) {
+function Check({ current_user, showNotification, glccSettings }) {
// 输入搜索框
const [data, setData] = useState([]);
@@ -22,6 +22,10 @@ function Check({ current_user, showNotification, currentRound }) {
const [taskList, setTaskList] = useState([]);
const [taskId, setTaskId] = useState();
const [havePass, setHavePass] = useState(false);
+ // 导师审核
+ const matching = glccSettings && glccSettings.filter(item=>item.name === "matching");
+ // 学生名单公示
+ const stuPublic = glccSettings && glccSettings.filter(item=>item.name === "stuPublic");
const columns = [
{
@@ -220,11 +224,7 @@ function Check({ current_user, showNotification, currentRound }) {
![]()
{ setVisible(true); setPicture(record.proveAttachmentId) }}
- src={`${window.location.href.indexOf('test') > -1 ||
- window.location.href.indexOf('localhost') > -1
- ? 'https://testforgeplus.trustie.net'
- : ''
- }/api/attachments/${record.proveAttachmentId}`}
+ src={`${httpUrl}/busiAttachments/download/${record.proveAttachmentId}`}
>
}
@@ -284,7 +284,7 @@ function Check({ current_user, showNotification, currentRound }) {
2、您可根据学生报名信息与学生进行邮箱或电话沟通了解学生详细情况,选择满意的学生
3、每个课题仅允许审核通过一个学生,在审核过程中,您可以随时调整各学生的审核状态,直到与学生匹配成功
{/* */}
- 4、请各位导师在7月1日前完成课题申请的审核,7月1日凌晨1点平台将根据各导师审核信息,正式公布各课题学生入选名单
+ 4、请各位导师在{formatParsedResult(matching, "start")}前完成课题申请的审核,{formatParsedResult(stuPublic, "start")}平台将根据各导师审核信息,正式公布各课题学生入选名单
{ setTaskId(e) }} activeKey={taskId + ''}>
diff --git a/src/glcc/index.jsx b/src/glcc/index.jsx
index 0af84917c..b767c9fc5 100644
--- a/src/glcc/index.jsx
+++ b/src/glcc/index.jsx
@@ -240,28 +240,28 @@ const Glcc = (propsF) => {
{(period === "stuApply" || period === "stuApply1") && (
-
+
)}
>}
{/* 开源夏令营报名页面 */}
{period === "repoApply" && (
-
+
)}
>}
{/* 导师报名课题路由通道(补录) */}
{applyRepo && (
-
+
)}
>}
{/* 导师-学生配对阶段 */}
{isMatching && hasRole && (
-
+
)}
>}
@@ -292,14 +292,14 @@ const Glcc = (propsF) => {
{!(round === currentRound && !repoPublic) && (
-
+
)}
>}
{/* 项目/课题列表 */}
{!(round === currentRound && !repoPublic) && (
-
+
)}
>}
@@ -307,7 +307,7 @@ const Glcc = (propsF) => {
{!(round === currentRound && !repoPublic) && (
-
+
)}
>}
diff --git a/src/glcc/project/component/projectDetail.jsx b/src/glcc/project/component/projectDetail.jsx
index 9772bd6d0..92c8af159 100644
--- a/src/glcc/project/component/projectDetail.jsx
+++ b/src/glcc/project/component/projectDetail.jsx
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
import { Button, message, Tooltip } from 'antd';
import Nodata from '../../../forge/Nodata';
import { useEffect } from 'react';
-import { getProjectById, rewardMoney, rewardSettingRound } from '../../api';
+import { currentRound, getProjectById, rewardMoney, rewardSettingRound } from '../../api';
import './index.scss';
export default ({ detail, projectId, applyTaskId, period, showTask=true, applyTask, id, round, listLen }) => {
@@ -48,13 +48,13 @@ export default ({ detail, projectId, applyTaskId, period, showTask=true, applyTa
{round >= rewardSettingRound && item.settingRewardValue !== rewardMoney && 奖励备注: {item.settingRewardRemark}
}
{/* 报名详情按钮 */}
- {round === 2 && applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && }
+ {round === currentRound && applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && }
{/* 课题申请时间范围内: 申请课题 */}
{/* 第一次报名 */}
- {round === 2 && period === "stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && }
+ {round === currentRound && period === "stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && }
{/* 第二次报名 锁定状态 */}
- {round === 2 && period === "stuApply1" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && (item.locked ? : )}
+ {round === currentRound && period === "stuApply1" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && (item.locked ? : )}
{/* 查看课题详情按钮 */}
diff --git a/src/glcc/project/taskDetail/index.jsx b/src/glcc/project/taskDetail/index.jsx
index d4fb433f1..7d7770635 100644
--- a/src/glcc/project/taskDetail/index.jsx
+++ b/src/glcc/project/taskDetail/index.jsx
@@ -1,13 +1,13 @@
import React, {useEffect, useState } from 'react';
import { Button, Spin, Tooltip} from 'antd';
-import { getTaskById, rewardMoney, rewardSettingRound } from '../../api';
+import { currentRound, getTaskById, rewardMoney, rewardSettingRound } from '../../api';
import bgPng from "../../img/bgPng.png";
import '../index.scss';
import './index.scss';
// 课题列表
function TaskDetail(props) {
- const {match, location, period, applyTaskId, applyTask, match:{params:{id}}, currentRound, round} = props
+ const {match, location, period, applyTaskId, applyTask, match:{params:{id}}, round} = props
const taskId = Number(match.params.taskId);
const [detail, setDetail] = useState(undefined);
@@ -55,9 +55,9 @@ function TaskDetail(props) {
{/* 课题申请时间范围内: 申请课题 */}
{/* 第一次报名 */}
- {detail.taskReward > 0 && round === currentRound && period==="stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(taskId.toString())) && }
+ {round === currentRound && period==="stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(taskId.toString())) && }
{/* 第二次报名 锁定状态 */}
- {detail.taskReward > 0 && round === currentRound && period === "stuApply1" && !(applyTaskId && Object.keys(applyTaskId).includes(taskId.toString())) && (detail.locked ? : )}
+ {round === currentRound && period === "stuApply1" && !(applyTaskId && Object.keys(applyTaskId).includes(taskId.toString())) && (detail.locked ? : )}
diff --git a/src/glcc/project/taskList/index.jsx b/src/glcc/project/taskList/index.jsx
index 3f6aab7d9..6094516f2 100644
--- a/src/glcc/project/taskList/index.jsx
+++ b/src/glcc/project/taskList/index.jsx
@@ -1,13 +1,13 @@
import React, { Fragment, useEffect, useState } from 'react';
import { Checkbox, Input, message, Modal, Table, Tooltip } from 'antd';
import './index.scss';
-import { cancelTaskApply, rewardMoney, rewardSettingRound, taskList } from '../../api';
+import { cancelTaskApply, currentRound, rewardMoney, rewardSettingRound, taskList } from '../../api';
import ProjectDetail from '../component/projectDetail';
import bgPng from "../../img/bgPng.png";
const { Search } = Input;
// 课题列表
-function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDialog,cancelCount,showNotification, applyTask, round, match:{params:{id}}, period, currentRound, lockedTaskName }) {
+function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDialog,cancelCount,showNotification, applyTask, round, match:{params:{id}}, period, lockedTaskName }) {
const [visible, setVisible] = useState(false);
const [deleteTaskId, setDeleteTaskId] = useState(undefined);
// 输入搜索框
@@ -165,7 +165,7 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
- {round === 2 && current_user && current_user.login ?
{setCurrent(1);setApply(e.target.checked)}}>已报名 :
}
+ {round === currentRound && current_user && current_user.login ?
{setCurrent(1);setApply(e.target.checked)}}>已报名 :
}
{round === 2 && period === "stuApply1" &&
{setCurrent(1);setIsAvailable(e.target.checked)}}>可申请课题}
{ setCurrent(1); setKeyword(value) }} />
diff --git a/src/glcc/student/index.jsx b/src/glcc/student/index.jsx
index 8eeaaf35d..7e9488d62 100644
--- a/src/glcc/student/index.jsx
+++ b/src/glcc/student/index.jsx
@@ -1,8 +1,8 @@
import React, { useCallback, useEffect, useState, Fragment } from 'react';
-import { Breadcrumb, Button, Form, Input, Select, Upload, Cascader, Spin, Radio } from 'antd';
+import { Breadcrumb, Button, Form, Input, Select, Upload, Cascader, Spin, Radio, message } from 'antd';
import { getUploadActionUrl, getUrl, appendFileSizeToUploadFileAll } from 'educoder';
import { locData } from '../../forge/Utils/locData';
-import { getStudentApplyInfo, taskList, studentApply, studentApplyEdit } from '../api';
+import { getStudentApplyInfo, taskList, studentApply, studentApplyEdit, formatParsedResult, yearByRound, currentRound } from '../api';
import TextArea from 'antd/lib/input/TextArea';
import {Confirm} from '../../components/ModalFun';
import { httpUrl } from '../fetch';
@@ -24,8 +24,10 @@ const gradeList = [
{ id: '博士及以上', name: '博士及以上' }
];
function Apply(props) {
- const { form, current_user, showNotification, match, setStudentInfoReset, period, round } = props;
+ const { form, current_user, showNotification, match, setStudentInfoReset, period, glccSettings } = props;
const taskId = Number(match.params.taskId);
+ const studentApplyTime = glccSettings && glccSettings.filter(item=>item.name === "stuApply");
+ const stuPublic = glccSettings && glccSettings.filter(item=>item.name === "stuPublic");
const { getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll } = form;
const [imageUrl, setImageUrl] = useState(undefined);
const [loading, setLoading] = useState(false);
@@ -62,19 +64,19 @@ function Apply(props) {
const params = {
curPage: 1,
pageSize: 10000,
- round
+ round: currentRound
}
taskList(params).then(response => {
if (response && response.message === "success") {
setAllTaskList(response.data.rows);
}
})
- }, [round])
+ }, [])
useEffect(() => {
// 获取当前用户报名信息
- current_user && getStudentApplyInfo({ userId: current_user.user_id, round }).then(response => {
+ current_user && getStudentApplyInfo({ userId: current_user.user_id, round: currentRound }).then(response => {
if (response && response.message === "success" && response.data) {
let data = response.data;
let applyInfo = {
@@ -162,7 +164,7 @@ function Apply(props) {
}).then(res => setFieldsValue({ 'taskId0': taskId }))
}
})
- }, [current_user, reload, round])
+ }, [current_user, reload])
// 当用户输入结束时 检验用户输入是否符合规范
function verify(dataIndex) {
@@ -175,23 +177,22 @@ function Apply(props) {
// 学生报名夏令营
function handleSubmit(e) {
-
e.preventDefault();
- Confirm({
- title:'提示',
- content:'提交后,您的课题报名信息将无法更改,确认提交?',
- onOk:()=>{
- validateFieldsAndScroll((err, values) => {
- if (!err) {
+ validateFieldsAndScroll((err, values) => {
+ if (!err) {
+ Confirm({
+ title: '提示',
+ content: '一旦提交,您依然可调整报名页“基本信息”部分的内容,而“课题信息”部分的内容无法更改。确认提交?',
+ onOk: () => {
setLoading(true);
- if(myTaskList && myTaskList.length){
- const {enrollFirst=0} = values;
- myTaskList.map((item, index)=>{
+ if (myTaskList && myTaskList.length) {
+ const { enrollFirst = 0 } = values;
+ myTaskList.map((item, index) => {
// registrationStudentTaskList需要传round字段
- item.round = round;
+ item.round = currentRound;
// 课题优先级
item.enrollFirst = index === enrollFirst;
- item.subRound= values[`subRound${index}`] === 0 ? 0 : 1;
+ item.subRound = values[`subRound${index}`] === 0 ? 0 : 1;
})
}
const params = {
@@ -199,13 +200,13 @@ function Apply(props) {
location: Array.isArray(values.location) && values.location.join(),
mail: values.mail,
phone: values.phone,
- proveAttachmentId: values.proveAttachmentId.file ? values.proveAttachmentId.file.response.id : userApplyInfo.proveAttachmentId,
+ proveAttachmentId: values.proveAttachmentId.file ? values.proveAttachmentId.file.response.data.id : userApplyInfo.proveAttachmentId,
school: values.school,
profession: values.profession,
studentName: values.studentName,
userId: current_user.user_id,
registrationStudentTaskList: myTaskList,
- round
+ round: currentRound
}
if (userApplyInfo) {
params.id = userApplyInfo.id;
@@ -215,9 +216,12 @@ function Apply(props) {
setStudentInfoReset(Math.random());
setReload(Math.random());
setLoading(false);
- window.scrollTo(0,0);
+ window.scrollTo(0, 0);
// history.push(`/glcc/subjects`)
}
+ }).catch(() => {
+ message.error("系统错误")
+ setLoading(false);
});
} else {
studentApply(params).then(response => {
@@ -226,13 +230,17 @@ function Apply(props) {
setStudentInfoReset(Math.random());
setReload(Math.random());
setLoading(false);
- window.scrollTo(0,0);
+ window.scrollTo(0, 0);
// history.push(`/glcc/subjects`)
}
+ }).catch(() => {
+ message.error("系统错误")
+ setLoading(false);
});
}
}
});
+
}
});
};
@@ -345,17 +353,17 @@ function Apply(props) {
开源夏令营
- 课题及项目列表
+ 课题及项目列表
学生报名
申请说明:
-
1、学生报名时间为2023年6月4日-6月21日,请在报名截止时间(北京时间2023年6月21日24点)前提交报名信息
+
1、学生报名时间为{formatParsedResult(studentApplyTime, "rangeDay")},请在报名截止时间(北京时间{formatParsedResult(studentApplyTime, "end")})前提交报名信息
2、本次GLCC夏令营基于GitLink代码托管平台完成编程任务,若您没有平台账户,请先注册后完成课题申请
3、每位学员最多可申请2个课题,有且仅有1个课题可以入选
4、每个学生有且仅有两次取消申请课题的机会,请谨慎选择课题或取消课题
5、建议在提交课题申请,与课题导师邮件沟通,详细了解课题描述、编码任务、技能要求&编程语言、预期产出结果等信息,以便您能够选择最适合的课题
-
6、提交申请后,请耐心等待,我们会在2023年7月1日公布入围结果。如有任何问题,请添加开源夏令营QQ群:210174286进行咨询
+
6、提交申请后,请耐心等待,我们会在{formatParsedResult(stuPublic, "start")}公布入围结果。如有任何问题,请添加开源夏令营QQ群:210174286进行咨询
学生报名
@@ -427,13 +435,14 @@ function Apply(props) {
listType="picture-card"
className="avatar-uploader"
showUploadList={false}
- action={getUploadActionUrl()}
+ // action={getUploadActionUrl()}
+ action={httpUrl + `/busiAttachments/upload`}
accept=".png,.jpg,.jpeg"
beforeUpload={beforeUpload}
onChange={handleChange}
>
{imageUrl ?

: userApplyInfo && userApplyInfo.proveAttachmentId ?
-
: