From d2d38c2d8c10a29911d0b4b2e6200b41724fcb43 Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Tue, 25 Jan 2022 16:25:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20userTable=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BC=A0=E5=8F=82=E6=A0=BC=E5=BC=8F=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BF=AE=E5=A4=8Drole=20?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=97=B6=E5=86=85=E5=AE=B9=E5=9B=9E=E6=98=BE?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/rightBox/settings/RoleBox.vue | 2 +- src/components/table/settings/UserTable.vue | 4 ++-- src/views/settings/Roles.vue | 11 +++++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/rightBox/settings/RoleBox.vue b/src/components/rightBox/settings/RoleBox.vue index e989141d..b640fb30 100644 --- a/src/components/rightBox/settings/RoleBox.vue +++ b/src/components/rightBox/settings/RoleBox.vue @@ -84,7 +84,7 @@ export default { handler (n) { this.editRole = JSON.parse(JSON.stringify(n)) if (this.editRole.roles && this.editRole.roles.length > 0) { - this.editRole.roleIds = this.editRole.roles.map(t => t.id) + this.editRole.roleIds = this.editRole.roles.map(t => t.id).json(',') } } } diff --git a/src/components/table/settings/UserTable.vue b/src/components/table/settings/UserTable.vue index f77335c1..a2ddebf8 100644 --- a/src/components/table/settings/UserTable.vue +++ b/src/components/table/settings/UserTable.vue @@ -143,14 +143,14 @@ export default { methods: { statusChange (user) { if (user.roles) { - user.roleIds = user.roles.map(t => t.id) + user.roleIds = user.roles.map(t => t.id).join(',') } // if (!user.id){ // return // } put('sys/user', user).then(response => { if (response.code === 200) { - this.rightBox.show = false + // this.rightBox.show = false this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') }) } else { this.$message.error(response.msg) diff --git a/src/views/settings/Roles.vue b/src/views/settings/Roles.vue index 06cf1852..078d29d2 100644 --- a/src/views/settings/Roles.vue +++ b/src/views/settings/Roles.vue @@ -67,7 +67,14 @@ export default { url: api.role, tableId: 'rolesTable', // 需要分页的table的id,用于记录每页数量 blankObject: { // 空白对象 - name: '' + name: '', + buildIn: '', + i18n: '', + id: '', + menuIds: [], + remark: '', + uby: 0, + utime: '' } } }, @@ -75,7 +82,7 @@ export default { edit (u) { get(`${this.url}`, { ids: u.id }).then(response => { if (response.code === 200) { - this.object = response.data + this.object = response.data.list[0] this.rightBox.show = true } })