<template>
  <div class="m-container">
    <h2>
      <el-page-header @back="onCancel"
                      content="学生点名总览"></el-page-header>
      <!-- <div class="term">第一学期</div>
      <div class="term active">第二学期</div> -->
    </h2>
    <div class='m-core'>
      <!-- <div class="searchBtn">导出</div> -->
      <!-- table  -->
      <div class="tableList">
        <el-table :data='tableList'>
          <el-table-column align='center'
                           prop="signTime"
                           label="时间">
          </el-table-column>
          <el-table-column align='center'
                           prop="courseScheduleName"
                           label="课程名称">
          </el-table-column>
          <el-table-column align='center'
                           prop="name"
                           label="学生名称">
          </el-table-column>
          <el-table-column align='center'
                           prop="signStatus"
                           label="签到">
            <template slot-scope="scope">
              <div>
                {{ scope.row.signStatus|studentSign}}
              </div>
            </template>
          </el-table-column>
        </el-table>
        <pagination :total="rules.total"
                    :page.sync="rules.page"
                    :limit.sync="rules.limit"
                    :page-sizes="rules.page_size"
                    @pagination="getList" />
      </div>
    </div>
  </div>
</template>
<script>
import pagination from '@/components/Pagination/index'
import { getStudentRecord } from '@/api/studentManager'
export default {
  name: 'studentSignin',
  components: {
    pagination
  },
  data () {
    return {
      tableList: [], // table列表
      rules: {
        // 分页规则
        limit: 10, // 限制显示条数
        page: 1, // 当前页
        total: 0, // 总条数
        page_size: [10, 20, 40, 50] // 选择限制显示条数
      },
      teamid: ''
    }
  },
  created () {
    this.teamid = this.$route.query.id;
  },
  mounted () {
    this.getList()
  },
  methods: {
    onCancel () {
      // history.go(-1)
      let params = this.$route.query
      this.$router.push({
        path: '/business/teamDetails',
        query: {
          id: params.id,
          status: params.status,
          name: params.name,
          checkIndex: "3"
        }
      })
    },
    getList () {
      // console.log(111);
      getStudentRecord({ search: this.teamid }).then(res => {
        if (res.code == 200) {
          this.tableList = res.data.rows;
          this.rules.total = res.data.total;
        }
      })
    }
  },
}
</script>
<style lang="scss" scope>
// .m-container {
//   h2 {
//     height: 48px;
//     line-height: 48px;
//     position: relative;
//     // padding-left: 30px;
//     margin-bottom: 30px;
//     display: flex;
//     flex-direction: row;
//     justify-content: flex-start;
//     align-items: center;
//     .term {
//       height: 32px;
//       line-height: 32px;
//       border-radius: 24px;
//       width: 100px;
//       color: #14928a;
//       border: 1px solid rgba(20, 146, 138, 1);
//       font-size: 14px;
//       text-align: center;
//       margin-right: 12px;
//       &:nth-child(1) {
//         margin-left: 47px;
//       }
//     }
//     .term.active {
//       color: #fff;
//       background-color: #14928a;
//     }
//   }
// }
</style>