Merge remote-tracking branch 'upstream/gitlink_server' into gitlink_server

This commit is contained in:
黄心宇 2023-11-28 09:08:00 +08:00
commit c026e13cdc
9 changed files with 3312 additions and 15 deletions

3003
src/common/util/emoji.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,7 @@ import marked, { getTocContent, cleanToc, getMathExpressions, resetMathExpressio
import 'code-prettify';
import dompurify from 'dompurify';
import { getEmoji } from '../forge/Main/emoji';
import { emojiList } from '../common/util/emoji';
import axios from 'axios';
import imgError from '../images/img-error.png'
@ -69,6 +70,25 @@ export default ({
rs = rs.replace(matchStr[i],getEmoji(matchStr[i]));
}
}
if(rs){
for(let i = 0;i<emojiList.length;i++){
if(rs.indexOf(emojiList[i].code)>=0){
const reg = '/\\'+emojiList[i].code+'/g'
switch(emojiList[i].index){
case 1:
rs = rs.replace(eval(reg), `<img style="width:24px;" src="https://testforum.trustie.net/editormd/emoji/${emojiList[i].name}.png"/>`)
case 2:
rs = rs.replace(eval(reg), `<img style="width:24px;" src="https://twemoji.maxcdn.com/36x36/${emojiList[i].name}.png"/>`)
case 3:
rs = rs.replace(eval(reg), `<i class="fa fa-emoji fa-${emojiList[i].name}"></i>`)
case 4:
rs = rs.replace(eval(reg), `<i class="${emojiList[i].name}"></i>`)
}
}
}
}
if(owner && projectsId && issues && issues.length>0){
for(var x=0;x<issues.length;x++){
let item = issues[x];

View File

@ -851,4 +851,19 @@
}
}
}
}
.editormd-emoji-dialog {
.editormd-dialog-mask {
display: none !important;
}
.editormd-tab-box {
.editormd-grid-table {
.editormd-grid-table-row {
.selected {
background-color: #708cff;
}
}
}
}
}

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

@ -9,8 +9,8 @@ import 'codemirror/lib/codemirror.css';
import './css/newquestion.css';
const $ = window.$
const mdIcons = ["bold", "italic", "del", "|", "list-ul", "list-ol", "|", "code", "code-block", "link", "|", "image", "table", '|', "line-break", "watch", "clear", "fullscreen"];
const mdIconsHasLatex = ["bold", "italic", "del", "|", "list-ul", "list-ol", "|", "code", "code-block", "link", "|", "inline-latex", "latex", '|', "image", "table", '|', "line-break", "watch", "clear", "fullscreen"];
const mdIcons = ["bold", "italic", "del", "|", "list-ul", "list-ol", "|", "code", "code-block", "link", "|", "image", "table", '|', "line-break", "watch", "clear", "emoji", "fullscreen"];
const mdIconsHasLatex = ["bold", "italic", "del", "|", "list-ul", "list-ol", "|", "code", "code-block", "link", "|", "inline-latex", "latex", '|', "image", "table", '|', "line-break", "watch", "clear","emoji", "fullscreen"];
const NULL_CH = '▁';
@ -339,7 +339,7 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
syncScrolling: "single",
tex: true,
tocm: true,
emoji: !!emoji,
emoji: true,
taskList: true,
codeFold: true,
searchReplace: true,