Forráskód Böngészése

清除上次对话框内容

Michael Wang 4 éve
szülő
commit
cfd98cda6b

+ 7 - 2
src/features/system/UserManagement/UserManagementDialog.vue

@@ -183,7 +183,13 @@ export default {
   },
   watch: {
     user(val) {
+      this.resetForm(val);
+    },
+  },
+  methods: {
+    resetForm(val) {
       let tmp = { ...val };
+      // console.log({ user: this.user, tmp, val });
       if (!tmp.id) {
         tmp = {
           orgId: this.$store.state.user.orgId,
@@ -197,9 +203,8 @@ export default {
       }
       this.form = tmp;
     },
-  },
-  methods: {
     openDialog() {
+      this.resetForm(this.user);
       this.visible = true;
     },
     closeDialog() {