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() } },