Merge branch 'pre_develop_dev' of https://git.trustie.net/Gitlink/forgeplus-react into feature_notification_v2_noticeSettings

This commit is contained in:
谢思 2021-10-21 11:04:36 +08:00
commit 035296732a
2 changed files with 8 additions and 16 deletions

View File

@ -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);

View File

@ -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>