| | |
| | | </div> |
| | | |
| | | <div |
| | | style="margin-left: 15px;width:100%;position: relative" |
| | | style="margin-left: 10px;width:100%;position: relative" |
| | | > |
| | | |
| | | <el-button |
| | |
| | | <script> |
| | | import waves from '@/directive/waves' |
| | | import { |
| | | DataPermissions, RoleAddUpdateSava, RoleDeleteSava, |
| | | RoleAddUpdateSava, RoleDeleteSava, |
| | | RolePermissionSava, |
| | | RolePermissionSearchRole, |
| | | RolePermissionSearchRoleMenu, |
| | |
| | | } from '@/api/basicSettings' |
| | | import arrayToTree from 'array-to-tree' |
| | | import { throttle } from '@/utils/debounceAndThrottle' |
| | | import { DataPermissions } from '@/api/GeneralBasicData' |
| | | |
| | | export default { |
| | | name: 'RoleList', |
| | |
| | | // 获取菜单权限对应的按钮 |
| | | async getRolePermissionSearchRoleMenuButton(rolecode) { |
| | | const { data: res } = await RolePermissionSearchRoleMenuButton({ rolecode, type: this.activeName }) |
| | | this.allButtonData = JSON.parse(res[0].jsondate) |
| | | this.allButtonData = res.length > 0 ? JSON.parse(res[0].jsondate) : [] |
| | | }, |
| | | // 获取菜单权限 |
| | | async getRolePermissionSearchRoleMenu(rolecode) { |
| | |
| | | // 角色名称删除 |
| | | roleDeleteClick(self, node, data) { |
| | | // console.log(self, node, data) |
| | | const D = { |
| | | rolecode: data.code, |
| | | rolename: data.name, |
| | | type: this.activeName |
| | | } |
| | | RoleDeleteSava(D).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success('角色删除成功!') |
| | | this.$confirm('是否确认删除?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const D = { |
| | | rolecode: data.code, |
| | | rolename: data.name, |
| | | type: this.activeName |
| | | } |
| | | this.getRolePermissionSearchRole() |
| | | RoleDeleteSava(D).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success('角色删除成功!') |
| | | } |
| | | this.getRolePermissionSearchRole() |
| | | }) |
| | | }).catch(() => { |
| | | this.$notify.info('已取消删除') |
| | | }) |
| | | }, |
| | | // 角色名称保存 采用防抖形式 |
| | | roleSave: throttle(function(val) { |
| | | val.isEdit = false |
| | | |
| | | if (val.name.trim().length === 0) { |
| | | this.getRolePermissionSearchRole() |
| | | return this.$notify.info('无效保存!') |
| | | } |
| | | |
| | | const data = { |
| | | rolecode: val.code, |
| | | rolename: val.name, |