| | |
| | | }, |
| | | methods: { |
| | | getHasPermissionUserByApi() { |
| | | const that = this |
| | | that.spinning = true |
| | | dncApi.getHasPermissionUserApi(this.currentTreeNodeInfo) |
| | | .then(res => { |
| | | if (res.success) this.targetKeys = res.list.map(item => item.id) |
| | | }) |
| | | .finally(() => { |
| | | that.spinning = false |
| | | }) |
| | | }, |
| | | |
| | |
| | | method = dncApi.assignPermissionToUser |
| | | } else { |
| | | method = dncApi.removePermissionFromUser |
| | | const adminId = dataSource.find(item => item.username === 'admin').id |
| | | if (moveKeys.includes(adminId)) { |
| | | $notification.warning({ |
| | | message: '消息', |
| | | description: '不能移除管理员权限' |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | that.spinning = true |
| | | method(params) |