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
b3ffa311
Commit
b3ffa311
authored
Nov 29, 2019
by
tianbj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分类
parent
2a4ab99b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
25 deletions
+41
-25
CategoryAction.java
src/main/java/net/mingsoft/cms/action/CategoryAction.java
+3
-3
form.ftl
src/main/webapp/WEB-INF/manager/cms/category/form.ftl
+23
-13
index.ftl
src/main/webapp/WEB-INF/manager/cms/category/index.ftl
+15
-9
No files found.
src/main/java/net/mingsoft/cms/action/CategoryAction.java
View file @
b3ffa311
...
...
@@ -253,13 +253,13 @@ public class CategoryAction extends BaseAction{
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryTitle
()+
""
,
1
,
100
)){
return
ResultData
.
build
().
error
(
getResString
(
"err.length"
,
this
.
getResString
(
"category.title"
),
"1"
,
"100"
));
}
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryFlag
()+
""
,
1
,
100
)){
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryFlag
()+
""
,
0
,
100
)){
return
ResultData
.
build
().
error
(
getResString
(
"err.length"
,
this
.
getResString
(
"category.flag"
),
"1"
,
"100"
));
}
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryPath
()+
""
,
1
,
100
)){
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryPath
()+
""
,
0
,
100
)){
return
ResultData
.
build
().
error
(
getResString
(
"err.length"
,
this
.
getResString
(
"category.path"
),
"1"
,
"100"
));
}
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryParentId
()+
""
,
1
,
100
)){
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryParentId
()+
""
,
0
,
100
)){
return
ResultData
.
build
().
error
(
getResString
(
"err.length"
,
this
.
getResString
(
"category.parent.id"
),
"1"
,
"100"
));
}
categoryBiz
.
updateEntity
(
category
);
...
...
src/main/webapp/WEB-INF/manager/cms/category/form.ftl
View file @
b3ffa311
...
...
@@ -62,28 +62,28 @@
gutter=
"0"
justify=
"start"
align=
"top"
>
<el-col
span=
"12"
>
<el-form-item
label=
"列表模板"
prop=
"categoryList
Url"
>
<el-select
v-model=
"form.categoryList
Url"
<el-form-item
:label=
"form.categoryType =='1'? '内容模板' : '封面模板'"
prop=
"category
Url"
>
<el-select
v-model=
"form.category
Url"
:style=
"{width: '100%'}"
:filterable=
"false"
:disabled=
"false"
:multiple=
"false"
:clearable=
"true"
placeholder=
"请选择列表
模板"
>
<el-option
v-for=
'item in categoryListUrlOptions'
:key=
"item.id"
:value=
"item.id
"
:label=
"false?item.name:item.id
"
></el-option>
placeholder=
"请选择内容
模板"
>
<el-option
v-for=
'item in categoryUrlOptions'
:key=
"item"
:value=
"item
"
:label=
"item
"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col
span=
"12"
>
<el-form-item
label=
"内容模板"
prop=
"categoryUrl
"
>
<el-select
v-model=
"form.category
Url"
<el-form-item
label=
"列表模板"
prop=
"categoryListUrl"
v-if=
"form.categoryType == '1'
"
>
<el-select
v-model=
"form.categoryList
Url"
:style=
"{width: '100%'}"
:filterable=
"false"
:disabled=
"false"
:multiple=
"false"
:clearable=
"true"
placeholder=
"请选择内容
模板"
>
<el-option
v-for=
'item in categoryUrlOptions'
:key=
"item.id"
:value=
"item.id
"
:label=
"false?item.name:item.id
"
></el-option>
placeholder=
"请选择列表
模板"
>
<el-option
v-for=
'item in categoryListUrlOptions'
:key=
"item"
:value=
"item
"
:label=
"item
"
></el-option>
</el-select>
</el-form-item>
</el-col>
...
...
@@ -170,7 +170,7 @@
// 所属栏目
categoryId
:
''
,
// 栏目管理属性
categoryType
:
'
2
'
,
categoryType
:
'
1
'
,
// 自定义顺序
categorySort
:
0
,
// 列表模板
...
...
@@ -222,6 +222,10 @@
}
this
.
$refs
.
form
.
validate
((
valid
)
=>
{
if
(
valid
)
{
//栏目属性为封面则不需要列表模板
if
(
that
.
form
.
categoryType
==
'2'
){
that
.
form
.
categoryListUrl
=
''
;
}
that
.
saveDisabled
=
true
;
var
data
=
JSON
.
parse
(
JSON
.
stringify
(
that
.
form
));
if
(
data
.
id
&&
data
.
id
==
data
.
categoryId
){
...
...
@@ -276,7 +280,7 @@
categoryListUrlOptionsGet
()
{
var
that
=
this
;
ms
.
http
.
get
(
ms
.
manager
+
"/template/queryTemplateFileForColumn.do"
,
{}).
then
(
function
(
data
)
{
that
.
categoryListUrlOptions
=
data
.
rows
;
that
.
categoryListUrlOptions
=
data
;
}).
catch
(
function
(
err
)
{
console
.
log
(
err
);
});
...
...
@@ -285,7 +289,7 @@
categoryUrlOptionsGet
()
{
var
that
=
this
;
ms
.
http
.
get
(
ms
.
manager
+
"/template/queryTemplateFileForColumn.do"
,
{}).
then
(
function
(
data
)
{
that
.
categoryUrlOptions
=
data
.
rows
;
that
.
categoryUrlOptions
=
data
;
}).
catch
(
function
(
err
)
{
console
.
log
(
err
);
});
...
...
@@ -328,3 +332,8 @@
}
});
</script>
<style>
.el-select
{
width
:
100%
;
}
</style>
\ No newline at end of file
src/main/webapp/WEB-INF/manager/cms/category/index.ftl
View file @
b3ffa311
...
...
@@ -30,19 +30,25 @@
{{emptyText}}
</template>
<el-table-column
type=
"selection"
width=
"40"
></el-table-column>
<el-table-column
label=
"
栏目管理名称
"
align=
"left"
prop=
"categoryTitle"
>
<el-table-column
label=
"
标题
"
align=
"left"
prop=
"categoryTitle"
>
</el-table-column>
<el-table-column
label=
"
栏目管理属性"
align=
"left"
prop=
"categoryType"
:formatter=
"categoryTypeFormat
"
>
<el-table-column
label=
"
属性"
align=
"center"
prop=
"categoryType"
:formatter=
"categoryTypeFormat"
width=
"65
"
>
</el-table-column>
<el-table-column
label=
"
栏目路径"
align=
"left"
prop=
"categoryPath"
>
<el-table-column
label=
"
链接地址"
align=
"left"
prop=
"categoryPath"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label=
"自定义顺序"
width=
"100"
align=
"right"
prop=
"categorySort"
>
<el-table-column
label=
"列表地址"
align=
"left"
prop=
"categoryListUrl"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label=
"列表模板"
align=
"left"
prop=
"categoryListUrl"
>
<el-table-column
label=
"内容地址"
align=
"left"
prop=
"categoryUrl"
show-overflow-tooltip
>
<template
slot-scope=
"scope"
>
{{scope.row.categoryType == '1'?scope.row.categoryUrl:''}}
</template>
</el-table-column>
<el-table-column
label=
"内容模板"
align=
"left"
prop=
"categoryUrl"
>
<el-table-column
label=
"封面地址"
align=
"left"
prop=
"categoryUrl"
show-overflow-tooltip
>
<template
slot-scope=
"scope"
>
{{scope.row.categoryType == '2'?scope.row.categoryUrl:''}}
</template>
</el-table-column>
<el-table-column
label=
"操作"
width=
"1
8
0"
align=
"center"
>
<el-table-column
label=
"操作"
width=
"1
2
0"
align=
"center"
>
<template
slot-scope=
"scope"
>
<
@
shiro
.
hasPermission
name=
"cms:category:update"
>
<el-link
type=
"primary"
:underline=
"false"
@
click=
"save(scope.row.id)"
>
编辑
</el-link>
...
...
@@ -101,7 +107,7 @@ var indexVue = new Vue({
var
that
=
this
;
this
.
loadState
=
false
;
this
.
loading
=
true
;
ms
.
http
.
get
(
ms
.
manager
+
"/cms/category/list.do"
,
that
.
form
).
then
(
ms
.
http
.
get
(
ms
.
manager
+
"/cms/category/list.do"
).
then
(
function
(
res
)
{
if
(
that
.
loadState
){
that
.
loading
=
false
;
...
...
@@ -113,7 +119,7 @@ var indexVue = new Vue({
that
.
dataList
=
[];
}
else
{
that
.
emptyText
=
''
;
that
.
dataList
=
ms
.
util
.
treeData
(
res
.
data
.
rows
,
'id'
,
'
mdiyModel
Id'
,
'children'
);
that
.
dataList
=
ms
.
util
.
treeData
(
res
.
data
.
rows
,
'id'
,
'
category
Id'
,
'children'
);
}
}).
catch
(
function
(
err
)
{
console
.
log
(
err
);
...
...
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