|
@@ -30,14 +30,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="状态" width="80" align="center">
|
|
|
<template slot-scope="{row}">
|
|
|
- <el-switch
|
|
|
- v-model="row.status"
|
|
|
- :active-value="0"
|
|
|
- :inactive-value="1"
|
|
|
- active-color="#1890ff"
|
|
|
- inactive-color="#DCDFE6"
|
|
|
- @change="handleHiddenChange($index, row)"
|
|
|
- />
|
|
|
+ <el-switch v-model="row.status" :active-value="0" :inactive-value="1" active-color="#1890ff" inactive-color="#DCDFE6" @change="handleHiddenChange($index, row)" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="排序" width="80" align="center">
|
|
@@ -49,7 +42,7 @@
|
|
|
<template slot-scope="{row}">
|
|
|
<el-button plain size="mini" :disabled="row.childCount | disableNextLevel" @click="handleShowNextLevel(row)">查看子菜单
|
|
|
</el-button>
|
|
|
- <el-button plain size="mini" @click="handleAddMenus(row)">添加子菜单
|
|
|
+ <el-button plain size="mini" @click="handleCreateNextLevel(row)">添加子菜单
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -130,7 +123,7 @@ export default {
|
|
|
},
|
|
|
resetParentId() {
|
|
|
this.listQuery.pageNum = 1
|
|
|
- if (this.$route.query.parentId != null) {
|
|
|
+ if (this.$route.query.parentId) {
|
|
|
this.listQuery.parentId = this.$route.query.parentId
|
|
|
this.parentTitle = this.$route.query.title
|
|
|
} else {
|
|
@@ -157,17 +150,17 @@ export default {
|
|
|
goBack() {
|
|
|
this.$router.push({ path: '/sys/menus/list' })
|
|
|
},
|
|
|
- handleShowNextLevel(row) {
|
|
|
- this.$router.push({ path: '/sys/menus/list', query: { parentId: row.id, title: row.title }})
|
|
|
+ handleCreate() {
|
|
|
+ this.$router.push({ path: '/sys/menus/form', query: { parentId: this.listQuery.parentId, title: this.parentTitle } })
|
|
|
},
|
|
|
handleUpdate(row) {
|
|
|
- this.$router.push({ path: '/sys/menus/form', query: { id: row.id }})
|
|
|
+ this.$router.push({ path: '/sys/menus/form', query: { id: row.id, parentId: this.listQuery.parentId, title: this.parentTitle } })
|
|
|
},
|
|
|
- handleCreate() {
|
|
|
- this.$router.push({ path: '/sys/menus/form' })
|
|
|
+ handleShowNextLevel(row) {
|
|
|
+ this.$router.push({ path: '/sys/menus/list', query: { parentId: row.id, title: row.title } })
|
|
|
},
|
|
|
- handleAddMenus(row) {
|
|
|
- this.$router.push({ path: '/sys/menus/form', query: { parentId: row.id, title: row.title }})
|
|
|
+ handleCreateNextLevel(row) {
|
|
|
+ this.$router.push({ path: '/sys/menus/form', query: { parentId: row.id, title: row.title } })
|
|
|
},
|
|
|
handleDelete(row) {
|
|
|
this.$confirm('是否要删除该菜单', '提示', {
|
|
@@ -185,7 +178,8 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- handleOnInputBlur(row) { // 更新排序
|
|
|
+ handleOnInputBlur(row) {
|
|
|
+ // 更新排序
|
|
|
updateSelective(row.id, { sort: row.sort }).then(response => {
|
|
|
this.$message({
|
|
|
message: '操作成功',
|
|
@@ -195,7 +189,8 @@ export default {
|
|
|
this.getList()
|
|
|
})
|
|
|
},
|
|
|
- handleHiddenChange(index, row) { // 操作开关
|
|
|
+ handleHiddenChange(index, row) {
|
|
|
+ // 操作开关
|
|
|
updateSelective(row.id, { status: row.status }).then(response => {
|
|
|
this.$message({
|
|
|
message: '操作成功',
|