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 01/29] =?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; From fe9b028827b5673e9cfcf0048cd6048010e0ac9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 10 Feb 2020 16:26:52 +0800 Subject: [PATCH 02/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/question/component/Listjihe.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index 24118ef26..447fd669b 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -354,7 +354,7 @@ class Listjihe extends Component { this.props.Isitapopup&&this.props.Isitapopup==="true"? "" : - +

编辑 From 875af5efb6a2498baf6f0d65350294142240d622 Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Mon, 10 Feb 2020 18:25:45 +0800 Subject: [PATCH 03/29] update oj url match question --- .../modules/developer/newOrEditTask/index.js | 37 ++++++++++++++++--- .../modules/developer/studentStudy/index.js | 29 +++++++++++---- public/react/src/redux/actions/actionTypes.js | 1 + public/react/src/redux/actions/index.js | 4 +- public/react/src/redux/actions/ojForUser.js | 8 ++-- public/react/src/redux/actions/ojForm.js | 23 +++++++++--- .../react/src/redux/reducers/ojFormReducer.js | 11 +++++- 7 files changed, 90 insertions(+), 23 deletions(-) diff --git a/public/react/src/modules/developer/newOrEditTask/index.js b/public/react/src/modules/developer/newOrEditTask/index.js index 9be899b9c..86dc066b6 100644 --- a/public/react/src/modules/developer/newOrEditTask/index.js +++ b/public/react/src/modules/developer/newOrEditTask/index.js @@ -35,7 +35,9 @@ const NewOrEditTask = (props) => { getUserInfoForNew, handleCancelPublish, validateOjForm, - getQuestion + getQuestion, + saveSearchParams, + setOjInitialValue // updateTestAndValidate, } = props; @@ -61,7 +63,26 @@ const NewOrEditTask = (props) => { // console.log('获取路由参数: ====', props.match.params); const id = props.match.params.id; // 保存OJForm的id号,指明是编辑还是新增 - props.saveOJFormId(id); + props.saveOJFormId(id); + // 获取地址栏查询参数 + const $searchs = window.location.search && window.location.search.substring(1); + if ($searchs) { + const $params = $searchs.split('&') || []; + let obj = Object.create(null); + $params.forEach(item => { + const keys = item.split('='); + obj[keys[0]] = keys[1]; + }); + // 保存初始值 + if (obj['newoj']) { + setOjInitialValue({ + difficult: obj['difficult'], + sub_discipline_id: obj['sub_discipline_id'], + tag_discipline_id: obj['tag_discipline_id'] && obj['tag_discipline_id'].split(',') + }); + } + saveSearchParams({searchParams: $searchs, curPage: obj['pages']}); + } if (id) { // id号即 identifier // TODO id 存在时, 编辑, 获取 store 中的记录数 props.getOJFormById(id); @@ -96,7 +117,8 @@ const NewOrEditTask = (props) => { props.clearOJFormStore(); // 清空描述信息 toStore('oj_description', ''); - props.history.push('/problems'); + // props.history.push('/problems'); + props.history.push(`/question?${props.searchParams}`); } // 发布 @@ -236,7 +258,7 @@ const NewOrEditTask = (props) => { } const mapStateToProps = (state) => { - const { ojForm, identifier, testCases, isPublish } = state.ojFormReducer; + const { ojForm, identifier, testCases, isPublish, searchParams } = state.ojFormReducer; const { publishLoading, submitLoading } = state.commonReducer; const { userInfo } = state.userReducer; return { @@ -246,7 +268,8 @@ const mapStateToProps = (state) => { isPublish, // 是否已发布 publishLoading, submitLoading, - userInfo + userInfo, + searchParams } }; @@ -278,7 +301,9 @@ const mapDispatchToProps = (dispatch) => ({ // 新建时获取信息 getUserInfoForNew: () => dispatch(actions.getUserInfoForNew()), validateOjForm: (props, type, cb) => dispatch(actions.validateOjForm(props, type, cb)), - getQuestion: (params) => dispatch(actions.getQuestion(params)) + getQuestion: (params) => dispatch(actions.getQuestion(params)), + saveSearchParams: (params) => dispatch(actions.saveSearchParams(params)), + setOjInitialValue: (params) => dispatch(actions.setOjInitialValue(params)) }); export default withRouter(connect( diff --git a/public/react/src/modules/developer/studentStudy/index.js b/public/react/src/modules/developer/studentStudy/index.js index 0c8c7012f..184ce0af5 100644 --- a/public/react/src/modules/developer/studentStudy/index.js +++ b/public/react/src/modules/developer/studentStudy/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-23 10:53:19 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-06 15:27:34 + * @LastEditTime : 2020-02-10 18:24:01 */ import './index.scss'; import React, { useEffect, useState } from 'react'; @@ -31,7 +31,9 @@ function StudentStudy (props) { // user_program_identifier, restoreInitialCode, changeUserCodeTab, - changeShowOrHideControl + changeShowOrHideControl, + searchParams, + saveSearchParams } = props; const { @@ -47,7 +49,16 @@ function StudentStudy (props) { saveUserProgramIdentifier(id); // startProgramQuestion(id); getUserProgramDetail(id); - + const $searchs = window.location.search && window.location.search.substring(1); + if ($searchs) { + const $params = $searchs.split('&') || []; + let obj = Object.create(null); + $params.forEach(item => { + const keys = item.split('='); + obj[keys[0]] = keys[1]; + }); + saveSearchParams({searchParams: $searchs, curPage: obj['pages']}); + } if (tab) { changeUserCodeTab(tab); } @@ -97,7 +108,7 @@ function StudentStudy (props) { changeShowOrHideControl(false); props.saveEditorCodeForDetail(''); props.clearOjForUserReducer(); - props.history.push(`/problems/${identifier}/edit`); + props.history.push(`/problems/${identifier}/edit?{searchParams}`); } // 处理退出 const handleClickQuit = () => { @@ -106,7 +117,8 @@ function StudentStudy (props) { // 将控制台关闭 changeShowOrHideControl(false); props.saveEditorCodeForDetail(''); - props.history.push('/problems'); + // props.history.push('/problems'); + props.history.push(`/question?${searchParams}`); } return ( @@ -163,11 +175,13 @@ function StudentStudy (props) { const mapStateToProps = (state) => { const { userInfo } = state.userReducer; const { hack_identifier, user_program_identifier, hack } = state.ojForUserReducer; + const { searchParams } = state.ojFormReducer; return { hack, userInfo, user_program_identifier, - hack_identifier + hack_identifier, + searchParams }; }; @@ -182,7 +196,8 @@ const mapDispatchToProps = (dispatch) => ({ restoreInitialCode: (identifier, msg) => dispatch(actions.restoreInitialCode(identifier, msg)), changeShowOrHideControl: (flag) => dispatch(actions.changeShowOrHideControl(flag)), clearOjForUserReducer: () => dispatch(actions.clearOjForUserReducer()), - changeUserCodeTab: (tab) => dispatch(actions.changeUserCodeTab(tab)) + changeUserCodeTab: (tab) => dispatch(actions.changeUserCodeTab(tab)), + saveSearchParams: (params) => dispatch(actions.saveSearchParams(params)) }); export default withRouter(connect( diff --git a/public/react/src/redux/actions/actionTypes.js b/public/react/src/redux/actions/actionTypes.js index 22dfa5b77..4d422fc91 100644 --- a/public/react/src/redux/actions/actionTypes.js +++ b/public/react/src/redux/actions/actionTypes.js @@ -37,6 +37,7 @@ const types = { GET_COURSE_QUESTION: 'GET_COURSE_QUESTION', // 获取编辑题 CHANGE_KNOWLEDGES: 'CHANGE_KNOWLEDGES', // 保存所选择的知识点 SET_OJ_INITIAL_VALUE: 'SET_OJ_INITIAL_VALUE', // 设置初始值 + SET_SEARCH_PARAMS: 'SET_SEARCH_PARAMS', // 只在地址栏参数 // study SAVE_USER_PROGRAM_ID: 'SAVE_USER_PROGRAM_ID',// 保存用户编程题id值 USER_PROGRAM_DETAIL: 'USER_PROGRAM_DETAIL', // 用户编程题详情 diff --git a/public/react/src/redux/actions/index.js b/public/react/src/redux/actions/index.js index 663e94028..9a7eb7a28 100644 --- a/public/react/src/redux/actions/index.js +++ b/public/react/src/redux/actions/index.js @@ -38,7 +38,8 @@ import { getQuestion, saveKnowledge, setOjInitialValue, - tagDisciplines + tagDisciplines, + saveSearchParams } from './ojForm'; import { @@ -145,6 +146,7 @@ export default { saveKnowledge, setOjInitialValue, tagDisciplines, + saveSearchParams, // addTestCase, deleteTestCase, diff --git a/public/react/src/redux/actions/ojForUser.js b/public/react/src/redux/actions/ojForUser.js index e7520c533..87c877fa5 100644 --- a/public/react/src/redux/actions/ojForUser.js +++ b/public/react/src/redux/actions/ojForUser.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 13:42:11 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-09 14:14:47 + * @LastEditTime : 2020-02-10 18:17:00 */ import types from "./actionTypes"; import { Base64 } from 'js-base64'; @@ -24,7 +24,9 @@ import { notification } from "antd"; // 进入编程页面时,首先调用开启编程题接口 export const startProgramQuestion = (id, props) => { - return (dispatch) => { + return (dispatch, getState) => { + const {searchParams} = getState().ojFormReducer; + console.log(searchParams); fetchStartProgram(id).then(res => { const { status, data } = res; if (status === 200) { @@ -48,7 +50,7 @@ export const startProgramQuestion = (id, props) => { // console.log(path); // props.history.push(`/myproblems/${identifier}`); props.history.push({ - pathname: `/myproblems/${identifier}`, + pathname: `/myproblems/${identifier}?${searchParams}`, }); } } diff --git a/public/react/src/redux/actions/ojForm.js b/public/react/src/redux/actions/ojForm.js index aa8a7f50d..9098dae81 100644 --- a/public/react/src/redux/actions/ojForm.js +++ b/public/react/src/redux/actions/ojForm.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-20 16:35:46 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-07 16:45:34 + * @LastEditTime : 2020-02-10 18:09:17 */ import types from './actionTypes'; import CONST from '../../constants'; @@ -206,7 +206,7 @@ export const validateOjForm = (props, type, cb) => { if (hasSuccess) { // console.log('表单保存的数据为: ', getState()); const {ojFormReducer} = getState(); - const {code, score, ojForm, testCases = [], tag_discipline_id = []} = ojFormReducer; + const {code, score, ojForm, testCases = [], tag_discipline_id = [], curPage = 1} = ojFormReducer; const {category, description, difficult, language, name, openOrNot, timeLimit, sub_discipline_id} = ojForm; let paramsObj = {}; const hack = { // 编程题干 @@ -312,14 +312,19 @@ export const validateOjForm = (props, type, cb) => { payload: identifier }); - console.log(identifier , props.identifier); + // console.log(identifier , props.identifier); if (identifier || props.identifier) { dispatch(getOJFormById(identifier || props.identifier)); } // 保存成功后,调用编辑接口并改变路 if (paramsObj['submitType'] === 'add' && identifier) { - - props.history.push(`/problems/${identifier}/edit`); + //更改查询参数 + dispatch({ + type: types.SET_SEARCH_PARAMS, + searchParams: `editoj=1&pages=${curPage}`, + curPage: curPage + }); + props.history.push(`/problems/${identifier}/edit?editoj=1&pages=${curPage}`); }; } // 保存或更新后,调用start接口 @@ -763,3 +768,11 @@ export const tagDisciplines = (params) => { }); } } + +// 保存地址栏参数 +export const saveSearchParams = (params) => { + return { + type: types.SET_SEARCH_PARAMS, + payload: params + } +} diff --git a/public/react/src/redux/reducers/ojFormReducer.js b/public/react/src/redux/reducers/ojFormReducer.js index 0da4d415b..adbbcfa92 100644 --- a/public/react/src/redux/reducers/ojFormReducer.js +++ b/public/react/src/redux/reducers/ojFormReducer.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-20 16:40:32 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-03 17:38:50 + * @LastEditTime : 2020-02-10 17:59:55 */ import { Base64 } from 'js-base64'; import types from '../actions/actionTypes'; @@ -75,6 +75,8 @@ const init = { isPublish: 0, // 是否是发布状态: 0 未发布 1 已发布 courseQuestions: [], // 课程题库 knowledges: [], // 知识点下拉值 + searchParams: '', // 地址栏参数 + curPage: 1, // 当前页数 } const tcValidateObj = { @@ -350,11 +352,18 @@ const ojFormReducer = (state = initialState, action) => { } case types.SET_OJ_INITIAL_VALUE: const _p = action.payload; + console.log(_p.tag_discipline_id); return { ...state, ojForm: Object.assign({}, state.ojForm, {difficult: _p.difficult, sub_discipline_id: _p.sub_discipline_id}), tag_discipline_id: _p.tag_discipline_id || [] } + case types.SET_SEARCH_PARAMS: + return { + ...state, + searchParams: action.payload.searchParams, + curPage: action.payload.curPage + } default: return state; } From dd694d4624b285b3c3a34ac9ec03ec3682623491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 10 Feb 2020 21:17:05 +0800 Subject: [PATCH 04/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/config/webpack.config.prod.js | 4 ++-- public/react/src/modules/question/Questionitem_banks.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/public/react/config/webpack.config.prod.js b/public/react/config/webpack.config.prod.js index 1fe7a6c93..596843f5f 100644 --- a/public/react/config/webpack.config.prod.js +++ b/public/react/config/webpack.config.prod.js @@ -326,8 +326,8 @@ module.exports = { comments: false }, compress: { - drop_debugger: true, - drop_console: true + drop_debugger: false, + drop_console: false } } }), diff --git a/public/react/src/modules/question/Questionitem_banks.js b/public/react/src/modules/question/Questionitem_banks.js index d62b4f1df..ccf65a49d 100644 --- a/public/react/src/modules/question/Questionitem_banks.js +++ b/public/react/src/modules/question/Questionitem_banks.js @@ -465,7 +465,9 @@ class Questionitem_banks extends Component { sub_discipline_id: Getdatasdata[3].rbkc[1], tag_discipline_id: myrbkc, }); - window.open("/problems/new"); + console.log(Getdatasdata[3].rbkc[1].join(',')); + + // window.open( `/problems/new?difficult=${Getdatasdata[0].rbnd}&sub_discipline_id=\"\"&tag_discipline_id=\"\"&newoj=1&=pages=\"\"`); } From dd0a431c2d8b74a12955099c5c544cddc4c4afb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 11 Feb 2020 15:44:50 +0800 Subject: [PATCH 05/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/question/Question.js | 1 + .../modules/question/Questionitem_banks.js | 24 ++++++++-- .../modules/question/component/Contentpart.js | 45 ++++++++++--------- .../modules/question/component/Listjihe.js | 4 +- 4 files changed, 46 insertions(+), 28 deletions(-) diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index ba0b10b68..5011fa2c7 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -937,6 +937,7 @@ class Question extends Component { /> {/*头部*/} this.chakanjiexibool(e)} diff --git a/public/react/src/modules/question/Questionitem_banks.js b/public/react/src/modules/question/Questionitem_banks.js index ccf65a49d..8828bf94c 100644 --- a/public/react/src/modules/question/Questionitem_banks.js +++ b/public/react/src/modules/question/Questionitem_banks.js @@ -1,6 +1,6 @@ import React, {Component} from "react"; import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder'; +import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder'; import axios from 'axios'; import { notification, @@ -35,13 +35,25 @@ class Questionitem_banks extends Component { myquestion_choicesco: [], disciplinesdata: [], knowledgepoints: [], - disciplmy:[] + disciplmy:[], + pages:1, } } //初始化 componentDidMount() { + const query = this.props.location.search; + const parsed = queryString.parse(query); + console.log(parsed); + try { + this.setState({ + pages:parsed.pages + }) + }catch (e) { + + } + // let {defaultActiveKey}= this.state; // var data={ // public:defaultActiveKey @@ -454,6 +466,7 @@ class Questionitem_banks extends Component { } if (this.state.item_type === "PROGRAM") { //编程题 跳转到 oj 中创建 + debugger var myrbkc=[]; var Getdatasdatas=Getdatasdata[2].rbzsd; for(let myda of Getdatasdatas) { @@ -465,9 +478,12 @@ class Questionitem_banks extends Component { sub_discipline_id: Getdatasdata[3].rbkc[1], tag_discipline_id: myrbkc, }); - console.log(Getdatasdata[3].rbkc[1].join(',')); - // window.open( `/problems/new?difficult=${Getdatasdata[0].rbnd}&sub_discipline_id=\"\"&tag_discipline_id=\"\"&newoj=1&=pages=\"\"`); + let arrays=myrbkc.join(','); + // console.log("开始打印了"); + // console.log(arrays); + + window.open( `/problems/new?difficult=${Getdatasdata[0].rbnd}&sub_discipline_id=${Getdatasdata[3].rbkc[1]}&tag_discipline_id=${arrays}&newoj=1&pages=${this.state.pages}`); } diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index 61a0fb8ea..af81f43c3 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -53,46 +53,46 @@ class Contentpart extends Component { } } xinzenw=(e)=>{ - var urls="?"; + var urls=""; if(this.props.discipline_id){ - if(urls==="?"){ - urls=urls+`discipline_id=${this.props.discipline_id}` - }else { + // if(urls==="?"){ + // urls=urls+`discipline_id=${this.props.discipline_id}` + // }else { urls=urls+`&discipline_id=${this.props.discipline_id}` - } + // } } if(this.props.sub_discipline_id){ - if(urls==="?"){ - urls=urls+`sub_discipline_id=${this.props.sub_discipline_id}` - }else { + // if(urls==="?"){ + // urls=urls+`sub_discipline_id=${this.props.sub_discipline_id}` + // }else { urls=urls+`&sub_discipline_id=${this.props.sub_discipline_id}` - } + // } } if(this.props.tag_discipline_id){ - if(urls==="?"){ - urls=urls+`sub_discipline_id=${this.props.tag_discipline_id}` - }else { + // if(urls==="?"){ + // urls=urls+`sub_discipline_id=${this.props.tag_discipline_id}` + // }else { urls=urls+`&sub_discipline_id=${this.props.tag_discipline_id}` - } + // } } if(this.props.difficulty){ - if(urls==="?"){ - urls=urls+`difficulty=${this.props.difficulty}&` - }else { + // if(urls==="?"){ + // urls=urls+`difficulty=${this.props.difficulty}&` + // }else { urls=urls+`&difficulty=${this.props.difficulty}` - } + // } } if(this.props.item_type){ - if(urls==="?"){ - urls=urls+`item_type=${this.props.item_type}` - }else { + // if(urls==="?"){ + // urls=urls+`item_type=${this.props.item_type}` + // }else { urls=urls+`&item_type=${this.props.item_type}` - } + // } } + this.props.history.push("/question/newitem?pages="+this.props.pages+urls); - this.props.history.push("/question/newitem"+urls); } render() { let {page}=this.state; @@ -316,6 +316,7 @@ class Contentpart extends Component { keindex={index} items={object} key={index} + pages={this.props.pages} getitem_basketss={(id)=>this.props.getitem_basketss(id)} getitem_baskets={(e)=>this.props.getitem_baskets(e)} showmodels={(e)=>this.props.showmodels(e)} diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index 447fd669b..a6370d17e 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -354,7 +354,7 @@ class Listjihe extends Component { this.props.Isitapopup&&this.props.Isitapopup==="true"? "" : - +

编辑 @@ -364,7 +364,7 @@ class Listjihe extends Component { this.props.Isitapopup&&this.props.Isitapopup==="true"? "" : - +

编辑 From d87af3e29b119910ad8dcc8c327fbe1ef7c4a123 Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Tue, 11 Feb 2020 16:47:21 +0800 Subject: [PATCH 06/29] optimize oj knowledge --- .../developer/components/knowledge/index.js | 3 +-- .../modules/developer/newOrEditTask/index.js | 20 +++++++++++-------- .../newOrEditTask/leftpane/editorTab/index.js | 4 ++-- public/react/src/redux/actions/ojForm.js | 4 ++-- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/public/react/src/modules/developer/components/knowledge/index.js b/public/react/src/modules/developer/components/knowledge/index.js index 9598037ab..0a1e00125 100644 --- a/public/react/src/modules/developer/components/knowledge/index.js +++ b/public/react/src/modules/developer/components/knowledge/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-30 13:51:19 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-07 15:46:24 + * @LastEditTime : 2020-02-11 16:34:18 */ import './index.scss'; import React, { useState, useEffect } from 'react'; @@ -22,7 +22,6 @@ function KnowLedge (props) { showAdd, // 显示新增图标 addKnowledge // 调用新增知识点接口 } = props; - useEffect(() => { const _options = []; const _selects = []; diff --git a/public/react/src/modules/developer/newOrEditTask/index.js b/public/react/src/modules/developer/newOrEditTask/index.js index 86dc066b6..565d6af30 100644 --- a/public/react/src/modules/developer/newOrEditTask/index.js +++ b/public/react/src/modules/developer/newOrEditTask/index.js @@ -37,7 +37,8 @@ const NewOrEditTask = (props) => { validateOjForm, getQuestion, saveSearchParams, - setOjInitialValue + setOjInitialValue, + courseQuestions // updateTestAndValidate, } = props; @@ -56,10 +57,6 @@ const NewOrEditTask = (props) => { useEffect(() => { // 获取用户信息 getUserInfoForNew(); - // 获取课程列表 - getQuestion({ - source: 'question' - }); // console.log('获取路由参数: ====', props.match.params); const id = props.match.params.id; // 保存OJForm的id号,指明是编辑还是新增 @@ -75,14 +72,20 @@ const NewOrEditTask = (props) => { }); // 保存初始值 if (obj['newoj']) { + const tags = obj['tag_discipline_id']; + const tag_arrs = (tags && tags.split(',').map(tag => +tag)) || []; setOjInitialValue({ difficult: obj['difficult'], sub_discipline_id: obj['sub_discipline_id'], - tag_discipline_id: obj['tag_discipline_id'] && obj['tag_discipline_id'].split(',') + tag_discipline_id: tag_arrs }); } saveSearchParams({searchParams: $searchs, curPage: obj['pages']}); } + // 获取课程列表 + getQuestion({ + source: 'question' + }); if (id) { // id号即 identifier // TODO id 存在时, 编辑, 获取 store 中的记录数 props.getOJFormById(id); @@ -258,7 +261,7 @@ const NewOrEditTask = (props) => { } const mapStateToProps = (state) => { - const { ojForm, identifier, testCases, isPublish, searchParams } = state.ojFormReducer; + const { ojForm, identifier, testCases, isPublish, searchParams, courseQuestions } = state.ojFormReducer; const { publishLoading, submitLoading } = state.commonReducer; const { userInfo } = state.userReducer; return { @@ -269,7 +272,8 @@ const mapStateToProps = (state) => { publishLoading, submitLoading, userInfo, - searchParams + searchParams, + courseQuestions } }; diff --git a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js index 6fc264663..afa68fb23 100644 --- a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js +++ b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-20 10:35:40 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-10 15:06:23 + * @LastEditTime : 2020-02-11 16:44:57 */ import './index.scss'; // import 'katex/dist/katex.css'; @@ -61,7 +61,7 @@ class EditTab extends React.Component { top: 500, bottom: 20, offsetTop: 0, - showAdd: false + showAdd: props.tag_discipline_id || false // knowledges: [], // coursers: [] // 选中的课程 } diff --git a/public/react/src/redux/actions/ojForm.js b/public/react/src/redux/actions/ojForm.js index 9098dae81..e6fe1309e 100644 --- a/public/react/src/redux/actions/ojForm.js +++ b/public/react/src/redux/actions/ojForm.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-20 16:35:46 * @LastEditors : tangjiang - * @LastEditTime : 2020-02-10 18:09:17 + * @LastEditTime : 2020-02-11 16:29:32 */ import types from './actionTypes'; import CONST from '../../constants'; @@ -696,7 +696,7 @@ export const getQuestion = (params) => { disciplines.forEach(c => { if (sub_discipline_id && c.sub_disciplines) { c.sub_disciplines.forEach(sub => { - if (+sub.id === sub_discipline_id) { + if (+sub.id === +sub_discipline_id) { temp_knowledges = sub.tag_disciplines || []; } }); From 191973cbf5d90ab3df3765fd8f29d31c74775f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 11 Feb 2020 20:19:42 +0800 Subject: [PATCH 07/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/question/Paperreview.js | 2 +- .../modules/question/Questionitem_banks.js | 2 +- .../modules/question/component/Contentpart.js | 7 +- .../question/component/Headplugselections.js | 29 +++++++- .../question/component/Newknledpots.js | 67 ++++++++++++++++--- .../question/questioncss/questioncom.css | 24 ++++++- .../testpaper/component/Contentpart.js | 6 +- 7 files changed, 118 insertions(+), 19 deletions(-) diff --git a/public/react/src/modules/question/Paperreview.js b/public/react/src/modules/question/Paperreview.js index 2adc77c03..bdd5f20a9 100644 --- a/public/react/src/modules/question/Paperreview.js +++ b/public/react/src/modules/question/Paperreview.js @@ -449,7 +449,7 @@ class Paperreview extends Component { this.setCohetepaperbool(bool)} - onSubmits={() => this.preservation()} url={'/question'}> + onSubmits={() => this.preservation()} url={ artificialtype==="artificial"?'/question':'/paperlibrary'}>

) diff --git a/public/react/src/modules/question/Questionitem_banks.js b/public/react/src/modules/question/Questionitem_banks.js index 8828bf94c..bdaa7a12a 100644 --- a/public/react/src/modules/question/Questionitem_banks.js +++ b/public/react/src/modules/question/Questionitem_banks.js @@ -466,7 +466,7 @@ class Questionitem_banks extends Component { } if (this.state.item_type === "PROGRAM") { //编程题 跳转到 oj 中创建 - debugger + // debugger var myrbkc=[]; var Getdatasdatas=Getdatasdata[2].rbzsd; for(let myda of Getdatasdatas) { diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index af81f43c3..6b6c57a43 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -38,7 +38,7 @@ class Contentpart extends Component { } componentDidUpdate(prevProps) { if(prevProps.current_user !== this.props.current_user) { - debugger + 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; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; @@ -97,6 +97,7 @@ class Contentpart extends Component { render() { let {page}=this.state; let {defaultActiveKey,item_type,booljupyterurls}=this.props; + const defaultActiveKeys=defaultActiveKey+''; 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; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; @@ -166,14 +167,14 @@ class Contentpart extends Component { { isysladmins===true||(is_teacher===true&&professional_certification===true)? - this.props.callback(e)}> + this.props.callback(e)}> : - this.props.callback(e)}> + this.props.callback(e)}> diff --git a/public/react/src/modules/question/component/Headplugselections.js b/public/react/src/modules/question/component/Headplugselections.js index b3da84054..51220e28c 100644 --- a/public/react/src/modules/question/component/Headplugselections.js +++ b/public/react/src/modules/question/component/Headplugselections.js @@ -80,10 +80,36 @@ class Headplugselections extends Component { }catch (e) { } + + + } + + shixunserdchAlls=(itme,id)=>{ + if(id!=undefined){ + this.setState({ + shixunsearchAllvalue:id, + }) + try { + this.props.setdiscipline_id(id); + }catch (e) { + + } + + } + console.log(itme); + console.log(itme[0]); + if(itme!=undefined){ + try { + this.props.setsub_discipline_id(id,itme[0].id); + }catch (e) { + + } + } } //获取方向 shixunsearchAll = (id) => { + //大写A //console.log("获取方向"); //console.log(id); if(id!=undefined){ @@ -141,6 +167,7 @@ class Headplugselections extends Component { } } + } render() { let {shixunhoverData, shixunchildValues, shixunsearchAllvalue, InputValue,openStatus,openLevel} = this.state; @@ -233,7 +260,7 @@ class Headplugselections extends Component { return( item.sub_disciplines.length>0? trigger.parentNode} overlay={ overlaymenu(item.sub_disciplines,item.id)} key={key} placement={item.id<4?"bottomRight":item.id>=8?"bottomLeft":"bottomCenter"}> -
  • this.shixunsearchAll(item.id)}> +
  • this.shixunserdchAlls(item.sub_disciplines,item.id)}> {item.name}
  • diff --git a/public/react/src/modules/question/component/Newknledpots.js b/public/react/src/modules/question/component/Newknledpots.js index b299654af..5d234fd5d 100644 --- a/public/react/src/modules/question/component/Newknledpots.js +++ b/public/react/src/modules/question/component/Newknledpots.js @@ -9,7 +9,10 @@ class PaperDeletModel extends Component { constructor(props) { super(props); this.state={ - newkntypeinput:"" + newkntypeinput:"", + errores:false, + errorestit:'', + addonAfteronelens3:0, } } isNull=( str )=>{ @@ -28,12 +31,23 @@ class PaperDeletModel extends Component { // }) // //console.log(e.target.value); // //console.log(e.target.value.length); + if(this.isNull(e.target.value)===true){ this.props.showNotification('不能输入空格'); + this.setState({ + errorestit:'不能输入空格', + errores:true, + boolred:true, + }) return } + this.setState({ - newkntypeinput: e.target.value + newkntypeinput: e.target.value, + addonAfteronelens3:e.target.value.length, + errorestit:'', + errores:false, + boolred:false, }) this.props.setboolred(false); // @@ -48,7 +62,8 @@ class PaperDeletModel extends Component { // }) // } // } - } + }; + mysinputOnBlur=(e)=>{ //console.log("失去焦点了"); } @@ -57,8 +72,28 @@ class PaperDeletModel extends Component { //console.log("获取焦点"); } + NewknTypedeltyoedels=()=>{ + debugger + if(this.state.newkntypeinput.length===0){ + this.setState({ + errorestit:'请输入知识点', + errores:true, + boolred:true, + }) + return + } + if(this.isNull(this.state.newkntypeinput)===true){ + this.setState({ + errorestit:'不能输入空格', + errores:true, + boolred:true, + }) + return + } + this.props.NewknTypedeltyoedel(this.state.newkntypeinput) + } render() { - + let{errores,errorestit,addonAfteronelens3}=this.state; return(
    -
    - + +
    +
    -
    + { + errores===true? +

    {errorestit}

    + :"" + } +
    this.props.NewknTypedeldel(false)}>取消 - this.props.NewknTypedeltyoedel(this.state.newkntypeinput)}>确定 + this.NewknTypedeltyoedels()}>确定
    diff --git a/public/react/src/modules/question/questioncss/questioncom.css b/public/react/src/modules/question/questioncss/questioncom.css index 7f164535b..3fee3fc1e 100644 --- a/public/react/src/modules/question/questioncss/questioncom.css +++ b/public/react/src/modules/question/questioncss/questioncom.css @@ -996,8 +996,28 @@ } .inpustred .ant-input{ - border: 1px solid #f30707; - border-radius: 5px; + border: 1px solid #f30707 !important; + border-right: 0px solid #FFFFff !important; +} +.inpustredysl .ant-input:hover{ + border: 1px solid #f30707 !important; + border-right: 0px solid #FFFFff !important; +} +.inpustredysl .ant-input:active{ + border: 1px solid #f30707 !important; + border-right: 0px solid #FFFFff !important; +} +.inpustredysl .ant-input-group-addon{ + border: 1px solid #f30707 !important; + border-left: 0px solid #FFFFff !important; +} +.inpustredysl .ant-input-group-addon:hover{ + border: 1px solid #f30707 !important; + border-left: 0px solid #FFFFff !important; +} +.inpustredysl .ant-input-group-addon:active{ + border: 1px solid #f30707 !important; + border-left: 0px solid #FFFFff !important; } .mt15{ diff --git a/public/react/src/modules/testpaper/component/Contentpart.js b/public/react/src/modules/testpaper/component/Contentpart.js index e0151a2ff..7f9b4643f 100644 --- a/public/react/src/modules/testpaper/component/Contentpart.js +++ b/public/react/src/modules/testpaper/component/Contentpart.js @@ -57,7 +57,7 @@ class Contentpart extends Component { render() { let {page}=this.state; let {defaultActiveKey}=this.props; - + const defaultActiveKeys=defaultActiveKey+''; 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; @@ -108,14 +108,14 @@ class Contentpart extends Component { { isysladmins===true||(is_teacher===true&&professional_certification===true)? - this.props.callback(e)}> + this.props.callback(e)}> : - this.props.callback(e)}> + this.props.callback(e)}> From edd2f9dfc9949ee0808c3fc604577afc64a20cce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 11 Feb 2020 21:40:42 +0800 Subject: [PATCH 08/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/Paperreview_itemModel.js | 21 +++++++++++++++- .../component/Paperreview_itemModels.js | 24 ++++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/question/component/Paperreview_itemModel.js b/public/react/src/modules/question/component/Paperreview_itemModel.js index b4ceacc02..72c9dd469 100644 --- a/public/react/src/modules/question/component/Paperreview_itemModel.js +++ b/public/react/src/modules/question/component/Paperreview_itemModel.js @@ -20,6 +20,25 @@ class Paperreview_itemModel extends Component { }) } + setDownloadysl=()=>{ + var re = /^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 //判断正整数 /^[1-9]+[0-9]*]*$/ + var nubmer = this.state.value; + + if (!re.test(nubmer)) { + this.props.showNotification(`必须为数值`); + return; + } + + try { + if(nubmer<1){ + this.props.showNotification(`不能小于0`); + return; + } + }catch (e) { + + } + this.props.setDownloady(this.state.value) + } render() { return( @@ -56,7 +75,7 @@ width: 124px !important;
    this.props.Singlemagazine("",false)}>取消 - this.props.setDownloady(this.state.value)}>确定 + this.setDownloadysl()}>确定
    diff --git a/public/react/src/modules/question/component/Paperreview_itemModels.js b/public/react/src/modules/question/component/Paperreview_itemModels.js index ba7978aff..c6d7ce029 100644 --- a/public/react/src/modules/question/component/Paperreview_itemModels.js +++ b/public/react/src/modules/question/component/Paperreview_itemModels.js @@ -21,6 +21,28 @@ class Paperreview_itemModels extends Component { }) } + setDownloadysl=()=>{ + var re = /^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 //判断正整数 /^[1-9]+[0-9]*]*$/ + var nubmer = this.state.value; + + if (!re.test(nubmer)) { + this.props.showNotification(`必须为数值`); + return; + } + + try { + if(nubmer<1){ + this.props.showNotification(`不能小于0`); + return; + } + }catch (e) { + + } + console.log("必须为数值s"); + + this.props.setDownloadys(this.state.value); + } + render() { return( @@ -57,7 +79,7 @@ width: 124px !important;
    this.props.Singlemagazines(false,null)}>取消 - this.props.setDownloadys(this.state.value)}>确定 + this.setDownloadysl()}>确定
    From 57feb3c3459472fbd9acb9e3b1a27504e15c5a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sun, 16 Feb 2020 18:25:49 +0800 Subject: [PATCH 09/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/testpaper/Paperlibraryeditid.js | 4 ++-- public/react/src/modules/testpaper/Paperlibraryseeid.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/testpaper/Paperlibraryeditid.js b/public/react/src/modules/testpaper/Paperlibraryeditid.js index c65191e96..95b867974 100644 --- a/public/react/src/modules/testpaper/Paperlibraryeditid.js +++ b/public/react/src/modules/testpaper/Paperlibraryeditid.js @@ -246,8 +246,8 @@ class Paperlibraryeditid extends Component {
    - 试卷库 - 公告试卷库 + 试卷库 + 公共试卷库 试卷编辑
    diff --git a/public/react/src/modules/testpaper/Paperlibraryseeid.js b/public/react/src/modules/testpaper/Paperlibraryseeid.js index aa9263e67..cde9721ce 100644 --- a/public/react/src/modules/testpaper/Paperlibraryseeid.js +++ b/public/react/src/modules/testpaper/Paperlibraryseeid.js @@ -113,8 +113,8 @@ class Paperlibraryseeid extends Component {
    - 试卷库 - 公告试卷库 + 试卷库 + 公共试卷库 试卷查看
    From 2b3fce0089f359fc95c003af11ee37e40408b82f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 17 Feb 2020 16:50:54 +0800 Subject: [PATCH 10/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/question/component/Headplugselections.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/question/component/Headplugselections.js b/public/react/src/modules/question/component/Headplugselections.js index 51220e28c..aa31e3f00 100644 --- a/public/react/src/modules/question/component/Headplugselections.js +++ b/public/react/src/modules/question/component/Headplugselections.js @@ -259,7 +259,7 @@ class Headplugselections extends Component { disciplinesdata&&disciplinesdata.map((item,key)=>{ return( item.sub_disciplines.length>0? - trigger.parentNode} overlay={ overlaymenu(item.sub_disciplines,item.id)} key={key} placement={item.id<4?"bottomRight":item.id>=8?"bottomLeft":"bottomCenter"}> + trigger.parentNode} overlay={ overlaymenu(item.sub_disciplines,item.id)} key={key} placement={"bottomRight"}>
  • this.shixunserdchAlls(item.sub_disciplines,item.id)}> {item.name}
  • From 5717031a008f759588d97fa3d54e89f8ef0aadc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 17 Feb 2020 17:02:07 +0800 Subject: [PATCH 11/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/question/Paperreview_single.js | 5 ++++- .../react/src/modules/question/component/Listjihe.js | 12 ++++++++---- .../testpaper/component/Paperlibraryseeid_items.js | 4 ++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/question/Paperreview_single.js b/public/react/src/modules/question/Paperreview_single.js index c5bfa9832..6cbfa6ac3 100644 --- a/public/react/src/modules/question/Paperreview_single.js +++ b/public/react/src/modules/question/Paperreview_single.js @@ -91,7 +91,9 @@ class Paperreview_single extends Component { itemsnamesy=objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description; } var fenshul=(objectsingle.score+"分"); - + const options = [ + 'bold', // 加粗 + ] return (
    diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index a6370d17e..a858449b3 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -151,10 +151,13 @@ class Listjihe extends Component { }catch (e) { analysisnames=items&&items.analysis; } - console.log(items.name); - console.log(itemsnamesy); - - console.log(analysisnames); + // console.log(items.name); + // console.log(itemsnamesy); + // + // console.log(analysisnames); + const options = [ + 'bold', // 加粗 + ] return (
    @@ -195,6 +198,7 @@ class Listjihe extends Component { items.name.length>0? itemssname===null|| itemssname===undefined?"": diff --git a/public/react/src/modules/testpaper/component/Paperlibraryseeid_items.js b/public/react/src/modules/testpaper/component/Paperlibraryseeid_items.js index c7c974c5b..423cd6b04 100644 --- a/public/react/src/modules/testpaper/component/Paperlibraryseeid_items.js +++ b/public/react/src/modules/testpaper/component/Paperlibraryseeid_items.js @@ -87,6 +87,9 @@ class Paperlibraryseeid_items extends Component { }catch (e) { itemsnamesy=objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description; } + const options = [ + 'bold', // 加粗 + ] return (
    From c6b13f1090eb6d727d7ad7dc9686c9db12750f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 17 Feb 2020 17:28:12 +0800 Subject: [PATCH 12/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 6 +++--- .../modules/question/Paperreview_single.js | 19 ++++++++++------- .../modules/question/component/Listjihe.js | 21 ++++++++++++++----- .../component/Paperlibraryseeid_items.js | 19 +++++++++++------ 4 files changed, 44 insertions(+), 21 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 4667ebbde..e321b4d2e 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -42,11 +42,11 @@ if (isDev) { window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' } // 超管 -// debugType="admin"; +debugType="admin"; // 老师 -//debugType="teacher"; +// debugType="teacher"; // 学生 -debugType="student"; +// debugType="student"; diff --git a/public/react/src/modules/question/Paperreview_single.js b/public/react/src/modules/question/Paperreview_single.js index 6cbfa6ac3..4066658b9 100644 --- a/public/react/src/modules/question/Paperreview_single.js +++ b/public/react/src/modules/question/Paperreview_single.js @@ -125,7 +125,7 @@ class Paperreview_single extends Component { {/*顶部*/}
    -

    {indexx}

    、 +

    {indexx}

    @@ -149,13 +155,13 @@ class Paperreview_single extends Component { objectsingle.item_type==="PROGRAM"?
    ({objectsingle.score}分)
    -
    @@ -163,19 +169,18 @@ class Paperreview_single extends Component { :
    ({objectsingle.score}分)
    -
    { itemssname===null|| itemssname===undefined? "" : @@ -212,7 +217,7 @@ class Paperreview_single extends Component {

    { objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description? -

    { itemsnamesy===null || itemsnamesy===undefined? diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index a858449b3..47e460736 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -168,18 +168,29 @@ class Listjihe extends Component { padding-left: 0px !important; padding-top: 0px !important; } - + .markdown-body .ql-editor p span{ + font-weight: bold; + } + .markdown-body .ql-editor p { + font-weight: bold; + } .programquill .ql-editor{ padding-left: 0px !important; padding-top: 0px !important; } + .ql-editor{ + display: inline-block; + text-align: justify; + } ` }

    -
    +
    { this.props.listjihe }. @@ -187,10 +198,11 @@ class Listjihe extends Component { { items.item_type==="PROGRAM"? -
    +
    : -
    +
    + { items===undefined||items===null||items===""?"": items.name === undefined || items.name === null || items.name === "" ? "" @@ -198,7 +210,6 @@ class Listjihe extends Component { items.name.length>0? itemssname===null|| itemssname===undefined?"": diff --git a/public/react/src/modules/testpaper/component/Paperlibraryseeid_items.js b/public/react/src/modules/testpaper/component/Paperlibraryseeid_items.js index 423cd6b04..9fffcca76 100644 --- a/public/react/src/modules/testpaper/component/Paperlibraryseeid_items.js +++ b/public/react/src/modules/testpaper/component/Paperlibraryseeid_items.js @@ -121,7 +121,7 @@ class Paperlibraryseeid_items extends Component { {/*顶部*/}
    -

    {indexx}

    、 +

    {indexx}

    @@ -145,12 +153,12 @@ class Paperlibraryseeid_items extends Component { objectsingle.item_type==="PROGRAM"?
    ({objectsingle.score}分)
    -
    @@ -158,18 +166,17 @@ class Paperlibraryseeid_items extends Component { :
    ({objectsingle.score}分)
    -
    { itemssname===null || itemssname===undefined? "" : From 704e9dcf4da107f018bf73f83663ee9efdeb0c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 17 Feb 2020 18:17:32 +0800 Subject: [PATCH 13/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/Video/LiveItem.js | 2 +- public/react/src/modules/courses/Video/VideoIndex.js | 2 +- public/react/src/modules/question/Questionitem_banks.js | 5 ++++- public/react/src/modules/question/component/Itembankstop.js | 4 ++++ .../modules/question/comthetestpaper/Comthetestpaperst.js | 4 ++++ .../question/comthetestpaper/Intelligentcomponents.js | 4 ++++ 6 files changed, 18 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/Video/LiveItem.js b/public/react/src/modules/courses/Video/LiveItem.js index 913235ef0..b71e5b02b 100644 --- a/public/react/src/modules/courses/Video/LiveItem.js +++ b/public/react/src/modules/courses/Video/LiveItem.js @@ -174,4 +174,4 @@ class LiveItem extends Component{ ) } } -export default LiveItem; \ No newline at end of file +export default LiveItem; diff --git a/public/react/src/modules/courses/Video/VideoIndex.js b/public/react/src/modules/courses/Video/VideoIndex.js index 598810759..5cd2db851 100644 --- a/public/react/src/modules/courses/Video/VideoIndex.js +++ b/public/react/src/modules/courses/Video/VideoIndex.js @@ -287,4 +287,4 @@ class VideoIndex extends Component{ ) } } -export default VideoIndex; \ No newline at end of file +export default VideoIndex; diff --git a/public/react/src/modules/question/Questionitem_banks.js b/public/react/src/modules/question/Questionitem_banks.js index bdaa7a12a..c357fb136 100644 --- a/public/react/src/modules/question/Questionitem_banks.js +++ b/public/react/src/modules/question/Questionitem_banks.js @@ -509,7 +509,10 @@ class Questionitem_banks extends Component { From 91722ce9d7f085f5184b39df989e31e0df287ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 18 Feb 2020 13:59:22 +0800 Subject: [PATCH 15/29] =?UTF-8?q?=E9=A2=98=E5=BA=93=E5=AD=97=E6=95=B0?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/question/Questionitem_banks.js | 2 +- .../question/component/ChoquesEditor.js | 12 ++++----- .../question/component/Itembankstop.js | 1 - .../question/component/JudquestionEditor.js | 8 +++--- .../question/component/Newknledpots.js | 1 - .../question/component/SingleEditor.js | 27 ++++++++++++++----- .../comthetestpaper/Comthetestpaperst.js | 1 - .../comthetestpaper/Intelligentcomponents.js | 1 - 8 files changed, 31 insertions(+), 22 deletions(-) diff --git a/public/react/src/modules/question/Questionitem_banks.js b/public/react/src/modules/question/Questionitem_banks.js index c357fb136..11605ec6d 100644 --- a/public/react/src/modules/question/Questionitem_banks.js +++ b/public/react/src/modules/question/Questionitem_banks.js @@ -511,7 +511,7 @@ class Questionitem_banks extends Component { ` body{ width: 100%!important; - overflow: hidden!important; + } .newFooter{ display: none; diff --git a/public/react/src/modules/question/component/ChoquesEditor.js b/public/react/src/modules/question/component/ChoquesEditor.js index b218f1e88..0df3f36ff 100644 --- a/public/react/src/modules/question/component/ChoquesEditor.js +++ b/public/react/src/modules/question/component/ChoquesEditor.js @@ -236,8 +236,8 @@ class ChoquesEditor extends Component{ texts=""; } } else { - if(_text.length>=301){ - var result = _text.substring(0,300); + if(_text.length>=500){ + var result = _text.substring(0,450); texts={"ops":[{"insert":result}]}; texts=JSON.stringify(texts); }else { @@ -285,8 +285,8 @@ class ChoquesEditor extends Component{ } else { // 提交到后台的内容需要处理一下; var texts=""; - if(_text.length>=1001){ - var result = _text.substring(0,1000); + if(_text.length>=979){ + var result = _text.substring(0,975); texts={"ops":[{"insert":result}]}; texts=JSON.stringify(texts); }else { @@ -315,8 +315,8 @@ class ChoquesEditor extends Component{ } else { // 提交到后台的内容需要处理一下; var texts=""; - if(_text.length>=1001){ - var result = _text.substring(0,1000); + if(_text.length>=979){ + var result = _text.substring(0,975); texts={"ops":[{"insert":result}]}; texts=JSON.stringify(texts); }else { diff --git a/public/react/src/modules/question/component/Itembankstop.js b/public/react/src/modules/question/component/Itembankstop.js index 3b6c34564..126dc6bc8 100644 --- a/public/react/src/modules/question/component/Itembankstop.js +++ b/public/react/src/modules/question/component/Itembankstop.js @@ -683,7 +683,6 @@ class Itembankstop extends Component { ` body{ width: 100%!important; - overflow: hidden!important; } .ant-form-item{ margin-bottom: 0px !important; diff --git a/public/react/src/modules/question/component/JudquestionEditor.js b/public/react/src/modules/question/component/JudquestionEditor.js index cff1f186b..e105ca2b7 100644 --- a/public/react/src/modules/question/component/JudquestionEditor.js +++ b/public/react/src/modules/question/component/JudquestionEditor.js @@ -314,8 +314,8 @@ class JudquestionEditor extends Component{ // 提交到后台的内容需要处理一下; var texts=""; - if(_text.length>=1001){ - var result = _text.substring(0,1000); + if(_text.length>=979){ + var result = _text.substring(0,975); texts={"ops":[{"insert":result}]}; texts=JSON.stringify(texts); }else { @@ -345,8 +345,8 @@ class JudquestionEditor extends Component{ } else { // 提交到后台的内容需要处理一下; var texts=""; - if(_text.length>=1001){ - var result = _text.substring(0,1000); + if(_text.length>=979){ + var result = _text.substring(0,975); texts={"ops":[{"insert":result}]}; texts=JSON.stringify(texts); }else { diff --git a/public/react/src/modules/question/component/Newknledpots.js b/public/react/src/modules/question/component/Newknledpots.js index 13194b263..98f766196 100644 --- a/public/react/src/modules/question/component/Newknledpots.js +++ b/public/react/src/modules/question/component/Newknledpots.js @@ -116,7 +116,6 @@ class PaperDeletModel extends Component { body{ width: 100%!important; - overflow: hidden!important; } ` diff --git a/public/react/src/modules/question/component/SingleEditor.js b/public/react/src/modules/question/component/SingleEditor.js index fd7f8ce94..76137b211 100644 --- a/public/react/src/modules/question/component/SingleEditor.js +++ b/public/react/src/modules/question/component/SingleEditor.js @@ -21,7 +21,8 @@ const tagArray = [ 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' ] - +const stringmysl=`"{"ops":[{"insert":"阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈"}]}"` +const srruhsldssd=`"{"ops":[{"insert":"萨克卡了丽萨啊死拉屎加拉加斯来得及啦睡觉就辣椒链接啊死了就丽萨链接金蛇郎君看见啊死了就链接啊离开家辣椒水金拉丝就链接里撒娇接口将阿拉斯加就啊链接是老伦就啊急死了拉丝就啊死了姐就啊死离开了谁姐啦链接里就是离开家链接啊了就辣椒金蛇郎君链接看见啊死就辣椒阿利森大家撒链接链接啊死了姐离开就撒链接的里撒娇库萨了家里就啊睡觉啊死了萨克卡了丽萨啊死拉屎加拉加斯来得及啦睡觉就辣椒链接啊死了就丽萨链接金蛇郎君看见啊死了就链接啊离开家辣椒水金拉丝就链接里撒娇接口将阿拉斯加就啊链接是老伦就啊急死了拉丝就啊死了姐就啊死离开了谁姐啦链接里就是离开家链接啊了就辣椒金蛇郎君链接看见啊死就辣椒阿利森大家撒链接链接啊死了姐离开就撒链接的里撒娇库萨了家里就啊睡觉啊死了萨克卡了丽萨啊死拉屎加拉加斯来得及啦睡觉就辣椒链接啊死了就丽萨链接金蛇郎君看见啊死了就链接啊离开家辣椒水金拉丝就链接里撒娇接口将阿拉斯加就啊链接是老伦就啊急死了拉丝就啊死了姐就啊死离开了谁姐啦链接里就是离开家链接啊了就辣椒金蛇郎君链接看见啊死就辣椒阿利森大家撒链接链接啊死了姐离开就撒链接的里撒娇库萨了家里就啊睡觉啊死了萨克卡了丽萨啊死拉屎加拉加斯来得及啦睡觉就辣椒链接啊死了就丽萨链接金蛇郎君看见啊死了就链接啊离开家辣椒水金拉丝就链接里撒娇接口将阿拉斯加就啊链接是老伦就啊急死了拉丝就啊死了姐就啊死离开了谁姐啦链接里就是离开家链接啊了就辣椒金蛇郎君链接看见啊死就辣椒阿利森大家撒链接链接啊死了姐离开就撒链接的里撒娇库萨了家里就啊睡觉啊死了萨克卡了丽萨啊死拉屎加拉加斯来得及啦睡觉就辣椒链接啊死了就丽萨链接金蛇郎君看见啊死了就链接啊离开家辣椒水金拉丝就链接里撒娇接口将阿拉斯加就啊链接是老伦就啊急死了拉丝就啊死了姐就啊死离开了谁姐啦链接里就是离开家链接啊了就辣椒金蛇郎君链接看见啊死就辣椒阿利森大家撒链接链接啊死了姐离开就撒链接的里撒娇库萨了家里就啊睡觉啊死了萨克卡了丽萨啊死拉屎加拉加斯来得及啦睡觉就辣椒链接啊死了就丽萨链接金蛇郎君看见啊死了就链接啊离开家辣椒水金拉丝就链接里撒娇接口将阿拉斯加就啊链接是老伦就啊急死了拉丝就啊死了姐就啊死离开了谁姐啦链接里就是离开家链接啊了就辣椒金蛇郎君链接看见啊死就辣椒阿利森大家撒链接链接啊死了姐离开就撒链接的里撒娇库萨了家里就啊睡觉啊死了萨克卡了丽萨啊死拉屎加拉加斯来得及啦睡"}]}"` //题库的试卷 单选题 组件 class SingleEditor extends Component{ constructor(props){ @@ -259,8 +260,8 @@ class SingleEditor extends Component{ texts=""; } } else { - if(_text.length>=301){ - var result = _text.substring(0,300); + if(_text.length>=500){ + var result = _text.substring(0,450); texts={"ops":[{"insert":result}]}; texts=JSON.stringify(texts); }else { @@ -290,6 +291,8 @@ class SingleEditor extends Component{ } onContentChange=(value,quill)=>{ + console.log("stringmysl"); + console.log(stringmysl.length); var _text = quill.getText(); const reg = /^[\s\S]*.*[^\s][\s\S]*$/; @@ -308,10 +311,14 @@ class SingleEditor extends Component{ // 提交到后台的内容需要处理一下; var texts=""; - if(_text.length>=1001){ - var result = _text.substring(0,1000); + if(_text.length>=979){ + var result = _text.substring(0,975); + console.log("11111111"); + console.log(result.length); texts={"ops":[{"insert":result}]}; texts=JSON.stringify(texts); + console.log("2222"); + console.log(texts.length); }else { value = JSON.stringify(value) texts=value; @@ -328,6 +335,8 @@ class SingleEditor extends Component{ } } onContentChanges=(value,quill)=>{ + console.log("srruhsldssd"); + console.log(srruhsldssd.length); const _text = quill.getText(); const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { @@ -343,10 +352,14 @@ class SingleEditor extends Component{ } } else { var texts=""; - if(_text.length>=1001){ - var result = _text.substring(0,1000); + if(_text.length>=979){ + var result = _text.substring(0,975); + console.log("33333333"); + console.log(result.length); texts={"ops":[{"insert":result}]}; texts=JSON.stringify(texts); + console.log("44444444"); + console.log(texts.length); }else { value = JSON.stringify(value) texts=value; diff --git a/public/react/src/modules/question/comthetestpaper/Comthetestpaperst.js b/public/react/src/modules/question/comthetestpaper/Comthetestpaperst.js index 573e5fce9..a426e7ea7 100644 --- a/public/react/src/modules/question/comthetestpaper/Comthetestpaperst.js +++ b/public/react/src/modules/question/comthetestpaper/Comthetestpaperst.js @@ -623,7 +623,6 @@ class Comthetestpaperst extends Component { ` body{ width: 100%!important; - overflow: hidden!important; } .ant-form-item{ margin-bottom: 0px !important; diff --git a/public/react/src/modules/question/comthetestpaper/Intelligentcomponents.js b/public/react/src/modules/question/comthetestpaper/Intelligentcomponents.js index 34500381f..590de9e39 100644 --- a/public/react/src/modules/question/comthetestpaper/Intelligentcomponents.js +++ b/public/react/src/modules/question/comthetestpaper/Intelligentcomponents.js @@ -535,7 +535,6 @@ class Intelligentcomponents extends Component { ` body{ width: 100%!important; - overflow: hidden!important; } .ant-form-item{ margin-bottom: 0px !important; From 91dfb46fdca81fbca4a92582eb4398be747e88f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 18 Feb 2020 14:00:58 +0800 Subject: [PATCH 16/29] =?UTF-8?q?=E5=A4=9A=E9=80=89=E9=A2=98=E9=A2=98?= =?UTF-8?q?=E5=BA=93=E5=AD=97=E6=95=B0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/question/component/SingleEditor.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/public/react/src/modules/question/component/SingleEditor.js b/public/react/src/modules/question/component/SingleEditor.js index 76137b211..cd4096663 100644 --- a/public/react/src/modules/question/component/SingleEditor.js +++ b/public/react/src/modules/question/component/SingleEditor.js @@ -21,8 +21,6 @@ const tagArray = [ 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' ] -const stringmysl=`"{"ops":[{"insert":"阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈老师挨家挨户啊哈咯阿萨德家啊卡阿萨德就卡号上课讲啊爱睡觉打卡时大家卡号是阿哈电视的了就啊好受点哈是贺卡上了啊是还浪费哈说考虑好了哈哈反馈就金拉丝哈说了哈"}]}"` -const srruhsldssd=`"{"ops":[{"insert":"萨克卡了丽萨啊死拉屎加拉加斯来得及啦睡觉就辣椒链接啊死了就丽萨链接金蛇郎君看见啊死了就链接啊离开家辣椒水金拉丝就链接里撒娇接口将阿拉斯加就啊链接是老伦就啊急死了拉丝就啊死了姐就啊死离开了谁姐啦链接里就是离开家链接啊了就辣椒金蛇郎君链接看见啊死就辣椒阿利森大家撒链接链接啊死了姐离开就撒链接的里撒娇库萨了家里就啊睡觉啊死了萨克卡了丽萨啊死拉屎加拉加斯来得及啦睡觉就辣椒链接啊死了就丽萨链接金蛇郎君看见啊死了就链接啊离开家辣椒水金拉丝就链接里撒娇接口将阿拉斯加就啊链接是老伦就啊急死了拉丝就啊死了姐就啊死离开了谁姐啦链接里就是离开家链接啊了就辣椒金蛇郎君链接看见啊死就辣椒阿利森大家撒链接链接啊死了姐离开就撒链接的里撒娇库萨了家里就啊睡觉啊死了萨克卡了丽萨啊死拉屎加拉加斯来得及啦睡觉就辣椒链接啊死了就丽萨链接金蛇郎君看见啊死了就链接啊离开家辣椒水金拉丝就链接里撒娇接口将阿拉斯加就啊链接是老伦就啊急死了拉丝就啊死了姐就啊死离开了谁姐啦链接里就是离开家链接啊了就辣椒金蛇郎君链接看见啊死就辣椒阿利森大家撒链接链接啊死了姐离开就撒链接的里撒娇库萨了家里就啊睡觉啊死了萨克卡了丽萨啊死拉屎加拉加斯来得及啦睡觉就辣椒链接啊死了就丽萨链接金蛇郎君看见啊死了就链接啊离开家辣椒水金拉丝就链接里撒娇接口将阿拉斯加就啊链接是老伦就啊急死了拉丝就啊死了姐就啊死离开了谁姐啦链接里就是离开家链接啊了就辣椒金蛇郎君链接看见啊死就辣椒阿利森大家撒链接链接啊死了姐离开就撒链接的里撒娇库萨了家里就啊睡觉啊死了萨克卡了丽萨啊死拉屎加拉加斯来得及啦睡觉就辣椒链接啊死了就丽萨链接金蛇郎君看见啊死了就链接啊离开家辣椒水金拉丝就链接里撒娇接口将阿拉斯加就啊链接是老伦就啊急死了拉丝就啊死了姐就啊死离开了谁姐啦链接里就是离开家链接啊了就辣椒金蛇郎君链接看见啊死就辣椒阿利森大家撒链接链接啊死了姐离开就撒链接的里撒娇库萨了家里就啊睡觉啊死了萨克卡了丽萨啊死拉屎加拉加斯来得及啦睡觉就辣椒链接啊死了就丽萨链接金蛇郎君看见啊死了就链接啊离开家辣椒水金拉丝就链接里撒娇接口将阿拉斯加就啊链接是老伦就啊急死了拉丝就啊死了姐就啊死离开了谁姐啦链接里就是离开家链接啊了就辣椒金蛇郎君链接看见啊死就辣椒阿利森大家撒链接链接啊死了姐离开就撒链接的里撒娇库萨了家里就啊睡觉啊死了萨克卡了丽萨啊死拉屎加拉加斯来得及啦睡"}]}"` //题库的试卷 单选题 组件 class SingleEditor extends Component{ constructor(props){ @@ -291,8 +289,6 @@ class SingleEditor extends Component{ } onContentChange=(value,quill)=>{ - console.log("stringmysl"); - console.log(stringmysl.length); var _text = quill.getText(); const reg = /^[\s\S]*.*[^\s][\s\S]*$/; @@ -335,8 +331,6 @@ class SingleEditor extends Component{ } } onContentChanges=(value,quill)=>{ - console.log("srruhsldssd"); - console.log(srruhsldssd.length); const _text = quill.getText(); const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { From 3610b7e687448b196010b0e70a1dfc8bea13b986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 18 Feb 2020 14:15:48 +0800 Subject: [PATCH 17/29] =?UTF-8?q?=E5=A4=9A=E9=80=89=E9=A2=98=E9=A2=98?= =?UTF-8?q?=E5=BA=93=E5=AD=97=E6=95=B0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../question/component/ChoquesEditor.js | 39 ++++++++++++-- .../question/component/JudquestionEditor.js | 24 +++++++-- .../question/component/SingleEditor.js | 52 ++++++++++++++----- 3 files changed, 92 insertions(+), 23 deletions(-) diff --git a/public/react/src/modules/question/component/ChoquesEditor.js b/public/react/src/modules/question/component/ChoquesEditor.js index 0df3f36ff..0e483cf9f 100644 --- a/public/react/src/modules/question/component/ChoquesEditor.js +++ b/public/react/src/modules/question/component/ChoquesEditor.js @@ -243,7 +243,15 @@ class ChoquesEditor extends Component{ }else { // 提交到后台的内容需要处理一下; value = JSON.stringify(value); - texts=value; + if(value.length>=500){ + let a=value.length-500; + let b=_text.length-a; + var result = _text.substring(0,b); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else{ + texts=value; + } } } let question_choices = this.state.question_choices.slice(0); @@ -269,6 +277,7 @@ class ChoquesEditor extends Component{ } onContentChange=(value,quill)=>{ + debugger const _text = quill.getText(); const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { @@ -289,9 +298,19 @@ class ChoquesEditor extends Component{ var result = _text.substring(0,975); texts={"ops":[{"insert":result}]}; texts=JSON.stringify(texts); + console.log("111111111"); + console.log(texts.length); }else { - value = JSON.stringify(value) - texts=value; + value = JSON.stringify(value); + if(value.length>=1000){ + let a=value.length-1000; + let b=_text.length-a; + var result = _text.substring(0,b); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else{ + texts=value; + } } this.setState({ question_titleysl:texts @@ -319,9 +338,19 @@ class ChoquesEditor extends Component{ var result = _text.substring(0,975); texts={"ops":[{"insert":result}]}; texts=JSON.stringify(texts); + console.log("2222222"); + console.log(texts.length); }else { - value = JSON.stringify(value) - texts=value; + value = JSON.stringify(value); + if(value.length>=1000){ + let a=value.length-1000; + let b=_text.length-a; + var result = _text.substring(0,b); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else{ + texts=value; + } } this.setState({ question_titlesysl:texts diff --git a/public/react/src/modules/question/component/JudquestionEditor.js b/public/react/src/modules/question/component/JudquestionEditor.js index e105ca2b7..6edcabb61 100644 --- a/public/react/src/modules/question/component/JudquestionEditor.js +++ b/public/react/src/modules/question/component/JudquestionEditor.js @@ -319,8 +319,16 @@ class JudquestionEditor extends Component{ texts={"ops":[{"insert":result}]}; texts=JSON.stringify(texts); }else { - value = JSON.stringify(value) - texts=value; + value = JSON.stringify(value); + if(value.length>=1000){ + let a=value.length-1000; + let b=_text.length-a; + var result = _text.substring(0,b); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else{ + texts=value; + } } this.setState({ question_titleysl:texts @@ -350,8 +358,16 @@ class JudquestionEditor extends Component{ texts={"ops":[{"insert":result}]}; texts=JSON.stringify(texts); }else { - value =JSON.stringify(value); - texts=value; + value = JSON.stringify(value); + if(value.length>=1000){ + let a=value.length-1000; + let b=_text.length-a; + var result = _text.substring(0,b); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else{ + texts=value; + } } this.setState({ question_titlesysl:texts diff --git a/public/react/src/modules/question/component/SingleEditor.js b/public/react/src/modules/question/component/SingleEditor.js index cd4096663..2c3bd1a83 100644 --- a/public/react/src/modules/question/component/SingleEditor.js +++ b/public/react/src/modules/question/component/SingleEditor.js @@ -264,8 +264,16 @@ class SingleEditor extends Component{ texts=JSON.stringify(texts); }else { // 提交到后台的内容需要处理一下; - value = JSON.stringify(value) - texts=value; + value = JSON.stringify(value); + if(value.length>=500){ + let a=value.length-500; + let b=_text.length-a; + var result = _text.substring(0,b); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else{ + texts=value; + } } } let question_choices = this.state.question_choices.slice(0); @@ -309,15 +317,23 @@ class SingleEditor extends Component{ var texts=""; if(_text.length>=979){ var result = _text.substring(0,975); - console.log("11111111"); - console.log(result.length); + // console.log("11111111"); + // console.log(result.length); texts={"ops":[{"insert":result}]}; texts=JSON.stringify(texts); - console.log("2222"); - console.log(texts.length); + // console.log("2222"); + // console.log(texts.length); }else { - value = JSON.stringify(value) - texts=value; + value = JSON.stringify(value); + if(value.length>=1000){ + let a=value.length-1000; + let b=_text.length-a; + var result = _text.substring(0,b); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else{ + texts=value; + } } this.setState({ question_titleysl:texts @@ -348,15 +364,23 @@ class SingleEditor extends Component{ var texts=""; if(_text.length>=979){ var result = _text.substring(0,975); - console.log("33333333"); - console.log(result.length); + // console.log("33333333"); + // console.log(result.length); texts={"ops":[{"insert":result}]}; texts=JSON.stringify(texts); - console.log("44444444"); - console.log(texts.length); + // ; console.log("44444444"); + // console.log(texts.length) }else { - value = JSON.stringify(value) - texts=value; + value = JSON.stringify(value); + if(value.length>=1000){ + let a=value.length-1000; + let b=_text.length-a; + var result = _text.substring(0,b); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else{ + texts=value; + } } this.setState({ question_titlesysl:texts From 2d544818a88e9ed24cb613d337090b639f5a7ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 18 Feb 2020 15:53:49 +0800 Subject: [PATCH 18/29] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E7=9A=84=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/common/quillForEditor/index.js | 11 +++++----- .../question/component/ChoquesEditor.js | 21 +++++++++++++------ .../question/component/JudquestionEditor.js | 14 +++++++++++-- .../question/component/SingleEditor.js | 18 ++++++++++++---- 4 files changed, 47 insertions(+), 17 deletions(-) diff --git a/public/react/src/common/quillForEditor/index.js b/public/react/src/common/quillForEditor/index.js index 012743141..89a4f6224 100644 --- a/public/react/src/common/quillForEditor/index.js +++ b/public/react/src/common/quillForEditor/index.js @@ -22,8 +22,8 @@ import FillBlot from './FillBlot'; const Size = Quill.import('attributors/style/size'); const Font = Quill.import('formats/font'); // const Color = Quill.import('attributes/style/color'); -Size.whitelist = ['12px', '14px', '16px', '18px', '20px', false]; -Font.whitelist = ['SimSun', 'SimHei','Microsoft-YaHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']; +Size.whitelist = ['14px', '16px', '18px', '20px', false]; +Font.whitelist = ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']; window.Quill = Quill; window.katex = katex; @@ -55,10 +55,11 @@ function QuillForEditor ({ // toolbar 默认值 const defaultConfig = [ 'bold', 'italic', 'underline', - {size: ['12px', '14px', '16px', '18px', '20px']}, + {size: ['14px', '16px', '18px', '20px']}, {align: []}, {list: 'ordered'}, {list: 'bullet'}, // 列表 {script: 'sub'}, {script: 'super'}, { 'color': [] }, { 'background': [] }, + { 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}, {header: [1,2,3,4,5,false]}, 'blockquote', 'code-block', 'link', 'image', 'video', @@ -99,7 +100,7 @@ function QuillForEditor ({ */ handler: function (range, context) { /** - * index: 删除元素的位置 + * index: 删除元素的位置 * length: 删除元素的个数 */ const {index, length} = range; @@ -123,7 +124,7 @@ function QuillForEditor ({ let delIndexs = []; // 获取删除元素的下标 delArrs.forEach((item, i) => { - leaveLen === 0 ? delIndexs.push(i) : delIndexs.push(leaveLen + i); + leaveLen === 0 ? delIndexs.push(i) : delIndexs.push(leaveLen + i); }); deleteFill && deleteFill(delIndexs); // 调用删除回调, 返回删除的元素下标[] return true diff --git a/public/react/src/modules/question/component/ChoquesEditor.js b/public/react/src/modules/question/component/ChoquesEditor.js index 0e483cf9f..aaae5e4cc 100644 --- a/public/react/src/modules/question/component/ChoquesEditor.js +++ b/public/react/src/modules/question/component/ChoquesEditor.js @@ -277,7 +277,7 @@ class ChoquesEditor extends Component{ } onContentChange=(value,quill)=>{ - debugger + // debugger const _text = quill.getText(); const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { @@ -381,7 +381,10 @@ class ChoquesEditor extends Component{ // //////console.log("xuanzheshijuan"); // //////console.log(answerTagArray); // //////console.log(!exerciseIsPublish); - + const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']}, + { 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']}, + { 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']} + ] return(

    {/* {!question_id ? '新建' : '编辑'} */} @@ -414,7 +423,7 @@ class ChoquesEditor extends Component{ imgAttrs={{width: '146px', height: '136px'}} style={{ height: '155px'}} placeholder="请您输入题干" - options={['code-block', 'image', 'formula']} + options={options} value={question_title} onContentChange={this.onContentChange} @@ -448,7 +457,7 @@ class ChoquesEditor extends Component{ imgAttrs={{width: '146px', height: '136px'}} style={{ height: '166px'}} placeholder="请您输入题干" - options={['code-block', 'image', 'formula']} + options={options} value={item} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} /> @@ -458,7 +467,7 @@ class ChoquesEditor extends Component{ imgAttrs={{width: '146px', height: '136px'}} style={{ height: '166px'}} placeholder="请您输入题干" - options={['code-block', 'image', 'formula']} + options={options} value={JSON.parse(item)} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} /> @@ -497,7 +506,7 @@ class ChoquesEditor extends Component{ imgAttrs={{width: '146px', height: '136px'}} style={{height: '166px' }} placeholder="请您输入题目解析" - options={['code-block', 'image', 'formula']} + options={options} value={question_titles} onContentChange={this.onContentChanges} /> diff --git a/public/react/src/modules/question/component/JudquestionEditor.js b/public/react/src/modules/question/component/JudquestionEditor.js index 6edcabb61..50b824068 100644 --- a/public/react/src/modules/question/component/JudquestionEditor.js +++ b/public/react/src/modules/question/component/JudquestionEditor.js @@ -397,6 +397,10 @@ class JudquestionEditor extends Component{ // ////////console.log(answerTagArray); // ////////console.log(!exerciseIsPublish); const params= this.props&&this.props.match&&this.props.match.params; + const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']}, + { 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']}, + { 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']} + ] return(

    {/* {!question_id ? '新建' : '编辑'} */} @@ -429,7 +439,7 @@ class JudquestionEditor extends Component{ imgAttrs={{width: '146px', height: '136px'}} style={{ height: '155px'}} placeholder="请您输入题干" - options={['code-block', 'image', 'formula']} + options={options} value={question_title} onContentChange={this.onContentChange} @@ -479,7 +489,7 @@ class JudquestionEditor extends Component{ imgAttrs={{width: '146px', height: '136px'}} style={{height: '166px' }} placeholder="请您输入题目解析" - options={['code-block', 'image', 'formula']} + options={options} value={question_titles} onContentChange={this.onContentChanges} /> diff --git a/public/react/src/modules/question/component/SingleEditor.js b/public/react/src/modules/question/component/SingleEditor.js index 2c3bd1a83..a95ee6889 100644 --- a/public/react/src/modules/question/component/SingleEditor.js +++ b/public/react/src/modules/question/component/SingleEditor.js @@ -415,6 +415,10 @@ class SingleEditor extends Component{ // //////console.log("xuanzheshijuan"); // //////console.log(answerTagArray); // //////console.log(!exerciseIsPublish); + const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']}, + { 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']}, + { 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']} + ] return(

    @@ -436,6 +440,12 @@ class SingleEditor extends Component{ #e_tips_mdEditor_question_undefined4{ display: none; } + .signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-size { + line-height: 20px; + } + .signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font { + line-height: 20px; + } `}

    {/* {!question_id ? '新建' : '编辑'} */} @@ -448,7 +458,7 @@ class SingleEditor extends Component{ imgAttrs={{width: '146px', height: '136px'}} style={{ height: '155px'}} placeholder="请您输入题干" - options={['code-block', 'image', 'formula']} + options={options} value={question_title} onContentChange={this.onContentChange} /> @@ -480,7 +490,7 @@ class SingleEditor extends Component{ imgAttrs={{width: '146px', height: '136px'}} style={{ height: '166px'}} placeholder="请您输入题干" - options={['code-block', 'image', 'formula']} + options={options} value={item} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} /> @@ -490,7 +500,7 @@ class SingleEditor extends Component{ imgAttrs={{width: '146px', height: '136px'}} style={{ height: '166px'}} placeholder="请您输入题干" - options={['code-block', 'image', 'formula']} + options={options} value={JSON.parse(item)} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} /> @@ -531,7 +541,7 @@ class SingleEditor extends Component{ imgAttrs={{width: '146px', height: '136px'}} style={{height: '166px' }} placeholder="请您输入题目解析" - options={['code-block', 'image', 'formula']} + options={options} value={question_titles} onContentChange={this.onContentChanges} /> From f0ff9440d261bd8b4941bd340910f221c642ba40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 18 Feb 2020 16:38:00 +0800 Subject: [PATCH 19/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../question/component/ChoquesEditor.js | 113 +++++++++--------- .../question/component/JudquestionEditor.js | 70 +++++------ .../question/component/SingleEditor.js | 87 ++++---------- 3 files changed, 115 insertions(+), 155 deletions(-) diff --git a/public/react/src/modules/question/component/ChoquesEditor.js b/public/react/src/modules/question/component/ChoquesEditor.js index aaae5e4cc..ef1a07d9b 100644 --- a/public/react/src/modules/question/component/ChoquesEditor.js +++ b/public/react/src/modules/question/component/ChoquesEditor.js @@ -236,23 +236,24 @@ class ChoquesEditor extends Component{ texts=""; } } else { - if(_text.length>=500){ - var result = _text.substring(0,450); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - }else { - // 提交到后台的内容需要处理一下; - value = JSON.stringify(value); - if(value.length>=500){ - let a=value.length-500; - let b=_text.length-a; - var result = _text.substring(0,b); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - }else{ - texts=value; - } - } + // if(_text.length>=500){ + // var result = _text.substring(0,450); + // texts={"ops":[{"insert":result}]}; + // texts=JSON.stringify(texts); + // }else { + // // 提交到后台的内容需要处理一下; + // value = JSON.stringify(value); + // if(value.length>=500){ + // let a=value.length-500; + // let b=_text.length-a; + // var result = _text.substring(0,b); + // texts={"ops":[{"insert":result}]}; + // texts=JSON.stringify(texts); + // }else{ + // texts=value; + // } + // } + texts = JSON.stringify(value); } let question_choices = this.state.question_choices.slice(0); question_choices[index] = texts; @@ -293,25 +294,26 @@ class ChoquesEditor extends Component{ } } else { // 提交到后台的内容需要处理一下; - var texts=""; - if(_text.length>=979){ - var result = _text.substring(0,975); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - console.log("111111111"); - console.log(texts.length); - }else { - value = JSON.stringify(value); - if(value.length>=1000){ - let a=value.length-1000; - let b=_text.length-a; - var result = _text.substring(0,b); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - }else{ - texts=value; - } - } + let texts=""; + // if(_text.length>=979){ + // var result = _text.substring(0,975); + // texts={"ops":[{"insert":result}]}; + // texts=JSON.stringify(texts); + // console.log("111111111"); + // console.log(texts.length); + // }else { + // value = JSON.stringify(value); + // if(value.length>=1000){ + // let a=value.length-1000; + // let b=_text.length-a; + // var result = _text.substring(0,b); + // texts={"ops":[{"insert":result}]}; + // texts=JSON.stringify(texts); + // }else{ + // texts=value; + // } + // } + texts = JSON.stringify(value); this.setState({ question_titleysl:texts }) @@ -333,25 +335,26 @@ class ChoquesEditor extends Component{ } } else { // 提交到后台的内容需要处理一下; - var texts=""; - if(_text.length>=979){ - var result = _text.substring(0,975); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - console.log("2222222"); - console.log(texts.length); - }else { - value = JSON.stringify(value); - if(value.length>=1000){ - let a=value.length-1000; - let b=_text.length-a; - var result = _text.substring(0,b); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - }else{ - texts=value; - } - } + let texts=""; + // if(_text.length>=979){ + // var result = _text.substring(0,975); + // texts={"ops":[{"insert":result}]}; + // texts=JSON.stringify(texts); + // console.log("2222222"); + // console.log(texts.length); + // }else { + // value = JSON.stringify(value); + // if(value.length>=1000){ + // let a=value.length-1000; + // let b=_text.length-a; + // var result = _text.substring(0,b); + // texts={"ops":[{"insert":result}]}; + // texts=JSON.stringify(texts); + // }else{ + // texts=value; + // } + // } + texts = JSON.stringify(value); this.setState({ question_titlesysl:texts }) diff --git a/public/react/src/modules/question/component/JudquestionEditor.js b/public/react/src/modules/question/component/JudquestionEditor.js index 50b824068..b628d1012 100644 --- a/public/react/src/modules/question/component/JudquestionEditor.js +++ b/public/react/src/modules/question/component/JudquestionEditor.js @@ -313,23 +313,24 @@ class JudquestionEditor extends Component{ // console.log("有"); // 提交到后台的内容需要处理一下; - var texts=""; - if(_text.length>=979){ - var result = _text.substring(0,975); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - }else { - value = JSON.stringify(value); - if(value.length>=1000){ - let a=value.length-1000; - let b=_text.length-a; - var result = _text.substring(0,b); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - }else{ - texts=value; - } - } + let texts=""; + // if(_text.length>=979){ + // var result = _text.substring(0,975); + // texts={"ops":[{"insert":result}]}; + // texts=JSON.stringify(texts); + // }else { + // value = JSON.stringify(value); + // if(value.length>=1000){ + // let a=value.length-1000; + // let b=_text.length-a; + // var result = _text.substring(0,b); + // texts={"ops":[{"insert":result}]}; + // texts=JSON.stringify(texts); + // }else{ + // texts=value; + // } + // } + texts = JSON.stringify(value); this.setState({ question_titleysl:texts }) @@ -352,23 +353,24 @@ class JudquestionEditor extends Component{ } else { // 提交到后台的内容需要处理一下; - var texts=""; - if(_text.length>=979){ - var result = _text.substring(0,975); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - }else { - value = JSON.stringify(value); - if(value.length>=1000){ - let a=value.length-1000; - let b=_text.length-a; - var result = _text.substring(0,b); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - }else{ - texts=value; - } - } + let texts=""; + // if(_text.length>=979){ + // var result = _text.substring(0,975); + // texts={"ops":[{"insert":result}]}; + // texts=JSON.stringify(texts); + // }else { + // value = JSON.stringify(value); + // if(value.length>=1000){ + // let a=value.length-1000; + // let b=_text.length-a; + // var result = _text.substring(0,b); + // texts={"ops":[{"insert":result}]}; + // texts=JSON.stringify(texts); + // }else{ + // texts=value; + // } + // } + texts = JSON.stringify(value); this.setState({ question_titlesysl:texts }) diff --git a/public/react/src/modules/question/component/SingleEditor.js b/public/react/src/modules/question/component/SingleEditor.js index a95ee6889..50681c576 100644 --- a/public/react/src/modules/question/component/SingleEditor.js +++ b/public/react/src/modules/question/component/SingleEditor.js @@ -258,24 +258,26 @@ class SingleEditor extends Component{ texts=""; } } else { - if(_text.length>=500){ - var result = _text.substring(0,450); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - }else { - // 提交到后台的内容需要处理一下; - value = JSON.stringify(value); - if(value.length>=500){ - let a=value.length-500; - let b=_text.length-a; - var result = _text.substring(0,b); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - }else{ - texts=value; - } - } + // if(_text.length>=500){ + // var result = _text.substring(0,450); + // texts={"ops":[{"insert":result}]}; + // texts=JSON.stringify(texts); + // }else { + // // 提交到后台的内容需要处理一下; + // + // if(value.length>=500){ + // let a=value.length-500; + // let b=_text.length-a; + // var result = _text.substring(0,b); + // texts={"ops":[{"insert":result}]}; + // texts=JSON.stringify(texts); + // }else{ + // texts=value; + // } + // } + texts = JSON.stringify(value); } + let question_choices = this.state.question_choices.slice(0); question_choices[index] = texts; this.setState({ question_choices }); @@ -312,38 +314,11 @@ class SingleEditor extends Component{ }) } } else { - // 提交到后台的内容需要处理一下; - - var texts=""; - if(_text.length>=979){ - var result = _text.substring(0,975); - // console.log("11111111"); - // console.log(result.length); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - // console.log("2222"); - // console.log(texts.length); - }else { - value = JSON.stringify(value); - if(value.length>=1000){ - let a=value.length-1000; - let b=_text.length-a; - var result = _text.substring(0,b); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - }else{ - texts=value; - } - } + let texts = JSON.stringify(value); this.setState({ question_titleysl:texts }) - try { - //console.log("onContentChange"); - //console.log(quill.getText().length); - }catch (e) { - } } } onContentChanges=(value,quill)=>{ @@ -361,27 +336,7 @@ class SingleEditor extends Component{ }) } } else { - var texts=""; - if(_text.length>=979){ - var result = _text.substring(0,975); - // console.log("33333333"); - // console.log(result.length); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - // ; console.log("44444444"); - // console.log(texts.length) - }else { - value = JSON.stringify(value); - if(value.length>=1000){ - let a=value.length-1000; - let b=_text.length-a; - var result = _text.substring(0,b); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - }else{ - texts=value; - } - } + let texts = JSON.stringify(value); this.setState({ question_titlesysl:texts }) From abee25b58b44df1e3976bb45736c9f5835803666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 18 Feb 2020 16:39:28 +0800 Subject: [PATCH 20/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../question/component/ChoquesEditor.js | 72 +++++-------------- .../question/component/JudquestionEditor.js | 33 +-------- .../question/component/SingleEditor.js | 37 +++++----- 3 files changed, 37 insertions(+), 105 deletions(-) diff --git a/public/react/src/modules/question/component/ChoquesEditor.js b/public/react/src/modules/question/component/ChoquesEditor.js index ef1a07d9b..36ef4c61f 100644 --- a/public/react/src/modules/question/component/ChoquesEditor.js +++ b/public/react/src/modules/question/component/ChoquesEditor.js @@ -236,24 +236,23 @@ class ChoquesEditor extends Component{ texts=""; } } else { - // if(_text.length>=500){ - // var result = _text.substring(0,450); - // texts={"ops":[{"insert":result}]}; - // texts=JSON.stringify(texts); - // }else { - // // 提交到后台的内容需要处理一下; - // value = JSON.stringify(value); - // if(value.length>=500){ - // let a=value.length-500; - // let b=_text.length-a; - // var result = _text.substring(0,b); - // texts={"ops":[{"insert":result}]}; - // texts=JSON.stringify(texts); - // }else{ - // texts=value; - // } - // } - texts = JSON.stringify(value); + if(_text.length>=500){ + var result = _text.substring(0,450); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else { + // 提交到后台的内容需要处理一下; + value = JSON.stringify(value); + if(value.length>=500){ + let a=value.length-500; + let b=_text.length-a; + var result = _text.substring(0,b); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else{ + texts=value; + } + } } let question_choices = this.state.question_choices.slice(0); question_choices[index] = texts; @@ -295,24 +294,6 @@ class ChoquesEditor extends Component{ } else { // 提交到后台的内容需要处理一下; let texts=""; - // if(_text.length>=979){ - // var result = _text.substring(0,975); - // texts={"ops":[{"insert":result}]}; - // texts=JSON.stringify(texts); - // console.log("111111111"); - // console.log(texts.length); - // }else { - // value = JSON.stringify(value); - // if(value.length>=1000){ - // let a=value.length-1000; - // let b=_text.length-a; - // var result = _text.substring(0,b); - // texts={"ops":[{"insert":result}]}; - // texts=JSON.stringify(texts); - // }else{ - // texts=value; - // } - // } texts = JSON.stringify(value); this.setState({ question_titleysl:texts @@ -336,24 +317,7 @@ class ChoquesEditor extends Component{ } else { // 提交到后台的内容需要处理一下; let texts=""; - // if(_text.length>=979){ - // var result = _text.substring(0,975); - // texts={"ops":[{"insert":result}]}; - // texts=JSON.stringify(texts); - // console.log("2222222"); - // console.log(texts.length); - // }else { - // value = JSON.stringify(value); - // if(value.length>=1000){ - // let a=value.length-1000; - // let b=_text.length-a; - // var result = _text.substring(0,b); - // texts={"ops":[{"insert":result}]}; - // texts=JSON.stringify(texts); - // }else{ - // texts=value; - // } - // } + texts = JSON.stringify(value); this.setState({ question_titlesysl:texts diff --git a/public/react/src/modules/question/component/JudquestionEditor.js b/public/react/src/modules/question/component/JudquestionEditor.js index b628d1012..09cf1094f 100644 --- a/public/react/src/modules/question/component/JudquestionEditor.js +++ b/public/react/src/modules/question/component/JudquestionEditor.js @@ -314,22 +314,6 @@ class JudquestionEditor extends Component{ // 提交到后台的内容需要处理一下; let texts=""; - // if(_text.length>=979){ - // var result = _text.substring(0,975); - // texts={"ops":[{"insert":result}]}; - // texts=JSON.stringify(texts); - // }else { - // value = JSON.stringify(value); - // if(value.length>=1000){ - // let a=value.length-1000; - // let b=_text.length-a; - // var result = _text.substring(0,b); - // texts={"ops":[{"insert":result}]}; - // texts=JSON.stringify(texts); - // }else{ - // texts=value; - // } - // } texts = JSON.stringify(value); this.setState({ question_titleysl:texts @@ -354,22 +338,7 @@ class JudquestionEditor extends Component{ } else { // 提交到后台的内容需要处理一下; let texts=""; - // if(_text.length>=979){ - // var result = _text.substring(0,975); - // texts={"ops":[{"insert":result}]}; - // texts=JSON.stringify(texts); - // }else { - // value = JSON.stringify(value); - // if(value.length>=1000){ - // let a=value.length-1000; - // let b=_text.length-a; - // var result = _text.substring(0,b); - // texts={"ops":[{"insert":result}]}; - // texts=JSON.stringify(texts); - // }else{ - // texts=value; - // } - // } + texts = JSON.stringify(value); this.setState({ question_titlesysl:texts diff --git a/public/react/src/modules/question/component/SingleEditor.js b/public/react/src/modules/question/component/SingleEditor.js index 50681c576..c1255c83a 100644 --- a/public/react/src/modules/question/component/SingleEditor.js +++ b/public/react/src/modules/question/component/SingleEditor.js @@ -258,26 +258,24 @@ class SingleEditor extends Component{ texts=""; } } else { - // if(_text.length>=500){ - // var result = _text.substring(0,450); - // texts={"ops":[{"insert":result}]}; - // texts=JSON.stringify(texts); - // }else { - // // 提交到后台的内容需要处理一下; - // - // if(value.length>=500){ - // let a=value.length-500; - // let b=_text.length-a; - // var result = _text.substring(0,b); - // texts={"ops":[{"insert":result}]}; - // texts=JSON.stringify(texts); - // }else{ - // texts=value; - // } - // } - texts = JSON.stringify(value); + if(_text.length>=500){ + var result = _text.substring(0,450); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else { + // 提交到后台的内容需要处理一下; + value = JSON.stringify(value); + if(value.length>=500){ + let a=value.length-500; + let b=_text.length-a; + var result = _text.substring(0,b); + texts={"ops":[{"insert":result}]}; + texts=JSON.stringify(texts); + }else{ + texts=value; + } + } } - let question_choices = this.state.question_choices.slice(0); question_choices[index] = texts; this.setState({ question_choices }); @@ -336,6 +334,7 @@ class SingleEditor extends Component{ }) } } else { + let texts = JSON.stringify(value); this.setState({ question_titlesysl:texts From efe7abaeccbdb7f9e52580a92de87aea70f27bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 18 Feb 2020 16:58:02 +0800 Subject: [PATCH 21/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/config/webpack.config.prod.js | 4 ++-- .../react/src/modules/question/component/Listjihe.js | 4 ++-- .../src/modules/question/component/Newknledpots.js | 10 ---------- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/public/react/config/webpack.config.prod.js b/public/react/config/webpack.config.prod.js index 596843f5f..1fe7a6c93 100644 --- a/public/react/config/webpack.config.prod.js +++ b/public/react/config/webpack.config.prod.js @@ -326,8 +326,8 @@ module.exports = { comments: false }, compress: { - drop_debugger: false, - drop_console: false + drop_debugger: true, + drop_console: true } } }), diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index 47e460736..d613227fe 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -485,7 +485,7 @@ class Listjihe extends Component { {items ? items.analysis=== undefined || items.analysis=== null || items.analysis === "" ? - "" + "暂无解析" : items.analysis.length>0? analysisnames===null || analysisnames===undefined?"": @@ -495,7 +495,7 @@ class Listjihe extends Component { value={analysisnames} /> : - "" + "暂无解析" : "" } diff --git a/public/react/src/modules/question/component/Newknledpots.js b/public/react/src/modules/question/component/Newknledpots.js index 98f766196..7e0a79228 100644 --- a/public/react/src/modules/question/component/Newknledpots.js +++ b/public/react/src/modules/question/component/Newknledpots.js @@ -32,16 +32,6 @@ class PaperDeletModel extends Component { // //console.log(e.target.value); // //console.log(e.target.value.length); - if(this.isNull(e.target.value)===true){ - this.props.showNotification('不能输入空格'); - this.setState({ - errorestit:'不能输入空格', - errores:true, - boolred:true, - }) - return - } - this.setState({ newkntypeinput: e.target.value, addonAfteronelens3:e.target.value.length, From f35e9eb7ab397c06bdf621222551001e5cb5da96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 18 Feb 2020 17:01:46 +0800 Subject: [PATCH 22/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/testpaper/Paperlibraryeditid.js | 2 +- public/react/src/modules/testpaper/Paperlibraryseeid.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/testpaper/Paperlibraryeditid.js b/public/react/src/modules/testpaper/Paperlibraryeditid.js index 95b867974..5b1587022 100644 --- a/public/react/src/modules/testpaper/Paperlibraryeditid.js +++ b/public/react/src/modules/testpaper/Paperlibraryeditid.js @@ -247,7 +247,7 @@ class Paperlibraryeditid extends Component {

    试卷库 - 公共试卷库 + 公开试卷库 试卷编辑
    diff --git a/public/react/src/modules/testpaper/Paperlibraryseeid.js b/public/react/src/modules/testpaper/Paperlibraryseeid.js index cde9721ce..c0f27f13e 100644 --- a/public/react/src/modules/testpaper/Paperlibraryseeid.js +++ b/public/react/src/modules/testpaper/Paperlibraryseeid.js @@ -114,7 +114,7 @@ class Paperlibraryseeid extends Component {
    试卷库 - 公共试卷库 + 公开试卷库 试卷查看
    From ae8378bf5133fae299a1b62c042cd9624d9529fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 18 Feb 2020 17:43:43 +0800 Subject: [PATCH 23/29] =?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/testpaper/Paperlibraryeditid.js | 33 ++++++++++++++--- .../modules/testpaper/Paperlibraryseeid.js | 27 ++++++++++++-- .../src/modules/testpaper/Testpaperlibrary.js | 5 ++- .../testpaper/component/Contentpart.js | 37 +++++++++++++++++-- .../modules/testpaper/component/Listjihe.js | 4 +- 5 files changed, 91 insertions(+), 15 deletions(-) diff --git a/public/react/src/modules/testpaper/Paperlibraryeditid.js b/public/react/src/modules/testpaper/Paperlibraryeditid.js index 5b1587022..8700a216f 100644 --- a/public/react/src/modules/testpaper/Paperlibraryeditid.js +++ b/public/react/src/modules/testpaper/Paperlibraryeditid.js @@ -1,6 +1,6 @@ import React, {Component} from "react"; import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder'; +import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder'; import axios from 'axios'; import { notification, @@ -37,6 +37,7 @@ class Paperlibraryeditid extends Component { disciplmy: [], item_banksedit: [], newmyshixunmodelbool:false, + defaultActiveKey:"0", } @@ -110,6 +111,26 @@ class Paperlibraryeditid extends Component { } }); + const query = this.props.location.search; + const parsed = queryString.parse(query); + if(JSON.stringify(parsed)==="{}"){ + this.setState({ + defaultActiveKey:"0", + }) + }else { + if(parsed.defaultActiveKey==="0"){ + this.setState({ + defaultActiveKey:"0", + }) + }else{ + this.setState({ + defaultActiveKey:"1", + }) + } + + } + + } @@ -206,10 +227,10 @@ class Paperlibraryeditid extends Component { } render() { - let {paperlibrartdata,newmyshixunmodelbool} = this.state; + let {paperlibrartdata,newmyshixunmodelbool,defaultActiveKey} = this.state; const params = this.props && this.props.match && this.props.match.params; - // //console.log("newmyshixunmodelbool"); - // //console.log(newmyshixunmodelbool); + let urlsysl=`/paperlibrary?defaultActiveKey=${defaultActiveKey}`; + return (
    试卷库 - 公开试卷库 + {defaultActiveKey==="1"?"公开试卷库":"我的试卷库"} 试卷编辑
    @@ -304,7 +325,7 @@ class Paperlibraryeditid extends Component { newmyshixunmodelbool === true ? "" : this.setCohetepaperbool(bool)} - onSubmits={() => this.preservation()} url={'/paperlibrary'}> + onSubmits={() => this.preservation()} url={urlsysl}> }
    ) diff --git a/public/react/src/modules/testpaper/Paperlibraryseeid.js b/public/react/src/modules/testpaper/Paperlibraryseeid.js index c0f27f13e..d81a0afa7 100644 --- a/public/react/src/modules/testpaper/Paperlibraryseeid.js +++ b/public/react/src/modules/testpaper/Paperlibraryseeid.js @@ -1,6 +1,6 @@ import React, {Component} from "react"; import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder'; +import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder'; import axios from 'axios'; import { notification, @@ -26,6 +26,7 @@ class Paperlibraryseeid extends Component { this.contentMdRef = React.createRef(); this.state = { paperlibrartdata:[], + defaultActiveKey:"0", } @@ -37,7 +38,24 @@ class Paperlibraryseeid extends Component { componentDidMount() { ////console.log("Paperlibraryseeid"); this.getdata(); + const query = this.props.location.search; + const parsed = queryString.parse(query); + if(JSON.stringify(parsed)==="{}"){ + this.setState({ + defaultActiveKey:"0", + }) + }else { + if(parsed.defaultActiveKey==="0"){ + this.setState({ + defaultActiveKey:"0", + }) + }else{ + this.setState({ + defaultActiveKey:"1", + }) + } + } } @@ -92,9 +110,10 @@ class Paperlibraryseeid extends Component { this.contentMdRef = Ref; } render() { - let {paperlibrartdata} = this.state; + let {paperlibrartdata,defaultActiveKey} = this.state; const params = this.props && this.props.match && this.props.match.params; // ////console.log(params); + let urlsysl=`/paperlibrary?defaultActiveKey=${defaultActiveKey}`; return (
    试卷库 - 公开试卷库 + {defaultActiveKey==="1"?"公开试卷库":"我的试卷库"} 试卷查看
    @@ -171,7 +190,7 @@ class Paperlibraryseeid extends Component { this.setCohetepaperbool(bool)} - onSubmits={() => this.preservation()} url={'/paperlibrary'}> + onSubmits={() => this.preservation()} url={urlsysl}>
    ) diff --git a/public/react/src/modules/testpaper/Testpaperlibrary.js b/public/react/src/modules/testpaper/Testpaperlibrary.js index 4d9ad75a9..9c4aa18a6 100644 --- a/public/react/src/modules/testpaper/Testpaperlibrary.js +++ b/public/react/src/modules/testpaper/Testpaperlibrary.js @@ -77,6 +77,9 @@ class Testpaperlibrary extends Component { }) } }); + + + } paginationonChange=(pages)=>{ @@ -340,7 +343,7 @@ class Testpaperlibrary extends Component { }; Testpapereditor=(id)=>{ - this.props.history.push(`/paperlibrary/edit/${id}`); + this.props.history.push(`/paperlibrary/edit/${id}?defaultActiveKey=${this.state.defaultActiveKey}`); } diff --git a/public/react/src/modules/testpaper/component/Contentpart.js b/public/react/src/modules/testpaper/component/Contentpart.js index 7f9b4643f..ad65211a2 100644 --- a/public/react/src/modules/testpaper/component/Contentpart.js +++ b/public/react/src/modules/testpaper/component/Contentpart.js @@ -1,6 +1,6 @@ import React, {Component} from "react"; import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder'; +import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl,queryString} from 'educoder'; import axios from 'axios'; import { notification, @@ -24,12 +24,32 @@ class Contentpart extends Component { super(props); this.state = { page:1, + defaultActiveKeyss:"0", } } //初始化 componentDidMount(){ + const query = this.props.location.search; + const parsed = queryString.parse(query); + console.log("Contentpart"); + console.log(parsed); + if(JSON.stringify(parsed)==="{}"){ + this.setState({ + defaultActiveKeyss:"0", + }) + }else { + if(parsed.defaultActiveKey==="0"){ + this.setState({ + defaultActiveKeyss:"0", + }) + }else{ + this.setState({ + defaultActiveKeyss:"1", + }) + } + } } //跳转人工组卷 @@ -50,14 +70,19 @@ class Contentpart extends Component { }else{ defaultActiveKeys="1" } + if (this.state.defaultActiveKeyss==="0"){ + defaultActiveKeys="0" + } else { + defaultActiveKeys="1" + } this.props.callback(defaultActiveKeys); } } render() { - let {page}=this.state; + let {page,defaultActiveKeyss}=this.state; let {defaultActiveKey}=this.props; - const defaultActiveKeys=defaultActiveKey+''; + let defaultActiveKeys=defaultActiveKey+''; 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; @@ -79,6 +104,12 @@ class Contentpart extends Component {
    ); + if(defaultActiveKeyss==="0"){ + defaultActiveKeys="0"; + }else { + defaultActiveKeys="1"; + } + return (
    diff --git a/public/react/src/modules/testpaper/component/Listjihe.js b/public/react/src/modules/testpaper/component/Listjihe.js index 1ae0d3e70..b2f358b96 100644 --- a/public/react/src/modules/testpaper/component/Listjihe.js +++ b/public/react/src/modules/testpaper/component/Listjihe.js @@ -58,7 +58,7 @@ class Listjihe extends Component { gotoseesj=(id)=>{ - this.props.history.push(`/paperlibrary/see/${id}`); + this.props.history.push(`/paperlibrary/see/${id}?defaultActiveKey=${this.props.defaultActiveKey}`); } @@ -73,6 +73,8 @@ class Listjihe extends Component { const update_times=items&&items.update_time&&items.update_time; const quotess =items&&items.quotes&&items.quotes; const authors=items&&items.author&&items.author.name; + + return (
    From 8e4f47887f23689ce403572cb5e24d8e1370b291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 18 Feb 2020 17:59:54 +0800 Subject: [PATCH 24/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/testpaper/Testpaperlibrary.js | 14 ++++++- .../testpaper/component/Contentpart.js | 37 ++++++++++++------- 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/public/react/src/modules/testpaper/Testpaperlibrary.js b/public/react/src/modules/testpaper/Testpaperlibrary.js index 9c4aa18a6..0fb34200e 100644 --- a/public/react/src/modules/testpaper/Testpaperlibrary.js +++ b/public/react/src/modules/testpaper/Testpaperlibrary.js @@ -42,6 +42,7 @@ class Testpaperlibrary extends Component { modalsType:false, timuid:0, modalsTypeInaudit:false, + defaultActiveKeybool:false, } } getContainer = () => { @@ -122,12 +123,21 @@ class Testpaperlibrary extends Component { } this.getdata(data); } - callback = (key) => { + callback = (key,bool) => { + try { + var currenturl = window.location.href; + var newUrl = (currenturl.split("?"))[0]; + window.history.pushState('','',newUrl+'?defaultActiveKey='+key); + }catch (e) { + + } + this.setState({ defaultActiveKey: key, difficulty:null, keyword:null, page:1, + defaultActiveKeybool:bool, }) var data={ page:1, @@ -477,7 +487,7 @@ class Testpaperlibrary extends Component { showmodels={(e)=>this.showmodels(e)} showmodelysl={(e)=>this.showmodelysl(e)} setdatafuns={(key)=>this.setdatafuns(key)} - callback={(key)=>this.callback(key)} + callback={(key,bool)=>this.callback(key,bool)} 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 ad65211a2..8a3d57414 100644 --- a/public/react/src/modules/testpaper/component/Contentpart.js +++ b/public/react/src/modules/testpaper/component/Contentpart.js @@ -64,24 +64,32 @@ class Contentpart extends Component { const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; let {defaultActiveKey} = this.props; - var defaultActiveKeys=defaultActiveKey; + let defaultActiveKeys=defaultActiveKey; if(isysladmins===true||(is_teacher===true&&professional_certification===true)){ defaultActiveKeys="0" }else{ defaultActiveKeys="1" } - if (this.state.defaultActiveKeyss==="0"){ - defaultActiveKeys="0" - } else { - defaultActiveKeys="1" + try { + if(this.props.defaultActiveKeybool===false){ + if (this.state.defaultActiveKeyss==="0"){ + defaultActiveKeys="0" + } else { + defaultActiveKeys="1" + } + } + }catch (e) { + } - this.props.callback(defaultActiveKeys); + + + this.props.callback(defaultActiveKeys,false); } } render() { let {page,defaultActiveKeyss}=this.state; - let {defaultActiveKey}=this.props; + let {defaultActiveKey,defaultActiveKeybool}=this.props; let defaultActiveKeys=defaultActiveKey+''; const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; @@ -104,13 +112,16 @@ class Contentpart extends Component {
    ); - if(defaultActiveKeyss==="0"){ - defaultActiveKeys="0"; - }else { - defaultActiveKeys="1"; + if(defaultActiveKeybool===false){ + if(defaultActiveKeyss==="0"){ + defaultActiveKeys="0"; + }else { + defaultActiveKeys="1"; + } } + return (
    @@ -139,14 +150,14 @@ class Contentpart extends Component { { isysladmins===true||(is_teacher===true&&professional_certification===true)? - this.props.callback(e)}> + this.props.callback(e,true)}> : - this.props.callback(e)}> + this.props.callback(e,true)}> From 58f95cf861ed7b521c4f6e1879731a1f1e20d5c3 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, 19 Feb 2020 14:39:04 +0800 Subject: [PATCH 25/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/question/Question.js | 1 + .../src/modules/question/component/Headplugselections.js | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index 5011fa2c7..e4a618f19 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -118,6 +118,7 @@ class Question extends Component { setsub_discipline_id=(discipline_id,sub_discipline_id)=>{ this.setState({ sub_discipline_id:sub_discipline_id, + discipline_id:discipline_id, tag_discipline_id:null, keyword:"", page:1, diff --git a/public/react/src/modules/question/component/Headplugselections.js b/public/react/src/modules/question/component/Headplugselections.js index aa31e3f00..4da7a57e3 100644 --- a/public/react/src/modules/question/component/Headplugselections.js +++ b/public/react/src/modules/question/component/Headplugselections.js @@ -96,8 +96,8 @@ class Headplugselections extends Component { } } - console.log(itme); - console.log(itme[0]); + // console.log(itme); + // console.log(itme[0]); if(itme!=undefined){ try { this.props.setsub_discipline_id(id,itme[0].id); @@ -154,7 +154,8 @@ class Headplugselections extends Component { getshixunchildValue = (id,ids) => { // //console.log("getshixunchildValue"); - // //console.log(id); + // console.log(id); + // console.log(ids); // debugger if(id!=undefined ||ids!=undefined){ this.setState({ From f585a65b199f069e1036e6f895616e11f32c73ba 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, 19 Feb 2020 14:41:23 +0800 Subject: [PATCH 26/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../question/component/ChoquesEditor.js | 19 ++----------------- .../question/component/SingleEditor.js | 19 ++----------------- 2 files changed, 4 insertions(+), 34 deletions(-) diff --git a/public/react/src/modules/question/component/ChoquesEditor.js b/public/react/src/modules/question/component/ChoquesEditor.js index 36ef4c61f..25aab75a1 100644 --- a/public/react/src/modules/question/component/ChoquesEditor.js +++ b/public/react/src/modules/question/component/ChoquesEditor.js @@ -236,23 +236,8 @@ class ChoquesEditor extends Component{ texts=""; } } else { - if(_text.length>=500){ - var result = _text.substring(0,450); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - }else { - // 提交到后台的内容需要处理一下; - value = JSON.stringify(value); - if(value.length>=500){ - let a=value.length-500; - let b=_text.length-a; - var result = _text.substring(0,b); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - }else{ - texts=value; - } - } + value = JSON.stringify(value); + texts=value; } let question_choices = this.state.question_choices.slice(0); question_choices[index] = texts; diff --git a/public/react/src/modules/question/component/SingleEditor.js b/public/react/src/modules/question/component/SingleEditor.js index c1255c83a..39c2e447e 100644 --- a/public/react/src/modules/question/component/SingleEditor.js +++ b/public/react/src/modules/question/component/SingleEditor.js @@ -258,23 +258,8 @@ class SingleEditor extends Component{ texts=""; } } else { - if(_text.length>=500){ - var result = _text.substring(0,450); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - }else { - // 提交到后台的内容需要处理一下; - value = JSON.stringify(value); - if(value.length>=500){ - let a=value.length-500; - let b=_text.length-a; - var result = _text.substring(0,b); - texts={"ops":[{"insert":result}]}; - texts=JSON.stringify(texts); - }else{ - texts=value; - } - } + value = JSON.stringify(value); + texts=value; } let question_choices = this.state.question_choices.slice(0); question_choices[index] = texts; From e0dee2101fcfd637f92bc10e5e8fb6c022a729b5 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, 19 Feb 2020 15:13:08 +0800 Subject: [PATCH 27/29] =?UTF-8?q?=E8=B0=83=E6=95=B4=20=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 6 +-- public/react/src/modules/tpm/NewHeader.js | 51 +++++++++++++++++------ 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index b2a293483..1a4fb0c08 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -42,11 +42,11 @@ if (isDev) { window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' } // 超管 -debugType="admin"; +// debugType="admin"; // 老师 -//debugType="teacher"; +// debugType="teacher"; // 学生 -// debugType="student"; +debugType="student"; diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 5ef112d84..6520f3b08 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -945,7 +945,29 @@ submittojoinclass=(value)=>{

    试卷库

    ); - return ( + + // console.log("头部"); + // console.log(this.props); + //判断平台身份 + let Periofters=false; + if(this.props){ + if(this.props.current_user){ + if(this.props.current_user.admin){ + Periofters=true; + } + else if(this.props.current_user.business){ + Periofters=true; + } + else if(this.props.current_user.is_teacher){ + Periofters=true; + }else if(this.props.current_user.user_identity !=="学生") { + Periofters=true; + } + } + } + + + return (
    -
  • - -
    -
    - 题库 -
    -
    -
    -
  • + { + Periofters===true? +
  • + +
    +
    + 题库 +
    +
    +
    +
  • + :"" + } +
  • Date: Wed, 19 Feb 2020 15:43:23 +0800 Subject: [PATCH 28/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 4 ++-- public/react/src/modules/question/Paperreview.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 1a4fb0c08..e321b4d2e 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -42,11 +42,11 @@ if (isDev) { window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' } // 超管 -// debugType="admin"; +debugType="admin"; // 老师 // debugType="teacher"; // 学生 -debugType="student"; +// debugType="student"; diff --git a/public/react/src/modules/question/Paperreview.js b/public/react/src/modules/question/Paperreview.js index bdd5f20a9..33f137cd1 100644 --- a/public/react/src/modules/question/Paperreview.js +++ b/public/react/src/modules/question/Paperreview.js @@ -406,14 +406,14 @@ class Paperreview extends Component { Cohetepaperbool===false? artificialtype==="artificial"? - 试题库 - 人工组卷 + 试题库 + 人工组卷 试卷预览 : - 试卷库 - 智能组卷 + 试卷库 + 智能组卷 试卷预览 : From e2173ef50fba6103a296a5b6fa9e462f77084294 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 21 Feb 2020 15:56:48 +0800 Subject: [PATCH 29/29] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/concerns/controller_rescue_handler.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/controllers/concerns/controller_rescue_handler.rb b/app/controllers/concerns/controller_rescue_handler.rb index 60ac09d64..e680f32c1 100644 --- a/app/controllers/concerns/controller_rescue_handler.rb +++ b/app/controllers/concerns/controller_rescue_handler.rb @@ -10,6 +10,7 @@ module ControllerRescueHandler Util.logger_error e render json: {status: -1, message: "接口数据异常"} end + # rescue_from ActionView::MissingTemplate, with: :object_not_found # rescue_from ActiveRecord::RecordNotFound, with: :object_not_found rescue_from Educoder::TipException, with: :tip_show @@ -24,6 +25,11 @@ module ControllerRescueHandler rescue_from ActiveRecord::RecordInvalid do |ex| render_error(ex.record.errors.full_messages.join(',')) end + + rescue_from ActionController::UnknownFormat do |e| + render json: {status: -1, message: "接口调用非JSON格式"} + end + # rescue_from RuntimeError do |ex| # Util.logger_error "#######ex:#{ex}" # render_error(ex.message)