forked from Gitlink/forgeplus-react-v2
issue修改
This commit is contained in:
commit
edc4bb4c40
|
|
@ -259,6 +259,7 @@ class CoderRootDirectory extends Component{
|
||||||
}
|
}
|
||||||
|
|
||||||
const urlRoot = filePath && filePath.length > 0 ? `/${filePath[filePath.length - 1].path}` : "";
|
const urlRoot = filePath && filePath.length > 0 ? `/${filePath[filePath.length - 1].path}` : "";
|
||||||
|
const { projectDetail } = this.props;
|
||||||
return(
|
return(
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{
|
{
|
||||||
|
|
@ -274,7 +275,7 @@ class CoderRootDirectory extends Component{
|
||||||
{
|
{
|
||||||
filePath && filePath.length > 0 &&
|
filePath && filePath.length > 0 &&
|
||||||
<span className="ml20 font-16">
|
<span className="ml20 font-16">
|
||||||
<a onClick={()=>this.getProjectRoot(branch)} className="color-blue">{projectsId}</a>
|
<a onClick={()=>this.getProjectRoot(branch)} className="color-blue">{ projectDetail && projectDetail.identifier }</a>
|
||||||
{
|
{
|
||||||
filePath.map((item,key)=>{
|
filePath.map((item,key)=>{
|
||||||
return(
|
return(
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,8 @@ class CoderRootFileDetail extends Component{
|
||||||
lineNumbers: true,
|
lineNumbers: true,
|
||||||
mode: 'javascript',
|
mode: 'javascript',
|
||||||
readOnly:readOnly?'nocursor':false,
|
readOnly:readOnly?'nocursor':false,
|
||||||
autofocus:readOnly?false:true
|
autofocus:readOnly?false:true,
|
||||||
|
styleActiveLine:true
|
||||||
};
|
};
|
||||||
return(
|
return(
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
|
|
@ -457,7 +457,7 @@ class Detail extends Component{
|
||||||
|
|
||||||
<Route path="/projects/:projectsId/merge/:mergeId/MergeSubmit"
|
<Route path="/projects/:projectsId/merge/:mergeId/MergeSubmit"
|
||||||
render={
|
render={
|
||||||
(props) => (<MergeSubmit {...this.props} {...props} {...this.state}/>)
|
(props) => (<MessageCount {...this.props} {...props} {...this.state}/>)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:projectsId/version/new"
|
<Route path="/projects/:projectsId/version/new"
|
||||||
|
|
|
||||||
|
|
@ -564,5 +564,6 @@ border: 1px solid #2185d0;
|
||||||
background-color: #f7f7f7;
|
background-color: #f7f7f7;
|
||||||
border: 1px solid #e4e4e4;
|
border: 1px solid #e4e4e4;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
height: auto;
|
||||||
}
|
}
|
||||||
.text-center{text-align: center;}
|
.text-center{text-align: center;}
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,11 @@
|
||||||
import React , {Component} from 'react';
|
import React , {Component} from 'react';
|
||||||
import {Link} from 'react-router-dom';
|
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import Nav from '../Order/Nav';
|
|
||||||
import UploadComponent from '../Upload/Index';
|
|
||||||
|
|
||||||
import{ Modal,Col,Form,Input,Tooltip,Popconfirm,Table} from 'antd'
|
import{ Form , Table , Spin } from 'antd'
|
||||||
import NoneData from '../../modules/courses/coursesPublic/NoneData';
|
|
||||||
import { getImageUrl } from 'educoder';
|
import { getImageUrl } from 'educoder';
|
||||||
|
|
||||||
|
|
||||||
const TextArea = Input.TextArea;
|
|
||||||
|
|
||||||
|
|
||||||
class MergeSubmit extends Component{
|
class MergeSubmit extends Component{
|
||||||
constructor(props){
|
constructor(props){
|
||||||
|
|
@ -30,15 +24,22 @@ class MergeSubmit extends Component{
|
||||||
limit:50,
|
limit:50,
|
||||||
page:1,
|
page:1,
|
||||||
titledata:undefined,
|
titledata:undefined,
|
||||||
|
isSpin:true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount=()=>{
|
componentDidMount=()=>{
|
||||||
|
// this.getDetail();
|
||||||
this.getDetail();
|
const { data } = this.props;
|
||||||
|
const { page , limit } = this.state;
|
||||||
|
this.setState({
|
||||||
|
isSpin:true
|
||||||
|
})
|
||||||
|
this.getCommitList( data.pull_request.base , page , limit );
|
||||||
}
|
}
|
||||||
|
|
||||||
getDetail=()=>{
|
getDetail=()=>{
|
||||||
|
|
||||||
const { projectsId , mergeId} = this.props.match.params;
|
const { projectsId , mergeId} = this.props.match.params;
|
||||||
const url = `/projects/${projectsId}/pull_requests/${mergeId}.json`;
|
const url = `/projects/${projectsId}/pull_requests/${mergeId}.json`;
|
||||||
axios.get(url).then((result)=>{
|
axios.get(url).then((result)=>{
|
||||||
|
|
@ -46,32 +47,13 @@ class MergeSubmit extends Component{
|
||||||
this.setState({
|
this.setState({
|
||||||
data:result.data,
|
data:result.data,
|
||||||
})
|
})
|
||||||
const { page , limit } = this.state;
|
|
||||||
|
|
||||||
this.getCommitList( result.data.pull_request.base , page , limit );
|
|
||||||
}
|
}
|
||||||
}).catch((error)=>{
|
}).catch((error)=>{
|
||||||
console.log(error);
|
console.log(error);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
handleok=() => {
|
|
||||||
this.setState({
|
|
||||||
isShow:false
|
|
||||||
});
|
|
||||||
};
|
|
||||||
handleCancel=()=>{
|
|
||||||
this.setState({
|
|
||||||
isShow:false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
imgshow=()=>{
|
|
||||||
this.setState({
|
|
||||||
isShow:true
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
//获取提交列表
|
//获取提交列表
|
||||||
getCommitList=(branch , page , limit)=>{
|
getCommitList=(branch , page , limit)=>{
|
||||||
const { projectsId } = this.props.match.params;
|
const { projectsId } = this.props.match.params;
|
||||||
|
|
@ -105,8 +87,8 @@ class MergeSubmit extends Component{
|
||||||
|
|
||||||
|
|
||||||
render(){
|
render(){
|
||||||
const { projectsId,mergeId } = this.props.match.params;
|
// const { projectsId,mergeId } = this.props.match.params;
|
||||||
const { data,titledata} = this.state;
|
const { titledata } = this.state;
|
||||||
|
|
||||||
|
|
||||||
const columns=[{
|
const columns=[{
|
||||||
|
|
@ -153,58 +135,58 @@ class MergeSubmit extends Component{
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const url = this.props.history.location.pathname;
|
// const url = this.props.history.location.pathname;
|
||||||
return(
|
return(
|
||||||
<div className="main">
|
// <div className="main">
|
||||||
<div className="topWrapper">
|
// <div className="topWrapper">
|
||||||
<Nav {...this.props} {...this.state}/>
|
// <Nav {...this.props} {...this.state}/>
|
||||||
<Link to={`/projects/${projectsId}/merge/new`} className="topWrapper_btn">创建合并请求</Link>
|
// <Link to={`/projects/${projectsId}/merge/new`} className="topWrapper_btn">创建合并请求</Link>
|
||||||
</div>
|
// </div>
|
||||||
<div>
|
// <div>
|
||||||
<div className="detailContent">
|
// <div className="detailContent">
|
||||||
<p>
|
// <p>
|
||||||
{
|
// {
|
||||||
data ?
|
// data ?
|
||||||
<span className="font-20">【{ data.issue.issue_classify==='issue'?data.issue.tracker:"合并"}】</span>
|
// <span className="font-20">【{ data.issue.issue_classify==='issue'?data.issue.tracker:"合并"}】</span>
|
||||||
:
|
// :
|
||||||
""
|
// ""
|
||||||
}
|
// }
|
||||||
<span className="font-20" > { data && data.issue.subject }</span>
|
// <span className="font-20" > { data && data.issue.subject }</span>
|
||||||
|
|
||||||
</p>
|
// </p>
|
||||||
<p className="mt10 color-grey-c">
|
// <p className="mt10 color-grey-c">
|
||||||
<span className={data&&data.issue.issue_status==="关闭"?"closedetail":data&&data.pull_request.status===0?"opendetail":"prdetail"}>{data&&data.issue.issue_status==="关闭"?"关闭中":data&&data.pull_request.status===0?"开启中":"已合并"} </span>
|
// <span className={data&&data.issue.issue_status==="关闭"?"closedetail":data&&data.pull_request.status===0?"opendetail":"prdetail"}>{data&&data.issue.issue_status==="关闭"?"关闭中":data&&data.pull_request.status===0?"开启中":"已合并"} </span>
|
||||||
<span className="ml10 lineH32">
|
// <span className="ml10 lineH32">
|
||||||
请求从{data && data.pull_request.head}分支合并到{data && data.pull_request.base}分支
|
// 由 { data && data.issue.author_name} 于 { data && data.issue.created_at }创建{ data && data.issue.journals_count && data.issue.journals_count > 0 ?` · ${data.issue.journals_count} 条评论`:""}
|
||||||
|
// </span>
|
||||||
{/* 由 { data && data.issue.author_name} 于 { data && data.issue.created_at }创建{ data && data.issue.journals_count && data.issue.journals_count > 0 ?` · ${data.issue.journals_count} 条评论`:""} */}
|
// <span className="pull-right lineH32">
|
||||||
</span>
|
// <Link to={`/projects/${projectsId}/merge/${mergeId}/UpdateMerge`} className="color-blue fr">编辑</Link>
|
||||||
<span className="pull-right lineH32">
|
// </span>
|
||||||
<Link to={`/projects/${projectsId}/merge/${mergeId}/UpdateMerge`} className="color-blue fr">编辑</Link>
|
// </p>
|
||||||
</span>
|
// </div>
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div className="detailHeader-wrapper">
|
// <div className="detailHeader-wrapper">
|
||||||
<div className="normal f-wrap-between">
|
// <div className="normal f-wrap-between">
|
||||||
<ul className="headerMenu-wrapper" style={{paddingTop:42,paddingLeft:15}}>
|
// <ul className="headerMenu-wrapper" style={{paddingTop:42,paddingLeft:15}}>
|
||||||
<li className={url.indexOf("Messagecount")>0? "active" : ""}><Link to={`/projects/${projectsId}/merge/${mergeId}/Messagecount`}>对话内容</Link></li>
|
// <li className={url.indexOf("Messagecount")>0? "active" : ""}><Link to={`/projects/${projectsId}/merge/${mergeId}/Messagecount`}>对话内容</Link></li>
|
||||||
<li className={url.indexOf("MergeSubmit")>0 ? "active" : ""}><Link to={`/projects/${projectsId}/merge/${mergeId}/MergeSubmit`}>代码提交</Link></li>
|
// <li className={url.indexOf("MergeSubmit")>0 ? "active" : ""}><Link to={`/projects/${projectsId}/merge/${mergeId}/MergeSubmit`}>代码提交</Link></li>
|
||||||
</ul>
|
// </ul>
|
||||||
</div>
|
// </div>
|
||||||
</div>
|
// </div>
|
||||||
<Table
|
<Spin spinning={this.state.isSpin}>
|
||||||
className="mt20 wrap-commit-table"
|
<Table
|
||||||
columns={columns}
|
className="mt20 wrap-commit-table"
|
||||||
dataSource={titledata}
|
columns={columns}
|
||||||
showHeader={false}
|
dataSource={titledata}
|
||||||
size="small"
|
showHeader={false}
|
||||||
pagination={false}
|
size="small"
|
||||||
title={() => title()}
|
pagination={false}
|
||||||
/>
|
title={() => title()}
|
||||||
</div>
|
/>
|
||||||
</div>
|
</Spin>
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,9 @@ import {Modal, Form, Input, Tooltip, Popconfirm, Pagination , Spin,Dropdown,Ico
|
||||||
import Attachments from '../Upload/attachment'
|
import Attachments from '../Upload/attachment'
|
||||||
import './merge.css';
|
import './merge.css';
|
||||||
import QuillForEditor from '../quillForEditor';
|
import QuillForEditor from '../quillForEditor';
|
||||||
|
import MergeSubmit from './MergeSubmit';
|
||||||
|
|
||||||
const TextArea = Input.TextArea;
|
// const TextArea = Input.TextArea;
|
||||||
|
|
||||||
const options = [
|
const options = [
|
||||||
['bold', 'italic', 'underline'],
|
['bold', 'italic', 'underline'],
|
||||||
|
|
@ -46,11 +47,15 @@ class MessageCount extends Component{
|
||||||
title:'',
|
title:'',
|
||||||
body:'',
|
body:'',
|
||||||
commentsContent:undefined,
|
commentsContent:undefined,
|
||||||
quillFlag:false
|
quillFlag:false,
|
||||||
|
SpinFlag:true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount=()=>{
|
componentDidMount=()=>{
|
||||||
|
this.setState({
|
||||||
|
SpinFlag:true
|
||||||
|
})
|
||||||
this.getDetail();
|
this.getDetail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -140,7 +145,8 @@ class MessageCount extends Component{
|
||||||
search_count:result.data.journals_count,
|
search_count:result.data.journals_count,
|
||||||
isSpin:false,
|
isSpin:false,
|
||||||
fileList:undefined,
|
fileList:undefined,
|
||||||
showFiles: true
|
showFiles: true,
|
||||||
|
SpinFlag:false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch(error=>{
|
}).catch(error=>{
|
||||||
|
|
@ -487,16 +493,13 @@ class MessageCount extends Component{
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div className="detailContent">
|
<div className="detailContent">
|
||||||
<p>
|
{
|
||||||
{
|
data &&
|
||||||
data ?
|
<p>
|
||||||
<span className="font-20">【{ data.issue.issue_classify==='issue'?data.issue.tracker:"合并"}】</span>
|
<span className="font-20">【{ data.issue && (data.issue.issue_classify==='issue' ? data.issue.tracker : "合并")}】</span>
|
||||||
:
|
<span className="font-20" > { data.issue && data.issue.subject }</span>
|
||||||
""
|
</p>
|
||||||
}
|
}
|
||||||
<span className="font-20" > { data && data.issue.subject }</span>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
<p className="mt10 color-grey-c">
|
<p className="mt10 color-grey-c">
|
||||||
<span className={data&&data.issue.issue_status==="关闭"?"closedetail":data&&data.pull_request.status===0?"opendetail":"prdetail"}>{data&&data.issue.issue_status==="关闭"?"关闭中":data&&data.pull_request.status===0?"开启中":"已合并"} </span>
|
<span className={data&&data.issue.issue_status==="关闭"?"closedetail":data&&data.pull_request.status===0?"opendetail":"prdetail"}>{data&&data.issue.issue_status==="关闭"?"关闭中":data&&data.pull_request.status===0?"开启中":"已合并"} </span>
|
||||||
<span className="ml10 lineH32">
|
<span className="ml10 lineH32">
|
||||||
|
|
@ -524,134 +527,140 @@ class MessageCount extends Component{
|
||||||
<div className="normal f-wrap-between">
|
<div className="normal f-wrap-between">
|
||||||
<ul className="headerMenu-wrapper" style={{paddingTop:42,paddingLeft:15}}>
|
<ul className="headerMenu-wrapper" style={{paddingTop:42,paddingLeft:15}}>
|
||||||
<li className={url.indexOf("Messagecount")>0? "active" : ""}><Link to={`/projects/${projectsId}/merge/${mergeId}/Messagecount`}>对话内容</Link></li>
|
<li className={url.indexOf("Messagecount")>0? "active" : ""}><Link to={`/projects/${projectsId}/merge/${mergeId}/Messagecount`}>对话内容</Link></li>
|
||||||
<li className={url.indexOf("MergeSubmit")>0 ? "active" : ""}><Link to={`/projects/${projectsId}/merge/${mergeId}/MergeSubmit`}>代码提交</Link></li>
|
<li className={url.indexOf("MergeSubmit")>0 ? "active" : ""}><Link to={`/projects/${projectsId}/merge/${mergeId}/MergeSubmit`}>代码提交</Link></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div className="f-wrap-between mt5" style={{alignItems:"flex-start"}}>
|
{
|
||||||
<div className="item-list-right" >
|
url.indexOf("Messagecount")>0 ?
|
||||||
<Spin spinning={isSpin}>
|
<Spin spinning={this.state.SpinFlag}>
|
||||||
<ul className="ul_width">
|
<div className="f-wrap-between mt5" style={{alignItems:"flex-start"}}>
|
||||||
{renderList()}
|
<div className="item-list-right" >
|
||||||
</ul>
|
<Spin spinning={isSpin}>
|
||||||
</Spin>
|
<ul className="ul_width">
|
||||||
|
{renderList()}
|
||||||
|
</ul>
|
||||||
|
</Spin>
|
||||||
|
|
||||||
{ Paginations }
|
{ Paginations }
|
||||||
|
|
||||||
{
|
{
|
||||||
data && data.issue.user_permission ?
|
data && data.issue.user_permission ?
|
||||||
<div className="df" style={{display:this.state.data&&this.state.data.pull_request.status===1?'none':'flex'}}>
|
<div className="df" style={{display:this.state.data&&this.state.data.pull_request.status===1?'none':'flex'}}>
|
||||||
<img className="user_img" src={getImageUrl(`images/${current_user && current_user.image_url}`)} alt=""/>
|
<img className="user_img" src={getImageUrl(`images/${current_user && current_user.image_url}`)} alt=""/>
|
||||||
<div className="new_context" >
|
<div className="new_context" >
|
||||||
<p>该合并请求可以进行自动合并操作</p>
|
<p>该合并请求可以进行自动合并操作</p>
|
||||||
<p style={{marginTop:15,display:this.state.mergekey==='rebase'?this.state.buttonshow==='none'?"block":"none":this.state.ismesrge==='none'?"block":"none"}}>
|
<p style={{marginTop:15,display:this.state.mergekey==='rebase'?this.state.buttonshow==='none'?"block":"none":this.state.ismesrge==='none'?"block":"none"}}>
|
||||||
{/* <button className="topmerge_btn" onClick={this.submitmerge} >{this.state.mergename}</button> */}
|
{/* <button className="topmerge_btn" onClick={this.submitmerge} >{this.state.mergename}</button> */}
|
||||||
{/* <Dropdown style={{marginBottom:5}} overlay={menu} trigger={['click']} > */}
|
{/* <Dropdown style={{marginBottom:5}} overlay={menu} trigger={['click']} > */}
|
||||||
<Dropdown.Button overlay={menu} type="primary" onClick={this.submitmerge} icon={<Icon type="caret-down"/>}>
|
<Dropdown.Button overlay={menu} type="primary" onClick={this.submitmerge} icon={<Icon type="caret-down"/>}>
|
||||||
{this.state.mergename}
|
{this.state.mergename}
|
||||||
</Dropdown.Button>
|
</Dropdown.Button>
|
||||||
|
|
||||||
{/* </Dropdown> */}
|
{/* </Dropdown> */}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div style={{display:this.state.ismesrge,marginTop:15}}>
|
<div style={{display:this.state.ismesrge,marginTop:15}}>
|
||||||
<Input placeholder="标题" value={this.state.title} onChange={this.changtitlepr}/>
|
<Input placeholder="标题" value={this.state.title} onChange={this.changtitlepr}/>
|
||||||
<div className="quillContent" style={{marginTop:"20px"}}>
|
<div className="quillContent" style={{marginTop:"20px"}}>
|
||||||
<QuillForEditor
|
<QuillForEditor
|
||||||
value = {this.state.body}
|
value = {this.state.body}
|
||||||
wrapStyle={{
|
wrapStyle={{
|
||||||
height: '220px',
|
height: '220px',
|
||||||
opacity:1,
|
opacity:1,
|
||||||
}}
|
}}
|
||||||
// autoFocus={true}
|
// autoFocus={true}
|
||||||
style={{ height: '170px' }}
|
style={{ height: '170px' }}
|
||||||
placeholder="请输入合并请求描述..."
|
placeholder="请输入合并请求描述..."
|
||||||
options={options}
|
options={options}
|
||||||
onContentChange={this.changbodypr}
|
onContentChange={this.changbodypr}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
{/* <TextArea placeholder="请输入合并描述..." style={{height:"300px",marginTop:15}} value={this.state.body} onChange={this.changbodypr} /> */}
|
||||||
|
</div>
|
||||||
|
<p className="clearfix mt15" style={{display:this.state.buttonshow}}>
|
||||||
|
<a className="topWrapper_btn " type="submit" onClick={()=>this.prmerge()}>合并请求</a>
|
||||||
|
<a className="a_btn cancel_btn " type="submit" style={{marginLeft:15}} onClick={this.nonemerge}>取消</a>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{/* <TextArea placeholder="请输入合并描述..." style={{height:"300px",marginTop:15}} value={this.state.body} onChange={this.changbodypr} /> */}
|
|
||||||
</div>
|
</div>
|
||||||
<p className="clearfix mt15" style={{display:this.state.buttonshow}}>
|
: ''
|
||||||
<a className="topWrapper_btn " type="submit" onClick={()=>this.prmerge()}>合并请求</a>
|
}
|
||||||
<a className="a_btn cancel_btn " type="submit" style={{marginLeft:15}} onClick={this.nonemerge}>取消</a>
|
|
||||||
|
<div className="order_line" style={{marginLeft:80}}></div>
|
||||||
|
<div className="df">
|
||||||
|
<img className="user_img" src={getImageUrl(`images/${current_user && current_user.image_url}`)} alt=""/>
|
||||||
|
<div className="new_context">
|
||||||
|
{/* <Form.Item>
|
||||||
|
{getFieldDecorator('content', {
|
||||||
|
rules: [{
|
||||||
|
required: true, message: '请输入内容'
|
||||||
|
}],
|
||||||
|
})(
|
||||||
|
<TextArea placeholder="添加评论..." style={{height: "200px"}}/>
|
||||||
|
)}
|
||||||
|
</Form.Item> */}
|
||||||
|
<div className="quillContent">
|
||||||
|
<QuillForEditor
|
||||||
|
value = {commentsContent}
|
||||||
|
wrapStyle={{
|
||||||
|
height: '240px',
|
||||||
|
opacity:1,
|
||||||
|
}}
|
||||||
|
// autoFocus={true}
|
||||||
|
style={{ height: '170px' }}
|
||||||
|
placeholder="请输入评论内容..."
|
||||||
|
options={options}
|
||||||
|
onContentChange={this.changeComments}
|
||||||
|
/>
|
||||||
|
<p className="quillFlag">
|
||||||
|
{ quillFlag && <span className="">请输入评论内容</span>}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<UploadComponent load={this.UploadFunc} isComplete={showFiles}></UploadComponent>
|
||||||
|
<p className="clearfix mt15">
|
||||||
|
<a className="topWrapper_btn fr" type="submit" onClick={this.addjournals}>评论</a>
|
||||||
|
<a className="Closeor_btn fr" type="submit" style={{display:data&&data.pull_request.status===0?'block':'none'}}
|
||||||
|
onClick={() => this.closedetail(data && data.issue.issue_status === "关闭" ? 2 : 5)}>{data && data.issue.issue_status === "关闭" ? "开启" : "关闭"}</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
: ''
|
</div>
|
||||||
}
|
<div className="list-left DetailRight mt10">
|
||||||
|
<p>
|
||||||
<div className="order_line" style={{marginLeft:80}}></div>
|
<span className="span_title">标签</span>
|
||||||
<div className="df">
|
<span>{
|
||||||
<img className="user_img" src={getImageUrl(`images/${current_user && current_user.image_url}`)} alt=""/>
|
data && data.issue.issue_tags ? <span className="issue-tag-show" style={{background: data.issue.issue_tags[0].color}}>{data.issue.issue_tags[0].name}</span> : "--"
|
||||||
<div className="new_context">
|
}</span>
|
||||||
{/* <Form.Item>
|
|
||||||
{getFieldDecorator('content', {
|
|
||||||
rules: [{
|
|
||||||
required: true, message: '请输入内容'
|
|
||||||
}],
|
|
||||||
})(
|
|
||||||
<TextArea placeholder="添加评论..." style={{height: "200px"}}/>
|
|
||||||
)}
|
|
||||||
</Form.Item> */}
|
|
||||||
<div className="quillContent">
|
|
||||||
<QuillForEditor
|
|
||||||
value = {commentsContent}
|
|
||||||
wrapStyle={{
|
|
||||||
height: '240px',
|
|
||||||
opacity:1,
|
|
||||||
}}
|
|
||||||
// autoFocus={true}
|
|
||||||
style={{ height: '170px' }}
|
|
||||||
placeholder="请输入评论内容..."
|
|
||||||
options={options}
|
|
||||||
onContentChange={this.changeComments}
|
|
||||||
/>
|
|
||||||
<p className="quillFlag">
|
|
||||||
{ quillFlag && <span className="">请输入评论内容</span>}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<UploadComponent load={this.UploadFunc} isComplete={showFiles}></UploadComponent>
|
|
||||||
<p className="clearfix mt15">
|
|
||||||
<a className="topWrapper_btn fr" type="submit" onClick={this.addjournals}>评论</a>
|
|
||||||
<a className="Closeor_btn fr" type="submit" style={{display:data&&data.pull_request.status===0?'block':'none'}}
|
|
||||||
onClick={() => this.closedetail(data && data.issue.issue_status === "关闭" ? 2 : 5)}>{data && data.issue.issue_status === "关闭" ? "开启" : "关闭"}</a>
|
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
<span className="span_title">里程碑</span>
|
||||||
|
<span>{
|
||||||
|
data && data.issue.version ? data.issue.version : "--"
|
||||||
|
}</span>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span className="span_title">指派给</span>
|
||||||
|
<span>{data && data.issue.assign_user_name ? data.issue.assign_user_name : "--"}</span>
|
||||||
|
</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Spin>
|
||||||
<div className="list-left DetailRight mt10">
|
:
|
||||||
<p>
|
<MergeSubmit {...this.props} {...this.state} data={data} />
|
||||||
<span className="span_title">标签</span>
|
}
|
||||||
<span>{
|
|
||||||
data && data.issue.issue_tags ? <span className="issue-tag-show" style={{background: data.issue.issue_tags[0].color}}>{data.issue.issue_tags[0].name}</span> : "--"
|
|
||||||
}</span>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<span className="span_title">里程碑</span>
|
|
||||||
<span>{
|
|
||||||
data && data.issue.version ? data.issue.version : "--"
|
|
||||||
}</span>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<span className="span_title">指派给</span>
|
|
||||||
<span>{data && data.issue.assign_user_name ? data.issue.assign_user_name : "--"}</span>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<Modal
|
<Modal
|
||||||
onCancel={this.handleCancel}
|
onCancel={this.handleCancel}
|
||||||
visible={this.state.isShow}
|
visible={this.state.isShow}
|
||||||
width="400px"
|
width="400px"
|
||||||
footer={
|
footer={[]}
|
||||||
[]
|
bodyStyle={{textAlign:'center'}}
|
||||||
}
|
|
||||||
bodyStyle={{textAlign:'center'}}
|
|
||||||
>
|
>
|
||||||
<img className="list_img" src="https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1608431072,669449145&fm=27&gp=0.jpg" alt=""/>
|
<img className="list_img" src="https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1608431072,669449145&fm=27&gp=0.jpg" alt=""/>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
||||||
|
|
@ -239,7 +239,7 @@ class NewMerge extends Component{
|
||||||
const { getFieldDecorator } = this.props.form;
|
const { getFieldDecorator } = this.props.form;
|
||||||
const { projectsId } = this.props.match.params;
|
const { projectsId } = this.props.match.params;
|
||||||
const { current_user } = this.props;
|
const { current_user } = this.props;
|
||||||
const { issue_tag_ids , fixed_version_id ,assigned_to_id ,issue_chosen,data,titledata , desc } = this.state;
|
const { issue_tag_ids , fixed_version_id ,assigned_to_id , data,titledata , desc } = this.state;
|
||||||
|
|
||||||
|
|
||||||
const columns=[{
|
const columns=[{
|
||||||
|
|
@ -345,12 +345,12 @@ class NewMerge extends Component{
|
||||||
<QuillForEditor
|
<QuillForEditor
|
||||||
value = {desc}
|
value = {desc}
|
||||||
wrapStyle={{
|
wrapStyle={{
|
||||||
height: '220px',
|
height: '240px',
|
||||||
opacity:1,
|
opacity:1,
|
||||||
}}
|
}}
|
||||||
// autoFocus={true}
|
// autoFocus={true}
|
||||||
style={{ height: '170px' }}
|
style={{ height: '170px' }}
|
||||||
placeholder="合并请求的描述..."
|
placeholder="请输入合并请求的描述..."
|
||||||
options={options}
|
options={options}
|
||||||
onContentChange={this.onContentChange}
|
onContentChange={this.onContentChange}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -6,15 +6,21 @@ import Nav from '../Order/Nav';
|
||||||
|
|
||||||
import UploadComponent from '../Upload/Index';
|
import UploadComponent from '../Upload/Index';
|
||||||
import { getImageUrl } from 'educoder';
|
import { getImageUrl } from 'educoder';
|
||||||
import{ Modal,Col,Form,Input,Tooltip,Select } from 'antd'
|
import{ Modal , Form , Input , Select } from 'antd'
|
||||||
import NoneData from '../../modules/courses/coursesPublic/NoneData';
|
import QuillForEditor from '../quillForEditor';
|
||||||
|
|
||||||
|
|
||||||
import Attachments from '../Upload/attachment'
|
import Attachments from '../Upload/attachment'
|
||||||
|
|
||||||
const TextArea = Input.TextArea;
|
|
||||||
const Option = Select.Option;
|
const Option = Select.Option;
|
||||||
|
|
||||||
|
const options = [
|
||||||
|
['bold', 'italic', 'underline'],
|
||||||
|
[{header: [1,2,3,false]}],
|
||||||
|
['blockquote', 'code-block'],
|
||||||
|
['link', 'image'],
|
||||||
|
['formula']
|
||||||
|
];
|
||||||
class UpdateMerge extends Component{
|
class UpdateMerge extends Component{
|
||||||
constructor(props){
|
constructor(props){
|
||||||
super(props);
|
super(props);
|
||||||
|
|
@ -38,7 +44,8 @@ class UpdateMerge extends Component{
|
||||||
done_ratio:0,
|
done_ratio:0,
|
||||||
textcount:"",
|
textcount:"",
|
||||||
fileList:undefined,
|
fileList:undefined,
|
||||||
get_attachments: undefined
|
get_attachments: undefined,
|
||||||
|
desc:undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -101,17 +108,31 @@ class UpdateMerge extends Component{
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onContentChange=(value)=>{
|
||||||
|
this.setState({
|
||||||
|
textcount:JSON.stringify(value)
|
||||||
|
})
|
||||||
|
}
|
||||||
changmodelname=(e)=>{
|
changmodelname=(e)=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
subject:e.target.value
|
subject:e.target.value
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
changmodelcount=(e)=>{
|
// changmodelcount=(e)=>{
|
||||||
this.setState({
|
// this.setState({
|
||||||
textcount:e.target.value
|
// textcount:e.target.value
|
||||||
})
|
// })
|
||||||
|
// }
|
||||||
|
stringJson=(value) =>{
|
||||||
|
let _value = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
_value = JSON.parse(value);
|
||||||
|
} catch (e) {
|
||||||
|
_value = value;
|
||||||
}
|
}
|
||||||
|
return _value
|
||||||
|
}
|
||||||
|
|
||||||
renderSelect=(list)=>{
|
renderSelect=(list)=>{
|
||||||
if(list && list.length >0){
|
if(list && list.length >0){
|
||||||
|
|
@ -135,7 +156,7 @@ class UpdateMerge extends Component{
|
||||||
this.props.form.validateFieldsAndScroll((err, values) => {
|
this.props.form.validateFieldsAndScroll((err, values) => {
|
||||||
if(!err){
|
if(!err){
|
||||||
const { projectsId , mergeId } = this.props.match.params;
|
const { projectsId , mergeId } = this.props.match.params;
|
||||||
const { subject ,data} = this.state;
|
const { subject ,data , textcount } = this.state;
|
||||||
const url = `/projects/${projectsId}/pull_requests/${mergeId}.json`;
|
const url = `/projects/${projectsId}/pull_requests/${mergeId}.json`;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -149,9 +170,10 @@ class UpdateMerge extends Component{
|
||||||
values.assigned_to_id = ""
|
values.assigned_to_id = ""
|
||||||
}
|
}
|
||||||
axios.put(url,{
|
axios.put(url,{
|
||||||
project_id:projectsId,
|
project_id:projectsId,
|
||||||
id: data.issue.id,
|
id: data.issue.id,
|
||||||
attachment_ids:fileList,
|
attachment_ids:fileList,
|
||||||
|
body:textcount,
|
||||||
...values
|
...values
|
||||||
}).then(result=>{
|
}).then(result=>{
|
||||||
if(result){
|
if(result){
|
||||||
|
|
@ -170,8 +192,7 @@ class UpdateMerge extends Component{
|
||||||
const { projectsId , mergeId } = this.props.match.params;
|
const { projectsId , mergeId } = this.props.match.params;
|
||||||
const { getFieldDecorator } = this.props.form;
|
const { getFieldDecorator } = this.props.form;
|
||||||
const { current_user } = this.props;
|
const { current_user } = this.props;
|
||||||
const { issue_tag_ids , fixed_version_id , branch_name , status_id , tracker_id , issue_type ,assigned_to_id , priority_id , done_ratio,
|
const { issue_tag_ids , fixed_version_id , assigned_to_id , issue_chosen , subject, textcount,get_attachments } = this.state;
|
||||||
issue_chosen , branches, subject, textcount,get_attachments } = this.state;
|
|
||||||
return(
|
return(
|
||||||
<div className="main">
|
<div className="main">
|
||||||
<div className="topWrapper">
|
<div className="topWrapper">
|
||||||
|
|
@ -193,14 +214,26 @@ class UpdateMerge extends Component{
|
||||||
<Input placeholder="标题" onChange={this.changmodelname}/>
|
<Input placeholder="标题" onChange={this.changmodelname}/>
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item>
|
{/* <Form.Item>
|
||||||
{getFieldDecorator('body', {
|
{getFieldDecorator('body', {
|
||||||
rules: [],
|
rules: [],
|
||||||
initialValue: textcount
|
initialValue: textcount
|
||||||
})(
|
})(
|
||||||
<TextArea placeholder="请输入工单的描述..." style={{height:"300px"}} onChange={this.changmodelcount}/>
|
<TextArea placeholder="请输入工单的描述..." style={{height:"300px"}} onChange={this.changmodelcount}/>
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item> */}
|
||||||
|
<QuillForEditor
|
||||||
|
value = {this.stringJson(textcount)}
|
||||||
|
wrapStyle={{
|
||||||
|
height: '240px',
|
||||||
|
opacity:1,
|
||||||
|
}}
|
||||||
|
// autoFocus={true}
|
||||||
|
style={{ height: '170px' }}
|
||||||
|
placeholder="请输入合并请求的描述..."
|
||||||
|
options={options}
|
||||||
|
onContentChange={this.onContentChange}
|
||||||
|
/>
|
||||||
<UploadComponent load={this.UploadFunc} showNotification={this.props.showNotification} isComplete={true} ></UploadComponent>
|
<UploadComponent load={this.UploadFunc} showNotification={this.props.showNotification} isComplete={true} ></UploadComponent>
|
||||||
{
|
{
|
||||||
get_attachments ?
|
get_attachments ?
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
import React , { Component } from 'react';
|
import React , { Component } from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { Input , Form , Select , Checkbox , Button , Divider ,Spin } from 'antd';
|
import { Input , Form , Select , Checkbox , Button , Divider , Spin , AutoComplete } from 'antd';
|
||||||
|
|
||||||
import '../css/index.css';
|
import '../css/index.css';
|
||||||
import './new.css'
|
import './new.css'
|
||||||
|
|
||||||
import axios from 'axios' ;
|
import axios from 'axios' ;
|
||||||
|
import { callbackify } from 'util';
|
||||||
const Option = Select.Option
|
const Option = Select.Option
|
||||||
class Index extends Component{
|
class Index extends Component{
|
||||||
constructor(props){
|
constructor(props){
|
||||||
|
|
@ -23,6 +24,21 @@ class Index extends Component{
|
||||||
GitignoreList:undefined,
|
GitignoreList:undefined,
|
||||||
LicensesList:undefined,
|
LicensesList:undefined,
|
||||||
isSpin:false,
|
isSpin:false,
|
||||||
|
|
||||||
|
project_language_id:undefined,
|
||||||
|
project_category_id:undefined,
|
||||||
|
license_id:undefined,
|
||||||
|
ignore_id:undefined,
|
||||||
|
|
||||||
|
project_language_list:undefined,
|
||||||
|
project_category_list:undefined,
|
||||||
|
license_list:undefined,
|
||||||
|
ignore_list:undefined,
|
||||||
|
|
||||||
|
project_language_name:undefined,
|
||||||
|
project_category_name:undefined,
|
||||||
|
license_name:undefined,
|
||||||
|
ignore_name:undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getUserInfo=()=>{
|
getUserInfo=()=>{
|
||||||
|
|
@ -53,9 +69,9 @@ class Index extends Component{
|
||||||
const url = `/project_categories.json`
|
const url = `/project_categories.json`
|
||||||
axios.get(url).then((result)=>{
|
axios.get(url).then((result)=>{
|
||||||
if(result){
|
if(result){
|
||||||
let CategoryList = this.setOptionsList(result.data.project_categories)
|
this.setOptionsList(result.data.project_categories,'project_category');
|
||||||
this.setState({
|
this.setState({
|
||||||
CategoryList
|
CategoryList:result.data.project_categories
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch((error)=>{})
|
}).catch((error)=>{})
|
||||||
|
|
@ -65,9 +81,9 @@ class Index extends Component{
|
||||||
const url = `/project_languages.json`
|
const url = `/project_languages.json`
|
||||||
axios.get(url).then((result)=>{
|
axios.get(url).then((result)=>{
|
||||||
if(result){
|
if(result){
|
||||||
let LanguageList = this.setOptionsList(result.data.project_languages)
|
this.setOptionsList(result.data.project_languages,'project_language')
|
||||||
this.setState({
|
this.setState({
|
||||||
LanguageList
|
LanguageList:result.data.project_languages
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch((error)=>{})
|
}).catch((error)=>{})
|
||||||
|
|
@ -77,9 +93,9 @@ class Index extends Component{
|
||||||
const url = `/ignores.json`
|
const url = `/ignores.json`
|
||||||
axios.get(url).then((result)=>{
|
axios.get(url).then((result)=>{
|
||||||
if(result){
|
if(result){
|
||||||
let GitignoreList = this.setOptionsList(result.data.ignores)
|
this.setOptionsList(result.data.ignores,'ignore');
|
||||||
this.setState({
|
this.setState({
|
||||||
GitignoreList
|
GitignoreList:result.data.ignores
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch((error)=>{})
|
}).catch((error)=>{})
|
||||||
|
|
@ -89,24 +105,30 @@ class Index extends Component{
|
||||||
const url = `/licenses.json`
|
const url = `/licenses.json`
|
||||||
axios.get(url).then((result)=>{
|
axios.get(url).then((result)=>{
|
||||||
if(result){
|
if(result){
|
||||||
let LicensesList = this.setOptionsList(result.data.licenses)
|
this.setOptionsList(result.data.licenses,'license');
|
||||||
this.setState({
|
this.setState({
|
||||||
LicensesList
|
LicensesList:result.data.licenses
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch((error)=>{})
|
}).catch((error)=>{})
|
||||||
}
|
}
|
||||||
|
|
||||||
setOptionsList = (data) =>{
|
// 设置option
|
||||||
let list = undefined;
|
setOptionsList = (data,_head,name) =>{
|
||||||
if(data && data.length > 0){
|
if(data && data.length > 0){
|
||||||
list = data.map((item,key)=>{
|
let _data = data;
|
||||||
return(
|
if(name){
|
||||||
<Option key={item.id}>{item.name}</Option>
|
_data = data.filter(item=>item.name.indexOf(name)>-1);
|
||||||
)
|
}
|
||||||
|
let list = _data && _data.map((item) => (
|
||||||
|
<Option key={item.id} value={item.name}>
|
||||||
|
{item.name}
|
||||||
|
</Option>
|
||||||
|
));
|
||||||
|
this.setState({
|
||||||
|
[_head+"_list"]:list
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return list;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
subMitFrom = () =>{
|
subMitFrom = () =>{
|
||||||
|
|
@ -117,9 +139,14 @@ class Index extends Component{
|
||||||
if(!err){
|
if(!err){
|
||||||
const { current_user } = this.props;
|
const { current_user } = this.props;
|
||||||
const { projectsType } =this.props.match.params;
|
const { projectsType } =this.props.match.params;
|
||||||
|
const { project_language_id, project_category_id, license_id, ignore_id } = this.state;
|
||||||
const url = projectsType === "deposit" ? "/projects.json" :"/projects/migrate.json";
|
const url = projectsType === "deposit" ? "/projects.json" :"/projects/migrate.json";
|
||||||
axios.post(url,{
|
axios.post(url,{
|
||||||
...values,
|
...values,
|
||||||
|
project_language_id,
|
||||||
|
project_category_id,
|
||||||
|
license_id,
|
||||||
|
ignore_id,
|
||||||
user_id:current_user.user_id
|
user_id:current_user.user_id
|
||||||
}).then((result)=>{
|
}).then((result)=>{
|
||||||
if(result){
|
if(result){
|
||||||
|
|
@ -145,6 +172,39 @@ class Index extends Component{
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChangePlatform=(value,e,name,list)=>{
|
||||||
|
this.setOptionsList(list,name,value)
|
||||||
|
this.setState({
|
||||||
|
[name+"_id"]:e.key,
|
||||||
|
[name+"_name"]:value,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
blurCategory=(value,list,name)=>{
|
||||||
|
// console.log(value);
|
||||||
|
let filter = list && list.filter(item=>item.name === value);
|
||||||
|
if(!filter || filter.length===0){
|
||||||
|
this.props.form.setFieldsValue({
|
||||||
|
[name]:undefined
|
||||||
|
})
|
||||||
|
this.setState({
|
||||||
|
[name+"_name"]:undefined,
|
||||||
|
[name+"_id"]:undefined
|
||||||
|
})
|
||||||
|
this.setOptionsList(list,name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
checkId=(rule, value, callback,list,title)=>{
|
||||||
|
let filter = list.filter(item=>item.name === value);
|
||||||
|
if(filter && filter.length>0){
|
||||||
|
callback();
|
||||||
|
}else{
|
||||||
|
callback('请在下拉选项中选择正确的'+title+"!");
|
||||||
|
}
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
|
||||||
render(){
|
render(){
|
||||||
const { getFieldDecorator } = this.props.form;
|
const { getFieldDecorator } = this.props.form;
|
||||||
// 项目类型:deposit-托管项目,mirror-镜像项目
|
// 项目类型:deposit-托管项目,mirror-镜像项目
|
||||||
|
|
@ -161,10 +221,18 @@ class Index extends Component{
|
||||||
LanguageList,
|
LanguageList,
|
||||||
GitignoreList,
|
GitignoreList,
|
||||||
LicensesList,
|
LicensesList,
|
||||||
isSpin
|
isSpin,
|
||||||
}=this.state;
|
project_language_name,
|
||||||
|
project_category_name,
|
||||||
|
license_name,
|
||||||
|
ignore_name,
|
||||||
|
|
||||||
console.log("current_user",this.props);
|
project_language_list,
|
||||||
|
project_category_list,
|
||||||
|
license_list,
|
||||||
|
ignore_list,
|
||||||
|
}=this.state;
|
||||||
|
console.log("a:",project_category_list);
|
||||||
return(
|
return(
|
||||||
<div className="main back-white">
|
<div className="main back-white">
|
||||||
<div className="newPanel">
|
<div className="newPanel">
|
||||||
|
|
@ -172,21 +240,8 @@ class Index extends Component{
|
||||||
<Spin spinning={isSpin}>
|
<Spin spinning={isSpin}>
|
||||||
<Form>
|
<Form>
|
||||||
<div className="newPanel_content">
|
<div className="newPanel_content">
|
||||||
{/* <Form.Item
|
|
||||||
label="拥有者"
|
|
||||||
>
|
|
||||||
{getFieldDecorator('user_id', {
|
|
||||||
rules: [{
|
|
||||||
required: true, message: '请选择拥有者'
|
|
||||||
}],
|
|
||||||
})(
|
|
||||||
<Select value={authorValue}>
|
|
||||||
<Option key="0">kosasa</Option>
|
|
||||||
</Select>
|
|
||||||
)}
|
|
||||||
</Form.Item> */}
|
|
||||||
{
|
{
|
||||||
projectsType != "deposit" &&
|
projectsType !== "deposit" &&
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="镜像版本库地址"
|
label="镜像版本库地址"
|
||||||
|
|
@ -228,7 +283,7 @@ class Index extends Component{
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="仓库名称"
|
label="仓库名称"
|
||||||
style={{marginBottom:"20px"}}
|
style={{marginBottom:"0px"}}
|
||||||
>
|
>
|
||||||
{getFieldDecorator('repository_name', {
|
{getFieldDecorator('repository_name', {
|
||||||
rules: [{
|
rules: [{
|
||||||
|
|
@ -243,40 +298,43 @@ class Index extends Component{
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="项目类别"
|
label="项目类别"
|
||||||
>
|
>
|
||||||
{getFieldDecorator('project_category_id', {
|
{getFieldDecorator('project_category', {
|
||||||
rules: [{
|
rules: [{
|
||||||
required: true, message: '请选择大类别'
|
required: true, message: '请选择大类别',
|
||||||
|
},{
|
||||||
|
validator:(rule, value, callback)=>this.checkId(rule, value, callback,CategoryList,'项目类别')
|
||||||
}],
|
}],
|
||||||
})(
|
})(
|
||||||
<Select value={preType}>
|
<AutoComplete
|
||||||
{CategoryList}
|
placeholder="请选择项目类别"
|
||||||
</Select>
|
onChange={(value,e)=>this.ChangePlatform(value,e,'project_category',CategoryList)}
|
||||||
|
className="plateAutoComplete"
|
||||||
|
onBlur={(value)=>this.blurCategory(value,CategoryList,"project_category")}
|
||||||
|
>
|
||||||
|
{/* {this.setOptionsList(CategoryList,project_category_name)} */}
|
||||||
|
{project_category_list}
|
||||||
|
</AutoComplete>
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{/* <Form.Item>
|
|
||||||
{getFieldDecorator('project_language_id', {
|
|
||||||
rules: [{
|
|
||||||
required: true, message: '请选择子类别'
|
|
||||||
}],
|
|
||||||
})(
|
|
||||||
<Select value={subType} className="inline_Tag">
|
|
||||||
<Option key="0">HTMl</Option>
|
|
||||||
<Option key="1">HTMl111</Option>
|
|
||||||
</Select>
|
|
||||||
)}
|
|
||||||
</Form.Item> */}
|
|
||||||
{/* </div> */}
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="项目语言"
|
label="项目语言"
|
||||||
>
|
>
|
||||||
{getFieldDecorator('project_language_id', {
|
{getFieldDecorator('project_language', {
|
||||||
rules: [{
|
rules: [{
|
||||||
required: true, message: '请选择项目语言'
|
required: true, message: '请选择项目语言'
|
||||||
|
},{
|
||||||
|
validator:(rule, value, callback)=>this.checkId(rule, value, callback,LanguageList,'项目语言')
|
||||||
}],
|
}],
|
||||||
})(
|
})(
|
||||||
<Select value={languageValue}>
|
<AutoComplete
|
||||||
{LanguageList}
|
placeholder="请选择项目语言"
|
||||||
</Select>
|
onChange={(value,e)=>this.ChangePlatform(value,e,'project_language',LanguageList)}
|
||||||
|
className="plateAutoComplete"
|
||||||
|
onBlur={(value)=>this.blurCategory(value,LanguageList,"project_language")}
|
||||||
|
>
|
||||||
|
{/* {this.setOptionsList(LanguageList,project_language_name)} */}
|
||||||
|
{project_language_list}
|
||||||
|
</AutoComplete>
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -288,19 +346,39 @@ class Index extends Component{
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label=".gitignore"
|
label=".gitignore"
|
||||||
>
|
>
|
||||||
{getFieldDecorator('ignore_id')(
|
{getFieldDecorator('ignore',{
|
||||||
<Select value={gitignoreType} className="inline_Tag">
|
rules: [{
|
||||||
{GitignoreList}
|
validator:(rule, value, callback)=>this.checkId(rule, value, callback,GitignoreList,'gitignore')
|
||||||
</Select>
|
}],
|
||||||
|
})(
|
||||||
|
<AutoComplete
|
||||||
|
placeholder="请选择gitignore"
|
||||||
|
onChange={(value,e)=>this.ChangePlatform(value,e,'ignore',GitignoreList)}
|
||||||
|
className="plateAutoComplete"
|
||||||
|
onBlur={(value)=>this.blurCategory(value,GitignoreList,"ignore")}
|
||||||
|
>
|
||||||
|
{/* {this.setOptionsList(GitignoreList,ignore_name)} */}
|
||||||
|
{ignore_list}
|
||||||
|
</AutoComplete>
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="开源许可证"
|
label="开源许可证"
|
||||||
>
|
>
|
||||||
{getFieldDecorator('license_id')(
|
{getFieldDecorator('license',{
|
||||||
<Select value={LicensesType} className="inline_Tag">
|
rules: [{
|
||||||
{LicensesList}
|
validator:(rule, value, callback)=>this.checkId(rule, value, callback,LicensesList,'开源许可证')
|
||||||
</Select>
|
}],
|
||||||
|
})(
|
||||||
|
<AutoComplete
|
||||||
|
placeholder="请选择开源许可证"
|
||||||
|
onChange={(value,e)=>this.ChangePlatform(value,e,'license',LicensesList)}
|
||||||
|
className="plateAutoComplete"
|
||||||
|
onBlur={(value)=>this.blurCategory(value,LicensesList,"license")}
|
||||||
|
>
|
||||||
|
{/* {this.setOptionsList(LicensesList,license_name)} */}
|
||||||
|
{license_list}
|
||||||
|
</AutoComplete>
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,8 @@ class Detail extends Component{
|
||||||
issue_id:data.id,
|
issue_id:data.id,
|
||||||
attachment_ids:fileList
|
attachment_ids:fileList
|
||||||
}).then(result=>{
|
}).then(result=>{
|
||||||
if(result && result.journals_count > 0){
|
if(result){
|
||||||
|
this.props.showNotification("评论成功!");
|
||||||
this.props.form.setFieldsValue({
|
this.props.form.setFieldsValue({
|
||||||
content: ""
|
content: ""
|
||||||
});
|
});
|
||||||
|
|
@ -111,7 +112,6 @@ class Detail extends Component{
|
||||||
quillFlag:false
|
quillFlag:false
|
||||||
})
|
})
|
||||||
this.getjournalslist(page, limit);
|
this.getjournalslist(page, limit);
|
||||||
this.props.showNotification("评论成功!");
|
|
||||||
}
|
}
|
||||||
}).catch(error=>{
|
}).catch(error=>{
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|
@ -178,13 +178,13 @@ class Detail extends Component{
|
||||||
|
|
||||||
//修改评论
|
//修改评论
|
||||||
updatedetail=(id)=>{
|
updatedetail=(id)=>{
|
||||||
const {page, limit } = this.state;
|
const { page , limit , countvalue } = this.state;
|
||||||
const {orderId} = this.props.match.params;
|
const {orderId} = this.props.match.params;
|
||||||
const url = `/issues/${orderId}/journals/${id}.json`;
|
const url = `/issues/${orderId}/journals/${id}.json`;
|
||||||
axios.put(url,{
|
axios.put(url,{
|
||||||
issue_id:orderId,
|
issue_id:orderId,
|
||||||
id:id,
|
id:id,
|
||||||
content:this.state.countvalue
|
content:JSON.stringify(countvalue)
|
||||||
}).then(result=>{
|
}).then(result=>{
|
||||||
if(result){
|
if(result){
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
@ -221,20 +221,15 @@ class Detail extends Component{
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
changmodelname=(e)=>{
|
|
||||||
this.setState({
|
|
||||||
countvalue:e.target.value
|
|
||||||
})
|
|
||||||
}
|
|
||||||
editdetail=(count,status)=>{
|
editdetail=(count,status)=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
countvalue:count,
|
countvalue:this.stringJson(count),
|
||||||
isedit:status
|
isedit:status
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
renderJournalList=(list)=>{
|
renderJournalList=(list)=>{
|
||||||
// console.log(list);
|
|
||||||
if(list && list.length >0){
|
if(list && list.length >0){
|
||||||
return(
|
return(
|
||||||
list.map((item,key)=>{
|
list.map((item,key)=>{
|
||||||
|
|
@ -299,6 +294,7 @@ class Detail extends Component{
|
||||||
showFiles:flag
|
showFiles:flag
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 新建评论
|
||||||
onContentChange=(value)=>{
|
onContentChange=(value)=>{
|
||||||
if(value){
|
if(value){
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
@ -307,6 +303,14 @@ class Detail extends Component{
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 编辑评论
|
||||||
|
onEditContentChange=(value)=>{
|
||||||
|
if(value){
|
||||||
|
this.setState({
|
||||||
|
countvalue:value
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
handleShowImage=(value)=>{
|
handleShowImage=(value)=>{
|
||||||
// console.log("imgOnclick",value);
|
// console.log("imgOnclick",value);
|
||||||
|
|
@ -336,14 +340,14 @@ class Detail extends Component{
|
||||||
<QuillForEditor
|
<QuillForEditor
|
||||||
readOnly={true}
|
readOnly={true}
|
||||||
value={_ctx}
|
value={_ctx}
|
||||||
showUploadImage={this.handleShowImage}
|
// showUploadImage={this.handleShowImage}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
render(){
|
render(){
|
||||||
const { projectsId , orderId } = this.props.match.params;
|
const { projectsId , orderId } = this.props.match.params;
|
||||||
const { data,journalsdata, page, limit, search_count, isSpin, isedit, showFiles , quillValue , quillFlag } = this.state;
|
const { data,journalsdata, page, limit, search_count, isSpin, isedit, showFiles , quillValue , quillFlag , countvalue } = this.state;
|
||||||
const { current_user } = this.props;
|
const { current_user } = this.props;
|
||||||
const Paginations = (
|
const Paginations = (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
|
|
@ -398,20 +402,19 @@ class Detail extends Component{
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div style={{display: (isedit && isedit === item.id) ? "block" : "none"}}>
|
<div style={{display: (isedit && isedit === item.id) ? "block" : "none"}}>
|
||||||
<div className="quillContent">
|
<div className="quillContent mt20">
|
||||||
<QuillForEditor
|
<QuillForEditor
|
||||||
wrapStyle={{
|
wrapStyle={{
|
||||||
height: '220px',
|
height: '220px',
|
||||||
opacity:1,
|
opacity:1,
|
||||||
}}
|
}}
|
||||||
autoFocus={true}
|
autoFocus={true}
|
||||||
style={{ height: '150px' }}
|
style={{ height: '170px' }}
|
||||||
placeholder="添加评论..."
|
placeholder="添加评论..."
|
||||||
options={options}
|
options={options}
|
||||||
value={this.stringJson(this.state.countvalue)}
|
value={countvalue}
|
||||||
onContentChange={this.onContentChange}
|
onContentChange={this.onEditContentChange}
|
||||||
showUploadImage={this.handleShowImage}
|
// showUploadImage={this.handleShowImage}
|
||||||
// onContentChange={handleContentChange}
|
|
||||||
/>
|
/>
|
||||||
<p className="quillFlag">
|
<p className="quillFlag">
|
||||||
{ quillFlag && <span className="">请输入评论内容</span>}
|
{ quillFlag && <span className="">请输入评论内容</span>}
|
||||||
|
|
@ -538,8 +541,7 @@ class Detail extends Component{
|
||||||
options={options}
|
options={options}
|
||||||
value={quillValue}
|
value={quillValue}
|
||||||
onContentChange={this.onContentChange}
|
onContentChange={this.onContentChange}
|
||||||
showUploadImage={this.handleShowImage}
|
// showUploadImage={this.handleShowImage}
|
||||||
// onContentChange={handleContentChange}
|
|
||||||
/>
|
/>
|
||||||
<p className="quillFlag">
|
<p className="quillFlag">
|
||||||
{ quillFlag && <span className="">请输入评论内容</span>}
|
{ quillFlag && <span className="">请输入评论内容</span>}
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ class UpdateDetail extends Component{
|
||||||
|
|
||||||
onContentChange=(value)=>{
|
onContentChange=(value)=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
textcount:value
|
textcount:JSON.stringify(value)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -174,12 +174,12 @@ class UpdateDetail extends Component{
|
||||||
project_id:projectsId,
|
project_id:projectsId,
|
||||||
subject:subject,
|
subject:subject,
|
||||||
id: orderId,
|
id: orderId,
|
||||||
description:JSON.stringify(textcount),
|
description:textcount,
|
||||||
attachment_ids:fileList,
|
attachment_ids:fileList,
|
||||||
...values
|
...values
|
||||||
}).then(result=>{
|
}).then(result=>{
|
||||||
if(result){
|
if(result){
|
||||||
this.props.history.push(`/projects/${projectsId}/orders`);
|
this.props.history.push(`/projects/${projectsId}/orders/${orderId}/detail`);
|
||||||
}
|
}
|
||||||
}).catch(error=>{
|
}).catch(error=>{
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue