动态-新增内容显示
This commit is contained in:
parent
2731d54fd1
commit
8f75ed4637
|
|
@ -1,5 +1,6 @@
|
|||
import React , { Component } from 'react';
|
||||
import { Dropdown , Menu , Icon , Pagination , Spin } from 'antd';
|
||||
import { Dropdown , Menu , Icon , Pagination , Spin , Tooltip } from 'antd';
|
||||
import { getImageUrl } from 'educoder';
|
||||
import '../css/index.scss';
|
||||
import '../Branch/branch.scss';
|
||||
import './activity.css';
|
||||
|
|
@ -49,6 +50,8 @@ class Activity extends Component{
|
|||
data:undefined,
|
||||
project_trends:undefined,
|
||||
|
||||
codeStatus:undefined,
|
||||
|
||||
isSpin:false
|
||||
}
|
||||
}
|
||||
|
|
@ -59,6 +62,19 @@ class Activity extends Component{
|
|||
isSpin:true
|
||||
})
|
||||
this.getInfo(time,type,status,page);
|
||||
this.getCodeInfo();
|
||||
}
|
||||
|
||||
getCodeInfo(){
|
||||
const { projectsId , owner } = this.props.match.params;
|
||||
const url = `/v1/${owner}/${projectsId}/code_stats.json`;
|
||||
axios.get(url).then(result=>{
|
||||
if(result){
|
||||
this.setState({
|
||||
codeStatus:result.data
|
||||
})
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
componentDidUpdate(){
|
||||
|
|
@ -140,7 +156,7 @@ class Activity extends Component{
|
|||
render(){
|
||||
const { time , data , page , project_trends , isSpin ,
|
||||
pr_count , new_pr_count , close_issues_count , open_issues_count , pr_all_count ,issues_count,
|
||||
type,status } = this.state;
|
||||
type,status , codeStatus } = this.state;
|
||||
let name = time ? ARRAY.filter(item=>item.id === parseInt(time)) :[{name:"全部"}];
|
||||
|
||||
const first_per = pr_all_count > 0 ? `${parseFloat(pr_count/pr_all_count).toFixed(2)*100}%` :"50%";
|
||||
|
|
@ -148,6 +164,7 @@ class Activity extends Component{
|
|||
const third_per =issues_count > 0 ?`${parseFloat(close_issues_count/issues_count).toFixed(2)*100}%` :"50%";
|
||||
const fourth_per =issues_count > 0 ?`${parseFloat(open_issues_count/issues_count).toFixed(2)*100}%` :"50%";
|
||||
|
||||
const {projectDetail} = this.props;
|
||||
return(
|
||||
<div className="main mt20">
|
||||
|
||||
|
|
@ -187,6 +204,33 @@ class Activity extends Component{
|
|||
<span className={type==="Issue"&& status==="not_delay" ?`change active`:"change"} onClick={()=>this.changeTrends("Issue","not_delay")}>未处理的疑修</span>
|
||||
</li>
|
||||
</ul>
|
||||
{
|
||||
codeStatus &&
|
||||
<div className="prMsg">
|
||||
<div>排除合并,
|
||||
<span className="fontbold">{codeStatus.author_count} 作者</span> 已经推送 <span className="fontbold">{codeStatus.commit_count} 提交</span> 到
|
||||
{codeStatus.commit_count_in_all_branches && codeStatus.commit_count_in_all_branches>0?<span> {projectDetail && projectDetail.default_branch} 和 <span>{codeStatus.commit_count_in_all_branches} 提交</span> 到所有分支</span>:""}。 在 {projectDetail && projectDetail.default_branch} 上,
|
||||
{codeStatus.change_files && codeStatus.change_files >0 ? <span><span className="fontbold">{codeStatus.change_files} 文件</span> 已经改变 而且</span>:""}
|
||||
{codeStatus.additions && codeStatus.additions >0 ?<span><span className="fontbold greencount">新增 {codeStatus.additions} 行</span></span>:""}
|
||||
{(codeStatus.additions && codeStatus.additions >0) &&(codeStatus.deletions && codeStatus.deletions >0) ?<span>和</span>:""}
|
||||
{codeStatus.deletions && codeStatus.deletions >0 ?<span><span className="fontbold redcount">删除 {codeStatus.deletions} 行</span></span>:""}.</div>
|
||||
{
|
||||
codeStatus.authors && codeStatus.authors.length > 0 &&
|
||||
<ul className="prAuthor">
|
||||
{
|
||||
codeStatus.authors.map((i,v)=>{
|
||||
return(
|
||||
<a href={`/${i.author && i.author.login}`}>
|
||||
<img src={getImageUrl(i.author && i.author.image_url)} width="38px" alt=""/>
|
||||
<Tooltip title={i.author && i.author.name} placement="bottom"><span>{i.author && i.author.name}</span></Tooltip>
|
||||
</a>
|
||||
)
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div className="df trendsTop mt20">
|
||||
<div className="branchDropdown f-wrap-alignCenter">
|
||||
|
|
|
|||
|
|
@ -60,6 +60,48 @@
|
|||
.percentBox > li:last-child{
|
||||
border-right: none;
|
||||
}
|
||||
.prMsg{
|
||||
padding:0px 20px;
|
||||
border-top: 1px solid #f4f4f4;
|
||||
}
|
||||
.prMsg > div{
|
||||
padding:20px 20px 20px 0px;
|
||||
line-height: 22px;
|
||||
border-right:1px solid #f4f4f4;
|
||||
width: 50%;
|
||||
}
|
||||
.prMsg > div span.fontbold{
|
||||
font-weight: 500;
|
||||
}
|
||||
.prMsg > div span.fontbold.greencount{
|
||||
color: green;
|
||||
}
|
||||
.prMsg > div span.fontbold.redcount{
|
||||
color: red;
|
||||
}
|
||||
.prAuthor{
|
||||
padding-bottom: 20px;
|
||||
display: flex;
|
||||
border-right:1px solid #f4f4f4;
|
||||
width: 50%;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.prAuthor a{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 78px;
|
||||
}
|
||||
.prAuthor a img{
|
||||
border-radius: 50%;
|
||||
}
|
||||
.prAuthor a span{
|
||||
display: block;
|
||||
max-width: 78px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.activity_list .activity_item{
|
||||
border-bottom: 1px solid #f4f4f4;
|
||||
padding:15px 0px;
|
||||
|
|
|
|||
|
|
@ -260,9 +260,8 @@ export default Form.create()(
|
|||
<div className="infosTip">
|
||||
<p className="font-16 mb14 weight">附件大小说明</p>
|
||||
<p>
|
||||
单个附件不能超过 100M(GVP 项目200M),每个仓库总附件不可超过
|
||||
1G(推荐项目不可超过 5G;GVP 项目不可超过
|
||||
20G)。附件总容量统计包括仓库附件和发行版附件。
|
||||
单个附件不能超过 100M,每个仓库总附件不可超过
|
||||
1G。附件总容量统计包括仓库附件和发行版附件。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue