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
b3ffa311
Commit
b3ffa311
authored
Nov 29, 2019
by
tianbj
Browse files
分类
parent
2a4ab99b
Changes
3
Hide whitespace changes
Inline
Side-by-side
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,30 +62,30 @@
gutter="0"
justify="start" align="top">
<el-col span="12">
<el-form-item label="
列表模板
" prop="category
List
Url">
<el-select v-model="form.category
List
Url"
:style="
{
width
:
'
100
%'
}
"
:filterable="false"
:disabled="false"
:multiple="false" :clearable="true"
placeholder="请选择
列表
模板">
<el-option v-for='item in category
List
UrlOptions' :key="item
.id
" :value="item
.id
"
:label="false?item.name:item.id
"></el-option>
</el-select>
</el-form-item>
<el-form-item
:
label="
form.categoryType =='1'? '内容模板' : '封面模板'
" prop="categoryUrl">
<el-select v-model="form.categoryUrl"
:style="
{
width
:
'
100
%'
}
"
:filterable="false"
:disabled="false"
:multiple="false" :clearable="true"
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="category
Url
">
<el-select v-model="form.categoryUrl"
: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>
</el-select>
</el-form-item>
<el-form-item label="
列表
模板" prop="category
ListUrl" v-if="form.categoryType == '1'
">
<el-select v-model="form.category
List
Url"
:style="
{
width
:
'
100
%'
}
"
:filterable="false"
:disabled="false"
:multiple="false" :clearable="true"
placeholder="请选择
列表
模板">
<el-option v-for='item in category
List
UrlOptions' :key="item" :value="item"
:label="item
"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="栏目管理关键字" prop="categoryKeyword">
...
...
@@ -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
)
;
})
;
...
...
@@ -327,4 +331,9 @@
}
}
}
);
</
script
>
\ No newline at end of file
</
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>
<el-table-column label="列表模板" align="left" prop="categoryListUrl">
<el-table-column label="列表地址" align="left" prop="categoryListUrl" show-overflow-tooltip>
</el-table-column>
<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
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