guhongwei 4 лет назад
Родитель
Сommit
51fbed4ad1
2 измененных файлов с 10 добавлено и 4 удалено
  1. 8 2
      src/views/business/index.vue
  2. 2 2
      src/views/permission/index.vue

+ 8 - 2
src/views/business/index.vue

@@ -85,8 +85,14 @@ export default {
       this.user.role == '0' && !_.get(this.user, 'pid') ? '' : (query.pid = this.user.uid);
       const res = await this.getBusinessUser(query);
       if (this.$checkRes(res)) {
-        this.$set(this, `list`, res.data);
-        this.$set(this, `total`, res.total);
+        if (this.user.role == '0') {
+          let newarr = res.data.filter(i => i.role == '1');
+          this.$set(this, `list`, newarr);
+          this.$set(this, `total`, newarr.length);
+        } else {
+          this.$set(this, `list`, res.data);
+          this.$set(this, `total`, res.total);
+        }
       }
     },
     // 修改

+ 2 - 2
src/views/permission/index.vue

@@ -66,8 +66,8 @@ export default {
     };
   },
   async created() {
-    await this.search();
     await this.getOtherList();
+    await this.search();
   },
   methods: {
     ...authUser(['fetch', 'query', 'update']),
@@ -108,8 +108,8 @@ export default {
     },
     // 取消增加
     toClose() {
+      this.form = {};
       this.dialog = false;
-      this.form = { menus: [] };
     },
     async getOtherList() {
       if (this.user.role == '0') {