修改冲突

This commit is contained in:
sylor_huang@126.com 2020-04-26 16:55:10 +08:00
commit 4ca3237ab8
6 changed files with 223 additions and 183 deletions

View File

@ -242,10 +242,9 @@
</list>
</option>
</component>
<component name="ProjectFrameBounds" extendedState="6" fullScreen="true">
<option name="y" value="23" />
<component name="ProjectFrameBounds" fullScreen="true">
<option name="width" value="1440" />
<option name="height" value="877" />
<option name="height" value="900" />
</component>
<component name="ProjectView">
<navigator proportions="" version="1">

View File

@ -10,6 +10,8 @@ import Attachments from '../Upload/attachment'
import './merge.css';
import QuillForEditor from '../quillForEditor';
import MergeSubmit from './MergeSubmit';
import AmplifyImg from '../Order/AmplifyImg';
const Option = Select.Option;
const TextArea = Input.TextArea;
@ -54,7 +56,9 @@ class MessageCount extends Component{
issue_tag_ids: undefined,
issue_chosen: undefined,
fixed_version_id: undefined,
assigned_to_id: undefined
assigned_to_id: undefined,
imageUrl:undefined,
visible:false
}
}
@ -464,10 +468,21 @@ class MessageCount extends Component{
/>
)
};
handleShowImage=(value)=>{
this.setState({
imageUrl:value,
visible:true
})
}
setVisible=(flag)=>{
this.setState({
visible:flag
})
}
render(){
const { projectsId,mergeId } = this.props.match.params;
const { data,journalsdata, page, limit, search_count, isSpin, isedit, showFiles , commentsContent , quillFlag, editMerge, issue_tag_ids, issue_chosen,fixed_version_id,assigned_to_id } = this.state;
const { data,journalsdata, page, limit, search_count, isSpin, isedit, showFiles , commentsContent , quillFlag, editMerge, issue_tag_ids, issue_chosen,fixed_version_id,assigned_to_id , visible , imageUrl } = this.state;
const { getFieldDecorator } = this.props.form;
const { current_user } = this.props;
const url = this.props.history.location.pathname;
@ -628,14 +643,7 @@ class MessageCount extends Component{
return(
<div className="main">
{/*<div className="topWrapper">*/}
{/*<Nav {...this.props} {...this.state}/>*/}
{/*{*/}
{/*data && data.issue.user_permission ?*/}
{/*<Link to={`/projects/${projectsId}/merge/new`} className="topWrapper_btn">创建合并请求</Link>*/}
{/*: ''*/}
{/*}*/}
{/*</div>*/}
{ visible && <AmplifyImg url={imageUrl} visible={visible} setVisible={this.setVisible}/> }
<div>
<div className="detailContent">
{

View File

@ -0,0 +1,24 @@
import React , { useEffect, useState } from 'react';
import { Modal } from 'antd';
import './order.css';
function AmplifyImg (props){
return(
<Modal
title={null}
footer={null}
visible={props.visible}
onCancel={()=>props.setVisible(false)}
closable={true}
centered={true}
width={'96%'}
className={'AmplifyImg'}
>
<div className={"amplifyContent"}>
<img src={props.url} alt=""/>
</div>
</Modal>
);
}
export default AmplifyImg;

View File

@ -2,16 +2,13 @@ import React , {Component} from 'react';
import {Link} from 'react-router-dom';
import axios from 'axios';
import Nav from './Nav';
import UploadComponent from '../Upload/Index';
import { getImageUrl } from 'educoder';
import {Modal , Form, Input, Tooltip, Popconfirm, Pagination , Spin} from 'antd'
import {Modal , Form , Tooltip, Popconfirm, Pagination , Spin} from 'antd'
import Attachments from '../Upload/attachment';
import QuillForEditor from '../quillForEditor';
import { QuillDeltaToHtmlConverter } from 'quill-delta-to-html'
import AmplifyImg from './AmplifyImg';
const TextArea = Input.TextArea;
const options = [
['bold', 'italic', 'underline'],
[{header: [1,2,3,false]}],
@ -41,7 +38,10 @@ class Detail extends Component{
isSpin:false,
showFiles: true,
quillValue:'',
quillFlag:false
quillFlag:false,
// 点击放大的图片路径
imageUrl:undefined,
visible:false
}
}
@ -313,7 +313,15 @@ class Detail extends Component{
}
handleShowImage=(value)=>{
// console.log("imgOnclick",value);
this.setState({
imageUrl:value,
visible:true
})
}
setVisible=(flag)=>{
this.setState({
visible:flag
})
}
stringJson=(value) =>{
@ -340,14 +348,14 @@ class Detail extends Component{
<QuillForEditor
readOnly={true}
value={_ctx}
// showUploadImage={this.handleShowImage}
showUploadImage={this.handleShowImage}
/>
)
};
render(){
const { projectsId , orderId } = this.props.match.params;
const { data,journalsdata, page, limit, search_count, isSpin, isedit, showFiles , quillValue , quillFlag , countvalue } = this.state;
const { data,journalsdata, page, limit, search_count, isSpin, isedit, showFiles , quillValue , quillFlag , countvalue , imageUrl , visible } = this.state;
const { current_user } = this.props;
const Paginations = (
<React.Fragment>
@ -421,7 +429,6 @@ class Detail extends Component{
options={options}
value={countvalue}
onContentChange={this.onEditContentChange}
// showUploadImage={this.handleShowImage}
/>
<p className="quillFlag">
{ quillFlag && <span className="">请输入评论内容</span>}
@ -461,180 +468,166 @@ class Detail extends Component{
return(
<div className="main">
{/*<div className="topWrapper">*/}
{/*<Nav {...this.props} {...this.state}/>*/}
{/*{*/}
{/*data && data.user_permission ?*/}
{/*<Link to={`/projects/${projectsId}/orders/new`} className="topWrapper_btn">创建任务</Link>*/}
{/*: ''*/}
{/*}*/}
{ visible && <AmplifyImg url={imageUrl} visible={visible} setVisible={this.setVisible}/> }
<div>
<div className="detailContent">
<p>
{
data ?
<span className="font-20">{data.issue_classify === "issue" ? (data.tracker ? data.tracker : "缺陷" ) : "合并请求"}</span>
:
""
}
<span className="font-20" > { data && data.subject }</span>
{/*</div>*/}
<div>
<div className="detailContent">
<p>
{
data ?
<span className="font-20">{data.issue_classify === "issue" ? (data.tracker ? data.tracker : "缺陷" ) : "合并请求"}</span>
:
""
}
<span className="font-20" > { data && data.subject }</span>
</p>
<p className="mt15 color-grey-c">
<span className={data&&data.issue_status==="关闭"?"closedetail":"opendetail"}>{data&&data.issue_status==="关闭"?"关闭中":"开启中"} </span>
<span className="ml10 lineH32">
{ data && data.author_name} { data && data.created_at }创建{ data && data.journals_count && data.journals_count > 0 ?` · ${data.journals_count} 条评论`:""}
</span>
{
data && data.user_permission ?
<span className="pull-right lineH32">
<a className="color-blue fr" onClick={this.copydetail}>复制</a>
<Popconfirm placement="bottom" title={'您确定要删除吗'} okText="是" cancelText="否" onConfirm={()=>this.deletedetail(orderId)}>
<a className="color-blue fr" style={{marginLeft:20,marginRight:20}}>删除</a>
</Popconfirm>
</p>
<p className="mt15 color-grey-c">
<span className={data&&data.issue_status==="关闭"?"closedetail":"opendetail"}>{data&&data.issue_status==="关闭"?"关闭中":"开启中"} </span>
<span className="ml10 lineH32">
{ data && data.author_name} { data && data.created_at }创建{ data && data.journals_count && data.journals_count > 0 ?` · ${data.journals_count} 条评论`:""}
</span>
{
data && data.user_permission ?
<span className="pull-right lineH32">
<a className="color-blue fr" onClick={this.copydetail}>复制</a>
<Popconfirm placement="bottom" title={'您确定要删除吗'} okText="是" cancelText="否" onConfirm={()=>this.deletedetail(orderId)}>
<a className="color-blue fr" style={{marginLeft:20,marginRight:20}}>删除</a>
</Popconfirm>
<Link to={`/projects/${projectsId}/orders/${orderId}/updatedetail`} className="color-blue fr">编辑</Link>
</span>
:
""
}
</p>
<Link to={`/projects/${projectsId}/orders/${orderId}/updatedetail`} className="color-blue fr">编辑</Link>
</span>
:
""
}
</p>
</div>
<div className="f-wrap-between mt20" style={{alignItems:"flex-start"}}>
<div className="item-list-right" >
<div className="df ">
<Link to={`/users/${data && data.author_login}/projects`} className="show-user-link">
<img className="user_img" src={getImageUrl(`images/${data && data.author_picture}`)} alt=""/>
</Link>
{/*<Link to={``}><img className="user_img" src={getImageUrl(`images/${data && data.author_picture}`)} alt=""/></Link>*/}
<div className="detail_context">
<div className="detail_p">
{data&&data.description&&(data.description.length > 0)?this.commentCtx(data.description): <span className="color-grey-9 ml3 mr3">没有描述</span>}
</div>
<div className="f-wrap-between mt20" style={{alignItems:"flex-start"}}>
<div className="item-list-right" >
<div className="df ">
<Link to={``}><img className="user_img" src={getImageUrl(`images/${data && data.author_picture}`)} alt=""/></Link>
<div className="detail_context">
<div className="detail_p">
{data&&data.description&&(data.description.length > 0)?this.commentCtx(data.description): <span className="color-grey-9 ml3 mr3">没有描述</span>}
</div>
{
data && data.attachments && data.attachments.length > 0 ?
<Attachments attachments={data.attachments} showNotification={this.props.showNotification}/>
:
""
}
</div>
{
data && data.attachments && data.attachments.length > 0 ?
<Attachments attachments={data.attachments} showNotification={this.props.showNotification}/>
:
""
}
</div>
</div>
<div className="order_line" style={{marginLeft:80}}></div>
<Spin spinning={isSpin}>
<ul className="ul_width">
{renderList()}
</ul>
</Spin>
{ Paginations }
{
current_user && current_user.login ?
<React.Fragment>
<div className="order_line" style={{marginLeft:80}}></div>
<div className="df">
<Link to={`/users/${current_user && current_user.login}/projects`} className="show-user-link">
<Spin spinning={isSpin}>
<ul className="ul_width">
{renderList()}
</ul>
</Spin>
{ Paginations }
{
current_user && current_user.login ?
<React.Fragment>
<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=""/>
</Link>
<div className="new_context">
<div className="quillContent">
<QuillForEditor
<div className="new_context">
<div className="quillContent">
<QuillForEditor
wrapStyle={{
height: '220px',
opacity:1,
}}
autoFocus={true}
style={{ height: '150px' }}
placeholder="添加评论..."
options={options}
value={quillValue}
onContentChange={this.onContentChange}
// showUploadImage={this.handleShowImage}
/>
<p className="quillFlag">
{ quillFlag && <span className="">请输入评论内容</span>}
wrapStyle={{
height: '220px',
opacity:1,
}}
autoFocus={true}
style={{ height: '150px' }}
placeholder="添加评论..."
options={options}
value={quillValue}
onContentChange={this.onContentChange}
// showUploadImage={this.handleShowImage}
/>
<p className="quillFlag">
{ quillFlag && <span className="">请输入评论内容</span>}
</p>
</div>
<UploadComponent load={this.UploadFunc} isComplete={showFiles} changeIsComplete={this.changeIsComplete}></UploadComponent>
<p className="clearfix mt15">
<a className="topWrapper_btn fr" type="submit" onClick={this.addjournals}>评论</a>
{
data && data.user_permission ?
<a className="Closeor_btn fr" type="submit"
onClick={() => this.closedetail(data && data.issue_status === "关闭" ? 2 : 5)}>{data && data.issue_status === "关闭" ? "重新开启" : "关闭"}</a>
:
""
}
</p>
</div>
<UploadComponent load={this.UploadFunc} isComplete={showFiles} changeIsComplete={this.changeIsComplete}></UploadComponent>
<p className="clearfix mt15">
<a className="topWrapper_btn fr" type="submit" onClick={this.addjournals}>评论</a>
{
data && data.user_permission ?
<a className="Closeor_btn fr" type="submit"
onClick={() => this.closedetail(data && data.issue_status === "关闭" ? 2 : 5)}>{data && data.issue_status === "关闭" ? "重新开启" : "关闭"}</a>
:
""
}
</p>
</div>
</div>
</React.Fragment>
:
<div className="loginDiv"><Link to={`/login`}>登录</Link></div>
}
</React.Fragment>
:
<div className="loginDiv"><Link to={`/login`}>登录</Link></div>
}
</div>
<div className="list-left DetailRight" style={{backgroundColor:"#fff"}}>
<p>
<span className="span_title">分支</span>
<span>{
data && data.branch_name ? data.branch_name : "--"
}</span>
</p>
<p>
<span className="span_title">标签</span>
<span>{
data && data.issue_tags ? <span className="issue-tag-show" style={{background: data.issue_tags[0].color}}>{data.issue_tags[0].name}</span> : "--"
}</span>
</p>
<p style={{display: "inline-block",'white-space': "nowrap" }}>
<span className="span_title">里程碑</span>
<span className="title_overflow">{
data && data.version ? data.version : "--"
}</span>
</p>
<p>
<span className="span_title">当前状态</span>
<span>{
data && data.issue_status ? data.issue_status : "--"
}</span>
</p>
<p>
<span className="span_title">分类</span>
<span>{
data && data.tracker ? data.tracker : "--"
}</span>
</p>
<p>
<span className="span_title">指派给</span>
<span>{data && data.assign_user_name ? data.assign_user_name : "--"}</span>
</p>
<p>
<span className="span_title">优先级</span>
<span>{data && data.priority ? data.priority : "--"}</span>
</p>
<p>
<span className="span_title">完成度</span>
<span>{data && data.done_ratio ? data.done_ratio : "--"}</span>
</p>
</div>
<div className="list-left DetailRight" style={{backgroundColor:"#fff"}}>
<p>
<span className="span_title">分支</span>
<span>{
data && data.branch_name ? data.branch_name : "--"
}</span>
</p>
<p>
<span className="span_title">标签</span>
<span>{
data && data.issue_tags ? <span className="issue-tag-show" style={{background: data.issue_tags[0].color}}>{data.issue_tags[0].name}</span> : "--"
}</span>
</p>
<p style={{display: "inline-block",'white-space': "nowrap" }}>
<span className="span_title">里程碑</span>
<span className="title_overflow">{
data && data.version ? data.version : "--"
}</span>
</p>
<p>
<span className="span_title">当前状态</span>
<span>{
data && data.issue_status ? data.issue_status : "--"
}</span>
</p>
<p>
<span className="span_title">分类</span>
<span>{
data && data.tracker ? data.tracker : "--"
}</span>
</p>
<p>
<span className="span_title">指派给</span>
<span>{data && data.assign_user_name ? data.assign_user_name : "--"}</span>
</p>
<p>
<span className="span_title">优先级</span>
<span>{data && data.priority ? data.priority : "--"}</span>
</p>
<p>
<span className="span_title">完成度</span>
<span>{data && data.done_ratio ? data.done_ratio : "--"}</span>
</p>
</div>
</div>
</div>
</div>
<Modal
onCancel={this.handleCancel}
visible={this.state.isShow}
width="400px"
footer={
[]
}
bodyStyle={{textAlign:'center'}}
>
<img className="list_img" src="https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1608431072,669449145&fm=27&gp=0.jpg" alt=""/>
<Modal
onCancel={this.handleCancel}
visible={this.state.isShow}
width="400px"
footer={
[]
}
bodyStyle={{textAlign:'center'}}
>
<img className="list_img" src="https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1608431072,669449145&fm=27&gp=0.jpg" alt=""/>
</Modal>
</div>
)

View File

@ -535,4 +535,20 @@ a.issue-type-button.active:hover{background: #f4f4f4; color: #4CACFF;}
.ant-dropdown-menu{
max-height: 350px;
overflow-y:auto;
}
.ql-bubble .ql-editor img{
width:100px!important;
}
.AmplifyImg .ant-modal{
padding:0px;
}
.AmplifyImg img{
max-width: 100%;
margin: 0px auto;
}
.AmplifyImg .ant-modal-body{
padding:25px;
}
.amplifyContent{
text-align: center;
}

View File

@ -184,7 +184,7 @@ function QuillForEditor({
_quill.insertEmbed(range.index, 'image', {
url: fileUrl,
alt: '图片信息',
onClick: showUploadImage,
onClick: showUploadImage,
width,
height
});