From 1b55988fc542bb58ed37d6cd6ce459506518a7e4 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Sun, 26 Apr 2020 16:07:51 +0800 Subject: [PATCH] =?UTF-8?q?quill=E7=82=B9=E5=87=BB=E6=94=BE=E5=A4=A7?= =?UTF-8?q?=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Merge/MessageCount.js | 28 ++- src/forge/Order/AmplifyImg.js | 24 +++ src/forge/Order/Detail.js | 327 +++++++++++++++--------------- src/forge/Order/order.css | 16 ++ src/forge/quillForEditor/index.js | 2 +- 5 files changed, 222 insertions(+), 175 deletions(-) create mode 100644 src/forge/Order/AmplifyImg.js diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js index 206c6798..3b32036e 100644 --- a/src/forge/Merge/MessageCount.js +++ b/src/forge/Merge/MessageCount.js @@ -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; @@ -626,14 +641,7 @@ class MessageCount extends Component{ return(
- {/*
*/} - {/*
*/} + { visible && }
{ diff --git a/src/forge/Order/AmplifyImg.js b/src/forge/Order/AmplifyImg.js new file mode 100644 index 00000000..53a045a5 --- /dev/null +++ b/src/forge/Order/AmplifyImg.js @@ -0,0 +1,24 @@ +import React , { useEffect, useState } from 'react'; +import { Modal } from 'antd'; + +import './order.css'; +function AmplifyImg (props){ + + return( + props.setVisible(false)} + closable={true} + centered={true} + width={'96%'} + className={'AmplifyImg'} + > +
+ +
+
+ ); +} +export default AmplifyImg; \ No newline at end of file diff --git a/src/forge/Order/Detail.js b/src/forge/Order/Detail.js index dcea8f5a..9877b5bd 100644 --- a/src/forge/Order/Detail.js +++ b/src/forge/Order/Detail.js @@ -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{ ) }; 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 = ( @@ -418,7 +426,6 @@ class Detail extends Component{ options={options} value={countvalue} onContentChange={this.onEditContentChange} - // showUploadImage={this.handleShowImage} />

{ quillFlag && 请输入评论内容} @@ -458,174 +465,166 @@ class Detail extends Component{ return(

- {/*
*/} - {/*