代码库二级页面标签加载优化
This commit is contained in:
parent
f6c5fd7550
commit
dcb597ea37
|
@ -1,17 +1,17 @@
|
||||||
import React,{ useEffect , useState } from 'react';
|
import React,{ useEffect , useState } from 'react';
|
||||||
import SubMenu from '../sub/SubMenu';
|
import SubMenu from '../sub/SubMenu';
|
||||||
import { Table , Tooltip } from 'antd';
|
import { Table , Tooltip , Spin } from 'antd';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { truncateCommitId } from '../../common/util';
|
import { truncateCommitId } from '../../common/util';
|
||||||
import './Index.scss';
|
import './Index.scss';
|
||||||
import Tree from '../img/tree.png'
|
import Tree from '../img/tree.png'
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import Loading from '../../../Loading';
|
|
||||||
|
|
||||||
function Tags(props) {
|
function Tags(props) {
|
||||||
|
|
||||||
const [ source , setSource ] = useState([]);
|
const [ source , setSource ] = useState([]);
|
||||||
|
const [ isSpin , setIsSpin ] = useState(true);
|
||||||
|
|
||||||
const { projectsId , owner } = props.match.params;
|
const { projectsId , owner } = props.match.params;
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ function Tags(props) {
|
||||||
axios.get(url).then((result) => {
|
axios.get(url).then((result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
setSource(result.data);
|
setSource(result.data);
|
||||||
|
setIsSpin(false);
|
||||||
}
|
}
|
||||||
}).catch(error => {})
|
}).catch(error => {})
|
||||||
}
|
}
|
||||||
|
@ -83,7 +84,6 @@ function Tags(props) {
|
||||||
render:(txt,item)=>{
|
render:(txt,item)=>{
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<a href={`${item.tarball_url}`} download className="btn-83">
|
<a href={`${item.tarball_url}`} download className="btn-83">
|
||||||
<i className="iconfont icon-xiazai-icon font-16 mr5"></i>TAR
|
<i className="iconfont icon-xiazai-icon font-16 mr5"></i>TAR
|
||||||
</a>
|
</a>
|
||||||
|
@ -98,7 +98,17 @@ function Tags(props) {
|
||||||
return(
|
return(
|
||||||
<div>
|
<div>
|
||||||
<SubMenu tab={"tags"} projectsId={projectsId} owner={owner}/>
|
<SubMenu tab={"tags"} projectsId={projectsId} owner={owner}/>
|
||||||
<Table className="tagTable" dataSource={source} columns={columns} pagination={false}></Table>
|
{
|
||||||
|
source && source.length > 0 ?
|
||||||
|
|
||||||
|
<Table
|
||||||
|
className="tagTable"
|
||||||
|
dataSource={source} columns={columns} pagination={false}></Table>
|
||||||
|
:
|
||||||
|
<div className="tagSpin" style={{minHeight:"300px"}}>
|
||||||
|
<Spin spinning={isSpin}/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,3 +33,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.tagSpin{
|
||||||
|
text-align: center;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
Loading…
Reference in New Issue