diff --git a/.bashrc b/.bashrc new file mode 100644 index 000000000..f980f5a01 Binary files /dev/null and b/.bashrc differ diff --git a/src/AppConfig.js b/src/AppConfig.js index 95d42f9dc..326cfbb03 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -32,8 +32,8 @@ export function initAxiosInterceptors(props) { // 判断网络是否连接 initOnlineOfflineListener(); - var proxy = "https://testforgeplus.trustie.net"; + var proxy = "https://testforgeplus.trustie.net"; //响应前的设置 axios.interceptors.request.use( diff --git a/src/common/UrlTool.js b/src/common/UrlTool.js index 965387554..e45ae6ba2 100644 --- a/src/common/UrlTool.js +++ b/src/common/UrlTool.js @@ -6,7 +6,7 @@ const { Search } = Input; const $ = window.$; const isDev = window.location.port == 3007; const isdev2= window.location.hostname ==='www.educoder.net' -export const TEST_HOST = "https://testforgeplus.trustie.net/" +export const TEST_HOST = "https://testforgeplus.trustie.net" export function getImageUrl(path) { // https://www.educoder.net // https://testbdweb.trustie.net diff --git a/src/forge/Component/Releases.jsx b/src/forge/Component/Releases.jsx index fa7312e92..8fa92eb79 100644 --- a/src/forge/Component/Releases.jsx +++ b/src/forge/Component/Releases.jsx @@ -28,7 +28,8 @@ function Releases({ owner, projectsId, releaseVersions, distribution }) { :
暂无发行版 - {distribution && 发布新版本} + {distribution && 发布新版本}
} diff --git a/src/forge/Dataset/Index.jsx b/src/forge/Dataset/Index.jsx index de62c8133..ef4998d83 100644 --- a/src/forge/Dataset/Index.jsx +++ b/src/forge/Dataset/Index.jsx @@ -85,7 +85,7 @@ function Index(props){ key:6, width:"10%", render:(value,item)=>{ - return 下载 + return 下载 } }, ] diff --git a/src/forge/Information/Component/publicBanner.jsx b/src/forge/Information/Component/publicBanner.jsx index e4facf005..f26dea5c3 100644 --- a/src/forge/Information/Component/publicBanner.jsx +++ b/src/forge/Information/Component/publicBanner.jsx @@ -10,7 +10,7 @@ function PublicBanner(props){ const [ key , setKey ] = useState("1"); const { deptId } = props.match.params; const { pathname } = props.history.location; - const { data:{sectionHomepageShow, sectionHomepageTitle, sectionProjectShow, sectionProjectTitle, sectionResourceShow, sectionResourceTitle, sectionCmsShow, sectionCmsTitle, sectionMemberShow, sectionMemberTitle, sectionHelperShow, sectionHelperTitle}, data , adminUrl, temp } = props; + const { data:{sectionHomepageShow, sectionHomepageTitle, sectionProjectShow,sectionDataSetShow,sectionDataSetTitle, sectionProjectTitle, sectionResourceShow, sectionResourceTitle, sectionCmsShow, sectionCmsTitle, sectionMemberShow, sectionMemberTitle, sectionHelperShow, sectionHelperTitle}, data , adminUrl, temp } = props; useEffect(()=>{ if(pathname){ @@ -20,6 +20,7 @@ function PublicBanner(props){ const source = /[A-Za-z0-9]{0,}\/source/g; const vip = /[A-Za-z0-9]{0,}\/VIP/g; const help = /[A-Za-z0-9]{0,}\/help/g; + const dataset = /[A-Za-z0-9]{0,}\/dataset/g; if(pathname === `/zone/${deptId}`){ setKey("1"); } @@ -38,6 +39,9 @@ function PublicBanner(props){ else if(help.test(pathname)){ setKey("8"); } + else if(dataset.test(pathname)){ + setKey("9"); + } } },[pathname]) @@ -55,6 +59,7 @@ function PublicBanner(props){ {sectionHomepageShow && {sectionHomepageTitle}} {sectionProjectShow && {sectionProjectTitle}} + {sectionDataSetShow && {sectionDataSetTitle}} {sectionResourceShow && {sectionResourceTitle}} {sectionCmsShow && {sectionCmsTitle}} {/* Sig小组 */} diff --git a/src/forge/Information/Pages/dataset/fileList.jsx b/src/forge/Information/Pages/dataset/fileList.jsx new file mode 100644 index 000000000..8c83ac13c --- /dev/null +++ b/src/forge/Information/Pages/dataset/fileList.jsx @@ -0,0 +1,126 @@ +import React,{ useState, useEffect } from 'react'; +import { Breadcrumb , Tooltip , Table , Spin } from 'antd'; +import paperImg from '../../img/paperImg.png'; +import '../../index.scss'; +import { Link } from 'react-router-dom'; +import { getImageUrl } from 'educoder'; +import { getDataSetdetail } from '../../api'; + +const defaultList=[ + {title:"数据集名称数据集名称数据集名称数据集名称数据集名称",description:"描述描述内容",creator:{login:"innov",image_url:""},created_on:"2024-4-9 9:15",filesize:"15mb",url:"http://testforgeplus.trustie.net/"} +] + +function Index(props){ + const { deptId , datasetId } = props.match.params; + const [ detail , setDetail ] = useState(undefined); + const [ dataSource , setDataSource ] = useState(defaultList); + const [ total , setTotal ] = useState(0); + const [ page , setPage ] = useState(1); + const [ spinning , setSpinning ] = useState(true); + const pageSize = 10; + useEffect(()=>{ + window.scrollTo(0,0); + },[datasetId]) + + useEffect(()=>{ + Init(); + },[page]) + + function Init(){ + getDataSetdetail(datasetId,{limit:pageSize,page}).then(response=>{ + if(response && response.data){ + let data = response.data.data; + setDetail(data); + setDataSource(data.attachments); + setTotal(data.attachment_total_count); + setSpinning(false) + } + }).catch(error=>{}) + } + + const columns=[ + { + title:"文件名称", + dataIndex:"title", + key:1, + ellipsis:true, + width:"25%" + }, + { + title:"描述", + dataIndex:"description", + key:2, + ellipsis:true, + width:"27%", + render:(value)=>{ + return {value} + } + }, + { + title:"创建者", + dataIndex:"creator", + key:3, + width:"10%", + render:(value,item)=>{ + return + } + }, + { + title:"上传时间", + dataIndex:"created_on", + key:4, + width:"15%" + }, + { + title:"大小", + dataIndex:"filesize", + key:5, + }, + { + title:"操作", + dataIndex:"url", + key:6, + width:"15%", + render:(value,item)=>{ + return 下载 + } + }, + ] + + return( +
+ +
+ + 数据集 + 文件 + +
+ +
+

{detail && detail.title}

{detail && detail.license_name ? 许可证 : {detail.license_name} :""}
+

{detail && detail.description}

+
+ 进入项目 +
+
+ setPage(p)}} + /> + { + detail && detail.paper_content ? +
+

研究论文

+
{detail && detail.paper_content}
+
+ :"" + } + + + + ) +} +export default Index; \ No newline at end of file diff --git a/src/forge/Information/Pages/dataset/index.jsx b/src/forge/Information/Pages/dataset/index.jsx new file mode 100644 index 000000000..2392baaed --- /dev/null +++ b/src/forge/Information/Pages/dataset/index.jsx @@ -0,0 +1,69 @@ +import React,{ useState, useEffect } from 'react'; +import { Input } from 'antd'; +import { Link } from 'react-router-dom'; +import '../../index.scss'; +import { getDataSet } from '../../api'; +import Nodata from '../../../Nodata'; + +const { Search } = Input; + +function Index(props){ + const { deptId } = props.match.params; + const { id , temp, history, role, sectionResourceTitle } = props; + const [ data , setData ] = useState(undefined); + const [ search , setSearch ] = useState(undefined); + useEffect(()=>{ + id && Init(); + },[id, search]) + + function Init(){ + getDataSet({id,search}).then(response=>{ + if(response && response.data){ + setData(response.data.rows); + } + }).catch(error=>{}) + } + + function onSourceSearch(e){ + setSearch(e); + } + return( +
+
+

数据集

+
+ 搜索 } + /> +
+
+
+ { + data && data.length > 0 ? + data.map((item,key)=>{ + return( +
  • + +

    {item.dataSetName}

    +

    {item.dataSetDescription}

    + {/* 2023-09-08 15:54:23 */} + {item.repositoryName} + +
  • + ) + }):"" + } + { + data && data.length === 0 ?
    :"" + } +
    +
    + ) +} +export default Index; \ No newline at end of file diff --git a/src/forge/Information/Pages/headerPage.jsx b/src/forge/Information/Pages/headerPage.jsx index dcb312ad8..cc21f1535 100644 --- a/src/forge/Information/Pages/headerPage.jsx +++ b/src/forge/Information/Pages/headerPage.jsx @@ -74,13 +74,13 @@ function HeaderPage(props){ // 专区简介 data && (data.introductionTitle || data.introductionContent || data.introductionImage) &&
    -
    - {data.introductionTitle &&

    {data.introductionTitle}

    } -

    -
    +
    + {data.introductionTitle &&

    {data.introductionTitle}

    } +

    +
    { data.introductionImage && - + }
    } diff --git a/src/forge/Information/Pages/headerPagebyCCF.jsx b/src/forge/Information/Pages/headerPagebyCCF.jsx index 919320e57..1e3b10b11 100644 --- a/src/forge/Information/Pages/headerPagebyCCF.jsx +++ b/src/forge/Information/Pages/headerPagebyCCF.jsx @@ -237,7 +237,7 @@ function HeaderPageCCF(props) { { data.introductionImage && - + } } diff --git a/src/forge/Information/api.js b/src/forge/Information/api.js index c9cc48673..c37b42e9c 100644 --- a/src/forge/Information/api.js +++ b/src/forge/Information/api.js @@ -295,4 +295,21 @@ export function deleteComment(docId, id) { url: `cms/docComment/${ docId }/${ id }`, method: 'DELETE', }) +} + +// 数据集 +export function getDataSet(params) { + return fetch({ + url: `/zone/open/${params.id}/dataSet/projectList`, + method: 'GET', + params + }) +} +// /open/dataSet/{projectId} +export function getDataSetdetail(datasetId,params) { + return fetch({ + url: `/zone/open/dataSet/${datasetId}`, + method: 'GET', + params + }) } \ No newline at end of file diff --git a/src/forge/Information/img/datasetback.png b/src/forge/Information/img/datasetback.png new file mode 100644 index 000000000..6a5d38f2f Binary files /dev/null and b/src/forge/Information/img/datasetback.png differ diff --git a/src/forge/Information/img/paperImg.png b/src/forge/Information/img/paperImg.png new file mode 100644 index 000000000..7be684fd4 Binary files /dev/null and b/src/forge/Information/img/paperImg.png differ diff --git a/src/forge/Information/img/zone1Menu9.png b/src/forge/Information/img/zone1Menu9.png new file mode 100644 index 000000000..4a7e00e4e Binary files /dev/null and b/src/forge/Information/img/zone1Menu9.png differ diff --git a/src/forge/Information/img/zoneMenu9.png b/src/forge/Information/img/zoneMenu9.png new file mode 100644 index 000000000..3c3fe832d Binary files /dev/null and b/src/forge/Information/img/zoneMenu9.png differ diff --git a/src/forge/Information/index.jsx b/src/forge/Information/index.jsx index 6c0e59862..efde330f2 100644 --- a/src/forge/Information/index.jsx +++ b/src/forge/Information/index.jsx @@ -90,6 +90,14 @@ const HomePageByJCC = Loadable({ loader : () => import("./Pages/JCC/homePage"), loading : Loading, }); +const DatasetFileList = Loadable({ + loader : () => import("./Pages/dataset/fileList"), + loading : Loading, +}); +const DataSetList = Loadable({ + loader : () => import("./Pages/dataset/index"), + loading : Loading, +}); function Index(props){ const [ data , setData ] = useState(undefined); @@ -219,6 +227,18 @@ function Index(props){ )} > + ( + + )} + > + ( + + )} + > ( diff --git a/src/forge/Information/index.scss b/src/forge/Information/index.scss index 6681aab39..3a32f3e9d 100644 --- a/src/forge/Information/index.scss +++ b/src/forge/Information/index.scss @@ -770,7 +770,7 @@ display: flex; align-items: center; margin-top: 54px; - padding:27px 24px; + padding:40px 24px; &>img{ border-radius: 4px; object-fit: contain; @@ -783,7 +783,7 @@ font-size:20px; height: 28px; line-height: 28px; - margin-bottom: 35px!important; + margin-bottom: 30px!important; } .z_desc{ color:#3d485d; @@ -1324,6 +1324,9 @@ .ant-input-lg{ border-color: #fff; } + .ant-btn-primary:hover, .ant-btn-primary:focus,.ant-btn-primary{ + background-color: var(--primary-color); + } } .sources{ display: flex; @@ -1751,3 +1754,93 @@ } } } +// 数据集 +.fileslist{ + .operateButton{ + background-color: var(--primary-color); + border-color: var(--primary-color); + } +} +.sources.datasetList{ + padding:40px 25px; + flex-wrap: wrap; + li{ + margin: 0px 15px 30px!important; + background-image: url('./img/datasetback.png'); + height: 180px; + width: 30.7%; + background: #FFFFFF; + box-shadow: 0px 0px 15px 1px rgba(35,54,185,0.09); + border-radius: 4px 4px 4px 4px; + padding: 25px 20px; + font-weight: 400; + .titile{ + font-size: 16px; + color: #1F2329; + height: 22px; + line-height: 22px; + margin-bottom: 18px!important; + } + .desc{ + font-size: 14px; + color: #4C5876; + line-height: 24px; + margin-bottom: 15px!important; + height: 48px; + word-break: break-all; + } + .time{ + font-size: 14px; + color: #5E6685; + word-break: break-all; + display: block; + i{ + font-size: 14px!important; + margin-right: 5px; + } + } + } +} +.fileslist{ + padding-bottom: 40px; + .ant-breadcrumb{ + color: #4C5876; + font-size: 15px; + padding:25px 0px; + margin: 0px!important; + } + .datasetTable{ + .ant-table-thead > tr > th{ + background-color: #fff; + } + } + .mnistData{ + background: #FAFCFF; + border-radius: 3px; + border: 1px solid rgba(42,97,255,0.23); + padding:20px; + display: flex; + align-items: center; + justify-content: space-between; + p{ + font-weight: 500; + font-size: 14px; + color: #202D40; + line-height: 22px; + &:first-child { + max-width: 600px; + } + } + .license{ + height: 40px; + line-height: 40px; + background: #ECEFFE; + border-radius: 6px 6px 6px 6px; + padding:0px 12px; + font-weight: bold; + font-size: 15px; + color: #202D40; + display: inline-block; + } + } +} diff --git a/src/forge/SecuritySetting/website/createSite.jsx b/src/forge/SecuritySetting/website/createSite.jsx index 91344adfd..d3142d250 100644 --- a/src/forge/SecuritySetting/website/createSite.jsx +++ b/src/forge/SecuritySetting/website/createSite.jsx @@ -134,6 +134,7 @@ function CreateSite(props) { hugo jekyll hexo + files )} diff --git a/src/forge/Upload/Index.js b/src/forge/Upload/Index.js index e548250c1..526af68ac 100644 --- a/src/forge/Upload/Index.js +++ b/src/forge/Upload/Index.js @@ -136,7 +136,8 @@ class Index extends Component { action: actionUrl || `${getUploadActionUrl()}`, onChange: this.handleChange, onRemove: this.onAttachmentRemove, - beforeUpload: this.beforeUpload + beforeUpload: this.beforeUpload, + multiple:true }; return ( diff --git a/src/glcc/api.js b/src/glcc/api.js index 56d033149..7b25151c8 100644 --- a/src/glcc/api.js +++ b/src/glcc/api.js @@ -1,5 +1,10 @@ import fetch from './fetch'; +// 当前glcc +export const currentRound = 3; +export const rewardMoney = "现金奖励" +export const rewardSettingRound = 3; + // 获取当前用户项目报名信息(项目、课题) export function getUserApplyInfo(params) { return fetch({ @@ -281,6 +286,14 @@ export function formatParsedResult(setting, type= "range") { result= `${startYear}年${startMonth}月${startDay}日${startHour}点`; }else if(type === "end"){ result= `${endYear}年${endMonth}月${endDay}日${endHour}点`; + } else if(type === "rangeDay"){ + result = `${startYear}年${startMonth}月${startDay}日-${endYear}年${endMonth}月${endDay}日`; + } else if(type === "startMonthDay"){ + result= `${startMonth}.${startDay}`; + } else if(type === "endMonthDay"){ + result= `${endMonth}.${endDay}`; + } else if(type === "rangeConcatDot"){ + result = `${startMonth}.${startDay}-${endMonth}.${endDay}`; } return result; diff --git a/src/glcc/apply/editInfo.jsx b/src/glcc/apply/editInfo.jsx index cd037a6b6..86ecbf46f 100644 --- a/src/glcc/apply/editInfo.jsx +++ b/src/glcc/apply/editInfo.jsx @@ -1,5 +1,5 @@ import React , { useCallback, useEffect , useState } from 'react'; -import { Button, Form, Input, Select, Upload, message, Popconfirm } from 'antd'; +import { Button, Form, Input, Select, Upload, message, Popconfirm, Checkbox } from 'antd'; import {getUploadActionUrl} from 'educoder'; import {applyGlcc, findStudentTaskByTaskId, updateApplyGlcc} from '../api'; import TextArea from 'antd/lib/input/TextArea'; @@ -10,10 +10,10 @@ 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} = props; + const {form, applyInfo, current_user, round, 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 } = form; + const {getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll, getFieldValue, resetFields } = form; const [imageUrl, setImageUrl] = useState(undefined); // 提交按钮loading效果 const [loading, setLoading] = useState(false); @@ -22,30 +22,41 @@ function EditRepoApplyInfo(props) { useEffect(()=>{ if(applyInfo){ - const {projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, registrationTaskList, projectLogoId, contactMail} = applyInfo; + const {projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, registrationTaskList, projectLogoId, contactMail, joinCooperativeCommunity} = applyInfo; const taskInfo = {}; + const taskRewardRemark = {}; const taskCountArr = [] registrationTaskList.map((item, index)=>{ taskCountArr.push(index+1); - const{taskName, taskUrl, taskDifficulty, taskReward, tutorName, tutorMail, taskDesc, tutorPhone, id} = item; + const{taskName, taskUrl, taskDifficulty, tutorName, tutorMail, taskDesc, tutorPhone, id, settingRewardId, settingRewardRemark, tutorAddress} = item; taskInfo[`taskName${index+1}`] = taskName; taskInfo[`taskUrl${index+1}`] = taskUrl; taskInfo[`taskDifficulty${index+1}`] = taskDifficulty; - taskInfo[`taskReward${index+1}`] = taskReward; taskInfo[`tutorName${index+1}`] = tutorName; taskInfo[`tutorMail${index+1}`] = tutorMail; taskInfo[`taskDesc${index+1}`] = taskDesc; taskInfo[`tutorPhone${index+1}`] = tutorPhone; + taskInfo[`tutorAddress${index+1}`] = tutorAddress; taskInfo[`taskId${index+1}`] = id; + taskInfo[`settingRewardId${index+1}`] = parseInt(settingRewardId); + // taskInfo[`settingRewardRemark${index+1}`] = settingRewardRemark; + taskRewardRemark[`settingRewardRemark${index+1}`] = settingRewardRemark; }) setTaskCount(taskCountArr); setTimeout(() => { setFieldsValue({ projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, contactMail, ...taskInfo, - logo: {file:{response:{id: projectLogoId}}} + logo: {file:{response:{id: projectLogoId}}}, + joinCooperativeCommunity, }) }, 100); + // 课题奖励备注要根据奖励方式注入select/input + setTimeout(() => { + setFieldsValue({ + ...taskRewardRemark, + }) + }, 300); }else{ setTaskCount([1]) } @@ -81,17 +92,19 @@ function EditRepoApplyInfo(props) { taskName: values[`taskName${item}`], taskUrl: values[`taskUrl${item}`], taskDifficulty: values[`taskDifficulty${item}`], - taskReward: values[`taskReward${item}`], + settingRewardId: values[`settingRewardId${item}`], + settingRewardRemark: values[`settingRewardRemark${item}`], tutorName: values[`tutorName${item}`], tutorMail: values[`tutorMail${item}`], + tutorAddress: values[`tutorAddress${item}`], taskDesc: values[`taskDesc${item}`], tutorPhone: values[`tutorPhone${item}`], round }) }) - const {projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, contactMail} = values; + const {projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, contactMail, joinCooperativeCommunity=false} = values; const params ={ - projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, registrationTaskList, round, contactMail, + projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, registrationTaskList, round, contactMail, joinCooperativeCommunity, projectLogoId: values.logo.file.response.id+"", userId: current_user.user_id, userName: current_user.username @@ -101,27 +114,31 @@ function EditRepoApplyInfo(props) { // 用户已经报名项目 params[`id`] = applyInfo.id; updateApplyGlcc(params).then(response=>{ + setLoading(false); if(response && response.message === "success"){ message.success("修改成功"); setReload(); } - setLoading(false); setIsEdit(false); setEditRepoCount(0); setTimeout(() => { scrollToRepoInfo() }, 100); + }).catch(error=>{ + setLoading(false); }) return } applyGlcc(params).then(response=>{ + setLoading(false); if(response && response.message === "success"){ message.success("报名成功"); isAddRepo && setIsAddRepo(false); setReload(); } - setLoading(false); window.scrollTo(0,950); + }).catch(error=>{ + setLoading(false); }) } }); @@ -221,7 +238,25 @@ function EditRepoApplyInfo(props) { { max: 252, message: '超出限制长度252位字符,请重新编辑' }], {verify("gitlink")}}/> )} - {helper('联系人姓名', + + {getFieldDecorator("contactName", { rules: [{ required: true, message: "请输入项目联系人姓名" }, + { max: 32, message: '超出限制长度32位字符,请重新编辑' }], validateFirst: true, initialValue: current_user.username })( + {verify("name")}}/> + )} + + + {getFieldDecorator("contactPhone", { rules: [{ required: true, message: "输入项目联系人手机号码" }, + { pattern: phonereg, message: "请输入正确的手机号码"},], validateFirst: true, initialValue: current_user.phone })( + {verify("name")}}/> + )} + + + {getFieldDecorator("contactMail", { rules: [{ required: true, message: "输入项目联系人邮箱" }, + { pattern: emailreg, message: "请输入正确的邮箱地址"},], validateFirst: true, initialValue: current_user.email })( + {verify("name")}}/> + )} + + {/* {helper('联系人姓名', '', 'contactName', [{ required: true, message: "请输入项目联系人姓名" }, @@ -241,7 +276,7 @@ function EditRepoApplyInfo(props) { [{ required: true, message: "输入项目联系人邮箱" }, { pattern: emailreg, message: "请输入正确的邮箱地址"},], {verify("name")}}/> - )} + )} */}
    {helper('项目简介', '', 'projectIntro', @@ -268,13 +303,20 @@ function EditRepoApplyInfo(props) {
    } )} +
    + + {getFieldDecorator("joinCooperativeCommunity", { rules: [], validateFirst: true, valuePropName: "checked" })( + 授权将社区加入合作社区名单,项目logo可用于GLCC网站和海报宣传 + )} + +
    {taskCount.map((item, index)=>{ return
    课题信息({index+1}/5)
    {index>0 && }
    - +
    })} {taskCount && taskCount.length<5 &&
    @@ -282,7 +324,7 @@ function EditRepoApplyInfo(props) {
    } {(isAddRepo || applyInfo) && 取消编辑将清除已填写的所有项目信息,请谨慎操作} + title={取消将不保存所有修改,请谨慎操作} onConfirm={cancelEdit} okText="确定" cancelText="取消" diff --git a/src/glcc/apply/index.jsx b/src/glcc/apply/index.jsx index 7ee5d1782..fd70553c8 100644 --- a/src/glcc/apply/index.jsx +++ b/src/glcc/apply/index.jsx @@ -1,6 +1,6 @@ import React , { useEffect , useState } from 'react'; import { Breadcrumb, message } from 'antd'; -import {getUserApplyInfo} from '../api'; +import {getUserApplyInfo, getGlccSettings, currentRound, formatParsedResult} from '../api'; import axios from 'axios'; import RepoInfo from './repoInfo'; import EditInfo from './editInfo'; @@ -10,7 +10,7 @@ import './index.scss'; import { FlexAJ } from '../../forge/Component/layout'; // 项目、课题报名 function Apply(props) { - const {current_user, round} = props; + const {current_user, round, glccSettings} = props; const [reload, setReload] = useState(undefined); const [cateList, setCateList] = useState([]); const [userApplyInfo, setUserApplyInfo] = useState([]); @@ -18,6 +18,9 @@ function Apply(props) { const [isAddRepo, setIsAddRepo] = useState(false); // 编辑项目个数 const [editRepoCount, setEditRepoCount] = useState(0); + // 课题奖励-后台配置 + const [rewardList, setRewardList] = useState([]); + const applyTime = glccSettings && glccSettings.filter(item=>item.name === "repoApply"); useEffect(()=>{ // 进入此页面置顶 @@ -30,6 +33,12 @@ function Apply(props) { setCateList(result.data.project_categories); } }).catch(error=>{}) + // 获取课题奖励分类 + getGlccSettings({round: currentRound, type: "rewardSetting"}).then(res=>{ + if(res && res.data){ + setRewardList(res.data); + } + }) }else{ window.location.href="/login?go_page=/glcc/apply"; } @@ -74,20 +83,21 @@ function Apply(props) { {userApplyInfo.length > 0 &&
    您已报名成功,可实时修改您的报名信息再次提交。请关注夏令营首页新闻公告获得更多活动资讯!
    }

    申请说明

    -
    1、项目报名时间为4月29日—5月30日,请在报名截止时间(北京时间2023年5月30日24点)前提交报名信息。
    -
    2、本次GLCC夏令营建议使用GitLink为代码托管平台,学生基于GitLink上项目完成编程任务。同时也欢迎使用其他代码托管平台的项目参与活动。目前GLCC只对夏令营期间使用GitLink托管的项目提供部分奖金支持。
    -
    3、如果您的项目还未迁移到GitLink上,迁移事项请查看迁移说明文档。如在迁移过程中遇到问题,请加qq群: 1071514693 联系qq群管理员。
    +
    1、项目报名时间为{formatParsedResult(applyTime, "rangeDay")},请在报名截止时间(北京时间{formatParsedResult(applyTime, "end")})前提交报名信息。
    +
    2、本次GLCC夏令营建议使用GitLink为代码托管平台,学生基于GitLink上项目完成编程任务。同时也欢迎使用其他代码托管平台的项目参与活动。目前GLCC只对夏令营期间使用GitLink托管的项目提供部分奖励支持。
    +
    3、如果您的项目还未迁移到GitLink上,迁移事项请查看迁移说明文档。如在迁移过程中遇到问题,请加qq群: 1071514693 联系qq群管理员。
    4、提交社区和题目信息后,欢迎与组委会联系沟通宣传推广和后续合作工作。联系人微信: _TigerWang(备注GitLink编程夏令营)
    -
    5、奖金默认由项目方支持,请根据课题难度设定金额。若您可能无法支撑本课题奖金,GLCC组委会将进行资助评审,择优资助。如未获得资助,将下线该课题
    +
    5、在项目报名期间({formatParsedResult(applyTime, "rangeDay")}),您可以随时进入当前页调整项目或课题报名信息
    +
    6、课题奖励默认由项目方支持,可提供现金或者实习机会等其他形式的奖励,请根据课题难度设定奖励内容。若您可能无法支撑本课题奖励,GLCC组委会将进行资助评审,择优资助。如未获得资助,将下线该课题
    项目报名 {userApplyInfo.length > 0 && 添加项目} {userApplyInfo.length > 0 &&
    - {userApplyInfo.map((item, index)=>
    {setReload(Math.random())}} isAddRepo={isAddRepo} editRepoCount={editRepoCount} setEditRepoCount={setEditRepoCount} repoCount={userApplyInfo.length} scrollToEdit={scrollToEdit}/>
    )} + {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())}}/>} + {(!userApplyInfo.length || isAddRepo) && {setReload(Math.random())}} rewardList={rewardList}/>} ) diff --git a/src/glcc/apply/repoInfo.jsx b/src/glcc/apply/repoInfo.jsx index fdd7d104e..b45ad0d01 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 } from "../api"; +import { 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; @@ -34,20 +34,21 @@ function RepoInfo(props) { // 课题信息展示 const showTask = (task) => { - const {id, taskDifficulty, taskName, taskReward, tutorName, tutorPhone, tutorMail, taskDesc, taskUrl} = task; + const {id, taskDifficulty, taskName, taskReward, tutorName, tutorPhone, tutorMail, taskDesc, taskUrl, settingRewardValue, settingRewardRemark} = task; return
    {difficultyList[taskDifficulty]}
    {taskName}
    - ¥ {taskReward} + {settingRewardValue === rewardMoney ? `¥ ${settingRewardRemark}` : settingRewardValue}
    导师信息:{tutorName}({tutorPhone} | {tutorMail})
    课题链接:{taskUrl}
    + {settingRewardValue !== rewardMoney &&
    奖励备注:{settingRewardRemark}
    }
    课题简介:{taskDesc}
    diff --git a/src/glcc/apply/taskApply.jsx b/src/glcc/apply/taskApply.jsx index 86ed6c5f0..8fe90d38a 100644 --- a/src/glcc/apply/taskApply.jsx +++ b/src/glcc/apply/taskApply.jsx @@ -1,27 +1,27 @@ -import React from 'react'; -import {Form, Input, Select } from 'antd'; +import React, { useEffect, useState } from 'react'; +import {Form, Input, Radio, Select } from 'antd'; import TextArea from 'antd/lib/input/TextArea'; +import { rewardMoney } from '../api'; const Option = Select.Option; // 课题信息编辑 function TaskApply(props) { - const {helper, disabled, taskKey, phonereg, emailreg, getFieldDecorator} = props; + const {helper, disabled, taskKey, phonereg, emailreg, getFieldDecorator, rewardList, getFieldValue, resetFields} = props; // 低、中、高 const difficultyList = [ {id: 1, name: "低"}, {id: 2, name: "中"}, {id: 3, name: "高"} ] - // 奖金 - const rewardList = [ - {id: 12000}, - {id: 11000}, - {id: 10000}, - {id: 9000}, - {id: 8000}, - {id: 7000}, - {id: 6000}, - {id: 0}, - ] + // 奖金数额 + const amountList = [12000, 11000, 10000, 9000, 8000, 7000, 6000] + const disabledProps = { + disabled: disabled, + className: disabled? "disabledInput":"" + } + // 选中的奖励方式 + const rewardId = getFieldValue(`settingRewardId${taskKey}`); + const rewardItem = rewardId && rewardList && rewardList.filter(item=>item.id === rewardId); + const rewardName = rewardItem && rewardItem[0] && rewardItem[0].value; return(
    @@ -34,67 +34,95 @@ function TaskApply(props) { `taskName${taskKey}`, [{ required: true, message: "请输入课题名称,长度限制32个字符" }, { max: 32, message: '超出限制长度32位字符,请重新编辑' }], - + )} {helper('课题链接', '', `taskUrl${taskKey}`, [{ required: true, message: "请输入课题链接" }, { max: 252, message: '超出限制长度252位字符,请重新编辑' }], - + )} {helper('课题难度', '', `taskDifficulty${taskKey}`, [{ required: true, message: "请选择课题难度" }], - {difficultyList && difficultyList.map(item=> {return })} )} - {helper('课题奖金', - '', - `taskReward${taskKey}`, - [{ required: true, message: "请选择课题奖金" }, - // {pattern: /^[1-9]+[0-9]*]*$/, message: "请输入正整数" }, - // { validator: (rule,val,callback) =>{ - // if(val>=6000 && val<=12000){ - // callback(); - // }else{ - // callback("区间为6000-12000元"); - // } - // }} - ], - - )} +
    + {helper('课题奖励', + '', + `settingRewardId${taskKey}`, + [{ required: true, message: "请选择课题奖励" }, + ], + { + resetFields([`settingRewardRemark${taskKey}`]); + }}> + {rewardList && rewardList.map(item=> {return {item.value}})} + + )} +
    + {/* + {getFieldDecorator(`settingRewardRemark${taskKey}`, { + initialValue: '1233', + rules: rewardName === rewardMoney ? [{ required: true, message: "请选择课题奖金" }] : [] + })(rewardName === rewardMoney ? : )} + */} + {rewardName &&
    + {helper(rewardName === rewardMoney ? "奖金数额": "奖励备注", + '', + `settingRewardRemark${taskKey}`, + rewardName === rewardMoney ? [{ required: true, message: "请选择课题奖金" }] : [], + rewardName === rewardMoney ? : + )} +
    } + {/* {helper(rewardName === rewardMoney ? "奖金数额": "奖励备注", + '', + `settingRewardRemark${taskKey}`, + rewardName === rewardMoney ? [{ required: true, message: "请选择课题奖金" }] : [], + rewardName === rewardMoney ? : + )} */} {helper('导师姓名', '', `tutorName${taskKey}`, [{ required: true, message: "请输入导师姓名" }, { max: 32, message: '超出限制长度32位字符,请重新编辑' }], - + )} {helper('导师手机号', '', `tutorPhone${taskKey}`, [{ required: true, message: "请输入导师手机号" }, { pattern: phonereg, message: "请输入正确的电话号码"},], - + )} {helper('导师邮箱', '', `tutorMail${taskKey}`, [{ required: true, message: "请输入导师邮箱地址" }, { pattern: emailreg, message: "请输入正确的邮箱地址"},], - + + )} + {helper('导师邮寄地址', + '', + `tutorAddress${taskKey}`, + [{ required: true, message: "请输入导师地址" }], + )}
    {helper('课题简介', '', `taskDesc${taskKey}`, [{ required: true, message: "请输入课题简介" }, { max: 200, message: '超出限制长度200位字符,请重新编辑' }], -