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 @@ + + + + + +