Merge branch 'gitlink_server' of https://gitlink.org.cn/Gitlink/forgeplus-react into gitlink_server

This commit is contained in:
谢思 2023-12-14 10:34:24 +08:00
commit a57bfa87ee
12 changed files with 1720 additions and 1446 deletions

2852
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@ import Attachments from "../../../../forge/Upload/attachment";
import UploadImg from "../../../../forge/Images/upload.png";
import './list.scss';
import '../../../../forge/Order/order.scss';
import { useState } from 'react';
import { useState,useEffect } from 'react';
import { Link } from 'react-router-dom';
import axios from 'axios';
@ -23,7 +23,7 @@ function EditComment(props){
const [attachmentClean, setAttachmentClean] = useState(true);
const [ save , setSave ] = useState(undefined);
useState(()=>{
useEffect(()=>{
setSave(props.defaultFileList);
},[props.defaultFileList])

View File

@ -62,9 +62,11 @@ function CoderDepot(props){
let branchName = props.match.params.branchName;
branchName = returnbar(branchName);
let pathname = props.history.location.pathname;
let search = props.history.location.search
const { platform , mirror_status , bannerList , projectDetail } = props ;
//distribution
const distribution = projectDetail && projectDetail.type ===0 && ( projectDetail.permission && projectDetail.permission !== "Reporter");
useEffect(()=>{
if(bannerList && bannerList.length>0){
let a = bannerList.filter(i=>i.menu_name === "pulls");
@ -138,6 +140,15 @@ function CoderDepot(props){
}
},[projectsId,owner,pathname,defaultBranch,mirror_status])
//
useEffect(()=>{
if (projectsId && owner && defaultBranch && mirror_status===0 && !search){
let b = turnbar(branchName) ;
let url = pathname.split(`/tree/${b}/`)[1];
getFileInfo(url,branchName);
}
},[search])
useEffect(()=>{
if(platform && mirror_status===0){
setReadOnly(props.history.location.search.indexOf('edit') !== -1);

View File

@ -54,7 +54,7 @@ function CoderDepotCatalogue({item , goToSubRoot , owner , projectsId , platform
</span>
<span title="init project">
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.commit && item.commit.sha}`)}`} title={item.commit && item.commit.message}>
{getEmoji(getMessage(item.commit && item.commit.message))}
{getEmoji(getMessage(item.commit && item.commit.message.split('\n')[0]))}
</Link>
</span>
<span title={item.commit && item.commit.created_at}>{item.commit && item.commit.time_from_now}</span>

View File

@ -145,7 +145,7 @@ class UserSubmitComponent extends Component {
let b = currentBranch || branch;
let src = `/${owner}/${projectsId}${(values.branchname ? `/tree/${turnbar(values.branchname)}` : (b ? `/tree/${turnbar(b)}`:""))}${detail.path ? `/${returnbar(detail.path)}` : ""}`;
this.props.history.push(src);
this.props.showNotification("文件修改成功!");
this.props.showNotification("文件修改成功! ");
}
})
.catch((error) => {

View File

@ -3,9 +3,10 @@ import { Link } from 'react-router-dom';
import { AlignCenter } from '../../Component/layout';
import { TagInfo } from '../../Utils/TagColor';
import { getImageUrl } from 'educoder';
import { truncateCommitId } from "../../common/util";
function Activity({list}) {
function typeForUrl(trend_type,project,id){
function typeForUrl(trend_type,project,id,commit_log){
const { owner , identifier } = project;
switch(trend_type){
case 'Issue':
@ -14,6 +15,9 @@ function Activity({list}) {
return `/${owner && owner.login}/${identifier}/releases`;
case 'PullRequest':
return `/${owner && owner.login}/${identifier}/pulls/${id}`;
case 'CommitLog':
const commit = commit_log && commit_log.commit_id;
return `/${owner && owner.login}/${identifier}/commits/${truncateCommitId(commit)}`;
default :
return '';
}
@ -32,7 +36,7 @@ function Activity({list}) {
{i.priority && TagInfo(`${i.priority}`,"")}
{i.issue_status && <span className="status">{i.issue_status}</span> }
</AlignCenter>
<p className="aDesc"><Link to={typeForUrl(i.trend_type,i.project,i.trend_id)}>{i.action_type}{i.name}</Link></p>
<p className="aDesc"><Link to={typeForUrl(i.trend_type,i.project,i.trend_id,i.commit_log)}>{i.action_type}{i.name}</Link></p>
</div>
</li>
)

View File

@ -294,4 +294,13 @@ export function hasFinalExam(data) {
method: 'get',
data
});
}
// 无奖金结果列表
export function getExamineInfoListFor0In(params) {
return fetch({
url: `/api/examineMaterial/getExamineInfoListFor0In2023`,
method: 'get',
params
});
}

View File

@ -85,14 +85,30 @@ export default (props) => {
</div>
<div className="pt6">掌握项目课题详细信息</div>
</Link>}
{/* 结项考核结果公示页 */}
{period === "finalExamine3" && <Link className="apply" to={`/glcc/2023/result`}>
<div>
<img src={img1} alt="" className="applyIcon" />
<span className="til">正式课题考核结果</span>
</div>
<div className="pt6">结项课题考核结果公示</div>
</Link>}
{/* 0元项目 */}
<Link to={`/glcc/freeproject`} className="apply project" >
{/* <Link to={`/glcc/freeproject`} className="apply project" >
<div>
<img src={apply1} alt="" className="applyIcon" />
<span className="hover-none"><span className="til">无奖金项目</span> </span>
</div>
<div className="pt6">欢迎广大学生踊跃参与</div>
</Link> */}
{/* 无奖金课题结果公示 */}
<Link to={`/glcc/${id}/free-result`} className="apply project" >
<div>
<img src={apply1} alt="" className="applyIcon" />
<span className="hover-none"><span className="til">无奖金课题结果</span> </span>
</div>
<div className="pt6">面向无奖金课题学员考核结果公示</div>
</Link>
{/* 学生报名6.24结束第一次报名6.29 1:00 - 6.30 24:00第二次报名 */}
@ -166,15 +182,6 @@ export default (props) => {
</div>
<div className="pt6">中期课题考核结果公示</div>
</Link>}
{/* 结项考核结果公示页 */}
{period === "finalExamine3" && <Link className="apply" to={`/glcc/2023/result`}>
<div>
<img src={img1} alt="" className="applyIcon" />
<span className="til">考核结果</span>
</div>
<div className="pt6">结项课题考核结果公示</div>
</Link>}
</div>}
{/* </div> */}
<div className="introduce">

BIN
src/glcc/img/freeBanner.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 KiB

View File

@ -52,6 +52,11 @@ const FreeProject = Loadable({
loader: () => import("./freeProject"),
loading: Loading,
});
// -
const FreeResult = Loadable({
loader: () => import("./interimReview/freeResult"),
loading: Loading,
});
//
const TaskDetail = Loadable({
loader: () => import("./project/taskDetail"),
@ -302,13 +307,19 @@ const Glcc = (propsF) => {
)}
></Route>
<Route
{/* <Route
path="/glcc/freeproject"
render={(props) => (
<FreeProject {...propsF} {...props}/>
)}
></Route> */}
{/* 无奖金课题结果公示 */}
<Route
path="/glcc/:id/free-result"
render={(props) => (
<FreeResult id={id} round={round} period={period} current_user={current_user} history={props.history}/>
)}
></Route>
{/* openmmlab列表 */}
<Route
path="/glcc/openmmlab"

View File

@ -0,0 +1,232 @@
import React, { useEffect, useState } from "react";
import { Input, Table, Tooltip, Checkbox } from "antd";
import { getExamineInfoListFor0In } from "../api";
import ProjectDetail from "../project/component/projectDetail";
import freeBanner from "../img/freeBanner.png";
import bgPng from "../img/bgPng.png";
import "./index.scss";
import "../checkResult/index.scss";
import "../project/taskList/index.scss";
import "../project/index.scss";
const { Search } = Input;
//
function FreeResult({ round, id, period }) {
//
const [keyword, setKeyword] = useState(undefined);
const [data, setData] = useState([]);
// table
const [current, setCurrent] = useState(1);
const [total, setTotal] = useState(0);
const [pageSize, setPageSize] = useState(20);
const [loading, setLoading] = useState(false);
const [expandedRowKeys, setExpandedRowKeys] = useState([]);
useEffect(() => {
setLoading(true);
setExpandedRowKeys([]);
const params = {
curPage: current,
keyword,
pageSize,
term: period === "mediumExamine3" ? 1 : 2,
round,
};
getExamineInfoListFor0In(params).then((response) => {
if (response && response.message === "success") {
response.data.rows.map((item, index)=>{
item.id = (current-1)*pageSize+index + 1;
})
setData(response.data.rows);
setTotal(response.data.total);
}
setLoading(false);
});
}, [keyword, current, pageSize]);
const columns = [
{
title: "序号",
dataIndex: "index",
align: "center",
className: "columnsResult",
width: "8%",
render: (text, item, index) => (
<span>{(current - 1) * pageSize + index + 1}</span>
),
},
{
title: "入选学生",
dataIndex: "studentName",
className: "columnsResult taskName",
width: "12%",
ellipsis: true,
},
{
title: "课题导师",
dataIndex: "tutorName",
className: "columnsResult",
width: "12%",
ellipsis: true,
},
{
title: "课题名称",
dataIndex: "taskName",
className: "columnsResult",
width: "22%",
ellipsis: true,
render: (text, item) => (
<Tooltip title={text} placement="topLeft">
<span
className="toolTipSpan link"
onClick={() => {
window.open(`/glcc/${id}/subjects/detail/${item.taskId}`);
}}
>
{text}
</span>
</Tooltip>
),
},
{
title: "项目名称",
dataIndex: "projectName",
className: "columnsResult",
ellipsis: true,
width: "16%",
render: (text) => (
<Tooltip title={text} placement="topLeft">
<span className="toolTipSpan">{text}</span>
</Tooltip>
),
},
{
title: "项目简介",
dataIndex: "introduce",
className: "columnsResult",
width: "16%",
ellipsis: true,
},
{
title: "考核结果",
dataIndex: "totalityEvaluation",
align: "center",
className: "columnsResult actionBox",
},
];
const customExpandIcon = (props) => {
if (props.expanded) {
return (
<a
className="toolTipSpan link"
style={{ marginRight: 8 }}
onClick={(e) => {
props.onExpand(props.record, e);
}}
>
<i className="iconfont icon-ketixiangqingicon mr5"></i>项目简介
<i className="iconfont icon-changyongtubiao-xianxingdaochu-zhuanqu- font-12 ml5 down mr10"></i>
</a>
);
} else {
return (
<a
className="toolTipSpan link"
style={{ marginRight: 8 }}
onClick={(e) => {
props.onExpand(props.record, e);
}}
>
<i className="iconfont icon-ketixiangqingicon mr5"></i>项目简介
<i className="iconfont icon-jiantou9 font-12 ml5 down mr10"></i>
</a>
);
}
};
const expandRow = (record) => {
return (
<ProjectDetail
detail={null}
projectId={record.projectIntro}
showTask={false}
/>
);
};
//
function onExpand(expanded, record) {
const keys = new Set(expandedRowKeys);
if (expanded) {
keys.add(record.id);
} else {
keys.delete(record.id);
}
setExpandedRowKeys(Array.from(keys));
}
// pagesize
function onShowSizeChange(current, pageSize) {
window.scrollTo(0, 0);
setCurrent(1);
setPageSize(pageSize);
}
//
function changePage(page, pageSize) {
window.scrollTo(0, 0);
setCurrent(page);
}
return (
<div className="interimBox taskList resultListBox">
<img className="bannerInterim" src={freeBanner} alt=""></img>
<div className="bgBox">
<div className="resultList">
<div className="goBackBox">
<a href={`/glcc/${id}`}>开源夏令营 / </a>无奖金课题考核结果公示
</div>
<div className="searchBox">
<Search
className="search"
placeholder="请输入学生姓名或课题名称进行搜索"
allowClear
enterButton
onSearch={(value) => {
setCurrent(1);
setKeyword(value);
}}
/>
<div style={{ width: 100 }}></div>
</div>
<Table
loading={loading}
columns={columns}
dataSource={data}
expandedRowRender={expandRow}
expandIconColumnIndex={5}
expandIconAsCell={false}
expandIcon={customExpandIcon}
rowKey={"id"}
expandedRowKeys={expandedRowKeys}
onExpand={onExpand}
pagination={{
current: current,
pageSize: pageSize,
total: total,
showSizeChanger: true,
onShowSizeChange: onShowSizeChange,
showQuickJumper: true,
onChange: changePage,
}}
className="resultListTable pb30"
/>
</div>
<img src={bgPng} alt="" className="bgPng3" />
<img src={bgPng} alt="" className="bgPng4" />
</div>
</div>
);
}
export default FreeResult;

View File

@ -45,7 +45,7 @@
cursor: pointer;
/* 行内样式 */
max-width: 100% !important;
height: auto !important;
/* height: auto !important; */
}
.markdown-body pre ol.linenums,.markdown-body pre ul.linenums{
padding-left: 0px;
@ -57,7 +57,7 @@
.markdown-body video{
/* 行内样式 */
max-width: 100% !important;
height: auto !important;
/* height: auto !important; */
}
ol,