diff --git a/public/react/src/modules/question/component/ChoquesEditor.js b/public/react/src/modules/question/component/ChoquesEditor.js index e31e4b41a..afb7f4b3a 100644 --- a/public/react/src/modules/question/component/ChoquesEditor.js +++ b/public/react/src/modules/question/component/ChoquesEditor.js @@ -234,9 +234,15 @@ class ChoquesEditor extends Component{ // 处理编辑器内容为空 texts=""; } else { - // 提交到后台的内容需要处理一下; - value = JSON.stringify(value) - texts=value; + if(_text.length>=101){ + var result = _text.substring(0,100); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else { + // 提交到后台的内容需要处理一下; + value = JSON.stringify(value); + texts=value; + } } let question_choices = this.state.question_choices.slice(0); question_choices[index] = texts; @@ -270,9 +276,17 @@ class ChoquesEditor extends Component{ }) } else { // 提交到后台的内容需要处理一下; - value = JSON.stringify(value) + var texts=""; + if(_text.length>=101){ + var result = _text.substring(0,100); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else { + value = JSON.stringify(value) + texts=value; + } this.setState({ - question_titleysl:value + question_titleysl:texts }) } } @@ -286,9 +300,17 @@ class ChoquesEditor extends Component{ }) } else { // 提交到后台的内容需要处理一下; - value = JSON.stringify(value) + var texts=""; + if(_text.length>=101){ + var result = _text.substring(0,100); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else { + value = JSON.stringify(value) + texts=value; + } this.setState({ - question_titlesysl:value + question_titleysl:texts }) } } diff --git a/public/react/src/modules/question/component/JudquestionEditor.js b/public/react/src/modules/question/component/JudquestionEditor.js index eb68308db..3adba9e5c 100644 --- a/public/react/src/modules/question/component/JudquestionEditor.js +++ b/public/react/src/modules/question/component/JudquestionEditor.js @@ -288,9 +288,17 @@ class JudquestionEditor extends Component{ }) } else { // 提交到后台的内容需要处理一下; - value = JSON.stringify(value) + var texts=""; + if(_text.length>=101){ + var result = _text.substring(0,100); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else { + value = JSON.stringify(value) + texts=value; + } this.setState({ - question_titleysl:value + question_titleysl:texts }) } } @@ -304,9 +312,17 @@ class JudquestionEditor extends Component{ }) } else { // 提交到后台的内容需要处理一下; - value = JSON.stringify(value) + var texts=""; + if(_text.length>=101){ + var result = _text.substring(0,100); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else { + value =JSON.stringify(value); + texts=value; + } this.setState({ - question_titlesysl:value + question_titleysl:texts }) } } diff --git a/public/react/src/modules/question/component/SingleEditor.js b/public/react/src/modules/question/component/SingleEditor.js index c0135ac1f..bf2c27b36 100644 --- a/public/react/src/modules/question/component/SingleEditor.js +++ b/public/react/src/modules/question/component/SingleEditor.js @@ -255,13 +255,18 @@ class SingleEditor extends Component{ // 处理编辑器内容为空 texts=""; } else { - // 提交到后台的内容需要处理一下; - value = JSON.stringify(value) - texts=value; + if(_text.length>=101){ + var result = _text.substring(0,100); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else { + // 提交到后台的内容需要处理一下; + value = JSON.stringify(value) + texts=value; + } } let question_choices = this.state.question_choices.slice(0); question_choices[index] = texts; - console.log(question_choices); this.setState({ question_choices }); } on_question_score_change = (e) => { @@ -290,9 +295,17 @@ class SingleEditor extends Component{ }) } else { // 提交到后台的内容需要处理一下; - value = JSON.stringify(value) + var texts=""; + if(_text.length>=101){ + var result = _text.substring(0,100); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else { + value = JSON.stringify(value) + texts=value; + } this.setState({ - question_titleysl:value + question_titleysl:texts }) } } @@ -305,10 +318,17 @@ class SingleEditor extends Component{ question_titlesysl:"" }) } else { - // 提交到后台的内容需要处理一下; - value = JSON.stringify(value) + var texts=""; + if(_text.length>=101){ + var result = _text.substring(0,100); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else { + value = JSON.stringify(value) + texts=value; + } this.setState({ - question_titlesysl:value + question_titleysl:texts }) } } diff --git a/public/react/src/modules/testpaper/Paperlibraryeditid.js b/public/react/src/modules/testpaper/Paperlibraryeditid.js index 1b3ee95ef..efcb45496 100644 --- a/public/react/src/modules/testpaper/Paperlibraryeditid.js +++ b/public/react/src/modules/testpaper/Paperlibraryeditid.js @@ -258,17 +258,24 @@ class Paperlibraryeditid extends Component {