guhongwei 4 år sedan
förälder
incheckning
3032e28d8e
1 ändrade filer med 214 tillägg och 60 borttagningar
  1. 214 60
      src/views/resource/resource.vue

+ 214 - 60
src/views/resource/resource.vue

@@ -74,9 +74,9 @@
           <el-amap-search-box class="search-box" :search-option="searchOption" :on-search-result="onSearchResult"></el-amap-search-box>
           <el-col :span="4" class="dataList">
             <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
-              <el-tab-pane label="数据列表" name="first">
+              <!-- <el-tab-pane label="数据列表" name="first">
                 <first :firstList="firstList" :total="firstTotal" @tabBtn="tabBtn"></first>
-              </el-tab-pane>
+              </el-tab-pane> -->
               <el-tab-pane label="国家级" name="second">
                 <first :firstList="secondList" :total="secondTotal" @tabBtn="tabBtn"></first>
               </el-tab-pane>
@@ -235,7 +235,7 @@ export default {
       zdxm: zdxm,
       // 23科技奖励-,kjjl
       kjjl: kjjl,
-      activeName: 'first',
+      activeName: 'second',
       // 数据列表
       firstList: [],
       firstTotal: 0,
@@ -346,159 +346,313 @@ export default {
         for (const i of this.kjbm) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.kjbm);
-        this.$set(this, `firstTotal`, this.kjbm.length);
+        let two = this.kjbm.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.kjbm.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.kjbm.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '2-1') {
         for (const i of this.kyys) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.kyys);
-        this.$set(this, `firstTotal`, this.kyys.length);
+        let two = this.kyys.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.kyys.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.kyys.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '3-1') {
         for (const i of this.dzyx) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.dzyx);
-        this.$set(this, `firstTotal`, this.dzyx.length);
+        let two = this.dzyx.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.dzyx.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.dzyx.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '4-1') {
         let data = this.gxjsqy.filter(i => i.ing != '' && i.lat != '');
         for (const i of data) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.gxjsqy);
-        this.$set(this, `firstTotal`, this.gxjsqy.length);
+        let two = this.gxjsqy.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.gxjsqy.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.gxjsqy.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '4-2') {
         let data = this.cxxqy.filter(i => i.ing != '' && i.lat != '');
         for (const i of data) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.cxxqy);
-        this.$set(this, `firstTotal`, this.cxxqy.length);
+        let two = this.cxxqy.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.cxxqy.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.cxxqy.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '5-1') {
         for (const i of this.zdsys) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.zdsys);
-        this.$set(this, `firstTotal`, this.zdsys.length);
+        let two = this.zdsys.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.zdsys.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.zdsys.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '5-2') {
         let data = this.gcjsyjzx.filter(i => i.ing != '' && i.lat != '');
         for (const i of data) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.gcjsyjzx);
-        this.$set(this, `firstTotal`, this.gcjsyjzx.length);
+        let two = this.gcjsyjzx.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.gcjsyjzx.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.gcjsyjzx.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '5-3') {
         for (const i of this.dxkjy) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.dxkjy);
-        this.$set(this, `firstTotal`, this.dxkjy.length);
+        let two = this.dxkjy.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.dxkjy.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.dxkjy.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '5-4') {
         let data = this.kjqyfhq.filter(i => i.ing != '' && i.lat != '');
         for (const i of data) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.kjqyfhq);
-        this.$set(this, `firstTotal`, this.kjqyfhq.length);
+        let two = this.kjqyfhq.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.kjqyfhq.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.kjqyfhq.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '5-5') {
         for (const i of this.cyhjd) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.cyhjd);
-        this.$set(this, `firstTotal`, this.cyhjd.length);
+        let two = this.cyhjd.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.cyhjd.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.cyhjd.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '5-6') {
         for (const i of this.jszysfjg) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.jszysfjg);
-        this.$set(this, `firstTotal`, this.jszysfjg.length);
+        let two = this.jszysfjg.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.jszysfjg.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.jszysfjg.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '5-7') {
         for (const i of this.kjhzjd) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.kjhzjd);
-        this.$set(this, `firstTotal`, this.kjhzjd.length);
+        let two = this.kjhzjd.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.kjhzjd.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.kjhzjd.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '5-8') {
         let data = this.ysgzz.filter(i => i.ing != '' && i.lat != '');
         for (const i of data) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.ysgzz);
