|
@@ -0,0 +1,280 @@
|
|
|
|
+<template>
|
|
|
|
+ <el-dialog
|
|
|
|
+ :visible.sync="modalIsShow"
|
|
|
|
+ top="0"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ :close-on-press-escape="false"
|
|
|
|
+ :show-close="false"
|
|
|
|
+ append-to-body
|
|
|
|
+ fullscreen
|
|
|
|
+ @open="initData"
|
|
|
|
+ >
|
|
|
|
+ <div slot="title">
|
|
|
|
+ <h2 class="el-dialog__title">成绩详情</h2>
|
|
|
|
+ <button class="el-dialog__headerbtn" @click="cancel"></button>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="part-box part-box-filter part-box-flex">
|
|
|
|
+ <el-form ref="FilterForm" label-position="left" label-width="85px" inline>
|
|
|
|
+ <el-form-item label="学院">
|
|
|
|
+ <college-select
|
|
|
|
+ v-model="filter.college"
|
|
|
|
+ placeholder="学院"
|
|
|
|
+ ></college-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="专业">
|
|
|
|
+ <el-select v-model="filter.major" placeholder="专业" clearable>
|
|
|
|
+ <!-- TODO: -->
|
|
|
|
+ <el-option :value="1">班级1</el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="班级">
|
|
|
|
+ <major-class-select
|
|
|
|
+ v-model="filter.className"
|
|
|
|
+ :major-id="filter.majorId"
|
|
|
|
+ cascader
|
|
|
|
+ placeholder="班级"
|
|
|
|
+ ></major-class-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="姓名">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model.trim="filter.studentName"
|
|
|
|
+ placeholder="姓名"
|
|
|
|
+ clearable
|
|
|
|
+ >
|
|
|
|
+ </el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="学号">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model.trim="filter.studentCode"
|
|
|
|
+ placeholder="学号"
|
|
|
|
+ clearable
|
|
|
|
+ >
|
|
|
|
+ </el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label-width="0px">
|
|
|
|
+ <el-button type="primary" @click="search">查询</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <div class="part-box-action">
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ :disabled="downloading"
|
|
|
|
+ @click="toExportScore"
|
|
|
|
+ >
|
|
|
|
+ 成绩导出
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="part-box part-box-pad">
|
|
|
|
+ <el-table ref="TableList" :data="dataList">
|
|
|
|
+ <el-table-column
|
|
|
|
+ type="index"
|
|
|
|
+ label="序号"
|
|
|
|
+ width="70"
|
|
|
|
+ :index="indexMethod"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column prop="studentName" label="姓名" min-width="100">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="studentCode"
|
|
|
|
+ label="学号"
|
|
|
|
+ width="180"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="secretNumber"
|
|
|
|
+ label="院系"
|
|
|
|
+ width="180"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="className"
|
|
|
|
+ label="班级"
|
|
|
|
+ min-width="100"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column prop="checkTime" label="考试时间" width="170">
|
|
|
|
+ <span slot-scope="scope">{{
|
|
|
|
+ scope.row.checkTime | timestampFilter
|
|
|
|
+ }}</span>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="className"
|
|
|
|
+ label="课程名称"
|
|
|
|
+ min-width="100"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="className"
|
|
|
|
+ label="成绩"
|
|
|
|
+ min-width="100"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ class-name="action-column"
|
|
|
|
+ label="操作"
|
|
|
|
+ width="300"
|
|
|
|
+ fixed="right"
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button
|
|
|
|
+ class="btn-primary"
|
|
|
|
+ type="text"
|
|
|
|
+ @click="toViewSheetPaper(scope.row)"
|
|
|
|
+ >原图</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ class="btn-primary"
|
|
|
|
+ type="text"
|
|
|
|
+ @click="toViewPaper(scope.row)"
|
|
|
|
+ >轨迹图</el-button
|
|
|
|
+ >
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ <div class="part-page">
|
|
|
|
+ <el-pagination
|
|
|
|
+ background
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
+ :pager-count="5"
|
|
|
|
+ :current-page="current"
|
|
|
|
+ :total="total"
|
|
|
|
+ :page-size="size"
|
|
|
|
+ @current-change="toPage"
|
|
|
|
+ @size-change="pageSizeChange"
|
|
|
|
+ >
|
|
|
|
+ </el-pagination>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- image-preview -->
|
|
|
|
+ <simple-image-preview
|
|
|
|
+ :cur-image="curImage"
|
|
|
|
+ @on-prev="toPrevImage"
|
|
|
|
+ @on-next="toNextImage"
|
|
|
|
+ ref="SimpleImagePreview"
|
|
|
|
+ ></simple-image-preview>
|
|
|
|
+
|
|
|
|
+ <div slot="footer"></div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import { scoreDetailListPage, scoreClassDetailScoreExport } from "../api";
|
|
|
|
+import SimpleImagePreview from "@/components/SimpleImagePreview";
|
|
|
|
+import { downloadByApi } from "@/plugins/download";
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ name: "score-class-detail",
|
|
|
|
+ components: { SimpleImagePreview },
|
|
|
|
+ props: {
|
|
|
|
+ instance: {
|
|
|
|
+ type: Object,
|
|
|
|
+ default() {
|
|
|
|
+ return {};
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ modalIsShow: false,
|
|
|
|
+ filter: {
|
|
|
|
+ college: "",
|
|
|
|
+ className: "",
|
|
|
|
+ major: "",
|
|
|
|
+ studentName: "",
|
|
|
|
+ studentCode: "",
|
|
|
|
+ },
|
|
|
|
+ current: 1,
|
|
|
|
+ size: this.GLOBAL.pageSize,
|
|
|
|
+ total: 0,
|
|
|
|
+ dataList: [],
|
|
|
|
+ downloading: false,
|
|
|
|
+ // img view
|
|
|
|
+ curImage: {},
|
|
|
|
+ curImageIndex: 0,
|
|
|
|
+ imageList: [],
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ cancel() {
|
|
|
|
+ this.modalIsShow = false;
|
|
|
|
+ },
|
|
|
|
+ open() {
|
|
|
|
+ this.modalIsShow = true;
|
|
|
|
+ },
|
|
|
|
+ async getList() {
|
|
|
|
+ const datas = {
|
|
|
|
+ ...this.filter,
|
|
|
|
+ examId: this.instance.examId,
|
|
|
|
+ paperNumber: this.instance.pageNumber,
|
|
|
|
+ pageNumber: this.current,
|
|
|
|
+ pageSize: this.size,
|
|
|
|
+ };
|
|
|
|
+ if (datas.absent !== null && datas.absent !== "")
|
|
|
|
+ datas.absent = !!datas.absent;
|
|
|
|
+ if (datas.breach !== null && datas.breach !== "")
|
|
|
|
+ datas.breach = !!datas.breach;
|
|
|
|
+
|
|
|
|
+ const data = await scoreDetailListPage(datas);
|
|
|
|
+ this.dataList = data.records;
|
|
|
|
+ this.total = data.total;
|
|
|
|
+ },
|
|
|
|
+ toPage(page) {
|
|
|
|
+ this.current = page;
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ search() {
|
|
|
|
+ this.toPage(1);
|
|
|
|
+ },
|
|
|
|
+ async toExportScore() {
|
|
|
|
+ if (this.downloading) return;
|
|
|
|
+ this.downloading = true;
|
|
|
|
+
|
|
|
|
+ const res = await downloadByApi(() => {
|
|
|
|
+ return scoreClassDetailScoreExport({
|
|
|
|
+ ...this.filter,
|
|
|
|
+ examId: this.instance.examId,
|
|
|
|
+ paperNumber: this.instance.pageNumber,
|
|
|
|
+ });
|
|
|
|
+ }).catch((e) => {
|
|
|
|
+ this.$message.error(e || "下载失败,请重新尝试!");
|
|
|
|
+ });
|
|
|
|
+ this.downloading = false;
|
|
|
|
+
|
|
|
|
+ if (!res) return;
|
|
|
|
+ this.$message.success("下载成功!");
|
|
|
|
+ },
|
|
|
|
+ // img view
|
|
|
|
+ async toViewPaper() {
|
|
|
|
+ // TODO:
|
|
|
|
+ },
|
|
|
|
+ toViewSheetPaper(row) {
|
|
|
|
+ this.curImageIndex = 0;
|
|
|
|
+ this.imageList = (row.sheetUrls || []).map((url, index) => {
|
|
|
|
+ return { url, index: index + 1 };
|
|
|
|
+ });
|
|
|
|
+ this.selectImage(this.curImageIndex);
|
|
|
|
+ this.$refs.SimpleImagePreview.open();
|
|
|
|
+ },
|
|
|
|
+ selectImage(index) {
|
|
|
|
+ this.curImage = this.imageList[index];
|
|
|
|
+ },
|
|
|
|
+ toPrevImage() {
|
|
|
|
+ if (this.curImageIndex === 0) {
|
|
|
|
+ this.curImageIndex = this.imageList.length - 1;
|
|
|
|
+ } else {
|
|
|
|
+ this.curImageIndex--;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.selectImage(this.curImageIndex);
|
|
|
|
+ },
|
|
|
|
+ toNextImage() {
|
|
|
|
+ if (this.curImageIndex === this.imageList.length - 1) {
|
|
|
|
+ this.curImageIndex = 0;
|
|
|
|
+ } else {
|
|
|
|
+ this.curImageIndex++;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.selectImage(this.curImageIndex);
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|