Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
d9653575
Commit
d9653575
authored
May 16, 2018
by
Junling Bu
Browse files
update[litemall-admin]: 基于官方tinymce-vue库重新实现商品详情编辑和专题内容编辑。
parent
59c808f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
litemall-admin/src/views/goods/goods.vue
View file @
d9653575
...
...
@@ -154,7 +154,7 @@
</el-form-item>
<el-form-item
style=
"width: 700px;"
label=
"商品详细介绍"
>
<
tinymce
v-model=
"dataForm.goodsDesc"
></
tinymce
>
<
editor
:init=
"editorInit"
v-model=
"dataForm.goodsDesc"
></
editor
>
</el-form-item>
<el-form-item
label=
"商品主图"
>
...
...
@@ -207,13 +207,14 @@
<
script
>
import
{
listGoods
,
createGoods
,
updateGoods
,
deleteGoods
}
from
'
@/api/goods
'
import
{
createStorage
}
from
'
@/api/storage
'
import
waves
from
'
@/directive/waves
'
// 水波纹指令
import
BackToTop
from
'
@/components/BackToTop
'
import
Tinymce
from
'
@
/components/T
inymce
'
import
Editor
from
'
@
tinymce/t
inymce
-vue
'
export
default
{
name
:
'
Goods
'
,
components
:
{
BackToTop
,
Tinymce
},
components
:
{
BackToTop
,
Editor
},
directives
:
{
waves
},
data
()
{
return
{
...
...
@@ -239,7 +240,7 @@ export default {
listPicUrl
:
undefined
,
primaryPicUrl
:
undefined
,
goodsBrief
:
undefined
,
goodsDesc
:
undefined
,
goodsDesc
:
''
,
keywords
:
undefined
,
gallery
:
undefined
,
categoryId
:
undefined
,
...
...
@@ -255,7 +256,21 @@ export default {
goodsSn
:
[{
required
:
true
,
message
:
'
商品编号不能为空
'
,
trigger
:
'
blur
'
}],
name
:
[{
required
:
true
,
message
:
'
商品名称不能为空
'
,
trigger
:
'
blur
'
}]
},
downloadLoading
:
false
downloadLoading
:
false
,
editorInit
:
{
language
:
'
zh_CN
'
,
plugins
:
[
'
advlist anchor autolink autoresize autosave code codesample colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools importcss insertdatetime legacyoutput link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace tabfocus table template textcolor textpattern visualblocks visualchars wordcount
'
],
toolbar
:
[
'
bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript
'
,
'
hr bullist numlist link image charmap preview anchor pagebreak fullscreen media table emoticons forecolor backcolor
'
],
images_upload_handler
:
function
(
blobInfo
,
success
,
failure
)
{
const
formData
=
new
FormData
()
formData
.
append
(
'
file
'
,
blobInfo
.
blob
())
createStorage
(
formData
).
then
(
res
=>
{
success
(
res
.
data
.
data
.
url
)
}).
catch
(()
=>
{
failure
(
'
上传失败,请重新上传
'
)
})
}
}
}
},
created
()
{
...
...
@@ -299,7 +314,7 @@ export default {
listPicUrl
:
undefined
,
primaryPicUrl
:
undefined
,
goodsBrief
:
undefined
,
goodsDesc
:
undefined
,
goodsDesc
:
''
,
keywords
:
undefined
,
gallery
:
undefined
,
categoryId
:
undefined
,
...
...
litemall-admin/src/views/promotion/topic.vue
View file @
d9653575
...
...
@@ -68,7 +68,7 @@
<el-input
v-model=
"dataForm.subtitle"
></el-input>
</el-form-item>
<el-form-item
style=
"width: 700px;"
label=
"专题内容"
>
<
tinymce
v-model=
"dataForm.content"
></
tinymce
>
<
editor
:init=
"editorInit"
v-model=
"dataForm.content"
></
editor
>
</el-form-item>
<el-form-item
label=
"商品低价"
prop=
"priceInfo"
>
<el-input
v-model=
"dataForm.priceInfo"
></el-input>
...
...
@@ -117,11 +117,11 @@ import { listTopic, createTopic, updateTopic, deleteTopic } from '@/api/topic'
import
{
createStorage
}
from
'
@/api/storage
'
import
waves
from
'
@/directive/waves
'
// 水波纹指令
import
BackToTop
from
'
@/components/BackToTop
'
import
Tinymce
from
'
@
/components/T
inymce
'
import
Editor
from
'
@
tinymce/t
inymce
-vue
'
export
default
{
name
:
'
Topic
'
,
components
:
{
BackToTop
,
Tinymce
},
components
:
{
BackToTop
,
Editor
},
directives
:
{
waves
},
...
...
@@ -141,7 +141,7 @@ export default {
id
:
undefined
,
titile
:
undefined
,
subtitle
:
undefined
,
content
:
undefined
,
content
:
''
,
priceInfo
:
undefined
,
readCount
:
undefined
,
isShow
:
false
...
...
@@ -157,7 +157,21 @@ export default {
subtitle
:
[{
required
:
true
,
message
:
'
专题子标题不能为空
'
,
trigger
:
'
blur
'
}],
content
:
[{
required
:
true
,
message
:
'
专题内容不能为空
'
,
trigger
:
'
blur
'
}]
},
downloadLoading
:
false
downloadLoading
:
false
,
editorInit
:
{
language
:
'
zh_CN
'
,
plugins
:
[
'
advlist anchor autolink autoresize autosave code codesample colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools importcss insertdatetime legacyoutput link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace tabfocus table template textcolor textpattern visualblocks visualchars wordcount
'
],
toolbar
:
[
'
bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript
'
,
'
hr bullist numlist link image charmap preview anchor pagebreak fullscreen media table emoticons forecolor backcolor
'
],
images_upload_handler
:
function
(
blobInfo
,
success
,
failure
)
{
const
formData
=
new
FormData
()
formData
.
append
(
'
file
'
,
blobInfo
.
blob
())
createStorage
(
formData
).
then
(
res
=>
{
success
(
res
.
data
.
data
.
url
)
}).
catch
(()
=>
{
failure
(
'
上传失败,请重新上传
'
)
})
}
}
}
},
created
()
{
...
...
@@ -193,7 +207,7 @@ export default {
id
:
undefined
,
titile
:
undefined
,
subtitle
:
undefined
,
content
:
undefined
,
content
:
''
,
priceInfo
:
undefined
,
readCount
:
undefined
,
isShow
:
false
...
...
Write
Preview
Supports
Markdown
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