From d76416bf1a2fdcb38ca2d8c20b32a66d2c23de3a Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 2 Apr 2021 11:57:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9E=84=E5=BB=BA=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Source/Index.jsx | 39 ++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/src/forge/Source/Index.jsx b/src/forge/Source/Index.jsx index 3ba406782..bcc27acda 100644 --- a/src/forge/Source/Index.jsx +++ b/src/forge/Source/Index.jsx @@ -4,6 +4,7 @@ import { Blueback , FlexAJ } from '../Component/layout'; import { Dropdown, Input , Menu , Pagination } from 'antd'; import { Link } from 'react-router-dom'; import UploadSource from './UploadSource'; +import axios from 'axios'; const { Search } = Input; const sort = [ @@ -12,6 +13,7 @@ const sort = [ "按引用排序" ] const limit = 15; +const https = 'https://testfiles.trustie.net'; function Index(props){ const [ sortValue , setSortValue ] = useState(0); const [ page , setPage ] = useState(1); @@ -19,10 +21,31 @@ function Index(props){ const [ search , setSearch ] = useState(undefined); const [ visible , setVisible ] = useState(false); + const repo_id = props.projectDetail && props.projectDetail.repo_id; + const owner = props.match.params.owner; useEffect(()=>{ + if(owner && repo_id){ + getData(); + } + },[repo_id,owner,search,sortValue,page]) - },[search,sort,page]) + function getData(){ + const url = https +`/api/project/achievement/`; + axios.get(url,{ + params:{ + projectId:repo_id, + curPage:page, + pageSize:limit, + name:search, + sort:sortValue+1, + } + }).then(result=>{ + if(result && result.data){ + + } + }).catch(error=>{}) + } // 搜索 function onSearch(value){ @@ -31,6 +54,7 @@ function Index(props){ // 切换排序方式 function changeSort(e,index){ + console.log(index); setSortValue(index); } @@ -40,7 +64,7 @@ function Index(props){ { sort && sort.map((item,key)=>{ return( - changeSort(e,key)} value={key} className={key === sortValue ?"color-blue":""}>{item} + changeSort(e,key)} value={key} className={key=== sortValue ?"color-blue":""}>{item} ) }) } @@ -55,12 +79,19 @@ function Index(props){ ) + // 上传资源确定 function onOk(){ } + + // 删除标签 + function removeTagFunc(){ + + } + return(
- setVisible(false)} onOk={onOk}/> + setVisible(false)} onOk={onOk} showNotification={props.showNotification}/>
资源库(18) @@ -98,7 +129,7 @@ function Index(props){

资源描述资源描述资源描述资源描述资源描述资源描述资源描述

- 软件版本 + 软件版本