123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- <template>
- <div class="StudentLogManage">
- <div class="part-box-head">
- <div class="part-box-head-left"><h1>考生端日志管理</h1></div>
- </div>
- <div class="part-filter">
- <div class="part-filter-form">
- <el-form ref="FilterForm" label-position="left" inline>
- <el-form-item>
- <el-select
- v-model="filter.examId"
- placeholder="请选择批次"
- @change="examChange"
- >
- <el-option
- v-for="item in examBatchs"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select
- v-model="filter.roomCode"
- placeholder="请选择考场"
- clearable
- >
- <el-option
- v-for="item in examRooms"
- :key="item.id"
- :value="item.roomCode"
- :label="item.roomName"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select
- v-model="filter.courseCode"
- placeholder="请选择科目"
- clearable
- >
- <el-option
- v-for="item in examCourses"
- :key="item.courseCode"
- :value="item.courseCode"
- :label="item.courseName"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-input
- v-model.trim="filter.name"
- placeholder="姓名"
- clearable
- ></el-input>
- </el-form-item>
- <el-form-item>
- <el-input
- v-model.trim="filter.identity"
- placeholder="证件号"
- clearable
- ></el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="toPage(1)">查询</el-button>
- </el-form-item>
- </el-form>
- </div>
- </div>
- <el-table ref="TableList" :data="dataList">
- <el-table-column type="index" label="排序"></el-table-column>
- <el-table-column prop="examName" label="批次名称(ID)"></el-table-column>
- <el-table-column
- prop="examActivityCode"
- label="场次代码"
- ></el-table-column>
- <el-table-column prop="examroom" label="考场名称(代码)">
- <span slot-scope="scope"
- >{{ scope.row.roomName }}({{ scope.row.roomCode }})</span
- >
- </el-table-column>
- <el-table-column prop="identity" label="证件号"></el-table-column>
- <el-table-column prop="name" label="姓名"></el-table-column>
- <el-table-column prop="courseCode" label="科目名称(代码)">
- <span slot-scope="scope">
- {{ scope.row.courseName }}({{ scope.row.courseCode }})
- </span>
- </el-table-column>
- <el-table-column label="操作" width="100">
- <template slot-scope="scope">
- <el-button
- class="btn-table-icon"
- type="primary"
- icon="icon icon-view"
- @click="toDetail(scope.row)"
- >详情</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <div class="part-page">
- <el-pagination
- background
- layout="prev, pager, next,total,sizes,jumper"
- :current-page="current"
- :total="total"
- :page-size.sync="size"
- @size-change="toPage(1)"
- @current-change="toPage"
- >
- </el-pagination>
- </div>
- <student-log-detail-dialog
- :detail-id="curLogId"
- ref="StudentLogDetailDialog"
- ></student-log-detail-dialog>
- </div>
- </template>
- <script>
- import {
- studentLogList,
- examBatchList,
- examActivityRoomList,
- } from "@/api/invigilation";
- import StudentLogDetailDialog from "./StudentLogDetailDialog";
- import { mapState, mapActions, mapMutations } from "vuex";
- export default {
- name: "StudentLogManage",
- components: { StudentLogDetailDialog },
- data() {
- return {
- filter: {
- examId: null,
- roomCode: null,
- courseCode: null,
- name: "",
- identity: "",
- },
- current: 1,
- total: 0,
- size: 10,
- examTasks: [],
- examBatchs: [],
- examActivities: [],
- examRooms: [],
- examCourses: [],
- dataList: [],
- curLogId: "",
- };
- },
- computed: {
- ...mapState("invigilation", ["selectedExamId"]),
- },
- mounted() {
- this.initData();
- },
- methods: {
- ...mapActions("invigilation", ["updateSelectedExamId"]),
- ...mapMutations("invigilation", ["setSelectedExamId"]),
- async initData() {
- await this.getExamBatchList();
- if (!this.examBatchs.length) return;
- // this.filter.examId = this.examBatchs[0] && this.examBatchs[0].id;
- this.updateSelectedExamId({
- exams: this.examBatchs,
- selectedExamId: this.selectedExamId,
- });
- this.filter.examId = this.selectedExamId;
- this.getExamActivityRoomList();
- this.toPage(1);
- },
- async getList() {
- const datas = {
- ...this.filter,
- pageNumber: this.current,
- pageSize: this.size,
- };
- const res = await studentLogList(datas);
- this.dataList = res.data.data.records;
- this.total = res.data.data.total;
- },
- toPage(page) {
- this.setSelectedExamId(this.filter.examId);
- this.current = page;
- this.getList();
- },
- async getExamBatchList() {
- const res = await examBatchList();
- this.examBatchs = res.data.data;
- },
- async getExamActivityRoomList() {
- if (!this.filter.examId) return;
- const res = await examActivityRoomList(this.filter.examId);
- this.examActivities = res.data.data.examActivitys;
- this.examRooms = res.data.data.examRooms;
- this.examCourses = res.data.data.examCourses;
- },
- examChange() {
- this.filter.examActivityId = null;
- this.filter.roomCode = null;
- this.filter.courseCode = null;
- this.getExamActivityRoomList();
- },
- toDetail(row) {
- this.curLogId = row.examStudentId;
- this.$refs.StudentLogDetailDialog.open();
- },
- },
- };
- </script>
|