新增子栏目优化

This commit is contained in:
xierz 2020-10-19 12:12:46 +08:00
parent a655345c9a
commit 7048413885
2 changed files with 12 additions and 9 deletions

View File

@ -540,15 +540,18 @@
this.categoryUrlOptionsGet();
this.categoryFlagOptionsGet();
this.form.id = ms.util.getParameter("id");
this.form.child = ms.util.getParameter("child");
this.form.childId = ms.util.getParameter("childId");// 判断是否增加子栏目
this.categoryTypeDisabled = false;
if (this.form.id != undefined && this.form.child == undefined) {
// 判断三种状态,默认为编辑状态
this.categoryTypeDisabled = false;// 控制栏目分类是否可编辑
if (this.form.id != undefined && this.form.childId == undefined) {
// 切换新增状态id&childId 为空
this.categoryTypeDisabled = true;
this.get(this.form.id);
} else if (this.form.child) {
} else if (this.form.childId) {
// 切换新增子栏目状态id&childId 不为空
this.form.id = null;
this.form.categoryId = this.form.child;
this.form.categoryId = this.form.childId;
}
}
});

View File

@ -62,10 +62,10 @@
{{scope.row.categoryType == '2'?scope.row.categoryUrl:''}}
</template>
</el-table-column>
<el-table-column label="操作" width="120" align="center">
<el-table-column label="操作" width="150" align="center">
<template slot-scope="scope">
<@shiro.hasPermission name="cms:category:save">
<el-link type="primary" :underline="false" @click="save(scope.row.id, scope.row.id)">新增子栏目</el-link>
<el-link type="primary" :underline="false" @click="save(scope.row.id, scope.row.id)"><i class="el-icon-plus"></i>子栏目</el-link>
</@shiro.hasPermission>
<@shiro.hasPermission name="cms:category:update">
<el-link type="primary" :underline="false" @click="save(scope.row.id)">编辑</el-link>
@ -234,9 +234,9 @@
return value;
},
//新增
save: function (id, child) {
save: function (id, childId) {
if (id) {
location.href = this.manager + "/cms/category/form.do?id=" + id + "&child=" + child;
location.href = this.manager + "/cms/category/form.do?id=" + id + "&childId=" + childId;
} else {
location.href = this.manager + "/cms/category/form.do";
}