Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
93fd7ffe
Commit
93fd7ffe
authored
May 08, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:题库题目信息样式保留
parent
4d5bed0d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
13 deletions
+20
-13
src/modules/teach-tool/paper-manage/modal/SelectQuestionModal.jsx
+2
-1
src/modules/teach-tool/question-manage/components/QuestionEditor.jsx
+16
-10
src/modules/teach-tool/question-manage/components/QuestionEditor.less
+2
-2
No files found.
src/modules/teach-tool/paper-manage/modal/SelectQuestionModal.jsx
View file @
93fd7ffe
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-03-29 10:52:26
* @LastEditors: yuananting
* @LastEditTime: 2021-0
4-07 15:23:06
* @LastEditTime: 2021-0
5-08 16:11:27
* @Description: 助学工具-试卷-新建选择题目弹窗
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -35,6 +35,7 @@ class SelectQuestionModal extends Component {
return
(
<
Modal
className=
"select-question-modal"
maskClosable=
{
false
}
destroyOnClose=
{
true
}
title=
"选择题目"
visible=
{
true
}
...
...
src/modules/teach-tool/question-manage/components/QuestionEditor.jsx
View file @
93fd7ffe
...
...
@@ -126,18 +126,24 @@ class QuestionEditor extends Component {
// 自定义处理粘贴的文本内容
editorRoot
.
config
.
pasteTextHandle
=
function
(
content
)
{
if
(
content
==
""
&&
!
content
)
return
""
;
var
str
=
content
;
str
=
str
.
replace
(
/<xml>
[\s\S]
*
?
<
\/
xml>/gi
,
""
);
str
=
str
.
replace
(
/<style>
[\s\S]
*
?
<
\/
style>/gi
,
""
);
str
=
str
.
replace
(
/<
\/?[^
>
]
*>/g
,
""
);
str
=
str
.
replace
(
/
[
|
]
*
\n
/g
,
"
\
n"
);
str
=
str
.
replace
(
/
\&
nbsp
\;
/gi
,
" "
);
str
=
str
.
replace
(
/
[\r\n]
/g
,
""
);
if
(
str
.
length
>
1000
)
{
str
=
str
.
substring
(
0
,
1000
);
var
str1
=
content
;
// 所有特殊字符
str1
=
str1
.
replace
(
/<xml>
[\s\S]
*
?
<
\/
xml>/gi
,
""
);
str1
=
str1
.
replace
(
/<style>
[\s\S]
*
?
<
\/
style>/gi
,
""
);
str1
=
str1
.
replace
(
/<
\/?[^
>
]
*>/g
,
""
);
str1
=
str1
.
replace
(
/
[
|
]
*
\n
/g
,
"
\
n"
);
str1
=
str1
.
replace
(
/
\&
nbsp
\;
/gi
,
" "
);
str1
=
str1
.
replace
(
/
[\r\n]
/g
,
""
);
var
str2
=
content
;
// 保留空格和换行的其他字符
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字"
);
}
else
{
content
=
str2
;
}
return
str
;
return
content
;
};
let
prevList
=
[];
...
...
src/modules/teach-tool/question-manage/components/QuestionEditor.less
View file @
93fd7ffe
...
...
@@ -41,7 +41,7 @@
.editor-box_content {
width: calc(100% - 80px);
p {
display: inline
-block
;
display: inline;
}
}
.editor-limit {
...
...
@@ -60,7 +60,7 @@
max-height: 110px;
overflow: auto;
p {
display: inline
-block
;
display: inline;
overflow-y: scroll;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment