Browse Source

bug: Fix bug in form reset

QM303176530 5 years ago
parent
commit
66b228114f

+ 1 - 6
web/src/view/superAdmin/api/api.vue

@@ -167,12 +167,7 @@ export default {
       this.getTableData()
     },
     initForm() {
-      this.form = {
-        path: '',
-        apiGroup: '',
-        description: '',
-        method: ''
-      }
+      this.$refs.apiForm.resetFields()
     },
     closeDialog() {
       this.initForm()

+ 1 - 3
web/src/view/superAdmin/authority/authority.vue

@@ -136,9 +136,7 @@ export default {
     },
     // 初始化表单
     initForm() {
-      for (const key in this.form) {
-        this.form[key] = ''
-      }
+      this.$refs.authorityForm.resetFields()
     },
     // 关闭窗口
     closeDialog() {

+ 1 - 11
web/src/view/superAdmin/menu/menu.vue

@@ -162,17 +162,7 @@ export default {
     },
     // 初始化弹窗内表格方法
     initForm() {
-      this.form = {
-        path: '',
-        name: '',
-        hidden: '',
-        parentId: '',
-        component: '',
-        meta: {
-          title: '',
-          icon: ''
-        }
-      }
+      this.$refs.menuForm.resetFields()
     },
     // 关闭弹窗
     closeDialog() {

+ 1 - 7
web/src/view/superAdmin/user/user.vue

@@ -141,13 +141,7 @@ export default {
       })
     },
     closeAddUserDialog() {
-      this.userInfo = {
-        username: '',
-        password: '',
-        nickName: '',
-        headerImg: '',
-        authorityId: ''
-      }
+      this.$refs.userForm.resetFields()
       this.addUserDialog = false
     },
     handleAvatarSuccess(res) {