-        this.$set(this, `firstTotal`, this.ysgzz.length);
+        let two = this.ysgzz.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.ysgzz.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.ysgzz.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '5-9') {
         let data = this.jscxlm.filter(i => i.ing != '' && i.lat != '');
         for (const i of data) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.jscxlm);
-        this.$set(this, `firstTotal`, this.jscxlm.length);
+        let two = this.jscxlm.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.jscxlm.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.jscxlm.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '5-10') {
         for (const i of this.kjcxzx) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.kjcxzx);
-        this.$set(this, `firstTotal`, this.kjcxzx.length);
+        let two = this.kjcxzx.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.kjcxzx.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.kjcxzx.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '5-11') {
         let data = this.kjcgzhzszx.filter(i => i.ing != '' && i.lat != '');
         for (const i of data) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.kjcgzhzszx);
-        this.$set(this, `firstTotal`, this.kjcgzhzszx.length);
+        let two = this.kjcgzhzszx.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.kjcgzhzszx.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.kjcgzhzszx.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '6-1') {
         let data = this.sccjzx.filter(i => i.ing != '' && i.lat != '');
         for (const i of data) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.sccjzx);
-        this.$set(this, `firstTotal`, this.sccjzx.length);
+        let two = this.sccjzx.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.sccjzx.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.sccjzx.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '6-2') {
         for (const i of this.jshtdjd) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.jshtdjd);
-        this.$set(this, `firstTotal`, this.jshtdjd.length);
+        let two = this.jshtdjd.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.jshtdjd.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.jshtdjd.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '6-3') {
         for (const i of this.jsdsc) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.jsdsc);
-        this.$set(this, `firstTotal`, this.jsdsc.length);
+        let two = this.jsdsc.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.jsdsc.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.jsdsc.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '6-4') {
         for (const i of this.kjcgpjsd) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.kjcgpjsd);
-        this.$set(this, `firstTotal`, this.kjcgpjsd.length);
+        let two = this.kjcgpjsd.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.kjcgpjsd.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.kjcgpjsd.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '7-1') {
         for (const i of this.zdxm) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.zdxm);
-        this.$set(this, `firstTotal`, this.zdxm.length);
+        let two = this.zdxm.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.zdxm.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.zdxm.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       } else if (index === '8-1') {
         for (const i of this.kjjl) {
           this.setMark(i);
         }
-        this.$set(this, `firstList`, this.kjjl);
-        this.$set(this, `firstTotal`, this.kjjl.length);
+        let two = this.kjjl.filter(i => i.xtype == '1');
+        if (two) if (two) this.$set(this, `secondList`, two);
+        this.$set(this, `secondTotal`, two.length);
+        let three = this.kjjl.filter(i => i.xtype == '2');
+        if (three) if (three) this.$set(this, `thirdList`, three);
+        this.$set(this, `thirdTotal`, three.length);
+        let four = this.kjjl.filter(i => i.xtype == '3');
+        if (four) this.$set(this, `fourthList`, four);
+        this.$set(this, `fourthTotal`, four.length);
       }
     },
     // 点击小分类
     handleClick(tab, event) {
-      if (tab.index == '1') {
-        let data = local.filter(i => i.xtype == '1');
-        if (data) this.$set(this, `secondList`, data);
-        this.$set(this, `secondTotal`, data.length);
-      } else if (tab.index == '2') {
-        let data = local.filter(i => i.xtype == '2');
-        if (data) this.$set(this, `thirdList`, data);
-        this.$set(this, `thirdTotal`, data.length);
-      } else if (tab.index == '3') {
-        let data = local.filter(i => i.xtype == '3');
-        if (data) this.$set(this, `fourthList`, data);
-        this.$set(this, `fourthTotal`, data.length);
-      }
+      // if (tab.index == '1') {
+      //   let data = local.filter(i => i.xtype == '1');
+      //   if (data) this.$set(this, `secondList`, data);
+      //   this.$set(this, `secondTotal`, data.length);
+      // } else if (tab.index == '2') {
+      //   let data = local.filter(i => i.xtype == '2');
+      //   if (data) this.$set(this, `thirdList`, data);
+      //   this.$set(this, `thirdTotal`, data.length);
+      // } else if (tab.index == '3') {
+      //   let data = local.filter(i => i.xtype == '3');
+      //   if (data) this.$set(this, `fourthList`, data);
+      //   this.$set(this, `fourthTotal`, data.length);
+      // }
     },
     tabBtn(data) {
       let datas = [data];