courseInfo2.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <div class='courseInfo'>
  3. <div class="tableWrap tableMargin">
  4. <!-- <h4>试听课</h4> -->
  5. <el-table :data='teamList'
  6. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  7. <el-table-column label="星期"
  8. width="180px">
  9. <template slot-scope="scope">
  10. {{ scope.row.classDate | formatWeek }}
  11. </template>
  12. </el-table-column>
  13. <el-table-column label="试听安排"
  14. prop="startTimes">
  15. </el-table-column>
  16. <el-table-column label="试听专业"
  17. prop="subjectNames">
  18. </el-table-column>
  19. </el-table>
  20. <pagination :total="pageInfo.total"
  21. :page.sync="pageInfo.page"
  22. :limit.sync="pageInfo.limit"
  23. :page-sizes="pageInfo.page_size"
  24. @pagination="getList" />
  25. </div>
  26. </div>
  27. </template>
  28. <script>
  29. import { findTeacherDemoGroups } from '@/api/teacherManager'
  30. import pagination from '@/components/Pagination/index'
  31. import store from '@/store'
  32. export default {
  33. name: 'courseInfo2',
  34. components: {
  35. pagination
  36. },
  37. data () {
  38. return {
  39. teamList: [],
  40. organId: null,
  41. teacherId: this.$route.query.teacherId,
  42. pageInfo: {
  43. // 分页规则
  44. limit: 10, // 限制显示条数
  45. page: 1, // 当前页
  46. total: 1, // 总条数
  47. page_size: [10, 20, 40, 50] // 选择限制显示条数
  48. }
  49. }
  50. },
  51. mounted () {
  52. this.getList()
  53. },
  54. activated () {
  55. this.getList()
  56. },
  57. methods: {
  58. getList () {
  59. findTeacherDemoGroups({
  60. rows: this.pageInfo.limit,
  61. page: this.pageInfo.page,
  62. teacherId: this.teacherId
  63. }).then(res => {
  64. if (res.code == 200) {
  65. let data = res.data.rows
  66. data.forEach(item => {
  67. if (item.startTimes) {
  68. item.startTimes = item.startTimes.replace(/\s+/g, '-')
  69. }
  70. })
  71. this.teamList = data
  72. this.pageInfo.total = res.data.total
  73. }
  74. })
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="scss" scope>
  80. .courseInfo {
  81. h4 {
  82. margin-bottom: 20px;
  83. }
  84. .tableMargin {
  85. margin-top: 20px;
  86. }
  87. }
  88. </style>