From a513442751fbc8f60a6f99741af5b7004de64ad5 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Mon, 8 Apr 2024 10:12:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86-v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Dataset/Index.jsx | 39 ++++++++++++++------ src/forge/Dataset/component/new.jsx | 10 ++--- src/forge/Dataset/component/uploadModal.jsx | 19 +++++++++- src/forge/Dataset/image/paperImg.png | Bin 0 -> 468 bytes src/forge/Dataset/index.scss | 15 +++++++- src/forge/Main/Detail.js | 1 + src/forge/Main/list.scss | 2 +- 7 files changed, 64 insertions(+), 22 deletions(-) create mode 100644 src/forge/Dataset/image/paperImg.png diff --git a/src/forge/Dataset/Index.jsx b/src/forge/Dataset/Index.jsx index 779f1633..de62c813 100644 --- a/src/forge/Dataset/Index.jsx +++ b/src/forge/Dataset/Index.jsx @@ -1,13 +1,15 @@ import React, { useState , useEffect } from 'react'; -import { Button , Table } from 'antd'; +import { Button , Table , Tooltip } from 'antd'; import { getImageUrl } from 'educoder'; +import paperImg from './image/paperImg.png'; import NewModal from './component/new'; import { Link } from 'react-router-dom'; import "./index.scss"; import axios from 'axios'; function Index(props){ - const { project , match } =props; + const { project , match , current_user , projectDetail , getProject } =props; + const permission = current_user && current_user.login ? (projectDetail && projectDetail.permission):""; const { owner ,projectsId } = match && match.params; const [ dataSource , setDataSource ] = useState([]); const [ empty , setEmpty ] = useState(project && (!project.has_dataset)); @@ -15,7 +17,8 @@ function Index(props){ const [ page , setPage ] = useState(1); const [ visible , setVisible ] = useState(false); const [ detail , setDetail ] = useState({}); - const pageSize = 20; + const pageSize = 10; + useEffect(()=>{ if(!empty){ Init(); @@ -51,7 +54,10 @@ function Index(props){ dataIndex:"description", key:2, ellipsis:true, - width:"30%" + width:"30%", + render:(value)=>{ + return {value} + } }, { title:"创建者", @@ -59,7 +65,7 @@ function Index(props){ key:3, width:"10%", render:(value,item)=>{ - return + return } }, { @@ -88,6 +94,7 @@ function Index(props){ function addFunc(){ setEmpty(false); setVisible(false); + getProject && getProject(); detail && detail.id && Init(); } return( @@ -98,14 +105,14 @@ function Index(props){ 数据集 : -
-

{detail.title}

-

{detail.description}

+
+

{detail.title}

{ detail.license_name ? 许可证 : {detail.license_name} :""}
+

{detail.description}

-
+ {(permission && permission!== "") ?
上传文件 -
+
:""} }
@@ -114,8 +121,8 @@ function Index(props){
暂无数据集 -

我们非常欢迎您创建并分享您的数据集,以便与其他用户共同促进开源社区的发展

- + { (permission && permission!== "") ?

我们非常欢迎您创建并分享您的数据集,以便与其他用户共同促进开源社区的发展

:"" } + { (permission && permission!== "") ? :""}
: setPage(p)}} /> } + { + detail.paper_content ? +
+

研究论文

+
{ detail.paper_content }
+
+ :"" + } ) } diff --git a/src/forge/Dataset/component/new.jsx b/src/forge/Dataset/component/new.jsx index a12c6a74..272b2384 100644 --- a/src/forge/Dataset/component/new.jsx +++ b/src/forge/Dataset/component/new.jsx @@ -94,7 +94,7 @@ function New(props){ onCancel={onCancel} > - + {getFieldDecorator('title', { rules: [ { @@ -103,7 +103,7 @@ function New(props){ } ], })( - , + , )} @@ -128,7 +128,7 @@ function New(props){ )} - + {getFieldDecorator('description', { rules: [ { @@ -136,12 +136,12 @@ function New(props){ message:"请输入描述内容" } ]})( -