From 695dc620874a3f258f4766f50f1227041af7f498 Mon Sep 17 00:00:00 2001 From: Romesum Date: Sun, 10 May 2020 15:08:15 +0800 Subject: [PATCH] =?UTF-8?q?[fix][V]=EF=BC=9A=E7=AE=80=E5=8C=96=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/supManager/userEditForm.vue | 1 - .../src/components/supManager/userManage.vue | 52 ++++++++++--------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/element-vue/src/components/supManager/userEditForm.vue b/element-vue/src/components/supManager/userEditForm.vue index 64a02ed..1f59fa7 100644 --- a/element-vue/src/components/supManager/userEditForm.vue +++ b/element-vue/src/components/supManager/userEditForm.vue @@ -104,7 +104,6 @@ }, cancel() { - this.$refs['userForm'].resetFields() this.$emit('cancel') } }, diff --git a/element-vue/src/components/supManager/userManage.vue b/element-vue/src/components/supManager/userManage.vue index 5523b23..7593ebd 100644 --- a/element-vue/src/components/supManager/userManage.vue +++ b/element-vue/src/components/supManager/userManage.vue @@ -6,7 +6,7 @@ 新增用户 + @click="editUser(null)">新增用户 多选删除 @@ -25,8 +25,8 @@ @@ -36,9 +36,14 @@ @@ -81,18 +86,6 @@ handleSelectionChange(val) { this.items = val; }, - addUser() { - this.edit = false - this.userForm = { - nickname: "", - tel: "", - email: "", - username: "", - office: "", - position: '' - } - this.dialogFormVisible = true - }, // 删除用户 async deleteUser(item) { await showDialog("确认要删除吗?", this) @@ -105,21 +98,30 @@ showFail("删除失败 " + e.msg, this) }) }, - async deleteUserMul(){ + async deleteUserMul() { await showDialog("确认要删除吗?", this) - showFail("尚未开发",this) + showFail("尚未开发", this) }, // 编辑用户 async editUser(item) { - this.edit = true - this.userForm = item + // 判断是否为编辑模式 + this.edit = !!item + this.userForm = item ? item : { + nickname: "", + tel: "", + email: "", + username: "", + office: "", + position: '' + } + // 弹出编辑框 this.dialogFormVisible = true }, - cancel(){ + cancel() { + this.load() this.dialogFormVisible = false }, - confirm(){ - this.load() + confirm() { this.cancel() } },