ruifeng_liu 3 年之前
父节点
当前提交
13b6122722
共有 1 个文件被更改,包括 11 次插入1 次删除
  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-row class="rowLesson" type="flex" justify="center" ref="print">
       <el-col :span="21" class="timeTable">
       <el-col :span="21" class="timeTable">
         <el-col :span="24" class="top">
         <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 :span="24" class="date"> ({{ th[0] }}—{{ th[th.length - 1] }}) </el-col>
         </el-col>
         </el-col>
         <el-col :span="24" class="info">
         <el-col :span="24" class="info">
@@ -113,6 +113,16 @@ export default {
       ).map(i => i.time);
       ).map(i => i.time);
       return mid;
       return mid;
     },
     },
+    titleYear() {
+      let year;
+      const day = _.head(this.th);
+      if (day) {
+        year = moment(day).year();
+      } else {
+        year = moment().year();
+      }
+      return year;
+    },
     ...mapState(['user']),
     ...mapState(['user']),
   },
   },
   methods: {
   methods: {