diff --git a/smallboot-web/src/views/system/menu/index.vue b/smallboot-web/src/views/system/menu/index.vue index 73a1156..29398a9 100644 --- a/smallboot-web/src/views/system/menu/index.vue +++ b/smallboot-web/src/views/system/menu/index.vue @@ -24,8 +24,7 @@ {{ currentClickMenu.path }} {{ currentClickMenu.redirect }} {{ currentClickMenu.component }} - {{ currentClickMenu.icon }} - + {{ currentClickMenu.icon }} {{ currentClickMenu.breadcrumb ? '显示' : '隐藏' }} {{ currentClickMenu.status ? '启用' : '禁用' }} {{ currentClickMenu.displayOrder }} @@ -38,15 +37,14 @@ - + - + @@ -58,8 +56,7 @@ - + @@ -90,6 +87,7 @@ export default { return { currentClickMenu: null, treeData: [], + permDataList: [], defaultProps: { children: 'children', label: 'title', @@ -106,16 +104,10 @@ export default { menuId: undefined, btnPerm: '', urlPerm: '', - } + }, } }, - computed: { - hasEditBtnPermission() { - // 是否有编辑按钮的权限 - const hasChildren = this.currentClickMenu && this.currentClickMenu.children.length === 0 - return hasChildren - }, - }, + computed: {}, mounted() { this.getMenuTree() }, @@ -130,39 +122,39 @@ export default { }, handleNodeClick(data) { this.currentClickMenu = data - if (this.hasEditBtnPermission) { - this.refreshTableDataRePerm() - } + this.refreshTableDataRePerm() }, addNextMenu() { if (!this.currentClickMenu) { - this.$message.error('请先选中你需要添加下级菜单的父级') + this.submitFail('请先选中你需要添加下级菜单的父级') return } this.$refs.edit.open(2, this.currentClickMenu) }, handleEdit() { if (!this.currentClickMenu) { - this.$message.error('请先选中你需要添加下级菜单的父级') + this.submitFail('请先选中你需要添加下级菜单的父级') return } this.$refs.edit.open(3, this.currentClickMenu) }, async handleDelete() { if (!this.currentClickMenu) { - this.$message.error('请先选中你需要删除的菜单') + this.submitFail('请先选中你需要删除的菜单') return } let res = await this.$api.sys_menu.delete(this.currentClickMenu.menuId) this.submitOk(res.msg) this.getMenuTree() }, - refreshTableDataRePerm() { - this.$refs.baseTableRePerm.refresh() + async refreshTableDataRePerm() { + let res = await this.$api.sys_menu.getPermListByMenuId(this.currentClickMenu.menuId) + this.permDataList = res.data }, async deleteMenuRePerm(id) { let res = await this.$api.sys_menu.deleteMenuReBtnPerm(id) this.submitOk(res.msg) + this.refreshTableDataRePerm() }, async saveMenuRePermForm() { this.menuRePermForm.menuId = this.currentClickMenu.menuId @@ -180,10 +172,8 @@ export default { this.dialogVisibleForMenuRePerm = true this.dialogStatusForMenuRePerm = 'create' this.menuRePermForm = {} - } - + }, }, } - +