From bbfa6fd1da4c0c84fefd3f22bf9686d4f8e7b083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Wed, 15 Feb 2023 10:29:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E6=94=AFissue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/tree/Index.jsx | 19 ++++++++++++++++--- src/modules/search/ItemList.jsx | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) 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}

}