|
|
|
@ -6,6 +6,7 @@ import '../css/index.css';
|
|
|
|
|
import '../Branch/branch.css';
|
|
|
|
|
import './activity.css';
|
|
|
|
|
|
|
|
|
|
import ActivityItem from './ActivityItem';
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
const LIMIT = 15;
|
|
|
|
|
const ARRAY = [
|
|
|
|
@ -26,6 +27,8 @@ const ARRAY = [
|
|
|
|
|
name:'1个月'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
const dataformat="YYYY-MM-DD HH:mm";
|
|
|
|
|
|
|
|
|
|
class Activity extends Component{
|
|
|
|
|
constructor(props){
|
|
|
|
|
super(props);
|
|
|
|
@ -35,7 +38,8 @@ class Activity extends Component{
|
|
|
|
|
state:undefined,
|
|
|
|
|
page:1,
|
|
|
|
|
|
|
|
|
|
data:undefined
|
|
|
|
|
data:undefined,
|
|
|
|
|
project_trends:undefined
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
componentDidMount=()=>{
|
|
|
|
@ -53,7 +57,8 @@ class Activity extends Component{
|
|
|
|
|
}).then(result=>{
|
|
|
|
|
if(result){
|
|
|
|
|
this.setState({
|
|
|
|
|
data:result.data
|
|
|
|
|
data:result.data,
|
|
|
|
|
project_trends:result.data.project_trends
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}).catch(error=>{
|
|
|
|
@ -62,13 +67,13 @@ class Activity extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 切换周期
|
|
|
|
|
// changeTime=(e)=>{
|
|
|
|
|
// this.setState({
|
|
|
|
|
// time:e.key
|
|
|
|
|
// })
|
|
|
|
|
// const { type,status,page } = this.state;
|
|
|
|
|
// this.getInfo(e.key,type,status,page);
|
|
|
|
|
// }
|
|
|
|
|
changeTime=(e)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
time:e.key
|
|
|
|
|
})
|
|
|
|
|
const { type,status,page } = this.state;
|
|
|
|
|
this.getInfo(e.key,type,status,page);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 分页
|
|
|
|
|
ChangePage=(page)=>{
|
|
|
|
@ -79,7 +84,7 @@ class Activity extends Component{
|
|
|
|
|
this.getInfo(time,type,status,page);
|
|
|
|
|
}
|
|
|
|
|
render(){
|
|
|
|
|
const { time , data , page } = this.state;
|
|
|
|
|
const { time , data , page , project_trends } = this.state;
|
|
|
|
|
|
|
|
|
|
const menu = (
|
|
|
|
|
<Menu>
|
|
|
|
@ -94,6 +99,7 @@ class Activity extends Component{
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const second_per = (parseInt(data && data.close_issues_count)/parseInt(data && data.issues_count)*100)+'%';
|
|
|
|
|
|
|
|
|
|
const third_per = (parseInt(data && data.close_issues_count)/parseInt(data && data.issues_count)*100)+'%';
|
|
|
|
|
const fourth_per = (parseInt(data && data.open_issues_count)/parseInt(data && data.issues_count)*100)+'%';
|
|
|
|
@ -104,9 +110,9 @@ class Activity extends Component{
|
|
|
|
|
<div class="normalBox-title">概览</div>
|
|
|
|
|
<div className="orderInfo">
|
|
|
|
|
<div>
|
|
|
|
|
<div className="percentLine">
|
|
|
|
|
<p className="percent_purple" style={{width:'20%'}}></p>
|
|
|
|
|
<p className="percent_green" style={{width:'80%'}}></p>
|
|
|
|
|
<div className="percentLine prPercent">
|
|
|
|
|
<p className="percent_purple" style={{width:'100%'}}></p>
|
|
|
|
|
<p className="percent_green resetStyle" style={{width:`${second_per}`}}></p>
|
|
|
|
|
</div>
|
|
|
|
|
<span>{data && data.pr_count}合并请求</span>
|
|
|
|
|
</div>
|
|
|
|
@ -148,17 +154,13 @@ class Activity extends Component{
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="activity_list">
|
|
|
|
|
<div className="activity_item">
|
|
|
|
|
<p>
|
|
|
|
|
<span className="activity_type">ISSUE</span>
|
|
|
|
|
<span className="color-blue">title</span>
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
<img alt="" src=""/>
|
|
|
|
|
<span>caicai</span>
|
|
|
|
|
<span className="color-grey-9">创建于<span className="ml2 color-grey-6">{moment('2019-01-18 18:00','')}</span></span>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
{
|
|
|
|
|
project_trends && project_trends.map((item,key)=>{
|
|
|
|
|
return(
|
|
|
|
|
<ActivityItem item={item}></ActivityItem>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
{
|
|
|
|
|
data && data.project_trends_size > 0 && data.project_trends_size > LIMIT &&
|
|
|
|
|