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
0e6356cc
Commit
0e6356cc
authored
Apr 27, 2021
by
wufan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/yuananting/20210327/test-paper' into 'master'
fix:富文本创建重复 See merge request
!17
parents
2f0d9525
166c3dca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
src/modules/teach-tool/question-manage/components/QuestionEditor.jsx
+11
-11
No files found.
src/modules/teach-tool/question-manage/components/QuestionEditor.jsx
View file @
0e6356cc
...
@@ -42,9 +42,16 @@ class QuestionEditor extends Component {
...
@@ -42,9 +42,16 @@ class QuestionEditor extends Component {
blanksList
:
props
.
blanksList
||
[],
blanksList
:
props
.
blanksList
||
[],
};
};
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
renderEditor
();
const
editorRoot
=
new
E
(
`#editor
${
this
.
state
.
editorId
}
_tabbar`
,
`#editor
${
this
.
state
.
editorId
}
_content`
);
this
.
setState
({
editorRoot
},
()
=>
{
this
.
renderEditor
(
editorRoot
);
editorRoot
.
create
();
this
.
editorRoot
=
editorRoot
;
});
}
}
static
getDerivedStateFromProps
(
nextProps
,
prevState
)
{
static
getDerivedStateFromProps
(
nextProps
,
prevState
)
{
...
@@ -57,7 +64,7 @@ class QuestionEditor extends Component {
...
@@ -57,7 +64,7 @@ class QuestionEditor extends Component {
const
{
detailInfo
,
blanksList
}
=
nextProps
;
const
{
detailInfo
,
blanksList
}
=
nextProps
;
if
(
this
.
state
.
detailInfo
!==
detailInfo
)
{
if
(
this
.
state
.
detailInfo
!==
detailInfo
)
{
this
.
setState
({
detailInfo
:
nextProps
.
detailInfo
},
()
=>
{
this
.
setState
({
detailInfo
:
nextProps
.
detailInfo
},
()
=>
{
this
.
renderEditor
();
this
.
renderEditor
(
this
.
state
.
editorRoot
);
});
});
}
}
if
(
blanksList
!==
this
.
state
.
blanksList
)
{
if
(
blanksList
!==
this
.
state
.
blanksList
)
{
...
@@ -94,13 +101,9 @@ class QuestionEditor extends Component {
...
@@ -94,13 +101,9 @@ class QuestionEditor extends Component {
);
);
};
};
renderEditor
()
{
renderEditor
(
editorRoot
)
{
const
{
editorId
,
detailInfo
}
=
this
.
state
;
const
{
editorId
,
detailInfo
}
=
this
.
state
;
const
{
onChange
,
bindChangeContent
}
=
this
.
props
;
const
{
onChange
,
bindChangeContent
}
=
this
.
props
;
const
editorRoot
=
new
E
(
`#editor
${
editorId
}
_tabbar`
,
`#editor
${
editorId
}
_content`
);
editorRoot
.
config
.
menus
=
[];
editorRoot
.
config
.
menus
=
[];
editorRoot
.
config
.
uploadImgMaxSize
=
1
*
1024
*
1024
;
editorRoot
.
config
.
uploadImgMaxSize
=
1
*
1024
*
1024
;
editorRoot
.
config
.
customAlert
=
function
(
info
)
{
editorRoot
.
config
.
customAlert
=
function
(
info
)
{
...
@@ -223,9 +226,6 @@ class QuestionEditor extends Component {
...
@@ -223,9 +226,6 @@ class QuestionEditor extends Component {
});
});
};
};
editorRoot
.
create
();
this
.
editorRoot
=
editorRoot
;
const
contentHtml
=
/^
\<
p/
.
test
(
detailInfo
.
content
)
const
contentHtml
=
/^
\<
p/
.
test
(
detailInfo
.
content
)
?
detailInfo
.
content
?
detailInfo
.
content
:
`<p>
${
detailInfo
.
content
}
</p>`
;
:
`<p>
${
detailInfo
.
content
}
</p>`
;
...
...
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