Toggle navigation
Toggle navigation
This project
Loading...
Sign in
platform
/
platform-cms
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
liangyi.chen@yoho.cn
6 years ago
Commit
1d5035231115bcdde975c1914a3d8e648cb6e534
1 parent
c34cc88a
增加文章预览功能
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
3 deletions
grass/src/main/java/com/yohobuy/platform/grass/service/impl/GrassArticleServiceImpl.java
web/src/main/resources/config.properties
web/src/main/webapp/META-INF/autoconf/config.properties
web/src/main/webapp/html/grass/articleManage/articleList.html
grass/src/main/java/com/yohobuy/platform/grass/service/impl/GrassArticleServiceImpl.java
View file @
1d50352
...
...
@@ -108,6 +108,9 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
@Value
(
"${api.yoho.url:http://api.yoho.cn}"
)
private
String
apiUrl
;
@Value
(
"${preview.url}"
)
private
String
previewUrl
;
private
ExecutorService
taskExecutor
=
Executors
.
newFixedThreadPool
(
6
);
@Override
...
...
@@ -1379,6 +1382,8 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
rspBo
.
setCopyright
(
article
.
getCopyright
());
rspBo
.
setActionUrl
(
linkMap
.
get
(
article
.
getId
())
==
null
?
""
:
linkMap
.
get
(
article
.
getId
()));
rspBo
.
setHasPublished
(
article
.
getCreateTime
()
>=
System
.
currentTimeMillis
()
?
"N"
:
"Y"
);
//拼接文章预览的url 类似:http://yoho-community-web.test3.ingress.dev.yohocorp.com/grass/article/1408536?type=preview
rspBo
.
setPreviewUrl
(
previewUrl
+
article
.
getId
()
+
"?type=preview"
);
rspBoList
.
add
(
rspBo
);
});
return
rspBoList
;
...
...
web/src/main/resources/config.properties
View file @
1d50352
...
...
@@ -64,7 +64,7 @@ rabbit_user=yoho
rabbit_password
=
yoho
#zookeeper address
zkAddress
=
1
27.0.0.
1:2181
zkAddress
=
1
92.168.102.21
1:2181
#dev
web.context
=
pfcms
...
...
@@ -251,3 +251,4 @@ qq.secretId = AKID6dwpKadiQgbDpXDtyNhppIHPO5qPv5GK
qq.secretKey
=
ACJkH9mg0DBA1PYpf0E7f3g534wBsQaW
uic.service.url
=
http://java-yoho-uic.test3.ingress.dev.yohocorp.com/uic
preview.url
=
http://yoho-community-web.test3.ingress.dev.yohocorp.com/grass/article/
...
...
web/src/main/webapp/META-INF/autoconf/config.properties
View file @
1d50352
...
...
@@ -236,4 +236,5 @@ qq.serverUri = ${qq.serverUri}
qq.secretId
=
${qq.secretId}
qq.secretKey
=
${qq.secretKey}
uic.service.url
=
${uic.service.url}
\ No newline at end of file
uic.service.url
=
${uic.service.url}
preview.url
=
${preview.url}
\ No newline at end of file
...
...
web/src/main/webapp/html/grass/articleManage/articleList.html
View file @
1d50352
...
...
@@ -532,8 +532,11 @@
}
str
+=
"<a role='deleteR' class='btn-success' dataId='"
+
rowData
.
articleId
+
"' index='"
+
rowIndex
+
"' style='margin-left:10px'>删除</a>"
;
if
(
rowData
.
authStatus
==
1
){
str
+=
"<a role='showDetail' dataId='"
+
rowData
.
articleId
+
"' index='"
+
rowIndex
+
"' status='1' style='margin-left:10px'>评论</a>"
;
str
+=
"<a role='showDetail'
class='btn-info'
dataId='"
+
rowData
.
articleId
+
"' index='"
+
rowIndex
+
"' status='1' style='margin-left:10px'>评论</a>"
;
}
str
+=
"<a role='preview' class='btn-info' dataId='"
+
rowData
.
previewUrl
+
"' index='"
+
rowIndex
+
"' style='margin-left:10px'>预览</a>"
;
return
str
;
}
}
...
...
@@ -571,6 +574,14 @@
}
});
$
(
this
).
datagrid
(
"getPanel"
).
find
(
"a[role='preview']"
).
linkbutton
({
iconCls
:
"icon-save"
,
onClick
:
function
()
{
var
previewUrl
=
$
(
this
).
attr
(
"dataId"
);
articlePreview
(
previewUrl
);
}
});
$
(
this
).
datagrid
(
"getPanel"
).
find
(
"a[role='switchR']"
).
linkbutton
({
iconCls
:
"icon-edit"
,
onClick
:
function
()
{
...
...
@@ -664,6 +675,20 @@
}
});
// 预览
function
articlePreview
(
previewUrl
){
var
articleEditer
=
$
(
"<div id='articleEditer' style ='overflow:scroll;'>"
).
appendTo
(
$
(
document
.
body
));
var
title
=
"预览"
;
$
(
articleEditer
).
myDialog
({
title
:
title
,
width
:
"500px"
,
height
:
"800px"
,
resizable
:
false
,
modal
:
true
,
href
:
previewUrl
});
}
// 编辑
function
articleEditer
(
data
){
var
articleEditer
=
$
(
"<div id='articleEditer'>"
).
appendTo
(
$
(
document
.
body
));
...
...
Please
register
or
login
to post a comment