From f289e9c270bb1603a6b86aea13d9b4592aeae4c0 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, 8 Jan 2020 14:32:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=B6=85=E8=BF=87100?= =?UTF-8?q?=E5=AD=97=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../question/component/ChoquesEditor.js | 36 ++++++++++++++---- .../question/component/JudquestionEditor.js | 24 ++++++++++-- .../question/component/SingleEditor.js | 38 ++++++++++++++----- .../modules/testpaper/Paperlibraryeditid.js | 15 ++++++-- public/react/src/modules/tpm/NewHeader.js | 13 +++++-- 5 files changed, 98 insertions(+), 28 deletions(-) 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 {
- + +
this.setnewmyshixunmodelbool(e)} all_score={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_questions_count} all_questions_count={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_score} difficulty={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.difficulty} > - - - +
{ return (
+ {isRender===true?this.Modifyloginvalue()} @@ -1033,13 +1040,11 @@ submittojoinclass=(value)=>{ top: 63px !important; } - .ant-popover-inner-content { - padding:0px !important; - } + ` } -
  • +
  • Date: Wed, 8 Jan 2020 15:15:29 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E9=A2=84=E8=A7=88=20?= =?UTF-8?q?=E8=AF=95=E5=8D=B7=E7=BC=96=E8=BE=91=20=20=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E7=BC=96=E8=BE=91=E5=99=A8=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/question/Paperreview_item.js | 4 +- .../src/modules/question/Paperreview_items.js | 4 +- .../modules/question/Paperreview_single.js | 96 +++++++++++++++++-- .../question/questioncss/questioncom.css | 3 + 4 files changed, 94 insertions(+), 13 deletions(-) diff --git a/public/react/src/modules/question/Paperreview_item.js b/public/react/src/modules/question/Paperreview_item.js index 9112aa248..a9747e8c2 100644 --- a/public/react/src/modules/question/Paperreview_item.js +++ b/public/react/src/modules/question/Paperreview_item.js @@ -426,8 +426,8 @@ class Paperreview_item extends Component { }}>
    -

    题数:{this.props.all_score}

    -

    总分:{this.props.all_questions_count}

    +

    题数:{this.props.all_questions_count}

    +

    总分:{this.props.all_score}

    this.props.setnewmyshixunmodelbool(true)}> diff --git a/public/react/src/modules/question/Paperreview_items.js b/public/react/src/modules/question/Paperreview_items.js index 81ec320b5..8e86c514a 100644 --- a/public/react/src/modules/question/Paperreview_items.js +++ b/public/react/src/modules/question/Paperreview_items.js @@ -59,8 +59,8 @@ class Paperreview_items extends Component { let {paperreviewsingleindex,paperreviewsinglename,typenames,indexs,object,typenamesn}=this.props; // console.log(object); - console.log("Paperreview_items"); - console.log(object.item_id); + // console.log("Paperreview_items"); + // console.log(object.item_id); return (
    { diff --git a/public/react/src/modules/question/Paperreview_single.js b/public/react/src/modules/question/Paperreview_single.js index 5b64372a8..fdc9ff095 100644 --- a/public/react/src/modules/question/Paperreview_single.js +++ b/public/react/src/modules/question/Paperreview_single.js @@ -17,6 +17,7 @@ import Itembankstop from "./component/Itembankstop"; import NoneData from './component/NoneData'; import './questioncss/questioncom.css'; import '../tpm/newshixuns/css/Newshixuns.css'; +import QuillForEditor from "../../common/quillForEditor"; const tagArray = [ 'A.', 'B.', 'C.', 'D.', 'E.', 'F.', 'G.', 'H.', 'I.', @@ -69,13 +70,42 @@ class Paperreview_single extends Component { render() { let {questions, totalscore, total, items} = this.state; let {objectsingle, indexx, paperreviewsingleindex, indexxy,name} = this.props; + + + var itemssname=""; + try { + itemssname= JSON.parse(objectsingle.name); + }catch (e) { + } + if(itemssname===undefined){ + itemssname=objectsingle.name + } return (
    this.props.showparagraphs(indexxy,name)} style={{ minHeight: "114px", }}> - + {/*顶部*/}
    @@ -99,9 +129,35 @@ class Paperreview_single extends Component { ` } -
    -
    + { + objectsingle.item_type==="PROGRAM"? +
    +
    + ({objectsingle.score}分) +
    +
    + +
    +
    + : +
    +
    + ({objectsingle.score}分) +
    +
    + + +
    +
    + } +
    {/*内容*/}
    @@ -114,7 +170,7 @@ class Paperreview_single extends Component { objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => { return (

    - + {object.choice_text}

    @@ -126,8 +182,17 @@ class Paperreview_single extends Component { objectsingle.item_type === "PROGRAM" ?

    -

    + { + objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description? +

    + +

    + : + ""}

    : @@ -137,8 +202,21 @@ class Paperreview_single extends Component { return (

    {tagArray[index]} -

    +

    + {object ? + object.choice_text === undefined || object.choice_text=== null || object.choice_text === "" ? + "" + : + object.choice_text.length>0? + + :"" + : + "" + } +

    ) }) diff --git a/public/react/src/modules/question/questioncss/questioncom.css b/public/react/src/modules/question/questioncss/questioncom.css index 1bdf3853c..ec2df7ca9 100644 --- a/public/react/src/modules/question/questioncss/questioncom.css +++ b/public/react/src/modules/question/questioncss/questioncom.css @@ -948,3 +948,6 @@ .lh26{ line-height: 26px !important; } +.tites{ + color: #888888 !important; +}