<!--  -->
<template>
  <div class>
    <div class="tableWrap">
      <el-table :data="tableList"
                :header-cell-style="{background:'#EDEEF0',color:'#444'}">
        <el-table-column align="center"
                         width="100"
                         prop="username"
                         label="学生姓名"></el-table-column>
        <el-table-column align="center"
                         width="100"
                         prop="score"
                         label="星级">
          <template slot-scope="scope">
            <div>
              {{ scope.row.score?scope.row.score+'星':'' }}
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="reason"
                         label="评价内容"></el-table-column>
      </el-table>
      <!-- <pagination
        :total="rules.total"
        :page.sync="rules.page"
        :limit.sync="rules.limit"
        @pagination="getList"
      /> -->
    </div>
  </div>
</template>

<script>
// import pagination from '@/components/Pagination/index'
import { getStuAndTeaReview } from '@/api/buildTeam'
export default {
  props: ['courseScheduleId'],
  data () {
    return {
      tableList: [],
      rules: {
        // 分页规则
        limit: 10, // 限制显示条数
        page: 1, // 当前页
        total: 0, // 总条数
        page_size: [10, 20, 40, 50] // 选择限制显示条数
      }
    };
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created () { },
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted () {
    // this.getList()
  },
  activated () {
    this.getList()
  },
  methods: {
    getList () {
      getStuAndTeaReview({ courseId: this.courseScheduleId }).then(res => {
        if (res.code == 200) {
          this.tableList = res.data.courseScheduleComplaints
        }
      })
    }
  }
};
</script>
<style lang='scss' scoped>
</style>