forked from Gitlink/forgeplus-react
项目详情接口-根据接口使用对应的数据字段
This commit is contained in:
parent
a542ed3dcd
commit
13c58faad8
|
@ -2,7 +2,7 @@ import React , { useState , useEffect } from 'react';
|
||||||
import { Input , Spin , Menu } from 'antd';
|
import { Input , Spin , Menu } from 'antd';
|
||||||
import { getBranch , getTag } from '../GetData/getData';
|
import { getBranch , getTag } from '../GetData/getData';
|
||||||
|
|
||||||
function SelectOverlay({ changeBranch , tagflag , branchList , projectsId , owner , visible }) {
|
function SelectOverlay({ changeBranch , tagflag , projectsId , owner , visible }) {
|
||||||
const [ inputValue , setInputValue] = useState(undefined);
|
const [ inputValue , setInputValue] = useState(undefined);
|
||||||
const [ nav , setNav ] = useState(0);
|
const [ nav , setNav ] = useState(0);
|
||||||
const [ isSpin , setIsSpin ] = useState(true);
|
const [ isSpin , setIsSpin ] = useState(true);
|
||||||
|
@ -11,21 +11,13 @@ function SelectOverlay({ changeBranch , tagflag , branchList , projectsId , owne
|
||||||
const [ datas , setDatas ] = useState(undefined);
|
const [ datas , setDatas ] = useState(undefined);
|
||||||
const [ keys ,setKeys] = useState("branch");
|
const [ keys ,setKeys] = useState("branch");
|
||||||
|
|
||||||
// useEffect(()=>{
|
|
||||||
// if(visible){
|
|
||||||
// setKeys("branch");
|
|
||||||
// getBranchs(projectsId,owner);
|
|
||||||
// setIsSpin(true);
|
|
||||||
// }
|
|
||||||
// },[visible])
|
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(branchList){
|
if(visible){
|
||||||
setData(branchList);
|
setKeys("branch");
|
||||||
setDatas(branchList);
|
getBranchs(projectsId,owner);
|
||||||
setIsSpin(false);
|
setIsSpin(true);
|
||||||
}
|
}
|
||||||
},[branchList])
|
},[visible])
|
||||||
|
|
||||||
async function getBranchs(id,owner){
|
async function getBranchs(id,owner){
|
||||||
let result = await getBranch(id,owner);
|
let result = await getBranch(id,owner);
|
||||||
|
|
|
@ -407,14 +407,14 @@ function CoderDepot(props){
|
||||||
<Link to={`/${owner}/${projectsId}/branches`} className="iconBtn">
|
<Link to={`/${owner}/${projectsId}/branches`} className="iconBtn">
|
||||||
<i className="iconfont icon-master_icon font-16"></i>
|
<i className="iconfont icon-master_icon font-16"></i>
|
||||||
<span>分支</span>
|
<span>分支</span>
|
||||||
<span>{projectDetail && projectDetail.branches && projectDetail.branches.total_count}</span>
|
<span>{projectDetail && projectDetail.branches_count}</span>
|
||||||
</Link>
|
</Link>
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
<AlignCenter className="mr20">
|
<AlignCenter className="mr20">
|
||||||
<Link to={`/${owner}/${projectsId}/tags`} className="iconBtn">
|
<Link to={`/${owner}/${projectsId}/tags`} className="iconBtn">
|
||||||
<i className="iconfont icon-biaoqianicon font-16"></i>
|
<i className="iconfont icon-biaoqianicon font-16"></i>
|
||||||
<span>标签</span>
|
<span>标签</span>
|
||||||
<span>{projectDetail && projectDetail.tags && projectDetail.tags.total_count}</span>
|
<span>{projectDetail && projectDetail.tags_count}</span>
|
||||||
</Link>
|
</Link>
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
|
|
Loading…
Reference in New Issue