guhongwei há 3 anos atrás
pai
commit
2f710a9cdc
2 ficheiros alterados com 14 adições e 13 exclusões
  1. 2 1
      src/views/account/users/index.vue
  2. 12 12
      src/views/test.vue

+ 2 - 1
src/views/account/users/index.vue

@@ -36,7 +36,8 @@ export default {
     ...personal(['query', 'delete', 'export', 'updatePassword']),
     async search({ skip = 0, limit = this.limit, searchName, ...info } = {}) {
       if (searchName) info.name = searchName;
-      let res = await this.query({ skip, limit, role: this.user.role, code: this.user.code, ...info });
+      if (this.user.role == '1') info.role = this.user.role;
+      let res = await this.query({ skip, limit, code: this.user.code, ...info });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);

+ 12 - 12
src/views/test.vue

@@ -39,12 +39,12 @@ export default {
     };
   },
   created() {
-    this.oneSearch();
-    // this.twoSearch();
+    // this.oneSearch();
+    this.twoSearch();
   },
   methods: {
     ...statistics(['patentInfoByApplyPerson']),
-    ...personal({ personalQuery: 'query' }),
+    ...personal({ personalQuery: 'query', personalUpdate: 'update' }),
     ...patentearly({ patentearlyQuery: 'query' }),
     // 添加用户
     async toAdd() {
@@ -74,15 +74,15 @@ export default {
         console.log(early_num);
       }
     },
-    // async twoSearch() {
-    //   let res = await this.personalQuery({ code: 'XQGQ' });
-    //   if (this.$checkRes(res)) {
-    //     for (const val of res.data) {
-    //       let arr = await this.patentearlyQuery({ user_id: val._id });
-    //       console.log(arr);
-    //     }
-    //   }
-    // },
+    async twoSearch() {
+      // let res = await this.personalQuery({ code: 'FMTTHY', isdel: '1' });
+      // if (this.$checkRes(res)) {
+      //   for (const val of res.data) {
+      //     let res = await this.personalUpdate({ id: val.id, isdel: '0' });
+      //     console.log(res);
+      //   }
+      // }
+    },
   },
   computed: {
     ...mapState(['user']),