scorpioyq 2 年 前
コミット
5eb79bd02b
1 ファイル変更43 行追加3 行削除
  1. 43 3
      src/views/home/component/pro_left.vue

+ 43 - 3
src/views/home/component/pro_left.vue

@@ -56,8 +56,21 @@
           </div>
         </div>
         <div v-else>
+          <div>
+            <el-select v-model="year" placeholder="选择年份"
+                       clearable
+                       @change="yearSelect"
+            >
+              <el-option
+                  v-for="item in years"
+                  :key="item.value"
+                  :label="item.value"
+                  :value="item.value"
+              />
+            </el-select>
+          </div>
           <div
-              class="flex flex-center grey-9 font-15 bold pointer"
+              class="flex flex-center grey-9 font-15 bold pointer mt-5"
               :class="active === index ? 'box-s' : 'box'"
               v-for="(item, index) in month"
               :key="item"
@@ -169,7 +182,31 @@ export default {
           value: '12月',
           index: 11
         },
-      ]
+      ],
+      year: '',
+      years: [
+        {
+          value: 2023
+        },
+        {
+          value: 2022
+        },
+        {
+          value: 2021
+        },
+        {
+          value: 2020
+        },
+        {
+          value: 2019
+        },
+        {
+          value: 2018
+        },
+        {
+          value: 2017
+        }
+      ],
     }
   },
   created() {
@@ -178,7 +215,7 @@ export default {
     this.onScroll()
   },
   methods: {
-    onScroll(event) {
+    get onScroll(event) {
       this.$bus.on('scorll', e => {
         const scrollTop = e.target.scrollTop
         const index = this.scorllTopList.findIndex(
@@ -249,6 +286,9 @@ export default {
     change(index) {
       this.active = index
       this.$emit('change', index)
+    },
+    yearSelect(res) {
+      this.year = res
     }
   }
 }