guhongwei пре 4 година
родитељ
комит
bfdb9d65d8
2 измењених фајлова са 8 додато и 6 уклоњено
  1. 1 1
      src/store/user.js
  2. 7 5
      src/views/user/index.vue

+ 1 - 1
src/store/user.js

@@ -9,7 +9,7 @@ const state = () => ({});
 const mutations = {};
 
 const actions = {
-  async query({ commit }, { skip = 0, limit = 10, ...info } = {}) {
+  async query({ commit }, { skip = 0, limit = undefined, ...info } = {}) {
     const res = await this.$axios.$get(api.interface, { skip, limit, ...info });
     return res;
   },

+ 7 - 5
src/views/user/index.vue

@@ -57,22 +57,24 @@ export default {
   methods: {
     ...users(['query', 'delete', 'update']),
     ...exportuser({ exportuserQuery: 'query' }),
-    async search({ skip = 0, limit = 10, ...info } = {}) {
+    async search({ ...info } = {}) {
       if (this.user.code.length == 3) {
-        const res = await this.query({ skip, limit, ...info });
-        const resTwo = await this.exportuserQuery({ skip, limit, ...info });
+        const res = await this.query({ ...info });
+        const resTwo = await this.exportuserQuery({ ...info });
         var newData = res.data.concat(resTwo.data);
         if (this.$checkRes(newData)) {
           var arr = newData.filter(item => item.pid == undefined && item.status != '3');
+          console.log(arr);
           this.$set(this, `list`, arr);
           this.$set(this, `total`, arr.length);
         }
       } else {
-        const res = await this.query({ skip, limit, code: this.user.code, ...info });
-        const resTwo = await this.exportuserQuery({ skip, limit, code: this.user.code, ...info });
+        const res = await this.query({ code: this.user.code, ...info });
+        const resTwo = await this.exportuserQuery({ code: this.user.code, ...info });
         var newData = res.data.concat(resTwo.data);
         if (this.$checkRes(newData)) {
           var arr = newData.filter(item => item.pid == undefined && item.status != '3');
+          console.log(arr);
           this.$set(this, `list`, arr);
           this.$set(this, `total`, arr.length);
         }