优化获取栏目id获取第一行
This commit is contained in:
parent
c1d15d6836
commit
9cefb64d57
|
@ -286,7 +286,7 @@
|
|||
// 文章标题
|
||||
contentTitle: '',
|
||||
// 所属栏目
|
||||
categoryId: '',
|
||||
categoryId: undefined,
|
||||
// 文章类型
|
||||
contentType: [],
|
||||
// 是否显示
|
||||
|
@ -675,8 +675,9 @@
|
|||
this.type = ms.util.getParameter("type");
|
||||
|
||||
//在指定栏目下新增或编辑文章时
|
||||
if (ms.util.getParameter("categoryId")) {
|
||||
this.form.categoryId = ms.util.getParameter("categoryId");
|
||||
var categoryId = ms.util.getParameter("categoryId");
|
||||
if (categoryId) {
|
||||
this.form.categoryId = categoryId;
|
||||
//如果是封面栏目直接跳转
|
||||
if (this.type) {
|
||||
this.getFromFengMian(this.form.categoryId);
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<el-header class="ms-header" height="50px">
|
||||
<el-col :span="12">
|
||||
<@shiro.hasPermission name="cms:content:save">
|
||||
<el-button type="primary" icon="el-icon-plus" size="mini" @click="save()">新增</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" size="mini" @click="save(0)">新增</el-button>
|
||||
</@shiro.hasPermission>
|
||||
<@shiro.hasPermission name="cms:content:del">
|
||||
<el-button type="danger" icon="el-icon-delete" size="mini" @click="del(selectionList)" :disabled="!selectionList.length">删除</el-button>
|
||||
|
@ -370,6 +370,9 @@
|
|||
save: function (id) {
|
||||
if (id) {
|
||||
location.href = this.manager + "/cms/content/form.do?id=" + id;
|
||||
} else if (id == 0){
|
||||
//在全部栏目下新增文章
|
||||
location.href = this.manager + "/cms/content/form.do";
|
||||
} else {
|
||||
location.href = this.manager + "/cms/content/form.do?categoryId=" + this.form.categoryId;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue