ruifeng_liu 3 lat temu
rodzic
commit
13b6122722
1 zmienionych plików z 11 dodań i 1 usunięć
  1. 11 1
      parts/time-table.vue

+ 11 - 1
parts/time-table.vue

@@ -8,7 +8,7 @@
     <el-row class="rowLesson" type="flex" justify="center" ref="print">
       <el-col :span="21" class="timeTable">
         <el-col :span="24" class="top">
-          <el-col :span="24" class="title"> 2020年第({{ data.term }})期高校大学生就业能力拓展训练课程表({{ getClassName(data.name) }}) </el-col>
+          <el-col :span="24" class="title"> {{ titleYear }}年第({{ data.term }})期高校大学生就业能力拓展训练课程表({{ getClassName(data.name) }}) </el-col>
           <el-col :span="24" class="date"> ({{ th[0] }}—{{ th[th.length - 1] }}) </el-col>
         </el-col>
         <el-col :span="24" class="info">
@@ -113,6 +113,16 @@ export default {
       ).map(i => i.time);
       return mid;
     },
+    titleYear() {
+      let year;
+      const day = _.head(this.th);
+      if (day) {
+        year = moment(day).year();
+      } else {
+        year = moment().year();
+      }
+      return year;
+    },
     ...mapState(['user']),
   },
   methods: {