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
18857ffc
Commit
18857ffc
authored
May 20, 2021
by
chenshu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修复
parent
70150640
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
25 deletions
+8
-25
src/modules/course-manage/components/GraphicsEditor.jsx
+8
-24
src/modules/course-manage/graphics-course/AddGraphicsCourse.jsx
+0
-1
No files found.
src/modules/course-manage/components/GraphicsEditor.jsx
View file @
18857ffc
...
@@ -18,14 +18,12 @@ class GraphicsEditor extends React.Component {
...
@@ -18,14 +18,12 @@ class GraphicsEditor extends React.Component {
diskList
:
[],
diskList
:
[],
}
}
this
.
editorInt
=
null
;
this
.
editorInt
=
null
;
this
.
isContent
=
true
;
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
renderEditor
()
this
.
renderEditor
()
this
.
resetIndex
(
true
);
this
.
resetIndex
(
true
);
this
.
initBus
();
this
.
initBus
();
this
.
bindClick
();
}
}
...
@@ -33,23 +31,6 @@ class GraphicsEditor extends React.Component {
...
@@ -33,23 +31,6 @@ class GraphicsEditor extends React.Component {
componentWillUnmount
()
{
componentWillUnmount
()
{
this
.
resetIndex
();
this
.
resetIndex
();
this
.
removeBus
();
this
.
removeBus
();
this
.
removeClick
();
}
bindClick
=
()
=>
{
window
.
addEventListener
(
'click'
,
this
.
clickEditor
)
}
removeClick
=
()
=>
{
window
.
removeEventListener
(
'click'
,
this
.
clickEditor
)
}
clickEditor
=
(
e
)
=>
{
if
(
e
&&
e
.
target
.
closest
(
'.content-editor'
))
{
this
.
isContent
=
true
}
else
if
(
e
&&
e
.
target
.
closest
(
'.introduce-editor'
))
{
this
.
isContent
=
false
}
}
}
resetIndex
=
(
bool
)
=>
{
resetIndex
=
(
bool
)
=>
{
...
@@ -103,9 +84,10 @@ class GraphicsEditor extends React.Component {
...
@@ -103,9 +84,10 @@ class GraphicsEditor extends React.Component {
}
}
this
.
editorInt
=
new
E
(
`#editor
${
editorId
}
`
);
this
.
editorInt
=
new
E
(
`#editor
${
editorId
}
`
);
this
.
editorInt
.
config
.
focus
=
false
;
this
.
editorInt
.
config
.
showFullScreen
=
!
isIntro
this
.
editorInt
.
config
.
showFullScreen
=
!
isIntro
this
.
editorInt
.
menus
.
extend
(
'xmimage'
,
ImageMenu
);
this
.
editorInt
.
menus
.
extend
(
'xmimage'
,
ImageMenu
);
this
.
editorInt
.
menus
.
extend
(
'xmvideo'
,
VideoMenu
);
!
isIntro
&&
this
.
editorInt
.
menus
.
extend
(
'xmvideo'
,
VideoMenu
);
this
.
editorInt
.
config
.
menus
=
isIntro
?
this
.
editorInt
.
config
.
menus
=
isIntro
?
[
[
'head'
,
'head'
,
...
@@ -185,19 +167,21 @@ class GraphicsEditor extends React.Component {
...
@@ -185,19 +167,21 @@ class GraphicsEditor extends React.Component {
// 选择图文
// 选择图文
handleSelectVideo
=
(
file
)
=>
{
handleSelectVideo
=
(
file
)
=>
{
const
{
ossUrl
}
=
file
||
{};
if
(
!
ossUrl
)
return
null
;
this
.
setState
({
this
.
setState
({
showSelectVideoModal
:
false
showSelectVideoModal
:
false
})
})
const
{
ossUrl
}
=
file
;
const
{
detail
}
=
this
.
props
;
const
{
detail
}
=
this
.
props
;
this
.
editorInt
&&
this
.
editorInt
.
txt
.
html
(
`
${
detail
.
content
}
<p style="width: 100%;padding-top: 56.25%;position: relative;"><iframe style="position: absolute;width: 100%;height: 100%;top: 0;left: 0;" src="
${
ossUrl
}
"></iframe><br/></p><p><br/></p>`
)
this
.
editorInt
&&
this
.
editorInt
.
txt
.
html
(
`
${
detail
.
content
}
<p style="width: 100%;padding-top: 56.25%;position: relative;"><iframe style="position: absolute;width: 100%;height: 100%;top: 0;left: 0;" src="
${
ossUrl
}
"></iframe><br/></p><p><br/></p>`
)
}
}
handleSelectImage
=
(
file
)
=>
{
handleSelectImage
=
(
file
)
=>
{
const
{
ossUrl
}
=
file
||
{};
if
(
!
ossUrl
)
return
null
;
this
.
setState
({
this
.
setState
({
showSelectImageModal
:
false
showSelectImageModal
:
false
})
})
const
{
ossUrl
}
=
file
;
const
{
detail
}
=
this
.
props
;
const
{
detail
}
=
this
.
props
;
this
.
editorInt
&&
this
.
editorInt
.
txt
.
html
(
`
${
detail
.
content
}
<p><img style="max-width: 100%;" src="
${
ossUrl
}
" /><br/><p>`
)
this
.
editorInt
&&
this
.
editorInt
.
txt
.
html
(
`
${
detail
.
content
}
<p><img style="max-width: 100%;" src="
${
ossUrl
}
" /><br/><p>`
)
}
}
...
@@ -205,13 +189,13 @@ class GraphicsEditor extends React.Component {
...
@@ -205,13 +189,13 @@ class GraphicsEditor extends React.Component {
initBus
=
()
=>
{
initBus
=
()
=>
{
const
{
isIntro
}
=
this
.
props
;
const
{
isIntro
}
=
this
.
props
;
Bus
.
bind
(
`graphicsEditorImage
${
isIntro
?
''
:
'Content'
}
`
,
this
.
uploadImage
)
Bus
.
bind
(
`graphicsEditorImage
${
isIntro
?
''
:
'Content'
}
`
,
this
.
uploadImage
)
Bus
.
bind
(
'graphicsEditorVideo'
,
this
.
uploadVideo
)
!
isIntro
&&
Bus
.
bind
(
'graphicsEditorVideo'
,
this
.
uploadVideo
)
}
}
removeBus
=
()
=>
{
removeBus
=
()
=>
{
const
{
isIntro
}
=
this
.
props
;
const
{
isIntro
}
=
this
.
props
;
Bus
.
unbind
(
`graphicsEditorImage
${
isIntro
?
''
:
'Content'
}
`
,
this
.
uploadImage
)
Bus
.
unbind
(
`graphicsEditorImage
${
isIntro
?
''
:
'Content'
}
`
,
this
.
uploadImage
)
Bus
.
unbind
(
'graphicsEditorVideo'
,
this
.
uploadVideo
)
!
isIntro
&&
Bus
.
unbind
(
'graphicsEditorVideo'
,
this
.
uploadVideo
)
}
}
uploadImage
=
()
=>
{
uploadImage
=
()
=>
{
...
...
src/modules/course-manage/graphics-course/AddGraphicsCourse.jsx
View file @
18857ffc
...
@@ -64,7 +64,6 @@ class AddGraphicsCourse extends React.Component {
...
@@ -64,7 +64,6 @@ class AddGraphicsCourse extends React.Component {
courseCatalogList
:[],
//分类列表
courseCatalogList
:[],
//分类列表
categoryId
:
null
,
//分类的Id值
categoryId
:
null
,
//分类的Id值
whetherVisitorsJoin
:
'NO'
,
// 是否允许游客加入
whetherVisitorsJoin
:
'NO'
,
// 是否允许游客加入
isContent
:
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