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/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..89510cd03 --- /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/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 c68756bd3..2d9b99395 100644 --- a/src/forge/Information/index.jsx +++ b/src/forge/Information/index.jsx @@ -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){ )} > + ( + + )} + > + ( + + )} + > ( diff --git a/src/forge/Information/index.scss b/src/forge/Information/index.scss index 6681aab39..3cb622392 100644 --- a/src/forge/Information/index.scss +++ b/src/forge/Information/index.scss @@ -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; + } + } +}