StudentLogManage.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <div class="StudentLogManage">
  3. <div class="part-box-head">
  4. <div class="part-box-head-left"><h1>考生端日志管理</h1></div>
  5. </div>
  6. <div class="part-filter">
  7. <div class="part-filter-form">
  8. <el-form ref="FilterForm" label-position="left" inline>
  9. <el-form-item>
  10. <el-select
  11. v-model="filter.examId"
  12. placeholder="请选择批次"
  13. @change="examChange"
  14. >
  15. <el-option
  16. v-for="item in examBatchs"
  17. :key="item.id"
  18. :value="item.id"
  19. :label="item.name"
  20. ></el-option>
  21. </el-select>
  22. </el-form-item>
  23. <el-form-item>
  24. <el-select
  25. v-model="filter.roomCode"
  26. placeholder="请选择考场"
  27. clearable
  28. >
  29. <el-option
  30. v-for="item in examRooms"
  31. :key="item.id"
  32. :value="item.roomCode"
  33. :label="item.roomName"
  34. ></el-option>
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item>
  38. <el-select
  39. v-model="filter.courseCode"
  40. placeholder="请选择科目"
  41. clearable
  42. >
  43. <el-option
  44. v-for="item in examCourses"
  45. :key="item.courseCode"
  46. :value="item.courseCode"
  47. :label="item.courseName"
  48. ></el-option>
  49. </el-select>
  50. </el-form-item>
  51. <el-form-item>
  52. <el-input
  53. v-model.trim="filter.name"
  54. placeholder="姓名"
  55. clearable
  56. ></el-input>
  57. </el-form-item>
  58. <el-form-item>
  59. <el-input
  60. v-model.trim="filter.identity"
  61. placeholder="证件号"
  62. clearable
  63. ></el-input>
  64. </el-form-item>
  65. <el-form-item>
  66. <el-button type="primary" @click="toPage(1)">查询</el-button>
  67. </el-form-item>
  68. </el-form>
  69. </div>
  70. </div>
  71. <el-table ref="TableList" :data="dataList">
  72. <el-table-column type="index" label="排序"></el-table-column>
  73. <el-table-column prop="examName" label="批次名称(ID)"></el-table-column>
  74. <el-table-column
  75. prop="examActivityCode"
  76. label="场次代码"
  77. ></el-table-column>
  78. <el-table-column prop="examroom" label="考场名称(代码)">
  79. <span slot-scope="scope"
  80. >{{ scope.row.roomName }}({{ scope.row.roomCode }})</span
  81. >
  82. </el-table-column>
  83. <el-table-column prop="identity" label="证件号"></el-table-column>
  84. <el-table-column prop="name" label="姓名"></el-table-column>
  85. <el-table-column prop="courseCode" label="科目名称(代码)">
  86. <span slot-scope="scope">
  87. {{ scope.row.courseName }}({{ scope.row.courseCode }})
  88. </span>
  89. </el-table-column>
  90. <el-table-column label="操作" width="100">
  91. <template slot-scope="scope">
  92. <el-button
  93. class="btn-table-icon"
  94. type="primary"
  95. icon="icon icon-view"
  96. @click="toDetail(scope.row)"
  97. >详情</el-button
  98. >
  99. </template>
  100. </el-table-column>
  101. </el-table>
  102. <div class="part-page">
  103. <el-pagination
  104. background
  105. layout="prev, pager, next,total,sizes,jumper"
  106. :current-page="current"
  107. :total="total"
  108. :page-size.sync="size"
  109. @size-change="toPage(1)"
  110. @current-change="toPage"
  111. >
  112. </el-pagination>
  113. </div>
  114. <student-log-detail-dialog
  115. :detail-id="curLogId"
  116. ref="StudentLogDetailDialog"
  117. ></student-log-detail-dialog>
  118. </div>
  119. </template>
  120. <script>
  121. import {
  122. studentLogList,
  123. examBatchList,
  124. examActivityRoomList,
  125. } from "@/api/invigilation";
  126. import StudentLogDetailDialog from "./StudentLogDetailDialog";
  127. import { mapState, mapActions, mapMutations } from "vuex";
  128. export default {
  129. name: "StudentLogManage",
  130. components: { StudentLogDetailDialog },
  131. data() {
  132. return {
  133. filter: {
  134. examId: null,
  135. roomCode: null,
  136. courseCode: null,
  137. name: "",
  138. identity: "",
  139. },
  140. current: 1,
  141. total: 0,
  142. size: 10,
  143. examTasks: [],
  144. examBatchs: [],
  145. examActivities: [],
  146. examRooms: [],
  147. examCourses: [],
  148. dataList: [],
  149. curLogId: "",
  150. };
  151. },
  152. computed: {
  153. ...mapState("invigilation", ["selectedExamId"]),
  154. },
  155. mounted() {
  156. this.initData();
  157. },
  158. methods: {
  159. ...mapActions("invigilation", ["updateSelectedExamId"]),
  160. ...mapMutations("invigilation", ["setSelectedExamId"]),
  161. async initData() {
  162. await this.getExamBatchList();
  163. if (!this.examBatchs.length) return;
  164. // this.filter.examId = this.examBatchs[0] && this.examBatchs[0].id;
  165. this.updateSelectedExamId({
  166. exams: this.examBatchs,
  167. selectedExamId: this.selectedExamId,
  168. });
  169. this.filter.examId = this.selectedExamId;
  170. this.getExamActivityRoomList();
  171. this.toPage(1);
  172. },
  173. async getList() {
  174. const datas = {
  175. ...this.filter,
  176. pageNumber: this.current,
  177. pageSize: this.size,
  178. };
  179. const res = await studentLogList(datas);
  180. this.dataList = res.data.data.records;
  181. this.total = res.data.data.total;
  182. },
  183. toPage(page) {
  184. this.setSelectedExamId(this.filter.examId);
  185. this.current = page;
  186. this.getList();
  187. },
  188. async getExamBatchList() {
  189. const res = await examBatchList();
  190. this.examBatchs = res.data.data;
  191. },
  192. async getExamActivityRoomList() {
  193. if (!this.filter.examId) return;
  194. const res = await examActivityRoomList(this.filter.examId);
  195. this.examActivities = res.data.data.examActivitys;
  196. this.examRooms = res.data.data.examRooms;
  197. this.examCourses = res.data.data.examCourses;
  198. },
  199. examChange() {
  200. this.filter.examActivityId = null;
  201. this.filter.roomCode = null;
  202. this.filter.courseCode = null;
  203. this.getExamActivityRoomList();
  204. },
  205. toDetail(row) {
  206. this.curLogId = row.examStudentId;
  207. this.$refs.StudentLogDetailDialog.open();
  208. },
  209. },
  210. };
  211. </script>