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
f6115990
Commit
f6115990
authored
Mar 22, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:wangeditor版本冲突
parent
b92e5d38
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
src/modules/teach-tool/components/QuestionEditor.jsx
+10
-12
No files found.
src/modules/teach-tool/components/QuestionEditor.jsx
View file @
f6115990
...
@@ -94,7 +94,6 @@ class QuestionEditor extends Component {
...
@@ -94,7 +94,6 @@ class QuestionEditor extends Component {
this
.
editorRoot
.
txt
.
html
(
this
.
editorRoot
.
txt
.
html
(
/^
\<
p/
.
test
(
content
)
?
content
:
`<p>
${
content
}
</p>`
/^
\<
p/
.
test
(
content
)
?
content
:
`<p>
${
content
}
</p>`
);
);
this
.
editorRoot
.
change
&&
this
.
editorRoot
.
change
();
};
};
renderEditor
()
{
renderEditor
()
{
...
@@ -104,12 +103,12 @@ class QuestionEditor extends Component {
...
@@ -104,12 +103,12 @@ class QuestionEditor extends Component {
`#editor
${
editorId
}
_tabbar`
,
`#editor
${
editorId
}
_tabbar`
,
`#editor
${
editorId
}
_content`
`#editor
${
editorId
}
_content`
);
);
editorRoot
.
c
ustomC
onfig
.
menus
=
[];
editorRoot
.
config
.
menus
=
[];
editorRoot
.
c
ustomC
onfig
.
uploadImgMaxSize
=
1
*
1024
*
1024
;
editorRoot
.
config
.
uploadImgMaxSize
=
1
*
1024
*
1024
;
editorRoot
.
c
ustomC
onfig
.
customAlert
=
function
(
info
)
{
editorRoot
.
config
.
customAlert
=
function
(
info
)
{
message
.
warning
(
/1M/
.
test
(
info
)
?
"图片大于1M,请使用图片上传"
:
info
);
message
.
warning
(
/1M/
.
test
(
info
)
?
"图片大于1M,请使用图片上传"
:
info
);
};
};
editorRoot
.
c
ustomC
onfig
.
customUploadImg
=
function
(
files
,
insert
)
{
editorRoot
.
config
.
customUploadImg
=
function
(
files
,
insert
)
{
// files 是 input 中选中的文件列表
// files 是 input 中选中的文件列表
// insert 是获取图片 url 后,插入到编辑器的方法
// insert 是获取图片 url 后,插入到编辑器的方法
UploadOss
.
uploadBlobToOSS
(
files
[
0
],
window
.
random_string
(
16
)).
then
(
UploadOss
.
uploadBlobToOSS
(
files
[
0
],
window
.
random_string
(
16
)).
then
(
...
@@ -118,10 +117,10 @@ class QuestionEditor extends Component {
...
@@ -118,10 +117,10 @@ class QuestionEditor extends Component {
}
}
);
);
};
};
editorRoot
.
c
ustomC
onfig
.
zIndex
=
999
;
editorRoot
.
config
.
zIndex
=
999
;
editorRoot
.
c
ustomC
onfig
.
pasteFilterStyle
=
false
;
editorRoot
.
config
.
pasteFilterStyle
=
false
;
// 自定义处理粘贴的文本内容
// 自定义处理粘贴的文本内容
editorRoot
.
c
ustomC
onfig
.
pasteTextHandle
=
function
(
content
)
{
editorRoot
.
config
.
pasteTextHandle
=
function
(
content
)
{
if
(
content
==
""
&&
!
content
)
return
""
;
if
(
content
==
""
&&
!
content
)
return
""
;
var
str
=
content
;
var
str
=
content
;
str
=
str
.
replace
(
/<xml>
[\s\S]
*
?
<
\/
xml>/gi
,
""
);
str
=
str
.
replace
(
/<xml>
[\s\S]
*
?
<
\/
xml>/gi
,
""
);
...
@@ -161,7 +160,7 @@ class QuestionEditor extends Component {
...
@@ -161,7 +160,7 @@ class QuestionEditor extends Component {
}
}
}
}
editorRoot
.
c
ustomC
onfig
.
onchange
=
(
html
)
=>
{
editorRoot
.
config
.
onchange
=
(
html
)
=>
{
const
conLen
=
html
.
replace
(
/<
(?!
img|input
)
.*
?
>/g
,
""
).
length
;
const
conLen
=
html
.
replace
(
/<
(?!
img|input
)
.*
?
>/g
,
""
).
length
;
counter
++
;
counter
++
;
const
{
focusFlag
}
=
this
.
state
;
const
{
focusFlag
}
=
this
.
state
;
...
@@ -209,9 +208,8 @@ class QuestionEditor extends Component {
...
@@ -209,9 +208,8 @@ class QuestionEditor extends Component {
);
);
};
};
editorRoot
.
c
ustomC
onfig
.
onblur
=
(
html
)
=>
{
editorRoot
.
config
.
onblur
=
(
html
)
=>
{
const
conLen
=
html
.
replace
(
/<
(?!
img|input
)
.*
?
>/g
,
""
).
length
;
const
conLen
=
html
.
replace
(
/<
(?!
img|input
)
.*
?
>/g
,
""
).
length
;
editorRoot
.
change
&&
editorRoot
.
change
();
this
.
setState
({
this
.
setState
({
focusFlag
:
false
,
focusFlag
:
false
,
visibleMediaBox
:
false
,
visibleMediaBox
:
false
,
...
@@ -220,7 +218,7 @@ class QuestionEditor extends Component {
...
@@ -220,7 +218,7 @@ class QuestionEditor extends Component {
});
});
};
};
editorRoot
.
c
ustomC
onfig
.
onfocus
=
()
=>
{
editorRoot
.
config
.
onfocus
=
()
=>
{
this
.
setState
({
this
.
setState
({
focusFlag
:
true
,
focusFlag
:
true
,
visibleMediaBox
:
true
,
visibleMediaBox
:
true
,
...
...
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