Merge pull request 'issue上线' (#178) from caishi/forgeplus-react:pre_develop_dev into pre_develop_dev

This commit is contained in:
jasder 2021-10-15 15:26:44 +08:00
commit 4b9cc26d9c
5 changed files with 48 additions and 19 deletions

View File

@ -40,6 +40,11 @@ class Activity extends Component{
type:undefined,
state:undefined,
page:1,
pr_count:undefined,
new_pr_count:undefined,
close_issues_count:undefined,
open_issues_count:undefined,
pr_all_count:undefined,issues_count:undefined,
data:undefined,
project_trends:undefined,
@ -67,7 +72,13 @@ class Activity extends Component{
this.setState({
data:result.data,
project_trends:result.data.project_trends,
isSpin:false
isSpin:false,
pr_count:result.data.pr_count,
new_pr_count:result.data.new_pr_count,
close_issues_count:result.data.close_issues_count,
open_issues_count:result.data.open_issues_count,
pr_all_count:result.data.pr_all_count,
issues_count:result.data.issues_count,
})
window.scrollTo(0,0);
}
@ -113,12 +124,14 @@ class Activity extends Component{
</Menu>
)
render(){
const { time , data , page , project_trends , isSpin } = this.state;
const { time , data , page , project_trends , isSpin , pr_count , new_pr_count , close_issues_count , open_issues_count , pr_all_count ,issues_count } = this.state;
let name = time ? ARRAY.filter(item=>item.id === parseInt(time)) :[{name:"全部"}];
const first_per = data && (parseInt(data.pr_count)/parseInt(data.pr_count+data.new_pr_count)*100).toFixed(2)+'%';
const second_per =data && (parseInt(data.new_pr_count)/parseInt(data.pr_count+data.new_pr_count)*100).toFixed(2)+'%';
const third_per =data && (parseInt(data.close_issues_count)/parseInt(data.issues_count)*100).toFixed(2)+'%';
const fourth_per =data && (parseInt(data.open_issues_count)/parseInt(data.issues_count)*100).toFixed(2)+'%';
const first_per = pr_all_count > 0 ? `${parseFloat(pr_count/pr_all_count).toFixed(2)*100}%` :"50%";
const second_per =pr_all_count > 0 ? `${parseFloat(new_pr_count/pr_all_count).toFixed(2)*100}%` :"50%";
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%";
return(
<div className="main">
@ -143,19 +156,19 @@ class Activity extends Component{
<ul className="percentBox">
<li>
<span className="purple">{data && data.pr_count}</span>
<span className="change" onClick={()=>this.changeTrends("PullRequest","close")}>已处理的合并请求</span>
<span className="change" onClick={()=>this.changeTrends("PullRequest","delay")}>已处理的合并请求</span>
</li>
<li>
<span className="green">{data && data.new_pr_count}</span>
<span className="change" onClick={()=>this.changeTrends("PullRequest","create")}>未处理的合并请求</span>
<span className="change" onClick={()=>this.changeTrends("PullRequest","not_delay")}>未处理的合并请求</span>
</li>
<li>
<span className="red">{data && data.close_issues_count}</span>
<span className="change" onClick={()=>this.changeTrends("Issue","close")}>已关闭的易修</span>
<span className="change" onClick={()=>this.changeTrends("Issue","delay")}>已关闭的易修</span>
</li>
<li>
<span className="green">{data && data.open_issues_count}</span>
<span className="change" onClick={()=>this.changeTrends("Issue","create")}>未处理的易修</span>
<span className="change" onClick={()=>this.changeTrends("Issue","not_delay")}>未处理的易修</span>
</li>
</ul>
</div>

View File

@ -480,7 +480,7 @@
}
}
.ant-anchor-wrapper{
padding-left: 2px;
padding-left: 2px!important;
.ant-anchor-ink::before{
background-color: #fff;
}
@ -490,8 +490,8 @@
margin:0px auto;
}
.griditemAnchor{
margin-left: 0px;
padding: 0px;
margin-left: 0px!important;
padding: 0px!important;
border-bottom: 1px solid #ddd;
.ant-anchor{
display: flex;

View File

@ -285,12 +285,16 @@ class Index extends Component {
if(value.indexOf("/") > -1){
let arr = value.split("/");
let first = arr[arr.length-1];
if(first.indexOf(".git") > -1){
if(first.indexOf(".") > -1){
let second = first.split('.')[0];
if(!second)return;
this.props.form.setFieldsValue({
repository_name:second
})
}else{
this.props.form.setFieldsValue({
repository_name:first
})
}
}
}
@ -351,7 +355,7 @@ class Index extends Component {
required: true, message: '请填写镜像版本库地址'
}],
})(
<Input placeholder="请输入需要导入到本项目的仓库地址" onChange={this.ChangeAddr} />
<Input placeholder="请输入需要导入到本项目的仓库地址" onBlur={this.ChangeAddr} />
)}
</Form.Item>
<p className="formTip color-orange">示例https://github.com/facebook/reack.git</p>

View File

@ -1,5 +1,7 @@
import React, { Component } from "react";
import Editor from "react-monaco-editor";
// import {UnControlled as CodeMirror} from 'react-codemirror2'
import UserSubmitComponent from "./UserSubmitComponent";
import "./index.css";
@ -103,6 +105,17 @@ class m_editor extends Component {
editorWillMount={this.editorWillMount}
editorDidMount={handleEditorMount}
/>
{/* <CodeMirror
value={editorValue}
options={{
theme: 'monokai',
mode: 'JavaScript',
extraKeys: {"Ctrl": "autocomplete"},//ctrl可以弹出提示
styleActiveLine: true,
lineNumbers: true,
readOnly:true
}}
/> */}
</div>
{!readOnly && (
<div className="editorBorderSubmitBox" style={{marginTop:"20px",padding:"20px"}}>

View File

@ -157,9 +157,6 @@ class Setting extends Component {
...values,
}).then((result) => {
if (result) {
this.setState({
loading:false
})
this.props.showNotification(`仓库信息修改成功!`);
if(values.project_identifier !== projectsId){
this.props.history.push(`/${owner}/${values.project_identifier}/settings`);
@ -168,8 +165,10 @@ class Setting extends Component {
getDetail && getDetail();
}
}
this.setState({
loading:false
})
}).catch((error) => {
console.log(error);
this.setState({
loading:false
})