专区数据集

This commit is contained in:
caishi 2024-04-15 08:52:12 +08:00
parent a513442751
commit f6c81060ea
12 changed files with 329 additions and 2 deletions

BIN
.bashrc Normal file

Binary file not shown.

View File

@ -85,7 +85,7 @@ function Index(props){
key:6,
width:"10%",
render:(value,item)=>{
return <a href={value} className="color-blue">下载</a>
return <a href={value} className="color-blue" download={value}>下载</a>
}
},
]

View File

@ -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){
<Menu mode={"horizontal"} selectedKeys={[key]}>
{sectionHomepageShow && <Menu.Item key={"1"}><Link to={`/zone/${deptId}`}><img src={require(`../img/${temp}Menu1.png`)} alt="" width="29px"/>{sectionHomepageTitle}</Link></Menu.Item>}
{sectionProjectShow && <Menu.Item key={"2"}><Link to={`/zone/${deptId}/projects`}><img src={require(`../img/${temp}Menu2.png`)} alt="" width="34px"/>{sectionProjectTitle}</Link></Menu.Item>}
{sectionDataSetShow && <Menu.Item key={"9"}><Link to={`/zone/${deptId}/dataset`}><img src={require(`../img/${temp}Menu9.png`)} alt="" width="34px"/>{sectionDataSetTitle}</Link></Menu.Item>}
{sectionResourceShow && <Menu.Item key={"3"}><Link to={`/zone/${deptId}/source`}><img src={require(`../img/${temp}Menu3.png`)} alt="" width="33px"/>{sectionResourceTitle}</Link></Menu.Item>}
{sectionCmsShow && <Menu.Item key={"4"}><Link to={`/zone/${deptId}/news`}><img src={require(`../img/${temp}Menu4.png`)} alt="" width="32px"/>{sectionCmsTitle}</Link></Menu.Item>}
{/* <Menu.Item key={"5"}><img src={Menu5} alt="" width="27px"/>Sig小组</Menu.Item> */}

View File

@ -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 <Tooltip title={value}>{value}</Tooltip>
}
},
{
title:"创建者",
dataIndex:"creator",
key:3,
width:"10%",
render:(value,item)=>{
return <Link to={`/${value.login}`}><img src={getImageUrl(`/${value.image_url}`)} alt="" style={{borderRadius:"50%"}} width="32px" height="32px" /></Link>
}
},
{
title:"上传时间",
dataIndex:"created_on",
key:4,
width:"15%"
},
{
title:"大小",
dataIndex:"filesize",
key:5,
},
{
title:"操作",
dataIndex:"url",
key:6,
width:"15%",
render:(value,item)=>{
return <a href={value} className="primaryColor" download={value}>下载</a>
}
},
]
return(
<div style={{background:"#fff"}}>
<Spin spinning={spinning}>
<div className='boxmain fileslist'>
<Breadcrumb separator=">">
<Breadcrumb.Item><Link className="primaryColor" to={`/zone/${deptId}/dataset`}>数据集</Link></Breadcrumb.Item>
<Breadcrumb.Item>文件</Breadcrumb.Item>
</Breadcrumb>
<div className='mnistData'>
<React.Fragment>
<div style={{width:0,flex:1}} className="mr20">
<div className="df mb15" style={{alignItems:"center"}}><p className="font-16 weight500 task-hide">{detail && detail.title}</p>{detail && detail.license_name ? <span className="license ml20">许可证 : {detail.license_name}</span> :""}</div>
<p style={{wordBreak:"break-all"}}>{detail && detail.description}</p>
</div>
<a href={detail && detail.repository_url} className="operateButton">进入项目</a>
</React.Fragment>
</div>
<Table
className={`datasetTable`}
columns={columns}
dataSource={dataSource}
pagination={{total,pageSize,current:page,hideOnSinglePage:true,onChange:(p)=>setPage(p)}}
/>
{
detail && detail.paper_content ?
<div className="mt25">
<p className="mb15 df" style={{alignItems:'center'}}><img src={paperImg} width={24} className="mr10" alt="" /><span className="font-16">研究论文</span></p>
<div className={`mnistData`}>{detail && detail.paper_content}</div>
</div>
:""
}
</div>
</Spin>
</div>
)
}
export default Index;

View File

@ -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(
<div className='zone_source_box'>
<div className='source_h'>
<p className='in_title'>数据集</p>
<div style={{marginTop:"30px",textAlign:"center"}} className='titleButBox'>
<Search
placeholder="请输入数据集名称"
onSearch={onSourceSearch}
style={{width:'645px',borderColor:"#fff",boxShadow:"0px 0px 10px rgba(61, 85, 183, 0.1)"}}
size="large"
className="source_search_box"
allowClear
enterButton={ <span><i className="iconfont icon-sousuo5 font-15"/>搜索</span> }
/>
</div>
</div>
<div className='sources datasetList'>
{
data && data.length > 0 ?
data.map((item,key)=>{
return(
<li>
<Link to={`/zone/${deptId}/dataset/${item.id}`}>
<p className='titile task-hide'>{item.dataSetName}</p>
<p className='task-hide-2 desc'>{item.dataSetDescription}</p>
{/* <span className='time'><i className='iconfont icon-a-31shijian'/>2023-09-08 15:54:23</span> */}
<span className='time'><i className='iconfont icon-daimakuicon1 font-14 mr8'/>{item.repositoryName}</span>
</Link>
</li>
)
}):""
}
{
data && data.length === 0 ?<div style={{textAlign:"center",width:"100%"}}><Nodata _html="暂无数据"/></div>:""
}
</div>
</div>
)
}
export default Index;

View File

@ -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
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -89,6 +89,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);
@ -217,6 +225,18 @@ function Index(props){
<SourceDetail {...props} {...p} id={id} temp={ temp } data={data}/>
)}
></Route>
<Route
path="/zone/:deptId/dataset/:datasetId"
render={(p) => (
<DatasetFileList {...props} {...p} id={id} temp={ temp } role={role} sectionResourceTitle={data && data.sectionResourceTitle}/>
)}
></Route>
<Route
path="/zone/:deptId/dataset"
render={(p) => (
<DataSetList {...props} {...p} id={id} temp={ temp } role={role} sectionResourceTitle={data && data.sectionResourceTitle}/>
)}
></Route>
<Route
path="/zone/:deptId/source"
render={(p) => (

View File

@ -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,90 @@
}
}
}
// 数据集
.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;
}
.time{
font-size: 14px;
color: #5E6685;
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;
}
}
}