From 2bde7bad74a6e866eaf7bfcfc2e9f3156ad18587 Mon Sep 17 00:00:00 2001 From: qiankanghui Date: Thu, 4 Jun 2026 11:21:45 +0800 Subject: [PATCH] =?UTF-8?q?feat(sys):=20=E6=B7=BB=E5=8A=A0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=89=B9=E6=AE=8A=E6=9D=83=E9=99=90=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在用户界面添加特殊权限按钮 - 导入获取用户特殊安全权限的API方法 - 配置权限表格列结构用于显示权限号 - 实现特殊权限授权方法,包括数据加载和验证逻辑 - 更新保存用户权限方法,支持批量权限项保存 - 添加选中用户验证确保操作有效性 - 优化权限值转换逻辑并改进错误提示机制 --- src/views/modules/sys/user.vue | 63 ++++++++++++++++++++++++++++++---- 1 file changed, 56 insertions(+), 7 deletions(-) diff --git a/src/views/modules/sys/user.vue b/src/views/modules/sys/user.vue index 6a66bfb..ef3fa0b 100644 --- a/src/views/modules/sys/user.vue +++ b/src/views/modules/sys/user.vue @@ -16,6 +16,7 @@ {{ buttons.deptAuthorization || '部门授权' }} {{ buttons.businessRoleAuthorization || '岗位' }} + {{ buttons.specialCompetencies || '特殊权限' }} { + this.dataListLoading = false + if (data && data.code === 0) { + const list = data.list || [] + this.securityList = list.map(row => ({ + ...row, + itemvalue: row.itemvalue === true || row.itemvalue === 'Y' + })) + this.specialVisible = true + } else { + this.$message.error((data && data.msg) || '加载失败') + } + }).catch(() => { + this.dataListLoading = false + }) + }, + // 保存用户权限 saveUserSecurity () { - let securityList = JSON.parse(JSON.stringify(this.securityList)).map(item => { - item.itemvalue = item.itemvalue === true ? 'Y' : 'N' - return item - }) - updateUserSpecialSecurity(securityList).then(({data}) => { + if (!this.selectUser || !this.selectUser.username) { + this.$message.warning('未选中用户') + return + } + const items = this.securityList.map(item => ({ + permissionCode: item.permissionCode, + itemvalue: item.itemvalue === true ? 'Y' : 'N' + })) + updateUserSpecialSecurity({ + username: this.selectUser.username, + items + }).then(({data}) => { if (data.code === 0) { this.$message.success(data.msg) this.specialVisible = false } else { - this.$message.success(data.msg) + this.$message.error(data.msg || '保存失败') } }) },