From 076cc1bae9f9b809f63076965277252bbc4eb05e Mon Sep 17 00:00:00 2001
From: caicai8 <1149225589@qq.com>
Date: Wed, 11 Mar 2020 16:31:46 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=94=BE=E5=A4=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/common/hooks/ImageLayer2.js | 2 +-
public/react/src/modules/page/layers/ImageLayer.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/public/react/src/common/hooks/ImageLayer2.js b/public/react/src/common/hooks/ImageLayer2.js
index 2b1979c74..202a7f343 100644
--- a/public/react/src/common/hooks/ImageLayer2.js
+++ b/public/react/src/common/hooks/ImageLayer2.js
@@ -16,7 +16,7 @@ function ImageLayer2(props) {
const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href')
// 判断imageSrc是否是图片
const fileName = event.target.innerHTML.trim()
- if (isImageExtension(imageSrc.trim()) || isImageExtension(fileName) || event.target.tagName == 'IMG' || imageSrc.indexOf('base64,') != -1) {
+ if (isImageExtension((imageSrc && imageSrc.trim())) || isImageExtension(fileName) || event.target.tagName == 'IMG' || (imageSrc && imageSrc.indexOf('base64,')) != -1) {
// 非回复里的头像图片; 非emoticons
if (imageSrc.indexOf('/images/avatars/User') === -1 &&
imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) {
diff --git a/public/react/src/modules/page/layers/ImageLayer.js b/public/react/src/modules/page/layers/ImageLayer.js
index 921a47d8c..b1adc5b6b 100644
--- a/public/react/src/modules/page/layers/ImageLayer.js
+++ b/public/react/src/modules/page/layers/ImageLayer.js
@@ -19,7 +19,7 @@ class ImageLayer extends Component {
{showImage ?
-
+
:
From bd0060fe87262ed120c7aadf9f843a3a2da106cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Wed, 11 Mar 2020 16:33:08 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modules/question/Questionitem_banks.js | 24 ++++++++++++++++++-
.../question/component/ChoquesEditor.js | 6 +++++
.../question/component/SingleEditor.js | 4 ++++
3 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/public/react/src/modules/question/Questionitem_banks.js b/public/react/src/modules/question/Questionitem_banks.js
index aade5de2e..345ca9753 100644
--- a/public/react/src/modules/question/Questionitem_banks.js
+++ b/public/react/src/modules/question/Questionitem_banks.js
@@ -22,6 +22,7 @@ import JudquestionEditor from "./component/JudquestionEditor";
import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import { connect } from 'react-redux';
import actions from "../../redux/actions";
+import QuestionModalPicture from "./component/QuestionModalPicture";
var restricte=false;
class Questionitem_banks extends Component {
constructor(props) {
@@ -38,6 +39,7 @@ class Questionitem_banks extends Component {
knowledgepoints: [],
disciplmy:[],
pages:1,
+ url:''
}
@@ -526,14 +528,32 @@ class Questionitem_banks extends Component {
this.scrollToAnchor("Itembankstopid");
}
+ handleShowUploadImage=(url)=>{
+ this.setState({
+ url:url
+ })
+ }
+ handleClose=()=>{
+ this.setState({
+ url:'',
+ })
+ }
+
+
render() {
- let {page, limit, count, Headertop, visible, placement, modalsType, item_type,restricte} = this.state;
+ let {page, limit, count, Headertop, visible, placement, modalsType, item_type,restricte,url} = this.state;
const params = this.props && this.props.match && this.props.match.params;
// ////console.log(params);
return (
+
+ {url?
+
this.handleClose()}>
+ :
+ ""
+ }
{
restricte===false?
this.getanswerMdRef(ref)}
+ handleShowUploadImage={(url)=>this.handleShowUploadImage(url)}
>
@@ -594,6 +615,7 @@ class Questionitem_banks extends Component {
{...this.state}
{...this.props}
getanswerMdRef={(ref) => this.getChoquesEditor(ref)}
+ handleShowUploadImage={(url)=>this.handleShowUploadImage(url)}
>
diff --git a/public/react/src/modules/question/component/ChoquesEditor.js b/public/react/src/modules/question/component/ChoquesEditor.js
index 640205d92..3277f03c9 100644
--- a/public/react/src/modules/question/component/ChoquesEditor.js
+++ b/public/react/src/modules/question/component/ChoquesEditor.js
@@ -184,6 +184,12 @@ class ChoquesEditor extends Component{
bindinginputs:i
})
+ try {
+ this.props.handleShowUploadImage(url)
+ }catch (e) {
+
+ }
+
}
componentDidMount = () => {
diff --git a/public/react/src/modules/question/component/SingleEditor.js b/public/react/src/modules/question/component/SingleEditor.js
index 659cd90a2..b34bfa9bb 100644
--- a/public/react/src/modules/question/component/SingleEditor.js
+++ b/public/react/src/modules/question/component/SingleEditor.js
@@ -258,7 +258,11 @@ class SingleEditor extends Component{
url:url,
bindinginputs:i
})
+ try {
+ this.props.handleShowUploadImage(url)
+ }catch (e) {
+ }
}
bindinginputs=(i)=>{
this.setState({