From fbd58e0eb2aca619e94a6c5bc988e0fef1078b38 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:43:39 +0800
Subject: [PATCH] =?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 | 3 +-
.../question/component/ChoquesEditor.js | 12 ++++++++
.../question/component/JudquestionEditor.js | 29 ++++++++++++++-----
.../question/component/SingleEditor.js | 12 ++++++++
4 files changed, 48 insertions(+), 8 deletions(-)
diff --git a/public/react/src/modules/question/Questionitem_banks.js b/public/react/src/modules/question/Questionitem_banks.js
index b5364faf7..f09e03dfe 100644
--- a/public/react/src/modules/question/Questionitem_banks.js
+++ b/public/react/src/modules/question/Questionitem_banks.js
@@ -520,6 +520,7 @@ class Questionitem_banks extends Component {
}
handleShowUploadImage=(url)=>{
+ debugger
this.setState({
url:url
})
@@ -541,7 +542,7 @@ class Questionitem_banks extends Component {
>
{url?
- this.handleClose()}>
+ this.handleClose()}>
:
""
}
diff --git a/public/react/src/modules/question/component/ChoquesEditor.js b/public/react/src/modules/question/component/ChoquesEditor.js
index f32fd5072..f72474ad0 100644
--- a/public/react/src/modules/question/component/ChoquesEditor.js
+++ b/public/react/src/modules/question/component/ChoquesEditor.js
@@ -166,7 +166,16 @@ class ChoquesEditor extends Component {
onCancel = () => {
this.props.onEditorCancel()
}
+ handleShowUploadImages=(url)=>{
+ this.setState({
+ url:url,
+ })
+ try {
+ this.props.handleShowUploadImage(url)
+ }catch (e) {
+ }
+ }
handleShowUploadImage = (url,i) => {
this.setState({
@@ -456,6 +465,8 @@ class ChoquesEditor extends Component {
options={options}
value={question_title}
onContentChange={this.onContentChange}
+ showUploadImage={(url)=>this.handleShowUploadImages(url)}
+
/>
@@ -567,6 +578,7 @@ class ChoquesEditor extends Component {
options={options}
value={question_titles}
onContentChange={this.onContentChanges}
+ showUploadImage={(url)=>this.handleShowUploadImages(url)}
/>
diff --git a/public/react/src/modules/question/component/JudquestionEditor.js b/public/react/src/modules/question/component/JudquestionEditor.js
index 716832641..1b651e4d5 100644
--- a/public/react/src/modules/question/component/JudquestionEditor.js
+++ b/public/react/src/modules/question/component/JudquestionEditor.js
@@ -40,12 +40,13 @@ class JudquestionEditor extends Component {
question_title: this.props.question_title !== undefined ? JSON.parse(this.props.question_title) : "",
question_type: this.props.question_type || 0,
question_score: this.props.question_score || this.props.init_question_score,
- question_titles: this.props.question_titles !== undefined ? JSON.parse(this.props.question_titles) : "",
- question_titlesysl: this.props.question_titlesysl || '',
- question_titleysl: this.props.question_title || '',
- zqda: null,
- item_banksedit: [],
- mychoicess: [],
+ question_titles: this.props.question_titles!==undefined?JSON.parse(this.props.question_titles):"",
+ question_titlesysl:this.props.question_titlesysl||'',
+ question_titleysl:this.props.question_title || '',
+ zqda:null,
+ item_banksedit:[],
+ mychoicess:[],
+ url:''
}
}
addOption = () => {
@@ -322,7 +323,17 @@ class JudquestionEditor extends Component {
}
}
}
- onContentChanges = (value, quill) => {
+ handleShowUploadImages=(url)=>{
+ this.setState({
+ url:url,
+ })
+ try {
+ this.props.handleShowUploadImage(url)
+ }catch (e) {
+
+ }
+ }
+ onContentChanges=(value,quill)=>{
const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
@@ -425,6 +436,8 @@ class JudquestionEditor extends Component {
options={options}
value={question_title}
onContentChange={this.onContentChange}
+ showUploadImage={(url)=>this.handleShowUploadImages(url)}
+
/>
@@ -475,6 +488,8 @@ class JudquestionEditor extends Component {
options={options}
value={question_titles}
onContentChange={this.onContentChanges}
+ showUploadImage={(url)=>this.handleShowUploadImages(url)}
+
/>
diff --git a/public/react/src/modules/question/component/SingleEditor.js b/public/react/src/modules/question/component/SingleEditor.js
index 6a14c3861..826d3fd05 100644
--- a/public/react/src/modules/question/component/SingleEditor.js
+++ b/public/react/src/modules/question/component/SingleEditor.js
@@ -239,6 +239,16 @@ class SingleEditor extends Component {
// standard_answers[index] = !standard_answers[index];
this.setState({ standard_answers })
}
+ handleShowUploadImages=(url)=>{
+ this.setState({
+ url:url,
+ })
+ try {
+ this.props.handleShowUploadImage(url)
+ }catch (e) {
+
+ }
+ }
handleShowUploadImage = (url,i) => {
@@ -482,6 +492,7 @@ class SingleEditor extends Component {
options={options}
value={question_title}
onContentChange={this.onContentChange}
+ showUploadImage={(url)=>this.handleShowUploadImages(url)}
/>
@@ -591,6 +602,7 @@ class SingleEditor extends Component {
options={options}
value={question_titles}
onContentChange={this.onContentChanges}
+ showUploadImage={(url)=>this.handleShowUploadImages(url)}
/>