新建分支填充默认分支

This commit is contained in:
谢思 2023-08-31 16:05:24 +08:00
parent f3a28a24d5
commit 71937ebd58
1 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,6 @@ function Index(props) {
const {branches, total_count} = result.data;
setTotal(total_count)
setList(branches);
setNewFormBranchName(branches[0].name);
}
setIsSpin(false);
}).catch(error=>{setIsSpin(false);})
@ -56,6 +55,7 @@ function Index(props) {
const { author, name} = projectDetail;
document.title = `所有分支-${author.name}/${name}`;
}
setNewFormBranchName(projectDetail && projectDetail.default_branch);
}, [projectDetail])
@ -387,7 +387,7 @@ function Index(props) {
<Input placeholder='请输入分支名称' className='createBranchInput' onChange={checkNewBranchName} maxLength={100}/>
<div className='newBranchError mt5'>{newBranchError}</div>
<div className='font-15 createBranchLabel mt20'>分支起点</div>
<Select showSearch style={{width: '340px'}} className='createBranchInput' placeholder="请选择分支起点" onChange={(value)=>{setNewFormBranchName(value)}} getPopupContainer={triggerNode => triggerNode.parentNode}>
<Select showSearch style={{width: '340px'}} className='createBranchInput' placeholder="请选择分支起点" value={newFormBranchName} onChange={(value)=>{setNewFormBranchName(value)}} getPopupContainer={triggerNode => triggerNode.parentNode}>
{branchList && branchList.map((item, index)=>{
return <Select.Option value={item.name} key={index}>{item.name}</Select.Option>
})}