Merge branch 'gitlink_server' of http://106.75.45.236:3000/Gitlink/forgeplus-react into feature_style

This commit is contained in:
何童崇 2022-06-15 09:14:33 +08:00
commit 38c12b02cb
6 changed files with 84 additions and 31 deletions

View File

@ -107,7 +107,7 @@ export default (props) => {
<div className="openMMlabBox">
<div className="logoTitle">
<img src={logo} alt="" className="logo"/>
<span className="title">活动特邀合作单位 openMMlab</span>
<span className="title">活动特邀合作单位 OpenMMlab</span>
<div></div>
<div></div>
</div>

View File

@ -14,12 +14,12 @@ const arithmeticArr = [
name: "MMPose算法演示",
describe: "MMPose 是 OpenMMLab 中的姿态估计算法库,目前已经支持了近 30 个算法和 300+ 预训练模型,涵盖了人体、人脸、人手、动物等多类目标的姿态估计。秉承 OpenMMLab 系列的结构化框架设计MMPose 很适合作为算法复现和创新的平台",
// source: 'https://www.gitlink.org.cn/preview/d2d62f65d08a22bcc257c5a24cf750fa_1654781749389.mp4',
source: 'https://www.gitlink.org.cn/api/attachments/387956.mp4',
source: 'https://www.gitlink.org.cn/api/attachments/388257.mp4',
type: 'mp4',
img: 'https://www.gitlink.org.cn/api/attachments/388006'
img: 'https://www.gitlink.org.cn/api/attachments/388256'
},
{
name: "MMMOCR算法演示",
name: "MMOCR算法演示",
describe: "MMOCR 作为 OpenMMLab 家族的一员,支持众多 OCR 相关的模型,涵盖了文本检测、文本识别以及关键信息提取等多个主要方向。通过在 MMOCR 中复现相关算法,你将可以了解到 OCR 领域的前沿知识,熟练掌握 MM 系列框架的整体流程,并积累深度学习相关的学术及工程经验",
source: 'https://www.gitlink.org.cn/api/attachments/388005',
type: 'img',
@ -51,7 +51,7 @@ const arithmeticArr = [
{
name: "MMFlow算法演示",
describe: "MMFlow是一款基于 PyTorch 和 MMCV 的光流估计开源工具箱,提供了多个 SOTA 光流估计算法,并支持光流领域主流学术数据集,以及光流可视化和评估方法",
source: 'https://www.gitlink.org.cn/api/attachments/387954',
source: 'https://www.gitlink.org.cn/api/attachments/388258',
type: 'img',
},
{

View File

@ -25,7 +25,7 @@ function SliderLeft({list,history}) {
// pathname:'/glcc/projects',
// state:{projectName:projectName.replace(/ /g,'-')}
// })
window.open(`/glcc/projects?projectName=${projectName}`);
window.open(`/glcc/projects?projectName=${projectName.replace(/ /g,'')}`);
}
return (

View File

@ -39,6 +39,12 @@ function Project(propsF) {
</div>
<Spin spinning={false}>
<Switch {...propsF}>
<Route
path="/glcc/projects/:gitlinkLastUrl"
render={(props) => (
<ProjectList {...propsF} {...props}/>
)}
></Route>
<Route
path="/glcc/projects"
render={(props) => (

View File

@ -33,6 +33,7 @@
.listBox{
background-image:linear-gradient(180deg,#ebf2ff 0%,#ebf2ff 43.09%,#f3f4f8 100%);
position: relative;
// min-height: 1200px;
.list{
width: 1200px;
margin: 0 auto;

View File

@ -1,4 +1,4 @@
import React , { useEffect , useState } from 'react';
import React, { useEffect, useState } from 'react';
import { Input, Popover, Spin } from 'antd';
import { main_site_url } from '../../fetch';
import './index.scss';
@ -6,48 +6,94 @@ import { projectList } from '../../api';
import ProjectDetail from '../component/projectDetail';
import bgPng from "../../img/bgPng.png";
import logo from "../../img/logo.png";
const {Search} = Input;
const { Search } = Input;
//
function ProjectList({applyTaskId, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd, location,history}) {
let openmmlab =location.search&&location.search.split('=')[1];
function ProjectList({ applyTaskId, current_user, showLoginDialog, isStudentApplyDate, studentApplyEnd, location, history, match }) {
let gitlinkLastUrl = match.params.gitlinkLastUrl && match.params.gitlinkLastUrl.replace(/\./g, '');
let openmmlab = location.search && location.search.split('=')[1];
//
const [keyword, setKeyword] = useState(openmmlab?'openmmlab':undefined);
const [keyword, setKeyword] = useState(openmmlab ? 'openmmlab' : undefined);
const [data, setData] = useState([]);
const [loading, setLoading] = useState(false);
useEffect(()=>{
useEffect(() => {
setLoading(true);
const params = {
curPage: 1,
keyword,
pageSize: 10000
}
projectList(params).then(response=>{
if(response && response.message === "success"){
setData(response.data.rows);
openmmlab&&setTimeout(()=>{
let openProject=document.querySelector(`.${openmmlab}`);
openProject.click();
let height=document.documentElement.clientWidth/1920*500+71+70+100+openProject.offsetTop;
window.scrollTo(0, height);
},100)
projectList(params).then(response => {
if (response && response.message === "success") {
let dataArr = response.data.rows;
dataArr.forEach(i => {
let urlArr = i.gitlinkUrl.split('/');
i.gitlinkLastUrl = urlArr.pop() || urlArr.pop();
i.gitlinkLastUrl = i.gitlinkLastUrl.replace(/\./g, '');
});
if (gitlinkLastUrl) {
let thisProjectArr = dataArr.filter(item => { return item.gitlinkLastUrl == gitlinkLastUrl })
setData(thisProjectArr);
setTimeout(() => {
let openProject = document.querySelector(`.${gitlinkLastUrl}`);
if (openProject) {
openProject.click();
let height = document.documentElement.clientWidth / 1920 * 500 + 71 + 70 + openProject.offsetTop;
if (thisProjectArr.length) {
document.querySelector('#taskList').style.height = (468 + thisProjectArr[0].registrationTaskList.length * 330 + 'px');
}
window.scrollTo(0, height);
}
}, 100)
} else {
setData(response.data.rows);
}
openmmlab && setTimeout(() => {
let openProject = document.querySelector(`.${openmmlab}`);
if(openProject){
openProject.click();
let height = document.documentElement.clientWidth / 1920 * 500 + 71 + 70 + 100 + openProject.offsetTop;
window.scrollTo(0, height);
}
}, 100)
}
setLoading(false);
})
},[keyword])
}, [keyword])
return(
<div className="taskList listBox">
function changeVisible(visible, item) {
if (visible) {
let height = document.documentElement.clientWidth / 1920 * 500 + 70 + document.querySelector(`.${item.gitlinkLastUrl}`).offsetTop + item.registrationTaskList.length*320;
document.querySelector('#taskList').style.height = height + 'px';
}else{
document.querySelector('#taskList').style.height = 'auto';
}
}
return (
<div id="taskList" className="taskList listBox">
<div className="list">
<div className='search'><Search placeholder='请输入项目名称进行搜索' allowClear enterButton onSearch={(value)=>{setKeyword(value)}}/></div>
{!gitlinkLastUrl && <div className='search'><Search placeholder='请输入项目名称进行搜索' allowClear enterButton onSearch={(value) => { setKeyword(value) }} /></div>}
<Spin spinning={loading}>
<div className='projectListBox'>
{data && data.map((item, index)=>{
return <Popover key={index} placement= {(index+1)%3 === 0 ? 'bottomRight' : (index+1)%3%2 === 0 ? 'bottom' : 'bottomLeft'} content={<ProjectDetail detail={item} applyTaskId={applyTaskId} current_user={current_user} showLoginDialog={showLoginDialog} isStudentApplyDate={isStudentApplyDate} studentApplyEnd={studentApplyEnd}/>} trigger='click' overlayClassName='projectItemPopover' autoAdjustOverflow={false}>
<div className={`projectItem ${(index+1)%3 === 0 || (index+1)%3%2 === 0 ? '' : 'firstBox'} ${item.projectName.replace(/ /g,'-')}`}>
{data && data.map((item, index) => {
return <Popover
onVisibleChange={(visible) => { changeVisible(visible, item) }}
key={index}
placement={(index + 1) % 3 === 0 ? 'bottomRight' : (index + 1) % 3 % 2 === 0 ? 'bottom' : 'bottomLeft'}
content={<ProjectDetail detail={item} applyTaskId={applyTaskId} current_user={current_user}
showLoginDialog={showLoginDialog}
isStudentApplyDate={isStudentApplyDate}
studentApplyEnd={studentApplyEnd}
/>}
trigger='click'
overlayClassName='projectItemPopover'
autoAdjustOverflow={false}
>
<div className={`projectItem ${(index + 1) % 3 === 0 || (index + 1) % 3 % 2 === 0 ? '' : 'firstBox'} ${item.projectName.replace(/ /g, '')} ${item.gitlinkLastUrl.replace(/\./g, '')}`}>
<div className="border"></div>
<div className="projectLogo"><img src={item.projectLogoId ? `${main_site_url}/api/attachments/${item.projectLogoId}` : logo} alt=''/></div>
<div className="projectLogo"><img src={item.projectLogoId ? `${main_site_url}/api/attachments/${item.projectLogoId}` : logo} alt='' /></div>
<div className="title">{item.projectName}</div>
<div className="intro">{item.projectIntro}</div>
</div>
@ -56,8 +102,8 @@ function ProjectList({applyTaskId, current_user, showLoginDialog, isStudentApply
</div>
</Spin>
</div>
<img src={bgPng} alt='' className='bgPng3'/>
<img src={bgPng} alt='' className='bgPng4'/>
<img src={bgPng} alt='' className='bgPng3' />
<img src={bgPng} alt='' className='bgPng4' />
</div>
)
}