diff --git a/src/forge/Main/tree/Index.jsx b/src/forge/Main/tree/Index.jsx index 475527963..4268934b9 100644 --- a/src/forge/Main/tree/Index.jsx +++ b/src/forge/Main/tree/Index.jsx @@ -21,6 +21,7 @@ function Index(props) { const [newBranchName, setNewBranchName] = useState(undefined); const [newFormBranchName, setNewFormBranchName] = useState(undefined); const [newBranchError, setNewBranchError] = useState(undefined); + const [branchList, setBranchList] = useState([]);//所有分支 // 通过分支名搜索分支 const [name, setName] = useState(undefined); // 分页 @@ -259,14 +260,26 @@ function Index(props) { setCurrent(page); } + // 新建分支按钮点击函数 + function addBranchBtn(){ + setAddBranch(true); + const url = `/v1/${owner}/${projectsId}/branches.json`; + Axios.get(url).then(result=>{ + if(result){ + const {branches} = result.data; + setBranchList(branches); + } + }).catch(error=>{console.log('error', error);}) + } + return(
- {setName(value)}} allowClear/> + {setCurrent(1);setName(value)}} allowClear/>
{isManager && 分支设置} - +
{newBranchError}
分支起点
diff --git a/src/modules/search/ItemList.jsx b/src/modules/search/ItemList.jsx index 79094d53a..799168fb5 100644 --- a/src/modules/search/ItemList.jsx +++ b/src/modules/search/ItemList.jsx @@ -18,7 +18,7 @@ export default (props) => { {item.type == 1 &&

{item.watchersCount} {item.praisesCount} - {item.forkedCount} + {item.forkedCount || 0}

}