Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cms_sys
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
西魏
cms_sys
Commits
7cb3edd7
Commit
7cb3edd7
authored
Nov 24, 2020
by
xierz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
封面栏目问题
parent
ee12b84b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
2 deletions
+65
-2
ContentAction.java
src/main/java/net/mingsoft/cms/action/ContentAction.java
+18
-0
form.ftl
src/main/webapp/WEB-INF/manager/cms/content/form.ftl
+47
-2
No files found.
src/main/java/net/mingsoft/cms/action/ContentAction.java
View file @
7cb3edd7
...
...
@@ -117,6 +117,24 @@ public class ContentAction extends BaseAction {
ContentEntity
_content
=
contentBiz
.
getById
(
content
.
getId
());
return
ResultData
.
build
().
success
(
_content
);
}
/**
* 获取文章
* @param content 文章实体
*/
@ApiOperation
(
value
=
"根据封面获取文章列表接口"
)
@ApiImplicitParam
(
name
=
"categoryId"
,
value
=
"分类编号"
,
required
=
true
,
paramType
=
"query"
)
@GetMapping
(
"/getByFengMian"
)
@ResponseBody
public
ResultData
getByFengMian
(
@ModelAttribute
@ApiIgnore
ContentEntity
content
){
if
(
content
.
getCategoryId
()
==
null
)
{
return
ResultData
.
build
().
error
();
}
List
<
ContentEntity
>
list
=
contentBiz
.
lambdaQuery
().
eq
(
ContentEntity:
:
getCategoryId
,
content
.
getCategoryId
()).
list
();
if
(
list
.
size
()
>
1
)
{
LOG
.
error
(
"获取封面文章异常"
);
}
return
ResultData
.
build
().
success
(
list
.
size
()
>
0
?
list
.
get
(
0
)
:
null
);
}
@ApiOperation
(
value
=
"保存文章列表接口"
)
@ApiImplicitParams
({
...
...
src/main/webapp/WEB-INF/manager/cms/content/form.ftl
View file @
7cb3edd7
...
...
@@ -524,6 +524,52 @@
console
.
log
(
err
);
});
},
//根据封面获取当前文章
getByFengMian
:
function
(
categoryId
)
{
var
that
=
this
;
ms
.
http
.
get
(
ms
.
manager
+
"/cms/content/getByFengMian.do"
,
{
"categoryId"
:
categoryId
}).
then
(
function
(
res
)
{
if
(
res
.
result
)
{
if
(
res
.
data
!=
null
)
{
if
(
res
.
data
.
contentType
&&
res
.
data
.
contentType
!=
''
)
{
res
.
data
.
contentType
=
res
.
data
.
contentType
.
split
(
','
);
}
else
{
res
.
data
.
contentType
=
[];
}
if
(
res
.
data
.
contentImg
)
{
res
.
data
.
contentImg
=
JSON
.
parse
(
res
.
data
.
contentImg
);
res
.
data
.
contentImg
.
forEach
(
function
(
value
)
{
value
.
url
=
ms
.
base
+
value
.
path
;
});
}
else
{
res
.
data
.
contentImg
=
[];
}
that
.
form
=
res
.
data
;
var
category
=
that
.
categoryIdOptions
.
filter
(
function
(
f
)
{
return
f
[
'id'
]
==
that
.
form
.
categoryId
;
});
if
(
category
.
length
==
1
)
{
if
(
category
[
0
].
categoryType
==
'2'
)
{
that
.
returnIsShow
=
false
;
}
}
that
.
changeModel
();
}
}
else
{
that
.
$notify
({
title
:
'失败'
,
message
:
"获取错误"
,
type
:
'warning'
});
}
}).
catch
(
function
(
err
)
{
console
.
log
(
err
);
});
},
//获取contentCategoryId数据源
contentCategoryIdOptionsGet
:
function
()
{
var
that
=
this
;
...
...
@@ -633,9 +679,8 @@
if
(
this
.
form
.
id
)
{
this
.
get
(
this
.
form
.
id
);
}
if
(
this
.
type
)
{
this
.
list
(
this
.
form
.
categoryId
);
this
.
getByFengMian
(
this
.
form
.
categoryId
);
this
.
returnIsShow
=
false
;
}
}
...
...
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