zhaoke 2 years ago
parent
commit
61a5eec197

+ 13 - 8
src/views/newUserManagement/index.vue

@@ -136,7 +136,7 @@ export default {
           user_group_id: 0,
           user_group_name: '全部账号组',
           user_group_status: true,
-          children: []
+          children: [],
         }
       ],
       treeCheckId: '',
@@ -200,13 +200,18 @@ export default {
       this.clearForm()
     },
     async handleNodeClick (data) {
-      this.treeCheckId = data.user_group_id
-      this.formInline = _.cloneDeep(data)
-      this.type = 'edit'
-      const result = await this.getQuery(SERVICE_ID.getUserTableId, false, {
-        user_group_id: data.user_group_id
-      })
-      this.tableData = result
+      if (data.user_group_id) {
+        this.treeCheckId = data.user_group_id
+        this.formInline = _.cloneDeep(data)
+        this.type = 'edit'
+        const result = await this.getQuery(SERVICE_ID.getUserTableId, false, {
+          user_group_id: data.user_group_id
+        })
+        this.tableData = result
+      } else {
+        this.formInline.user_group_name = ''
+        this.formInline.user_group_comment = ''
+      }
     },
     //清空表单
     clearForm () {

+ 0 - 8
src/views/systemSettings/views/newAuth/components/table.vue

@@ -239,14 +239,6 @@ export default {
       },
       immediate: true
     },
-    authTable: {
-      handler (val) {
-        if (val) {
-          this.restData()
-        }
-      },
-      immediate: true
-    },
   },
   async mounted () {
     const result = await this.getQuery(SERVICE_ID.sysAllMenuId, false, { serviceType: 1 })

+ 1 - 4
src/views/systemSettings/views/newAuth/index.vue

@@ -51,7 +51,7 @@
             </div>
           </el-form>
           <keep-alive>
-            <component ref="dataChild" :icons="icons" :authType="dataType" :authNum="authNum" :authObj="authObj" :authTable="authTable" :is="componentName"></component>
+            <component ref="dataChild" :icons="icons" :authType="dataType" :authNum="authNum" :authObj="authObj" :is="componentName"></component>
           </keep-alive>
         </div>
       </div>
@@ -198,7 +198,6 @@ export default {
       this.$refs['form'].validate(async (valid) => {
         if (valid) {
           let code = null
-          this.authTable = false
           const child = this.$refs['dataChild'].form
           const data = _.merge(child, this.form)
           if (data.pass_parameters && data.pass_parameters.length) {
@@ -227,11 +226,9 @@ export default {
               this.authObj = {}
               this.clearForm()
             }
-            this.authTable = true
             this.setTreeData()
           }
         } else {
-          this.authTable = false
           return false
         }
       });