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
MCMS
Commits
2533ec6f
Commit
2533ec6f
authored
Jan 29, 2019
by
yinxr
Browse files
Signed-off-by: yinxr <2273460044@qq.com>
parent
42fb675a
Changes
9
Hide whitespace changes
Inline
Side-by-side
src/main/webapp/WEB-INF/manager/images/data/article-default.png
0 → 100644
View file @
2533ec6f
6.1 KB
src/main/webapp/WEB-INF/manager/mweixin/metarial/form.ftl
View file @
2533ec6f
...
@@ -12,9 +12,10 @@
...
@@ -12,9 +12,10 @@
</el-header>
</el-header>
<el-container class=" ms-container">
<el-container class=" ms-container">
<el-aside width="280px">
<el-aside width="280px">
<!-- 主图文章 -->
<div class="ms-main-article">
<div class="ms-main-article">
<img :src=
'
mainArticle.basicPic ||
'
>
<img :src=
"
mainArticle.basicPic ||
ms.base+'/WEB-INF/manager/images/data/article-default.png'"
>
<div class="ms-
main-
article-mask"></div>
<div class="ms-article-mask"></div>
<span v-text='mainArticle.basicTitle'></span>
<span v-text='mainArticle.basicTitle'></span>
</div>
</div>
<draggable v-model="subArticleList" :options="
{
draggable
:
'
.ms-article-item
'
}
">
<draggable v-model="subArticleList" :options="
{
draggable
:
'
.ms-article-item
'
}
">
...
@@ -31,24 +32,38 @@
...
@@ -31,24 +32,38 @@
</el-aside>
</el-aside>
<el-main>
<el-main>
<div class="ms-main-header">
<div class="ms-main-header">
<el-upload class="ms-pic-upload" :show-file-list="false">
<el-upload
<img v-if="false" :src="false" class="avatar">
class="ms-pic-upload"
<i v-else class="el-icon-picture"></i>
:show-file-list="false"
<span>添加封面</span>
:on-success="basicPicSuccess"
:before-upload='beforeBasicPicUpload'
:action="ms.web + '/file/upload.do'"
:limit='1'
:data=
{
uploadFloderPath
:
"/mweixin/news"
}
>
<div class="ms-article-mask" v-show='headMask' @mouseover='headMask=true;' @mouseleave='headMask=false'>
<i class="el-icon-delete" @click='delThumbnail'></i>
</div>
<img v-if="thumbnailShow" :src="thumbnailUrl"
class="article-thumbnail" @mouseover='headMask=true;' @mouseleave='headMask=false;'>
<template v-else>
<i class="el-icon-picture"></i>
<span>添加封面</span>
</template>
</el-upload>
</el-upload>
<el-form label-width='40px'>
<el-form label-width='40px'>
<el-form-item label="标题" prop="">
<el-form-item label="标题" prop="">
<el-input size='small' placeholder="请输入图文标题" v-model='articleForm.basicTitle' @input="resetWordNum('
t
itle')">
<el-input size='small' placeholder="请输入图文标题" v-model='articleForm.basicTitle' @input="resetWordNum('
basicT
itle'
,64
)">
<span slot='suffix' v-text="titleWordNumber+'/64'"></span>
<span slot='suffix' v-text="titleWordNumber+'/64'"></span>
</el-input>
</el-input>
</el-form-item>
</el-form-item>
<el-form-item label="作者" prop="">
<el-form-item label="作者" prop="">
<el-input size='small' placeholder="请输入图文作者" v-model='articleForm.articleAuthor' @input="resetWordNum('author')">
<el-input size='small' placeholder="请输入图文作者" v-model='articleForm.articleAuthor' @input="resetWordNum('a
rticleA
uthor'
,8
)">
<span slot='suffix' v-text="authorWordNumber+'/8'"></span>
<span slot='suffix' v-text="authorWordNumber+'/8'"></span>
</el-input>
</el-input>
</el-form-item>
</el-form-item>
<el-form-item label="摘要" prop="">
<el-form-item label="摘要" prop="">
<el-input size='small' type='textarea' placeholder="选填,如果不写会默认抓取正文前54个字" :autosize="
{
minRows
:
2
,
maxRows
:
2
}
" resize='none' v-model='articleForm.basicDescription' @input="resetWordNum(
'desc'
)">
<el-input size='small' type='textarea' placeholder="选填,如果不写会默认抓取正文前54个字" :autosize="
{
minRows
:
2
,
maxRows
:
2
}
" resize='none' v-model='articleForm.basicDescription' @input="resetWordNum(
120
)">
<span slot='suffix' v-text="descWordNumber+'/54'"></span>
<span slot='suffix' v-text="descWordNumber+'/54'"></span>
</el-input>
</el-input>
</el-form-item>
</el-form-item>
...
@@ -70,6 +85,7 @@
...
@@ -70,6 +85,7 @@
basicPic
:
''
,
//主图
basicPic
:
''
,
//主图
basicTitle
:
''
,
//标题
basicTitle
:
''
,
//标题
},
},
defaultMainArticle
:
''
,
//拷贝主图信息
subArticleList
:
[]
,
//
子文章列表
subArticleList
:
[]
,
//
子文章列表
titleWordNumber
:
64
,
//图文标题剩余字数
titleWordNumber
:
64
,
//图文标题剩余字数
authorWordNumber
:
8
,
//图文作者剩余字数
authorWordNumber
:
8
,
//图文作者剩余字数
...
@@ -80,7 +96,19 @@
...
@@ -80,7 +96,19 @@
articleAuthor
:
''
,
//作者
articleAuthor
:
''
,
//作者
basicDescription
:
''
,
//摘要
basicDescription
:
''
,
//摘要
articleContent
:
''
,
//正文
articleContent
:
''
,
//正文
}
},
defaultArticleForm
:
''
,
//拷贝表单值
thumbnailShow
:
false
,
//显示缩略图
thumbnailUrl
:
''
,
//缩略图路径
headMask
:
false
,
//缩略图删除
},
watch
:{
articleForm
:{
handler
:
function
(
n
,
o
){
this
.mainArticle.basicTitle
=
n
.basicTitle
},
deep
:
true
,
}
},
},
methods
:
{
methods
:
{
open
:
function
(
material
){
open
:
function
(
material
){
...
@@ -88,11 +116,37 @@
...
@@ -88,11 +116,37 @@
if
(
material
&&
material
.newsId
>
0
){
if
(
material
&&
material
.newsId
>
0
){
//
编辑
//
编辑
this
.subArticleList
=
material
.articleList
this
.subArticleList
=
material
.articleList
this
.mainArticle
=
material
.newsArticle
}
else
{
}
else
{
//
新增
//
新增
console
.log
(
'
this
.defaultArticleForm
'
,
this
.defaultArticleForm
)
;
this
.articleForm
=
this
.defaultArticleForm
this
.mainArticle
=
this
.defaultMainArticle
}
}
console
.log
(
'
"material',material);
console
.log
(
'
"material',material);
},
},
// 图片上传之前的钩子
beforeBasicPicUpload:function(file){
var fileType = false;
if(file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/jpg'){
fileType = true;
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!fileType) {
this.$message.error('文章配图只能是 JPG、JPEG、PNG 格式!');
}
if (!isLt2M) {
this.$message.error('文章配图大小不能超过 2MB!');
}
return fileType && isLt2M;
},
// 图片上传成功函数
basicPicSuccess:function(url){
this.thumbnailShow = true
this.thumbnailUrl = ms.web + url
this.mainArticle.basicPic = this.thumbnailUrl
},
// 添加文章
// 添加文章
addArticle: function() {
addArticle: function() {
if(this.subArticleList.length > 6) {
if(this.subArticleList.length > 6) {
...
@@ -108,9 +162,23 @@
...
@@ -108,9 +162,23 @@
basicThumbnailsl: 'https://img03.sogoucdn.com/app/a/100520091/20190125113148'
basicThumbnailsl: 'https://img03.sogoucdn.com/app/a/100520091/20190125113148'
})
})
},
},
// 计算剩余字数
delThumbnail:function(){
resetWordNum: function(type) {
},
// 计算剩余字数
resetWordNum: function(type,limit) {
var result = event.target.value;
if(type.indexOf('Title') > -1){
this.titleWordNumber = this.titleWordNumber - result.length
}else{
this.authorWordNumber = this.authorWordNumber - result.length
}
if(result.length >= limit){
this.$message.error('超出字数限制,请输入不超过'+limit+'字符');
this.$nextTick(function(){
this.articleForm[type] = result.slice(0,limit);
})
}
}
}
},
},
mounted: function() {
mounted: function() {
...
@@ -150,6 +218,10 @@
...
@@ -150,6 +218,10 @@
);
);
});
});
}
}
// 初始化默认值
this.defaultArticleForm = JSON.parse(JSON.stringify(this.articleForm))
this.defaultMainArticle = JSON.parse(JSON.stringify(this.mainArticle))
}
}
})
})
</script>
</script>
\ No newline at end of file
src/main/webapp/WEB-INF/manager/mweixin/metarial/index.ftl
View file @
2533ec6f
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<!--右侧头部-->
<!--右侧头部-->
<el-header class="ms-header" height="50px">
<el-header class="ms-header" height="50px">
<el-row>
<el-row>
<el-button type="primary" size="small" icon="el-icon-plus"
@
click="
menuVue.menuActive = '新建图文'
">添加</el-button>
<el-button type="primary" size="small" icon="el-icon-plus"
on
click="
articleVue.open()
">添加</el-button>
<el-button class="ms-fr" size="small" icon="el-icon-refresh">刷新</el-button>
<el-button class="ms-fr" size="small" icon="el-icon-refresh">刷新</el-button>
<el-button class="ms-fr" size="small" @click='sync'>同步微信素材</el-button>
<el-button class="ms-fr" size="small" @click='sync'>同步微信素材</el-button>
</el-row>
</el-row>
...
...
src/main/webapp/static/ms-admin/4.7.0/images/login-bg.jpg
0 → 100644
View file @
2533ec6f
251 KB
src/main/webapp/static/ms-admin/4.7.0/images/login-slogn.png
0 → 100644
View file @
2533ec6f
13.7 KB
src/main/webapp/static/mweixin/article.less
View file @
2533ec6f
...
@@ -5,6 +5,14 @@
...
@@ -5,6 +5,14 @@
width: 100%;
width: 100%;
background: transparent !important;
background: transparent !important;
padding: 0 !important;
padding: 0 !important;
.ms-article-mask {
background: #000;
opacity: .2;
.ms-width-height(100%, 146px);
position: absolute;
top: 0;
left: 0;
}
.el-container {
.el-container {
.ms-container {
.ms-container {
padding: 0;
padding: 0;
...
@@ -21,14 +29,6 @@
...
@@ -21,14 +29,6 @@
img {
img {
.ms-width-height(100%, 146px);
.ms-width-height(100%, 146px);
}
}
.ms-main-article-mask {
background: #000;
opacity: .2;
.ms-width-height(100%, 146px);
position: absolute;
top: 0;
left: 0;
}
span {
span {
position: absolute;
position: absolute;
bottom: 0;
bottom: 0;
...
@@ -77,6 +77,7 @@
...
@@ -77,6 +77,7 @@
margin-left: 14px;
margin-left: 14px;
padding: 0 !important;
padding: 0 !important;
.ms-main-header {
.ms-main-header {
position: relative;
background: #fff;
background: #fff;
.ms-flex();
.ms-flex();
height: 180px;
height: 180px;
...
@@ -102,8 +103,25 @@
...
@@ -102,8 +103,25 @@
i {
i {
.ms-font(18px, @auxiliaryColor);
.ms-font(18px, @auxiliaryColor);
}
}
// 文章缩略图
.article-thumbnail{
.ms-width-height(140px);
}
>.ms-article-mask{
.ms-width-height(140px);
.ms-flex(center);
align-items: center;
left: 21px;
top: 20px;
z-index: 99;
opacity: .6;
>i{
.ms-font(19px,#fff);
}
}
}
}
} // 表单
}
// 表单
.el-form {
.el-form {
flex: 1;
flex: 1;
margin: 0 !important;
margin: 0 !important;
...
@@ -111,9 +129,12 @@
...
@@ -111,9 +129,12 @@
flex-direction: column;
flex-direction: column;
.el-form-item {
.el-form-item {
margin-bottom: 0 !important;
margin-bottom: 0 !important;
}
.el-input__suffix {
.el-input__suffix {
top: -3px !important;
top: -3px !important;
>input{
padding-right: 50px !important;
}
}
}
}
}
}
}
}
...
...
src/main/webapp/static/mweixin/css/article.css
View file @
2533ec6f
...
@@ -50,7 +50,7 @@ input::-webkit-input-placeholder,
...
@@ -50,7 +50,7 @@ input::-webkit-input-placeholder,
textarea
::-webkit-input-placeholder
{
textarea
::-webkit-input-placeholder
{
font-weight
:
initial
;
font-weight
:
initial
;
font-size
:
12px
;
font-size
:
12px
;
color
:
#
aaa
;
color
:
#
999
;
resize
:
none
;
resize
:
none
;
}
}
*
::-webkit-scrollbar
{
*
::-webkit-scrollbar
{
...
@@ -68,7 +68,7 @@ textarea::-webkit-input-placeholder {
...
@@ -68,7 +68,7 @@ textarea::-webkit-input-placeholder {
*
::-webkit-scrollbar-thumb
{
*
::-webkit-scrollbar-thumb
{
border-radius
:
10px
;
border-radius
:
10px
;
/*滚动条的圆角*/
/*滚动条的圆角*/
background-color
:
#
ddd
;
background-color
:
#
e6e6e6
;
/*滚动条的背景颜色*/
/*滚动条的背景颜色*/
}
}
.ms-container
{
.ms-container
{
...
@@ -104,7 +104,7 @@ textarea::-webkit-input-placeholder {
...
@@ -104,7 +104,7 @@ textarea::-webkit-input-placeholder {
height
:
55px
;
height
:
55px
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
padding
:
10px
10px
25px
10px
;
padding
:
10px
10px
25px
10px
;
border-bottom
:
1px
solid
#
ddd
;
border-bottom
:
1px
solid
#
e6e6e6
;
}
}
.ms-weixin-dialog
.el-dialog__header
.el-dialog__title
{
.ms-weixin-dialog
.el-dialog__header
.el-dialog__title
{
font-weight
:
bold
;
font-weight
:
bold
;
...
@@ -112,7 +112,7 @@ textarea::-webkit-input-placeholder {
...
@@ -112,7 +112,7 @@ textarea::-webkit-input-placeholder {
color
:
#333
;
color
:
#333
;
}
}
.ms-weixin-dialog
.el-dialog__footer
{
.ms-weixin-dialog
.el-dialog__footer
{
border-top
:
1px
solid
#
ddd
;
border-top
:
1px
solid
#
e6e6e6
;
padding
:
15px
!important
;
padding
:
15px
!important
;
}
}
.ms-hover
{
.ms-hover
{
...
@@ -130,6 +130,15 @@ textarea::-webkit-input-placeholder {
...
@@ -130,6 +130,15 @@ textarea::-webkit-input-placeholder {
background
:
transparent
!important
;
background
:
transparent
!important
;
padding
:
0
!important
;
padding
:
0
!important
;
}
}
.ms-article
.ms-article-mask
{
background
:
#000
;
opacity
:
.2
;
width
:
100%
;
height
:
146px
;
position
:
absolute
;
top
:
0
;
left
:
0
;
}
.ms-article
.el-container
.ms-container
{
.ms-article
.el-container
.ms-container
{
padding
:
0
;
padding
:
0
;
background
:
transparent
;
background
:
transparent
;
...
@@ -146,15 +155,6 @@ textarea::-webkit-input-placeholder {
...
@@ -146,15 +155,6 @@ textarea::-webkit-input-placeholder {
width
:
100%
;
width
:
100%
;
height
:
146px
;
height
:
146px
;
}
}
.ms-article
.el-container
.el-aside
.ms-main-article
.ms-main-article-mask
{
background
:
#000
;
opacity
:
0.2
;
width
:
100%
;
height
:
146px
;
position
:
absolute
;
top
:
0
;
left
:
0
;
}
.ms-article
.el-container
.el-aside
.ms-main-article
span
{
.ms-article
.el-container
.el-aside
.ms-main-article
span
{
position
:
absolute
;
position
:
absolute
;
bottom
:
0
;
bottom
:
0
;
...
@@ -172,7 +172,7 @@ textarea::-webkit-input-placeholder {
...
@@ -172,7 +172,7 @@ textarea::-webkit-input-placeholder {
display
:
flex
;
display
:
flex
;
justify-content
:
space-between
;
justify-content
:
space-between
;
padding
:
10px
0
;
padding
:
10px
0
;
border-bottom
:
1px
solid
#
ddd
;
border-bottom
:
1px
solid
#
e6e6e6
;
}
}
.ms-article
.el-container
.el-aside
.ms-article-item
p
{
.ms-article
.el-container
.el-aside
.ms-article-item
p
{
margin
:
0
10px
0
0
;
margin
:
0
10px
0
0
;
...
@@ -208,7 +208,7 @@ textarea::-webkit-input-placeholder {
...
@@ -208,7 +208,7 @@ textarea::-webkit-input-placeholder {
.ms-article
.el-container
.el-aside
.ms-article-footer
.el-button
span
{
.ms-article
.el-container
.el-aside
.ms-article-footer
.el-button
span
{
font-weight
:
initial
;
font-weight
:
initial
;
font-size
:
12px
;
font-size
:
12px
;
color
:
#
aaa
;
color
:
#
999
;
}
}
.ms-article
.el-container
.el-main
{
.ms-article
.el-container
.el-main
{
flex
:
1
;
flex
:
1
;
...
@@ -216,6 +216,7 @@ textarea::-webkit-input-placeholder {
...
@@ -216,6 +216,7 @@ textarea::-webkit-input-placeholder {
padding
:
0
!important
;
padding
:
0
!important
;
}
}
.ms-article
.el-container
.el-main
.ms-main-header
{
.ms-article
.el-container
.el-main
.ms-main-header
{
position
:
relative
;
background
:
#fff
;
background
:
#fff
;
display
:
flex
;
display
:
flex
;
justify-content
:
space-between
;
justify-content
:
space-between
;
...
@@ -223,13 +224,13 @@ textarea::-webkit-input-placeholder {
...
@@ -223,13 +224,13 @@ textarea::-webkit-input-placeholder {
padding
:
20px
;
padding
:
20px
;
padding-bottom
:
24px
;
padding-bottom
:
24px
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
border-bottom
:
1px
solid
#
ddd
;
border-bottom
:
1px
solid
#
e6e6e6
;
}
}
.ms-article
.el-container
.el-main
.ms-main-header
.ms-pic-upload
{
.ms-article
.el-container
.el-main
.ms-main-header
.ms-pic-upload
{
width
:
140px
;
width
:
140px
;
height
:
140px
;
height
:
140px
;
border-radius
:
4px
;
border-radius
:
4px
;
border
:
1px
dashed
#
ddd
;
border
:
1px
dashed
#
e6e6e6
;
display
:
flex
;
display
:
flex
;
justify-content
:
center
;
justify-content
:
center
;
flex-direction
:
column
;
flex-direction
:
column
;
...
@@ -244,13 +245,33 @@ textarea::-webkit-input-placeholder {
...
@@ -244,13 +245,33 @@ textarea::-webkit-input-placeholder {
.ms-article
.el-container
.el-main
.ms-main-header
.ms-pic-upload
.el-upload
span
{
.ms-article
.el-container
.el-main
.ms-main-header
.ms-pic-upload
.el-upload
span
{
font-weight
:
initial
;
font-weight
:
initial
;
font-size
:
12px
;
font-size
:
12px
;
color
:
#
aaa
;
color
:
#
999
;
margin-top
:
4px
;
margin-top
:
4px
;
}
}
.ms-article
.el-container
.el-main
.ms-main-header
.ms-pic-upload
.el-upload
i
{
.ms-article
.el-container
.el-main
.ms-main-header
.ms-pic-upload
.el-upload
i
{
font-weight
:
initial
;
font-weight
:
initial
;
font-size
:
18px
;
font-size
:
18px
;
color
:
#aaa
;
color
:
#999
;
}
.ms-article
.el-container
.el-main
.ms-main-header
.ms-pic-upload
.el-upload
.article-thumbnail
{
width
:
140px
;
height
:
140px
;
}
.ms-article
.el-container
.el-main
.ms-main-header
.ms-pic-upload
.el-upload
>
.ms-article-mask
{
width
:
140px
;
height
:
140px
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
left
:
21px
;
top
:
20px
;
z-index
:
99
;
opacity
:
.6
;
}
.ms-article
.el-container
.el-main
.ms-main-header
.ms-pic-upload
.el-upload
>
.ms-article-mask
>
i
{
font-weight
:
initial
;
font-size
:
19px
;
color
:
#fff
;
}
}
.ms-article
.el-container
.el-main
.ms-main-header
.el-form
{
.ms-article
.el-container
.el-main
.ms-main-header
.el-form
{
flex
:
1
;
flex
:
1
;
...
@@ -262,9 +283,12 @@ textarea::-webkit-input-placeholder {
...
@@ -262,9 +283,12 @@ textarea::-webkit-input-placeholder {
.ms-article
.el-container
.el-main
.ms-main-header
.el-form
.el-form-item
{
.ms-article
.el-container
.el-main
.ms-main-header
.el-form
.el-form-item
{
margin-bottom
:
0
!important
;
margin-bottom
:
0
!important
;
}
}
.ms-article
.el-container
.el-main
.ms-main-header
.el-form
.el-input__suffix
{
.ms-article
.el-container
.el-main
.ms-main-header
.el-form
.el-form-item
.el-input__suffix
{
top
:
-3px
!important
;
top
:
-3px
!important
;
}
}
.ms-article
.el-container
.el-main
.ms-main-header
.el-form
.el-form-item
.el-input__suffix
>
input
{
padding-right
:
50px
!important
;
}
.ms-article
.el-container
.el-main
.ms-main-body
{
.ms-article
.el-container
.el-main
.ms-main-body
{
height
:
calc
(
100%
-
180px
);
height
:
calc
(
100%
-
180px
);
background
:
#fff
;
background
:
#fff
;
...
...
src/main/webapp/static/mweixin/css/material-list.css
View file @
2533ec6f
...
@@ -188,6 +188,9 @@ textarea::-webkit-input-placeholder {
...
@@ -188,6 +188,9 @@ textarea::-webkit-input-placeholder {
display
:
-webkit-box
;
display
:
-webkit-box
;
-webkit-line-clamp
:
3
;
-webkit-line-clamp
:
3
;
-webkit-box-orient
:
vertical
;
-webkit-box-orient
:
vertical
;
font-weight
:
initial
;
font-size
:
12px
;
color
:
#999
;
}
}
.ms-weixin-content
.ms-admin-material-list
.ms-admin-material-item
.footer
{
.ms-weixin-content
.ms-admin-material-list
.ms-admin-material-item
.footer
{
display
:
flex
;
display
:
flex
;
...
...
src/main/webapp/static/mweixin/material-list.less
View file @
2533ec6f
...
@@ -47,6 +47,7 @@
...
@@ -47,6 +47,7 @@
margin: 0;
margin: 0;
color: @contentColor;
color: @contentColor;
.ms-ellipsis-clamp(3);
.ms-ellipsis-clamp(3);
.ms-font(@auxiliarySize,@auxiliaryColor);
}
}
}
}
.footer {
.footer {
...
...
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