outCourseList.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <div class="courseInfo">
  3. <save-form :inline="true" :model="searchList" @submit="search" save-key='teacherDetail-outCourseList'>
  4. <el-form-item>
  5. <el-input
  6. placeholder="课程组名称"
  7. clearable
  8. @keyup.enter.native="search"
  9. v-model.trim="searchList.search"
  10. ></el-input>
  11. </el-form-item>
  12. <el-form-item label="课程状态">
  13. <el-select v-model.trim="searchList.status" clearable>
  14. <el-option
  15. v-for="(item, index) in commGroupStatus"
  16. :key="index"
  17. :value="item.value"
  18. :label="item.label"
  19. ></el-option>
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item>
  23. <el-button type="danger" native-type="submit">搜索</el-button>
  24. </el-form-item>
  25. </save-form>
  26. <div class="tableWrap">
  27. <el-table
  28. :data="teamList"
  29. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  30. >
  31. <el-table-column label="编号" prop="id" align="center">
  32. <template slot-scope="scope">
  33. <copy-text>
  34. {{ scope.row.id }}
  35. </copy-text>
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="课程组名称" prop="name" align="center">
  39. <template slot-scope="scope">
  40. <copy-text>
  41. {{ scope.row.name }}
  42. </copy-text>
  43. </template>
  44. </el-table-column>
  45. <el-table-column label="课程组状态" align="center">
  46. <template slot-scope="scope">{{
  47. scope.row.status | courseGroup
  48. }}</template>
  49. </el-table-column>
  50. <el-table-column
  51. label="班级人数"
  52. prop="studentNum"
  53. align="center"
  54. ></el-table-column>
  55. <el-table-column
  56. label="课程组时间"
  57. prop="groupClassesTotalDuration"
  58. align="center"
  59. ></el-table-column>
  60. <el-table-column
  61. label="消耗时间"
  62. prop="groupClassesConsumeDuration"
  63. align="center"
  64. ></el-table-column>
  65. <el-table-column
  66. label="当前课次"
  67. align="center"
  68. prop="currentClassTimes"
  69. >
  70. <template slot-scope="scope">
  71. {{ scope.row.currentClassTimes }}/{{ scope.row.totalClassTimes }}
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="开课时间" align="center">
  75. <template slot-scope="scope">{{
  76. scope.row.firstClassesStartTime | formatterTime
  77. }}</template>
  78. </el-table-column>
  79. <el-table-column label="结束时间" align="center">
  80. <template slot-scope="scope">{{
  81. scope.row.lastClassesEndTime | formatTimer
  82. }}</template>
  83. </el-table-column>
  84. <el-table-column label="申请时间" align="center">
  85. <template slot-scope="scope">{{
  86. scope.row.createTime | formatterTime
  87. }}</template>
  88. </el-table-column>
  89. </el-table>
  90. <pagination
  91. save-key='teacherDetail-outCourseList'
  92. sync
  93. :total.sync="pageInfo.total"
  94. :page.sync="pageInfo.page"
  95. :limit.sync="pageInfo.limit"
  96. :page-sizes="pageInfo.page_size"
  97. @pagination="getList"
  98. />
  99. </div>
  100. </div>
  101. </template>
  102. <script>
  103. // import { getTeacherVipClass } from '@/api/teacherManager'
  104. import { findTeacherCourseGroupsWithWeb } from "@/api/teacherManager";
  105. import pagination from "@/components/Pagination/index";
  106. import { commGroupStatus } from "@/utils/searchArray";
  107. import store from "@/store";
  108. export default {
  109. name: "courseInfo1",
  110. components: {
  111. pagination,
  112. },
  113. data() {
  114. return {
  115. searchList: {
  116. status: "",
  117. search: "",
  118. },
  119. teamList: [],
  120. organId: null,
  121. commGroupStatus: commGroupStatus,
  122. teacherId: this.$route.query.teacherId,
  123. pageInfo: {
  124. // 分页规则
  125. limit: 10, // 限制显示条数
  126. page: 1, // 当前页
  127. total: 1, // 总条数
  128. page_size: [10, 20, 40, 50], // 选择限制显示条数
  129. },
  130. };
  131. },
  132. activated() {
  133. this.getList();
  134. },
  135. mounted() {
  136. this.getList();
  137. },
  138. methods: {
  139. getList() {
  140. this.teacherId = this.$route.query.teacherId;
  141. findTeacherCourseGroupsWithWeb({
  142. rows: this.pageInfo.limit,
  143. page: this.pageInfo.page,
  144. teacherId: this.teacherId,
  145. groupStatus: this.searchList.status || null,
  146. search: this.searchList.search || null,
  147. }).then((res) => {
  148. if (res.code == 200) {
  149. this.teamList = res.data.rows;
  150. this.pageInfo.total = res.data.total;
  151. }
  152. });
  153. },
  154. search() {
  155. this.pageInfo.page = 1;
  156. this.getList();
  157. },
  158. },
  159. filters: {
  160. formatterTime(val) {
  161. let result;
  162. if (val) {
  163. result = val.split(" ")[0];
  164. } else {
  165. result = "";
  166. }
  167. return result;
  168. },
  169. formatterStatus(val) {
  170. let arr = [
  171. "未开始",
  172. "报名中",
  173. "进行中",
  174. "取消",
  175. "已结束",
  176. "报名结束",
  177. "暂停",
  178. ];
  179. return arr[val];
  180. },
  181. },
  182. };
  183. </script>
  184. <style lang="scss" scoped>
  185. // .courseInfo {
  186. // h4 {
  187. // margin-bottom: 20px;
  188. // }
  189. // .tableMargin {
  190. // margin-top: 20px;
  191. // }
  192. // }
  193. </style>