@@ -147,24 +165,54 @@ function Tags(props) {
className="tagTable"
dataSource={source} columns={columns} pagination={false}>
}
- {total > limit ? (
-
-
+ {total > limit && {setPage(e)}}
- >
+ showSizeChanger={true}
+ onShowSizeChange={(current, pageSize)=>{setPage(1);setLimit(pageSize);}}
+ showQuickJumper={true}
+ >}
+
+ {/* {total > limit ? (
+
+ {total > limit &&
{setPage(e)}}
+ showSizeChanger={true}
+ onShowSizeChange={(current, pageSize)=>{setPage(1);setLimit(pageSize);}}
+ showQuickJumper={true}
+ >}
) : (
""
- )}
+ )} */}
{
source && source.length === 0 &&
}
+
+ {
+ (isManager || isDeveloper) && (projectDetail && projectDetail.type!==2) &&
+
+ 合并请求
+ }
+
+ 下载
+
+ {txt === item.default_branch ?
:
}
+
+ )
+ }
+ }
+ ];
+
function getList() {
const url = `/${owner}/${projectsId}/branches_slice.json`;
Axios.get(url).then(result=>{
@@ -45,10 +175,109 @@ function Index(props) {
}).catch(error=>{setIsSpin(false);})
}
+ // 删除分支确认函数
+ function deleteLabel(){
+ Axios.delete(`/v1/${owner}/${projectsId}/branches/${visible.name}.json`).then(res=>{
+ if(res && res.data){
+ if(current>1 && (list && list.length===1)){
+ setCurrent(current-1);
+ }else{
+ setReload(Math.random());
+ }
+ setVisible(false);
+ !res.data.status && message.success('删除成功');
+ }
+ })
+ }
+
+ // 新建分支确认函数
+ function createBranch(){
+ setNewBranchError(undefined);
+ if(!newBranchName){
+ setNewBranchError("请输入新建分支名称");
+ }else{
+ Axios.post(`/v1/${owner}/${projectsId}/branches.json`, {
+ new_branch_name: newBranchName,
+ old_branch_name: newFormBranchName
+ }).then(res=>{
+ if(res && res.data){
+ // 重新请求仓库详情接口,更新分支总数信息
+ getDetail();
+ setReload(Math.random());
+ setAddBranch(false);
+ message.success('新建分支成功');
+ }
+ })
+ }
+ }
+
+ // 新建分支名检查格式
+ function checkNewBranchName(e) {
+ setNewBranchError(undefined);
+ const value = e.target.value;
+ if (value) {
+ const str = '^*/';
+ let reg = /\\/g;
+ if(reg.test(value)){
+ setNewBranchError('分支名不能包含下列任何字符:^ * \\ /');
+ }else{
+ for(var i=0;i