From 3e4f238b2d8e5d5c58664be2a92ee935a4ef24f3 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, 22 Jan 2020 22:20:38 +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/Paperreview_single.js | 12 ++--- .../question/component/ChoquesEditor.js | 30 ++++++++++--- .../question/component/JudquestionEditor.js | 41 ++++++++++++++--- .../modules/question/component/Listjihe.js | 21 +++++++-- .../question/component/SingleEditor.js | 30 ++++++++++--- .../question/questioncss/questioncom.css | 22 ++++++++- .../src/modules/testpaper/Testpaperlibrary.js | 45 +++++++++++++++---- .../testpaper/component/Contentpart.js | 1 + .../modules/testpaper/component/Listjihe.js | 13 +++++- .../testpaper/component/QuestionModalys.js | 42 +++++++++++++++++ 10 files changed, 216 insertions(+), 41 deletions(-) create mode 100644 public/react/src/modules/testpaper/component/QuestionModalys.js diff --git a/public/react/src/modules/question/Paperreview_single.js b/public/react/src/modules/question/Paperreview_single.js index 3eacc9c16..c5bfa9832 100644 --- a/public/react/src/modules/question/Paperreview_single.js +++ b/public/react/src/modules/question/Paperreview_single.js @@ -90,6 +90,7 @@ class Paperreview_single extends Component { }catch (e) { itemsnamesy=objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description; } + var fenshul=(objectsingle.score+"分"); return (
({objectsingle.score}分)
-
+ +
: -
-
+
({objectsingle.score}分)
-
{ itemssname===null|| itemssname===undefined? diff --git a/public/react/src/modules/question/component/ChoquesEditor.js b/public/react/src/modules/question/component/ChoquesEditor.js index 3637fad3e..b218f1e88 100644 --- a/public/react/src/modules/question/component/ChoquesEditor.js +++ b/public/react/src/modules/question/component/ChoquesEditor.js @@ -230,7 +230,11 @@ class ChoquesEditor extends Component{ const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - texts=""; + try { + texts=JSON.stringify(value); + }catch (e) { + texts=""; + } } else { if(_text.length>=301){ var result = _text.substring(0,300); @@ -269,9 +273,15 @@ class ChoquesEditor extends Component{ const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - this.setState({ - question_titleysl:"" - }) + try { + this.setState({ + question_titleysl: JSON.stringify(value) + }) + }catch (e) { + this.setState({ + question_titleysl:"" + }) + } } else { // 提交到后台的内容需要处理一下; var texts=""; @@ -293,9 +303,15 @@ class ChoquesEditor extends Component{ const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - this.setState({ - question_titlesysl:"" - }) + try { + this.setState({ + question_titlesysl: JSON.stringify(value) + }) + }catch (e) { + this.setState({ + question_titlesysl:"" + }) + } } else { // 提交到后台的内容需要处理一下; var texts=""; diff --git a/public/react/src/modules/question/component/JudquestionEditor.js b/public/react/src/modules/question/component/JudquestionEditor.js index 0ab6176b2..cff1f186b 100644 --- a/public/react/src/modules/question/component/JudquestionEditor.js +++ b/public/react/src/modules/question/component/JudquestionEditor.js @@ -187,6 +187,13 @@ class JudquestionEditor extends Component{ }catch (e) { } + const params = this.props && this.props.match && this.props.match.params; + if(JSON.stringify(params) === "{}"){ + //新增 + this.setState({ + zqda:"0" + }) + } } componentDidUpdate(prevProps) { @@ -282,14 +289,29 @@ class JudquestionEditor extends Component{ } onContentChange=(value,quill)=>{ + // console.log("这是题干赋值"); + // console.log(value); + // console.log(quill); const _text = quill.getText(); const reg = /^[\s\S]*.*[^\s][\s\S]*$/; + // console.log(_text); + // console.log(_text.length); if (!reg.test(_text)) { // 处理编辑器内容为空 - this.setState({ - question_titleysl:"" - }) + try { + this.setState({ + question_titleysl:JSON.stringify(value) + }) + }catch (e) { + this.setState({ + question_titleysl:"" + }) + } + + // console.log("空"); } else { + // console.log("有"); + // 提交到后台的内容需要处理一下; var texts=""; if(_text.length>=1001){ @@ -310,9 +332,16 @@ class JudquestionEditor extends Component{ const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - this.setState({ - question_titlesysl:"" - }) + try { + this.setState({ + question_titlesysl:JSON.stringify(value) + }) + }catch (e) { + this.setState({ + question_titlesysl:"" + }) + } + } else { // 提交到后台的内容需要处理一下; var texts=""; diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index cdca0367e..24118ef26 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -319,8 +319,8 @@ class Listjihe extends Component { { items.choosed === true ?

this.Selectingpracticaltrainings(items.id)}> - - 撤销

+ {/**/} + 撤销

: items.item_type === "PROGRAM" ? items.program_attr.status === 0 ? @@ -400,7 +400,15 @@ class Listjihe extends Component { 公开

: - "" + ( + items.public==true? + "" + : +

this.props.showmodelsInaudit(e)}> + + 公开审核中 +

+ ) : "" } @@ -451,7 +459,12 @@ class Listjihe extends Component {
-

+ 解析: +

+

{items ? diff --git a/public/react/src/modules/question/component/SingleEditor.js b/public/react/src/modules/question/component/SingleEditor.js index dffbf620c..fd7f8ce94 100644 --- a/public/react/src/modules/question/component/SingleEditor.js +++ b/public/react/src/modules/question/component/SingleEditor.js @@ -253,7 +253,11 @@ class SingleEditor extends Component{ const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - texts=""; + try { + texts= JSON.stringify(value) + }catch (e) { + texts=""; + } } else { if(_text.length>=301){ var result = _text.substring(0,300); @@ -291,9 +295,15 @@ class SingleEditor extends Component{ const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - this.setState({ - question_titleysl:"" - }) + try { + this.setState({ + question_titleysl: JSON.stringify(value) + }) + }catch (e) { + this.setState({ + question_titleysl:"" + }) + } } else { // 提交到后台的内容需要处理一下; @@ -322,9 +332,15 @@ class SingleEditor extends Component{ const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - this.setState({ - question_titlesysl:"" - }) + try { + this.setState({ + question_titlesysl:JSON.stringify(value) + }) + }catch (e) { + this.setState({ + question_titlesysl:"" + }) + } } else { var texts=""; if(_text.length>=1001){ diff --git a/public/react/src/modules/question/questioncss/questioncom.css b/public/react/src/modules/question/questioncss/questioncom.css index 98edd9915..7f164535b 100644 --- a/public/react/src/modules/question/questioncss/questioncom.css +++ b/public/react/src/modules/question/questioncss/questioncom.css @@ -705,6 +705,9 @@ font-size: 14px; } +.testfondexsysl{ + width:5% !important; +} .yldxtits{ color: #888888; font-size: 14px; @@ -712,7 +715,9 @@ .mt25{ margin-top: 25px; } - +.wt930px{ + width: 930px !important; +} .postitonrelati{ position: relative; } @@ -1072,3 +1077,18 @@ .lh34{ line-height: 34px !important; } +.titesstwos{ + position: relative; +} +.titesstwostest{ + position: absolute; +} +.text-indents40{ + text-indent:40px +} +.text-indents44{ + text-indent:44px +} +.text-indents50{ + text-indent: 50px +} diff --git a/public/react/src/modules/testpaper/Testpaperlibrary.js b/public/react/src/modules/testpaper/Testpaperlibrary.js index 86a267b83..4d9ad75a9 100644 --- a/public/react/src/modules/testpaper/Testpaperlibrary.js +++ b/public/react/src/modules/testpaper/Testpaperlibrary.js @@ -18,6 +18,7 @@ import SiderBar from "../tpm/SiderBar"; import Headplugselections from "../question/component/Headplugselections"; import QuestionModal from "./component/QuestionModal"; import QuestionModals from "./component/QuestionModals"; +import QuestionModalys from "./component/QuestionModalys"; class Testpaperlibrary extends Component { constructor(props) { super(props); @@ -40,6 +41,7 @@ class Testpaperlibrary extends Component { modalsTypes:false, modalsType:false, timuid:0, + modalsTypeInaudit:false, } } getContainer = () => { @@ -138,11 +140,16 @@ class Testpaperlibrary extends Component { } //获取数据 - getdata=(data)=>{ + getdata=(data,bool)=>{ const url = `/examination_banks.json`; - this.setState({ - booljupyterurls:true, - }) + if(bool){ + + }else { + this.setState({ + booljupyterurls:true, + }) + } + axios.get((url), {params: data}).then((response) => { setTimeout(()=>{ this.setState({ @@ -288,7 +295,7 @@ class Testpaperlibrary extends Component { page: this.state.page, per_page:10, }; - this.getdata(data); + this.getdata(data,true); } }).catch((error) => { ////console.log(error); @@ -314,7 +321,7 @@ class Testpaperlibrary extends Component { page: this.state.page, per_page:10, }; - this.getdata(data); + this.getdata(data,true); } }) .catch(function (error) { @@ -325,8 +332,8 @@ class Testpaperlibrary extends Component { showmodels = (id) => { this.setState({ modalsType: true, - titilesm: "在平台审核后,所有成员均可使用试题", - titiless: "是否设置为公开?", + titilesm: "在平台审核后,所有成员均可使用试卷", + titiless: "是否设置为公开", titbool: true, timuid: id }) @@ -337,7 +344,19 @@ class Testpaperlibrary extends Component { } + showmodelsInaudit = (e) => { + this.setState({ + modalsTypeInaudit: true, + titilesm: "公开申请已提交,请等待管理员的审核", + titiless: "我们将在1-2个工作日内完成审核", + }) + }; + modalsTypeInauditbool=()=>{ + this.setState({ + modalsTypeInaudit:false, + }) + } showmodelysl = (id) => { this.setState({ @@ -403,7 +422,7 @@ class Testpaperlibrary extends Component { render() { - let{Headertop,items_count,page,per_page,modalsTypes,modalsType}=this.state; + let{Headertop,items_count,page,per_page,modalsTypes,modalsType,modalsTypeInaudit}=this.state; const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; @@ -424,6 +443,12 @@ class Testpaperlibrary extends Component { setDownload={() => this.setDownload()}> :"" } + { + modalsTypeInaudit===true? + this.modalsTypeInauditbool()} + setDownload={() => this.modalsTypeInauditbool()}> + :"" + } {/*试卷库*/} this.callback(key)} setdatafunsval={(key)=>this.setdatafunsval(key)} setdifficulty={(bool)=>this.setdifficulty(bool)} + showmodelsInaudit={(e)=>this.showmodelsInaudit(e)} + > diff --git a/public/react/src/modules/testpaper/component/Contentpart.js b/public/react/src/modules/testpaper/component/Contentpart.js index 7df1997cd..e0151a2ff 100644 --- a/public/react/src/modules/testpaper/component/Contentpart.js +++ b/public/react/src/modules/testpaper/component/Contentpart.js @@ -222,6 +222,7 @@ class Contentpart extends Component { showmodels={(e)=>this.props.showmodels(e)} showmodelysl={(e)=>this.props.showmodelysl(e)} Isitapopup={this.props.Isitapopup} + showmodelsInaudit={(e)=>this.props.showmodelsInaudit(e)} > diff --git a/public/react/src/modules/testpaper/component/Listjihe.js b/public/react/src/modules/testpaper/component/Listjihe.js index db08b97f3..1ae0d3e70 100644 --- a/public/react/src/modules/testpaper/component/Listjihe.js +++ b/public/react/src/modules/testpaper/component/Listjihe.js @@ -133,12 +133,21 @@ class Listjihe extends Component { } { - items.public === false ? + items.apply===false?

this.props.showmodels(items.id)}> 公开

- :"" + : + ( + items.public==true? + "" + : +

this.props.showmodelsInaudit(e)}> + + 公开审核中 +

+ ) }
:""} diff --git a/public/react/src/modules/testpaper/component/QuestionModalys.js b/public/react/src/modules/testpaper/component/QuestionModalys.js new file mode 100644 index 000000000..7bd704884 --- /dev/null +++ b/public/react/src/modules/testpaper/component/QuestionModalys.js @@ -0,0 +1,42 @@ +import React, { Component } from 'react'; +import {getImageUrl} from 'educoder'; +import { Modal} from 'antd'; +import axios from 'axios'; +import './../../question/questioncss/questioncom.css' +//立即申请试用 +class QuestionModalys extends Component { + + constructor(props) { + super(props); + this.state={ + + } + } + + + render() { + + return( + +
+

{this.props.titilesm}

+

{this.props.titiless}

+
+ this.props.setDownload()}>知道啦 +
+
+
+ ) + } +} + +export default QuestionModalys;