<template>
  <div class="p-wrap-full mb20 ng-scope">
    <div class="title-box mt5 clear">
      <h2 class="title">考试计划</h2>
    </div>
    <div class="learning-time-panel mt30">
      <el-table  :data="planList" border fit highlight-current-row
      :header-cell-style="{'background': '#cbd5e905', 'color':'black'}">
        <el-table-column label="考试时间" align="center" prop="startAt">
          <template slot-scope="{row}">
            <span>{{ row|rangeTime }}</span>
          </template>
        </el-table-column>
        <el-table-column label="考试类型" align="center" prop="courseType">
        </el-table-column>
        <el-table-column label="报名时间" align="center" prop="applyStartAt">
          <template slot-scope="{row}">
            <span>{{ row|rangeDate }}</span>
          </template>
        </el-table-column>
        <el-table-column label="考点" align="center" prop="address">
        </el-table-column>
        <el-table-column label="考点容纳人数" align="center" prop="totalCounter">
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
  import { mapGetters } from "vuex";
  import {formatTimeToStr} from "@/utils/date.js";
  export default {
    computed: {
    	...mapGetters("user", [ "planList"])
    },
    filters:{
      rangeTime(row){
        let mdate= formatTimeToStr(row.startAt, "yyyy-MM-dd")
        return mdate +"  "+ formatTimeToStr(row.startAt, "hh:mm:ss") + "到"+ formatTimeToStr(row.endAt, "hh:mm:ss")
      },
      rangeDate(row){
        let startDate = formatTimeToStr(row.applyStartAt, "yyyy-MM-dd")
        let endDate = formatTimeToStr(row.applyEndAt, "yyyy-MM-dd")
        return startDate + '到' + endDate;
      }
    },
    methods: {
    }
  }
</script>

<style>
  @import url("index.css");
</style>
