Commit 93fd7ffe by yuananting

fix:题库题目信息样式保留

parent 4d5bed0d
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-03-29 10:52:26 * @Date: 2021-03-29 10:52:26
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-04-07 15:23:06 * @LastEditTime: 2021-05-08 16:11:27
* @Description: 助学工具-试卷-新建选择题目弹窗 * @Description: 助学工具-试卷-新建选择题目弹窗
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -35,6 +35,7 @@ class SelectQuestionModal extends Component { ...@@ -35,6 +35,7 @@ class SelectQuestionModal extends Component {
return ( return (
<Modal <Modal
className="select-question-modal" className="select-question-modal"
maskClosable={false}
destroyOnClose={true} destroyOnClose={true}
title="选择题目" title="选择题目"
visible={true} visible={true}
......
...@@ -126,18 +126,24 @@ class QuestionEditor extends Component { ...@@ -126,18 +126,24 @@ class QuestionEditor extends Component {
// 自定义处理粘贴的文本内容 // 自定义处理粘贴的文本内容
editorRoot.config.pasteTextHandle = function (content) { editorRoot.config.pasteTextHandle = function (content) {
if (content == "" && !content) return ""; if (content == "" && !content) return "";
var str = content; var str1 = content; // 所有特殊字符
str = str.replace(/<xml>[\s\S]*?<\/xml>/gi, ""); str1 = str1.replace(/<xml>[\s\S]*?<\/xml>/gi, "");
str = str.replace(/<style>[\s\S]*?<\/style>/gi, ""); str1 = str1.replace(/<style>[\s\S]*?<\/style>/gi, "");
str = str.replace(/<\/?[^>]*>/g, ""); str1 = str1.replace(/<\/?[^>]*>/g, "");
str = str.replace(/[ | ]*\n/g, "\n"); str1 = str1.replace(/[ | ]*\n/g, "\n");
str = str.replace(/\&nbsp\;/gi, " "); str1 = str1.replace(/\&nbsp\;/gi, " ");
str = str.replace(/[\r\n]/g, ""); str1 = str1.replace(/[\r\n]/g, "");
if (str.length > 1000) { var str2 = content; // 保留空格和换行的其他字符
str = str.substring(0, 1000); str2 = str2.replace(/<xml>[\s\S]*?<\/xml>/gi, "");
str2 = str2.replace(/<style>[\s\S]*?<\/style>/gi, "");
str2 = str2.replace(/<(?!br).*?>/g, "");
if (editorRoot.txt.text().length + str1.length > 1000) {
content = str2.substring(0, 1000);
message.error("内容过长,不能超过1000字"); message.error("内容过长,不能超过1000字");
} else {
content = str2;
} }
return str; return content;
}; };
let prevList = []; let prevList = [];
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
.editor-box_content { .editor-box_content {
width: calc(100% - 80px); width: calc(100% - 80px);
p { p {
display: inline-block; display: inline;
} }
} }
.editor-limit { .editor-limit {
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
max-height: 110px; max-height: 110px;
overflow: auto; overflow: auto;
p { p {
display: inline-block; display: inline;
overflow-y: scroll; overflow-y: scroll;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment