合并代码
This commit is contained in:
commit
15550398dd
|
|
@ -302,13 +302,24 @@ class Detail extends Component {
|
|||
if (this.props.defaultDetail) {
|
||||
projectdata = this.props.defaultDetail
|
||||
} else {
|
||||
const res = await getProjectDetailFunc(owner, projectsId, !window.location.host);
|
||||
if (res.status === 200) {
|
||||
projectdata = res.data
|
||||
this.setState({
|
||||
firstSync: false,
|
||||
secondSync: false,
|
||||
mirror_status:0
|
||||
})
|
||||
this.getBanner(this.props.projectMenu)
|
||||
let projectdata
|
||||
if (this.props.defaultDetail) {
|
||||
projectdata = this.props.defaultDetail
|
||||
} else {
|
||||
const res = await getProjectDetailFunc(owner, projectsId, !window.location.host);
|
||||
if (res.status === 200) {
|
||||
projectdata = res.data
|
||||
}
|
||||
}
|
||||
if (projectdata) {
|
||||
this.getDetail(projectdata)
|
||||
}
|
||||
}
|
||||
if (projectdata) {
|
||||
this.getDetail(projectdata)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -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 && <a className='font-16 addRepoBut' onClick={addRepoBut}><i className='iconfont icon-tianjia_tianchong mr5 font-22'></i>添加项目</a>}
|
||||
</FlexAJ>
|
||||
{userApplyInfo.length > 0 && <div className='repoListBox'>
|
||||
{userApplyInfo.map((item, index)=><div className='repoList mb20' key={index}><RepoInfo cateList={cateList} applyInfo={item} current_user={current_user} round={round} setReload={()=>{setReload(Math.random())}} isAddRepo={isAddRepo} editRepoCount={editRepoCount} setEditRepoCount={setEditRepoCount} repoCount={userApplyInfo.length} scrollToEdit={scrollToEdit} rewardList={rewardList}/></div>)}
|
||||
{userApplyInfo.map((item, index)=><div className='repoList mb20' key={index}><RepoInfo cateList={cateList} applyInfo={item} current_user={current_user} setReload={()=>{setReload(Math.random())}} isAddRepo={isAddRepo} editRepoCount={editRepoCount} setEditRepoCount={setEditRepoCount} repoCount={userApplyInfo.length} scrollToEdit={scrollToEdit} rewardList={rewardList}/></div>)}
|
||||
</div>}
|
||||
{(!userApplyInfo.length || isAddRepo) && <EditInfo isAddRepo={isAddRepo} setIsAddRepo={setIsAddRepo} round={round} cateList={cateList} current_user={current_user} setReload={()=>{setReload(Math.random())}} rewardList={rewardList}/>}
|
||||
{(!userApplyInfo.length || isAddRepo) && <EditInfo isAddRepo={isAddRepo} setIsAddRepo={setIsAddRepo} cateList={cateList} current_user={current_user} setReload={()=>{setReload(Math.random())}} rewardList={rewardList}/>}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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 <div className="taskApplyInfo mt20" key={id}>
|
||||
<FlexAJ>
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -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 }) {
|
|||
<img className="info-img"
|
||||
alt=''
|
||||
onClick={() => { 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}`}
|
||||
></img>
|
||||
</div>
|
||||
</div>}
|
||||
|
|
@ -284,7 +284,7 @@ function Check({ current_user, showNotification, currentRound }) {
|
|||
<div className="head_content">2、您可根据学生报名信息与学生进行邮箱或电话沟通了解学生详细情况,选择满意的学生</div>
|
||||
<div className="head_content">3、每个课题仅允许审核通过一个学生,在审核过程中,您可以随时调整各学生的审核状态,直到与学生匹配成功</div>
|
||||
{/* <div className="head_content">4、6月28日后,各导师可访问 <a href='/glcc/result'>https://www.gitlink.org.cn/glcc/result</a> 查询匹配结果(需使用导师账号登录)</div> */}
|
||||
<div className="head_content">4、请各位导师在7月1日前完成课题申请的审核,7月1日凌晨1点平台将根据各导师审核信息,正式公布各课题学生入选名单</div>
|
||||
<div className="head_content">4、请各位导师在{formatParsedResult(matching, "start")}前完成课题申请的审核,{formatParsedResult(stuPublic, "start")}平台将根据各导师审核信息,正式公布各课题学生入选名单</div>
|
||||
</div>
|
||||
|
||||
<Tabs className="task-tabs" onChange={(e) => { setTaskId(e) }} activeKey={taskId + ''}>
|
||||
|
|
|
|||
|
|
@ -240,28 +240,28 @@ const Glcc = (propsF) => {
|
|||
{(period === "stuApply" || period === "stuApply1") && <Route
|
||||
path="/glcc/student/apply/:taskId"
|
||||
render={(props) => (
|
||||
<Student {...propsF} {...props} round={round} period={period} setStudentInfoReset={setStudentInfoReset}/>
|
||||
<Student {...propsF} {...props} period={period} setStudentInfoReset={setStudentInfoReset} glccSettings={glccSettings}/>
|
||||
)}
|
||||
></Route>}
|
||||
{/* 开源夏令营报名页面 */}
|
||||
{period === "repoApply" && <Route
|
||||
path="/glcc/apply"
|
||||
render={(props) => (
|
||||
<Apply round={currentRound} {...propsF} {...props} glccSettings={glccSettings}/>
|
||||
<Apply {...propsF} {...props} glccSettings={glccSettings}/>
|
||||
)}
|
||||
></Route>}
|
||||
{/* 导师报名课题路由通道(补录) */}
|
||||
{applyRepo && <Route
|
||||
path="/glcc/sign"
|
||||
render={(props) => (
|
||||
<Apply round={currentRound} {...propsF} {...props} glccSettings={glccSettings}/>
|
||||
<Apply {...propsF} {...props} glccSettings={glccSettings}/>
|
||||
)}
|
||||
></Route>}
|
||||
{/* 导师-学生配对阶段 */}
|
||||
{isMatching && hasRole && <Route
|
||||
path="/glcc/mentoradmin"
|
||||
render={(props) => (
|
||||
<Check {...propsF} {...props} currentRound={currentRound}/>
|
||||
<Check {...propsF} {...props} glccSettings={glccSettings}/>
|
||||
)}
|
||||
></Route>}
|
||||
|
||||
|
|
@ -292,14 +292,14 @@ const Glcc = (propsF) => {
|
|||
{!(round === currentRound && !repoPublic) && <Route
|
||||
path="/glcc/:id/subjects/detail/:taskId"
|
||||
render={(props) => (
|
||||
<TaskDetail {...propsF} {...props} applyTaskId={applyTaskId} applyTask={applyTask} period={period} round={round} currentRound={currentRound}/>
|
||||
<TaskDetail {...propsF} {...props} applyTaskId={applyTaskId} applyTask={applyTask} period={period} round={round}/>
|
||||
)}
|
||||
></Route>}
|
||||
{/* 项目/课题列表 */}
|
||||
{!(round === currentRound && !repoPublic) && <Route
|
||||
path="/glcc/:id/projects"
|
||||
render={(props) => (
|
||||
<Project period={period} round={round} {...propsF} {...props} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} applyTask={applyTask} currentRound={currentRound} glccSettings={glccSettings}/>
|
||||
<Project period={period} round={round} {...propsF} {...props} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} applyTask={applyTask} glccSettings={glccSettings}/>
|
||||
)}
|
||||
></Route>}
|
||||
|
||||
|
|
@ -307,7 +307,7 @@ const Glcc = (propsF) => {
|
|||
{!(round === currentRound && !repoPublic) && <Route
|
||||
path="/glcc/:id/subjects"
|
||||
render={(props) => (
|
||||
<Project period={period} round={round} {...propsF} {...props} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} cancelCount={cancelCount} applyTask={applyTask} currentRound={currentRound} lockedTaskName={lockedTaskName} glccSettings={glccSettings}/>
|
||||
<Project period={period} round={round} {...propsF} {...props} applyTaskId={applyTaskId} setStudentInfoReset={setStudentInfoReset} cancelCount={cancelCount} applyTask={applyTask} lockedTaskName={lockedTaskName} glccSettings={glccSettings}/>
|
||||
)}
|
||||
></Route>}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 }) => {
|
||||
|
|
@ -45,16 +45,16 @@ export default ({ detail, projectId, applyTaskId, period, showTask=true, applyTa
|
|||
<div className="center">
|
||||
<div className="taskDesc">{item.taskDesc}</div>
|
||||
{item.taskUrl && <div className="taskUrl oneLine">课题链接: <a href={item.taskUrl} target={"_blank"}>{item.taskUrl}</a></div>}
|
||||
{round >= rewardSettingRound && item.settingRewardValue !== rewardMoney && <div className="taskUrl oneLine"><span className="labelInfoBox">奖励备注: </span>{item.settingRewardRemark}</div>}
|
||||
{round >= rewardSettingRound && item.settingRewardValue !== rewardMoney && <div className="taskUrl oneLine mb10"><span className="labelInfoBox">奖励备注: </span>{item.settingRewardRemark}</div>}
|
||||
<div>
|
||||
{/* 报名详情按钮 */}
|
||||
{round === 2 && applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && <Button onClick={()=>{window.location.href=`/glcc/student/apply/${item.id}`}} className='lookDetail mr10'>报名详情</Button>}
|
||||
{round === currentRound && applyTaskId && Object.keys(applyTaskId).includes(item.id.toString()) && <Button onClick={()=>{window.location.href=`/glcc/student/apply/${item.id}`}} className='lookDetail mr10'>报名详情</Button>}
|
||||
|
||||
{/* 课题申请时间范围内: 申请课题 */}
|
||||
{/* 第一次报名 */}
|
||||
{round === 2 && period === "stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && <Button type='primary' className='applyBut mr10' onClick={()=>{applyTask(item.id)}}>申请课题</Button>}
|
||||
{round === currentRound && period === "stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && <Button type='primary' className='applyBut mr10' onClick={()=>{applyTask(item.id)}}>申请课题</Button>}
|
||||
{/* 第二次报名 锁定状态 */}
|
||||
{round === 2 && period === "stuApply1" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && (item.locked ? <Tooltip title={"该课题已有学生入选"}><Button type='primary' className='mr10' disabled>申请课题</Button></Tooltip> : <Button type='primary' className='applyBut mr10' onClick={()=>{applyTask(item.id)}}>申请课题</Button>)}
|
||||
{round === currentRound && period === "stuApply1" && !(applyTaskId && Object.keys(applyTaskId).includes(item.id.toString())) && (item.locked ? <Tooltip title={"该课题已有学生入选"}><Button type='primary' className='mr10' disabled>申请课题</Button></Tooltip> : <Button type='primary' className='applyBut mr10' onClick={()=>{applyTask(item.id)}}>申请课题</Button>)}
|
||||
|
||||
{/* 查看课题详情按钮 */}
|
||||
<Button onClick={()=>{window.open(`/glcc/${id}/subjects/detail/${item.id}`)}} className='lookDetail'>课题详情</Button>
|
||||
|
|
|
|||
|
|
@ -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())) && <Button type='primary' className='applyBut detailBut' onClick={()=>{applyTask(taskId)}}>申请课题</Button>}
|
||||
{round === currentRound && period==="stuApply" && !(applyTaskId && Object.keys(applyTaskId).includes(taskId.toString())) && <Button type='primary' className='applyBut detailBut' onClick={()=>{applyTask(taskId)}}>申请课题</Button>}
|
||||
{/* 第二次报名 锁定状态 */}
|
||||
{detail.taskReward > 0 && round === currentRound && period === "stuApply1" && !(applyTaskId && Object.keys(applyTaskId).includes(taskId.toString())) && (detail.locked ? <Tooltip title={"该课题已有学生入选"}><Button type='primary' className='mr10 detailBut' disabled>申请课题</Button></Tooltip> : <Button type='primary' className='applyBut mr10 detailBut' onClick={()=>{applyTask(taskId)}}>申请课题</Button>)}
|
||||
{round === currentRound && period === "stuApply1" && !(applyTaskId && Object.keys(applyTaskId).includes(taskId.toString())) && (detail.locked ? <Tooltip title={"该课题已有学生入选"}><Button type='primary' className='mr10 detailBut' disabled>申请课题</Button></Tooltip> : <Button type='primary' className='applyBut mr10 detailBut' onClick={()=>{applyTask(taskId)}}>申请课题</Button>)}
|
||||
</div>
|
||||
<img src={bgPng} alt='' className='bgPng1'/>
|
||||
<img src={bgPng} alt='' className='bgPng2'/>
|
||||
|
|
|
|||
|
|
@ -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, 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);
|
||||
// 输入搜索框
|
||||
|
|
@ -29,7 +29,10 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
|
|||
{ title: '课题名称', dataIndex: 'taskName', className:"taskTableColumns taskName", width: '24%', ellipsis: true, render: (text, item) => <Tooltip title={text} placement="topLeft"><span onClick={()=>{window.open(`/glcc/${id}/subjects/detail/${item.id}`)}}>{text}</span></Tooltip> },
|
||||
{ title: '课题类型', dataIndex: 'projectType', className:"taskTableColumns", width: '12%', ellipsis: true, },
|
||||
{ title: '项目名称', dataIndex: 'projectName', className:"taskTableColumns", width: '24%', ellipsis: true, render: (text) => <Tooltip title={text} placement="topLeft">{text}</Tooltip> },
|
||||
{ title: round >= rewardSettingRound ? '课题奖励' : '课题奖金', dataIndex: round >= rewardSettingRound ? 'settingRewardValue' : 'taskReward', className:"taskTableColumns", ellipsis: true, width: '10%', render: (text) => <Tooltip title={text} placement="topLeft"><span>{text}</span></Tooltip> },
|
||||
{ title: round >= rewardSettingRound ? '课题奖励' : '课题奖金', dataIndex: round >= rewardSettingRound ? 'settingRewardValue' : 'taskReward', className:"taskTableColumns", ellipsis: true, width: '10%', render: (text, item) => {
|
||||
const reward = round >= rewardSettingRound && text === rewardMoney && `¥ ${item.settingRewardRemark}`;
|
||||
return <Tooltip title={text} placement="topLeft"><span>{reward || text}</span></Tooltip>
|
||||
} },
|
||||
{
|
||||
title: '操作', dataIndex: 'action', align: 'center', className:"actionColumns taskTableColumns", render: ((text, item, index) => {
|
||||
return (
|
||||
|
|
@ -162,7 +165,7 @@ function TaskList({applyTaskId, setStudentInfoReset, current_user, showLoginDial
|
|||
<div className="list">
|
||||
<div className='search task'>
|
||||
<div>
|
||||
{round === 2 && current_user && current_user.login ? <Checkbox onChange={(e)=>{setCurrent(1);setApply(e.target.checked)}}>已报名</Checkbox> : <div></div>}
|
||||
{round === currentRound && current_user && current_user.login ? <Checkbox onChange={(e)=>{setCurrent(1);setApply(e.target.checked)}}>已报名</Checkbox> : <div></div>}
|
||||
{round === 2 && period === "stuApply1" && <Checkbox onChange={(e)=>{setCurrent(1);setIsAvailable(e.target.checked)}}>可申请课题</Checkbox>}
|
||||
</div>
|
||||
<Search className='taskSearch' placeholder='请输入课题/项目名称进行搜索' allowClear enterButton onSearch={(value) => { setCurrent(1); setKeyword(value) }} />
|
||||
|
|
|
|||
|
|
@ -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) {
|
|||
<div className='apply'>
|
||||
<Breadcrumb className='glcc_breadcrumb font-16'>
|
||||
<Breadcrumb.Item><Link to="/glcc">开源夏令营</Link></Breadcrumb.Item>
|
||||
<Breadcrumb.Item><Link to="/glcc/2023/subjects">课题及项目列表</Link></Breadcrumb.Item>
|
||||
<Breadcrumb.Item><Link to={`/glcc/${yearByRound[currentRound]}/subjects`}>课题及项目列表</Link></Breadcrumb.Item>
|
||||
<Breadcrumb.Item style={{ color: '#202D40' }}>学生报名</Breadcrumb.Item>
|
||||
</Breadcrumb>
|
||||
<div className="head_introduce">
|
||||
<h4 className="head_tit">申请说明:</h4>
|
||||
<div className="head_content">1、学生报名时间为<span className="head_bold">2023年6月4日-6月21日</span>,请在报名截止时间(北京时间<span className="head_bold">2023年6月21日24点</span>)前提交报名信息</div>
|
||||
<div className="head_content">1、学生报名时间为<span className="head_bold">{formatParsedResult(studentApplyTime, "rangeDay")}</span>,请在报名截止时间(北京时间<span className="head_bold">{formatParsedResult(studentApplyTime, "end")}</span>)前提交报名信息</div>
|
||||
<div className="head_content">2、本次GLCC夏令营基于GitLink代码托管平台完成编程任务,若您没有平台账户,请先注册后完成课题申请</div>
|
||||
<div className="head_content">3、每位学员最多可申请2个课题,有且仅有1个课题可以入选</div>
|
||||
<div className="head_content">4、每个学生有且仅有两次取消申请课题的机会,请谨慎选择课题或取消课题</div>
|
||||
<div className="head_content">5、建议在提交课题申请,与课题导师邮件沟通,详细了解课题描述、编码任务、技能要求&编程语言、预期产出结果等信息,以便您能够选择最适合的课题</div>
|
||||
<div className="head_content">6、提交申请后,请耐心等待,我们会在2023年7月1日公布入围结果。如有任何问题,请添加开源夏令营QQ群:210174286进行咨询</div>
|
||||
<div className="head_content">6、提交申请后,请耐心等待,我们会在{formatParsedResult(stuPublic, "start")}公布入围结果。如有任何问题,请添加开源夏令营QQ群:210174286进行咨询</div>
|
||||
</div>
|
||||
<div className="main-tit">
|
||||
<img src={studentSvg} alt='' /><span className="tit-text">学生报名</span>
|
||||
|
|
@ -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 ? <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>
|
||||
<div><img src={`${httpUrl}/busiAttachments/download/${userApplyInfo.proveAttachmentId}`} alt='' style={{ maxWidth: '100px' }} /></div> : <div>
|
||||
<i className='iconfont icon-tianjiadaohang font-30'></i>
|
||||
<div className="ant-upload-text font-13">请上传学生证明</div>
|
||||
</div>}
|
||||
|
|
|
|||
Loading…
Reference in New Issue