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
6cfcb6fd
Commit
6cfcb6fd
authored
Dec 17, 2019
by
tianbj
Browse files
优化
parent
879f9c55
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/webapp/WEB-INF/manager/cms/category/form.ftl
View file @
6cfcb6fd
...
@@ -41,13 +41,13 @@
...
@@ -41,13 +41,13 @@
<el-form-item prop="categoryType">
<el-form-item prop="categoryType">
<template slot='label'>栏目类型
<template slot='label'>栏目类型
<el-popover slot="label" placement="top-start" title="提示" trigger="hover" >
<el-popover slot="label" placement="top-start" title="提示" trigger="hover" >
列表:常用于带列表、详情的业务,例如:新闻列表、图片列表<br>封面:常用单篇文章显示,例如:关于我们、公司介绍
列表:常用于带列表、详情的业务,例如:新闻列表、图片列表<br>封面:常用单篇文章显示,例如:关于我们、公司介绍
<br>修改栏目时如果该栏目存在文章则不能修改栏目类型
<i class="el-icon-question" slot="reference"></i>
<i class="el-icon-question" slot="reference"></i>
</el-popover>
</el-popover>
</template>
</template>
<el-radio-group v-model="form.categoryType"
<el-radio-group v-model="form.categoryType"
:style="
{
width
:
''
}
"
:style="
{
width
:
''
}
"
:disabled="
false
">
:disabled="
categoryTypeDisabled
">
<el-radio :style="
{
display
:
true
?
'
inline-block
'
:
'
block
'
}
" :label="item.value"
<el-radio :style="
{
display
:
true
?
'
inline-block
'
:
'
block
'
}
" :label="item.value"
v-for='(item, index) in categoryTypeOptions' :key="item.value + index">
v-for='(item, index) in categoryTypeOptions' :key="item.value + index">
{{
true
?
item
.label
:
item
.value
}}
{{
true
?
item
.label
:
item
.value
}}
...
@@ -191,6 +191,7 @@
...
@@ -191,6 +191,7 @@
children
:
[]
,
children
:
[]
,
}
]
,
}
]
,
saveDisabled
:
false
,
saveDisabled
:
false
,
categoryTypeDisabled
:
true
,
//表单数据
//表单数据
form
:
{
form
:
{
//
栏目管理名称
//
栏目管理名称
...
@@ -251,6 +252,7 @@
...
@@ -251,6 +252,7 @@
}
}
this
.
$refs
.form.validate
((
valid
)
=>
{
this
.
$refs
.form.validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
//栏目属性为封面则不需要列表模板
//栏目属性为封面则不需要列表模板
if
(
that
.form.categoryType
==
'
2
'
){
if
(
that
.form.categoryType
==
'
2
'
){
that
.form.categoryListUrl
=
'';
that
.form.categoryListUrl
=
'';
...
@@ -319,6 +321,22 @@
...
@@ -319,6 +321,22 @@
res
.data.categoryId
=
'
0
';
res
.data.categoryId
=
'
0
';
}
}
that
.form
=
res
.data
;
that
.form
=
res
.data
;
//判断该分类是否存在文章,存在则不能修改栏目属性
that
.contentList
(
that
.form.id
)
;
}
})
.catch
(
function
(
err
)
{
console
.log
(
err
)
;
})
;
},
contentList
:
function
(
id
){
var
that
=
this
;
ms
.http.post
(
ms
.manager
+
"/cms/content/list.do"
,{
contentCategoryId
:
id
,
})
.then
(
function
(
data
)
{
if
(
data
.data.total
>
0
){
that
.categoryTypeDisabled
=
true
;
}
else
{
that
.categoryTypeDisabled
=
false
;
}
}
})
.catch
(
function
(
err
)
{
})
.catch
(
function
(
err
)
{
console
.log
(
err
)
;
console
.log
(
err
)
;
...
@@ -377,6 +395,8 @@
...
@@ -377,6 +395,8 @@
this
.form.id
=
ms
.util.getParameter
(
"id"
)
;
this
.form.id
=
ms
.util.getParameter
(
"id"
)
;
if
(
this
.form.id
)
{
if
(
this
.form.id
)
{
this
.get
(
this
.form.id
)
;
this
.get
(
this
.form.id
)
;
}
else
{
this
.categoryTypeDisabled
=
false
;
}
}
}
}
}
);
}
);
...
...
src/main/webapp/WEB-INF/manager/cms/content/form.ftl
View file @
6cfcb6fd
...
@@ -247,6 +247,7 @@
...
@@ -247,6 +247,7 @@
contentTitle
:
[
{
"required"
:
true
,
"message"
:
"请选择文章标题"
}
]
,
contentTitle
:
[
{
"required"
:
true
,
"message"
:
"请选择文章标题"
}
]
,
//
发布时间
//
发布时间
contentDatetime
:
[
{
"required"
:
true
,
"message"
:
"发布时间不能为空"
}
]
,
contentDatetime
:
[
{
"required"
:
true
,
"message"
:
"发布时间不能为空"
}
]
,
contentCategoryId
:
[
{
"required"
:
true
,
"message"
:
"所属栏目不能为空"
}
]
,
},
},
}
}
...
@@ -302,7 +303,9 @@
...
@@ -302,7 +303,9 @@
message
:
'保存成功'
,
message
:
'保存成功'
,
type
:
'
success
'
type
:
'
success
'
})
;
})
;
location
.href
=
ms
.manager
+
"/cms/content/main.do"
;
if
(
that
.returnIsShow
){
javascript
:
history
.go
(
-1
)
;
}
}
else
{
}
else
{
that
.
$notify
({
that
.
$notify
({
title
:
'失败'
,
title
:
'失败'
,
...
@@ -488,7 +491,9 @@
...
@@ -488,7 +491,9 @@
this
.contentCategoryIdOptionsGet
()
;
this
.contentCategoryIdOptionsGet
()
;
this
.contentTypeOptionsGet
()
;
this
.contentTypeOptionsGet
()
;
this
.form.id
=
ms
.util.getParameter
(
"id"
)
;
this
.form.id
=
ms
.util.getParameter
(
"id"
)
;
this
.form.contentCategoryId
=
ms
.util.getParameter
(
"categoryId"
)
;
if
(
ms
.util.getParameter
(
"categoryId"
)
!=
'
undefined
'
&&
ms
.util.getParameter
(
"categoryId"
)
!=
'
null
'
){
this
.form.contentCategoryId
=
ms
.util.getParameter
(
"categoryId"
)
;
}
this
.type
=
ms
.util.getParameter
(
"type"
)
;
this
.type
=
ms
.util.getParameter
(
"type"
)
;
if
(
this
.form.id
)
{
if
(
this
.form.id
)
{
this
.get
(
this
.form.id
)
;
this
.get
(
this
.form.id
)
;
...
...
src/main/webapp/WEB-INF/manager/cms/content/index.ftl
View file @
6cfcb6fd
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<!--左侧-->
<!--左侧-->
<el-container class="index-menu">
<el-container class="index-menu">
<div class="left-tree">
<div class="left-tree">
<el-tree :indent="5" v-loading="loading" :expand-on-click-node="false" default-expand-all :empty-text="emptyText" :data="treeData" :props="defaultProps" @node-click="handleNodeClick" style="padding: 10px;height: 100%;"></el-tree>
<el-tree :indent="5" v-loading="loading"
highlight-current
:expand-on-click-node="false" default-expand-all :empty-text="emptyText" :data="treeData" :props="defaultProps" @node-click="handleNodeClick" style="padding: 10px;height: 100%;"></el-tree>
</div>
</div>
<iframe :src="action" class="ms-iframe-style">
<iframe :src="action" class="ms-iframe-style">
</iframe>
</iframe>
...
...
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