Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
admin-base
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
new-sing
admin-base
Commits
ff3d5c8c
Commit
ff3d5c8c
authored
Nov 26, 2018
by
wangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
课包编辑 编写
parent
fa70b206
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
48 deletions
+58
-48
editorDialog.vue
src/components/resources/editorDialog.vue
+58
-48
No files found.
src/components/resources/editorDialog.vue
View file @
ff3d5c8c
...
...
@@ -96,16 +96,20 @@
methods
:{
onSave
(){
if
(
this
.
editorObj
.
type
===
1
){
alert
(
this
.
editorObj
.
category_id
)
let
json
=
{
category_id
:
this
.
editorObj
.
category_id
,
title
:
this
.
formData
.
title
,
content
:
JSON
.
stringify
(
this
.
formData
.
content
),
cover
:
this
.
formData
.
cover
};
editElementApi
(
this
.
editorObj
.
id
,
json
)
editElementApi
(
json
,
this
.
editorObj
.
id
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'保存成功!'
});
this
.
$emit
(
'reflash'
)
})
}
else
if
(
this
.
editorObj
.
type
===
0
){
alert
(
this
.
editorObj
.
category_id
)
let
json
=
{
category_id
:
this
.
editorObj
.
category_id
,
title
:
this
.
formData
.
title
,
...
...
@@ -113,59 +117,65 @@
cover
:
this
.
formData
.
cover
};
addElementApi
(
json
,
0
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'保存成功!'
});
this
.
$emit
(
'reflash'
)
})
}
}
},
watch
:{
'editorObj.id'
(
value
){
if
(
value
){
getElemenetDetailApi
(
value
).
then
(
res
=>
{
res
.
content
=
JSON
.
parse
(
res
.
content
);
this
.
formData
=
res
})
}
else
{
this
.
formData
=
{
title
:
''
,
cover
:
''
,
content
:{
base
:{},
tips
:{
content
:
''
,
title1
:
''
,
title1_content
:
''
,
title2
:
''
,
title2_content
:
''
},
look
:{
content
:
''
,
'editorObj.show'
(
t
){
if
(
t
){
let
value
=
this
.
editorObj
.
id
if
(
value
){
getElemenetDetailApi
(
value
).
then
(
res
=>
{
res
.
content
=
JSON
.
parse
(
res
.
content
);
this
.
formData
=
res
})
}
else
{
this
.
formData
=
{
title
:
''
,
cover
:
''
,
content
:{
base
:{},
tips
:{
content
:
''
,
title1
:
''
,
title1_content
:
''
,
title2
:
''
,
title2_content
:
''
},
look
:{
content
:
''
,
},
play
:{
type
:
false
,
audio
:[],
audio2
:[],
video
:[],
video2
:[],
change
:
false
,
change2
:
false
,
age
:
false
},
fun
:{
type
:
false
,
audio
:[],
audio2
:[],
video
:[],
video2
:[],
change
:
false
,
change2
:
false
,
age
:
false
}
},
play
:{
type
:
false
,
audio
:[],
audio2
:[],
video
:[],
video2
:[],
change
:
false
,
change2
:
false
,
age
:
false
},
fun
:{
type
:
false
,
audio
:[],
audio2
:[],
video
:[],
video2
:[],
change
:
false
,
change2
:
false
,
age
:
false
}
},
type
:
0
type
:
0
}
}
}
}
}
}
...
...
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