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 (
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.props.showmodels(items.id)}>
公开
this.props.showmodelsInaudit(e)}>
+
+ 公开审核中
+
编辑
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 {
/>
{/*头部*/}
编辑
@@ -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 {
{errorestit}
+ :"" + } +{indexx}
、 +{indexx}
、{ 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; + } ` }
{indexx}
、 +{indexx}
、{/* {!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(
{/* {!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 {
试卷库