wxy 4 年 前
コミット
f110a38175
1 ファイル変更15 行追加9 行削除
  1. 15 9
      src/views/halltwo/xmcg.vue

+ 15 - 9
src/views/halltwo/xmcg.vue

@@ -47,7 +47,7 @@
               <p>项目成果</p>
               <el-col :span="24" class="all">
                 <span class="field" v-for="(item, index) in fieldList" :key="index" @click="change(item, index)" :class="{ active: num == index }">{{
-                  item
+                  item.name
                 }}</span>
               </el-col>
               <el-col :span="24" class="list">
@@ -117,6 +117,7 @@
 import liveFoot from '@/layout/live/foot.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: dock } = createNamespacedHelpers('dock');
+const { mapActions: markettype } = createNamespacedHelpers('markettype');
 export default {
   metaInfo() {
     return { title: this.$route.meta.title };
@@ -150,9 +151,11 @@ export default {
   },
   async created() {
     await this.searchInfo();
+    await this.searchType();
   },
   methods: {
     ...dock({ dockQuery: 'query', dockFetch: 'fetch', goodsquery: 'goodsquery' }),
+    ...markettype({ markettypeList: 'query' }),
     async searchInfo() {
       // 查询展会详情
       if (this.dock_id) {
@@ -166,15 +169,17 @@ export default {
           let achieve = czxmNew.filter(i => i.type == '1');
           this.$set(this, `list`, achieve);
           this.$set(this, `total`, achieve.length);
-          let lists = this.list;
-          let fieldLists = this.fieldList;
-          fieldLists.push('全部');
-          for (let item of lists) {
-            if (fieldLists.indexOf(item.field) == -1) fieldLists.push(item.field);
-          }
         }
       }
     },
+    async searchType() {
+      //查领域
+      const res1 = await this.markettypeList({ category: '01' });
+      if (res1) {
+        res1.data.unshift({ name: '全部' });
+        this.$set(this, `fieldList`, res1.data);
+      }
+    },
     searchPage(page = 1) {
       this.$set(this, `list1`, this.origin[page - 1]);
     },
@@ -186,10 +191,10 @@ export default {
     },
     change(item, index) {
       let val = this.list;
-      if (item == '全部') {
+      if (item.name == '全部') {
         this.searchInfo();
       } else {
-        let techol = val.filter(i => i.field == item);
+        let techol = val.filter(i => i.field == item.name);
         this.$set(this, `list1`, techol);
         this.$set(this, `total`, techol.length);
       }
@@ -372,6 +377,7 @@ export default {
         .field:hover {
           color: #fff;
           background-color: #2152cb;
+          cursor: pointer;
         }
       }
       .list {