lrf402788946 4 år sedan
förälder
incheckning
e51abb0118

+ 3 - 1
src/components/list/list-page.vue

@@ -61,6 +61,7 @@ export default {
     return {
       searchInfo: '',
       currentPage: 1,
+      condition: {},
     };
   },
   created() {},
@@ -68,7 +69,7 @@ export default {
     search(page = 1) {
       this.currentPage = page;
       const skip = (this.currentPage - 1) * this.pageSize;
-      let condition = { skip, limit: this.pageSize };
+      let condition = { skip, limit: this.pageSize, ...this.condition };
       if (this.searchInfo && this.searchInfo !== '') condition[this.searchModel] = this.searchInfo;
       this.$emit('toSearch', condition);
     },
@@ -80,6 +81,7 @@ export default {
       this.search();
     },
     change(condition) {
+      this.$set(this, `condition`, condition);
       this.$emit('toChangeTab', condition);
     },
   },

+ 1 - 1
src/components/list/tabs.vue

@@ -27,7 +27,7 @@ export default {
   created() {},
   methods: {
     change(data) {
-      this.$emit('toSearch', data);
+      this.$emit('toSearch', { company: data });
     },
   },
   computed: {

+ 13 - 17
src/views/market/list/achieve.vue

@@ -47,9 +47,6 @@ export default {
     ...code({ codeQuery: 'query' }),
     // 查询相关
     async search({ skip = 0, limit = 5, ...info } = {}) {
-      console.log('in function:');
-      // TODO: 查询
-      if (this.company) info.company = this.company;
       let res = await this.query({ skip, limit, status: '2', type: '1', ...info });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
@@ -58,20 +55,19 @@ export default {
         this.$set(this, 'list', this.translate(this.list));
       }
     },
-    change(data) {
-      console.log(data);
-      if (data === '中科系') {
-        this.$set(this, `company`, data);
-        // TODO:原逻辑:将数据过滤出中科系;我觉得:应该是查有关中科系的信息
-      } else if (data === '其他') {
-        this.$set(this, `company`, data);
-        // TODO:原逻辑:是过滤某些单位; 应该去查这些单位的数据
-      } else {
-        this.$set(this, `company`, data);
-        // TODO:原逻辑:过滤含有这些内容的数据;应该去查
-      }
-      this.search();
-    },
+    // change(data) {
+    //   if (data === '中科系') {
+    //     this.$set(this, `company`, data);
+    //     // TODO:原逻辑:将数据过滤出中科系;我觉得:应该是查有关中科系的信息
+    //   } else if (data === '其他') {
+    //     this.$set(this, `company`, data);
+    //     // TODO:原逻辑:是过滤某些单位; 应该去查这些单位的数据
+    //   } else {
+    //     this.$set(this, `company`, data);
+    //     // TODO:原逻辑:过滤含有这些内容的数据;应该去查
+    //   }
+    //   this.search();
+    // },
     // 查询详情
     async searchInfo() {
       let res = await this.fetch(this.id);

+ 11 - 1
src/views/market/list/expert.vue

@@ -1,6 +1,15 @@
 <template>
   <div id="expert">
-    <list-page :displayList="firDroplist" :dropList="dropList" v-bind="$attrs" :total="total" v-if="!id" @toSearch="search" :pageSize="pageSize">
+    <list-page
+      :displayList="firDroplist"
+      :dropList="dropList"
+      v-bind="$attrs"
+      :total="total"
+      v-if="!id"
+      @toSearch="search"
+      :pageSize="pageSize"
+      @toChangeTab="search"
+    >
       <component :is="model" :list="list"></component>
     </list-page>
     <template v-else>
@@ -45,6 +54,7 @@ export default {
     ...code({ codeQuery: 'query' }),
     // 查询相关
     async search({ skip = 0, limit = this.pageSize, ...info } = {}) {
+      console.log(info);
       // TODO: 查询
       let res = await this.query({ skip, limit, ...info });
       if (this.$checkRes(res)) {