123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <template>
- <div class="report-breach">
- <el-button
- type="primary"
- icon="el-icon-download"
- style="margin: 0 0 10px"
- :loading="isDownload"
- @click="exportData"
- >导出数据</el-button
- >
- <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 prop="breachStatus" label="违纪/正常"> </el-table-column>
- <el-table-column label="操作">
- <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>
- <breach-detail-dialog
- :detail-id="detailId"
- ref="BreachDetailDialog"
- ></breach-detail-dialog>
- </div>
- </template>
- <script>
- import { reportBreachData, exportReportBreachData } from "@/api/invigilation";
- import BreachDetailDialog from "./BreachDetailDialog";
- import { downloadBlob } from "@/utils/utils";
- export default {
- name: "report-breach",
- components: { BreachDetailDialog },
- props: {
- filter: {
- type: Object,
- default() {
- return {};
- },
- },
- },
- data() {
- return {
- current: 1,
- total: 0,
- size: 10,
- dataList: [],
- detailId: "",
- isDownload: false,
- };
- },
- mounted() {
- this.getData();
- },
- methods: {
- async getList() {
- const datas = {
- ...this.filter,
- pageNumber: this.current,
- pageSize: this.size,
- };
- const res = await reportBreachData(datas);
- this.dataList = res.data.data.records;
- this.total = res.data.data.total;
- },
- toPage(page) {
- this.current = page;
- this.getList();
- },
- getData() {
- this.toPage(1);
- },
- toDetail(row) {
- this.detailId = row.examStudentId;
- this.$refs.BreachDetailDialog.open();
- },
- async exportData() {
- this.isDownload = true;
- const res = await downloadBlob(() => {
- return exportReportBreachData({
- ...this.filter,
- });
- }).catch(() => {});
- this.isDownload = false;
- if (res) {
- this.$message.success("导出成功!");
- } else {
- this.$message.error("导出失败,请重新尝试!");
- }
- },
- },
- };
- </script>
|