From 844ca0f06a3092a0da0b3650b28d0521d854ce1a Mon Sep 17 00:00:00 2001 From: "wu.jifen" Date: Thu, 24 Apr 2025 18:40:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=B3=BB=E7=BB=9F=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=83=A8=E5=88=86=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/menu/components/MenuDialog.vue | 6 ++++++ .../system/role/components/RoleDialog.vue | 5 ++++- .../system/user/components/UserDialog.vue | 21 +++++++++++++++++-- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/views/system/menu/components/MenuDialog.vue b/src/views/system/menu/components/MenuDialog.vue index f62d92c..96d258e 100644 --- a/src/views/system/menu/components/MenuDialog.vue +++ b/src/views/system/menu/components/MenuDialog.vue @@ -119,6 +119,7 @@ export default { .then(response => { if (response.code === '0') { this.listData = response.content.content || [] + this.clearForm() } else { this.$message.error(response.msg || '获取菜单列表失败') } @@ -133,6 +134,7 @@ export default { handleClose() { this.$refs.form.resetFields() this.$emit('update:visible', false) + this.clearForm() }, submitForm() { // 查看模式下不允许提交 @@ -165,9 +167,13 @@ export default { }) .finally(() => { this.loading = false + this.clearForm() }) } }) + }, + clearForm() { + this.form = {} } } } diff --git a/src/views/system/role/components/RoleDialog.vue b/src/views/system/role/components/RoleDialog.vue index 7210772..6c62407 100644 --- a/src/views/system/role/components/RoleDialog.vue +++ b/src/views/system/role/components/RoleDialog.vue @@ -88,6 +88,7 @@ export default { handleClose() { this.$refs.form.resetFields() this.$emit('update:visible', false) + this.clearForm() }, submitForm() { // 查看模式下不允许提交 @@ -109,7 +110,6 @@ export default { this.$message.success(this.isEdit ? '修改成功' : '添加成功') this.$emit('submit', submitData) this.handleClose() - this.form = {} } else { this.$message.error(response.msg || (this.isEdit ? '修改失败' : '添加失败')) this.form = {} @@ -123,6 +123,9 @@ export default { }) } }) + }, + clearForm() { + this.form = {} } } } diff --git a/src/views/system/user/components/UserDialog.vue b/src/views/system/user/components/UserDialog.vue index 7c0ccfc..5d44ea8 100644 --- a/src/views/system/user/components/UserDialog.vue +++ b/src/views/system/user/components/UserDialog.vue @@ -77,6 +77,18 @@ + + + + + +