From 37648bb560bb39f8151f490e50d9f56573aefe44 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Thu, 21 May 2020 22:40:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=A7=92=E8=89=B2=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E6=97=B6=E4=BC=98=E5=8C=96=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/settings/system/User.vue | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/frontend/src/business/components/settings/system/User.vue b/frontend/src/business/components/settings/system/User.vue index f88d51605f..ee1a664076 100644 --- a/frontend/src/business/components/settings/system/User.vue +++ b/frontend/src/business/components/settings/system/User.vue @@ -514,17 +514,23 @@ }) }, addRole() { - let roleInfo = {}; - roleInfo.selects = []; - let ids = this.form.roles.map(r => r.id); - ids.forEach(id => { - roleInfo.selects.push(id); + this.$refs['createUserForm'].validate(valid => { + if (valid) { + let roleInfo = {}; + roleInfo.selects = []; + let ids = this.form.roles.map(r => r.id); + ids.forEach(id => { + roleInfo.selects.push(id); + }) + let roles = this.form.roles; + roles.push(roleInfo); + if (this.form.roles.length > this.userRole.length - 1) { + this.btnAddRole = true; + } + } else { + return false; + } }) - let roles = this.form.roles; - roles.push(roleInfo); - if (this.form.roles.length > this.userRole.length - 1) { - this.btnAddRole = true; - } }, removeRole(item) { let index = this.form.roles.indexOf(item);