|
@@ -10,10 +10,11 @@
|
|
|
<div class="part-box part-box-pad">
|
|
|
<el-table :data="dataList">
|
|
|
<el-table-column type="index" label="序号" width="70"></el-table-column>
|
|
|
- <el-table-column prop="targetName" label="姓名"></el-table-column>
|
|
|
- <el-table-column prop="targetName" label="学号"></el-table-column>
|
|
|
- <el-table-column prop="targetValue" label="成绩"> </el-table-column>
|
|
|
- <el-table-column prop="targetValue" label="成绩明细"> </el-table-column>
|
|
|
+ <el-table-column prop="examStudentName" label="姓名"></el-table-column>
|
|
|
+ <el-table-column prop="examNumber" label="学号"></el-table-column>
|
|
|
+ <el-table-column prop="score" label="成绩"> </el-table-column>
|
|
|
+ <el-table-column prop="scoreDetailContent" label="成绩明细">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column class-name="action-column" label="操作" width="120px">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
@@ -45,22 +46,30 @@
|
|
|
title="导入期末成绩"
|
|
|
:upload-url="uploadUrl"
|
|
|
:format="['xls', 'xlsx']"
|
|
|
- :download-handle="() => downloadTemplate('endScore')"
|
|
|
+ :download-handle="downloadHandle"
|
|
|
:download-filename="dfilename"
|
|
|
:auto-upload="false"
|
|
|
@upload-success="getList"
|
|
|
></import-file>
|
|
|
+ <!-- SetBlueDialog -->
|
|
|
+ <set-blue-dialog ref="SetBlueDialog" :course="course"> </set-blue-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { endScoreListPage, endScoreEnable } from "../api";
|
|
|
+import {
|
|
|
+ endScoreListPage,
|
|
|
+ endScoreEnable,
|
|
|
+ endScoreTemplateDownload,
|
|
|
+} from "../api";
|
|
|
import ModifyEndScore from "./ModifyEndScore.vue";
|
|
|
+import SetBlueDialog from "./SetBlueDialog.vue";
|
|
|
import ImportFile from "@/components/ImportFile.vue";
|
|
|
+import { downloadByApi } from "@/plugins/download";
|
|
|
|
|
|
export default {
|
|
|
name: "end-score-manage",
|
|
|
- components: { ModifyEndScore, ImportFile },
|
|
|
+ components: { ModifyEndScore, SetBlueDialog, ImportFile },
|
|
|
props: {
|
|
|
course: {
|
|
|
type: Object,
|
|
@@ -84,6 +93,7 @@ export default {
|
|
|
// import
|
|
|
uploadUrl: "/api/admin/course/degree/score/end_exam/import",
|
|
|
dfilename: "期末成绩导入模板.xlsx",
|
|
|
+ downloading: false,
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -98,7 +108,17 @@ export default {
|
|
|
pageSize: this.size,
|
|
|
};
|
|
|
const data = await endScoreListPage(datas);
|
|
|
- this.dataList = data.records;
|
|
|
+ this.dataList = data.records.map((item) => {
|
|
|
+ const nitem = { ...item };
|
|
|
+ if (item.scoreDetail) {
|
|
|
+ nitem.scoreDetail = JSON.parse(item.scoreDetail);
|
|
|
+ nitem.scoreDetailContent = nitem.scoreDetail
|
|
|
+ .map((item) => item.score)
|
|
|
+ .join();
|
|
|
+ }
|
|
|
+
|
|
|
+ return nitem;
|
|
|
+ });
|
|
|
this.total = data.total;
|
|
|
},
|
|
|
toPage(page) {
|
|
@@ -109,12 +129,31 @@ export default {
|
|
|
this.$refs.ImportFile.open();
|
|
|
},
|
|
|
toSetBlue() {
|
|
|
- // TODO:
|
|
|
+ this.$refs.SetBlueDialog.open();
|
|
|
},
|
|
|
toEdit(row) {
|
|
|
this.curRow = { ...row };
|
|
|
this.$refs.ModifyEndScore.open();
|
|
|
- // TODO:
|
|
|
+ },
|
|
|
+ async downloadHandle() {
|
|
|
+ if (this.downloading) return;
|
|
|
+ this.downloading = true;
|
|
|
+
|
|
|
+ const res = await downloadByApi(() => {
|
|
|
+ const datas = {
|
|
|
+ examId: this.course.examId,
|
|
|
+ courseCode: this.course.courseCode,
|
|
|
+ paperNumber: this.course.paperNumber,
|
|
|
+ paperType: this.course.paperType,
|
|
|
+ };
|
|
|
+ return endScoreTemplateDownload(datas);
|
|
|
+ }).catch((e) => {
|
|
|
+ this.$message.error(e || "下载失败,请重新尝试!");
|
|
|
+ });
|
|
|
+ this.downloading = false;
|
|
|
+
|
|
|
+ if (!res) return;
|
|
|
+ this.$message.success("下载成功!");
|
|
|
},
|
|
|
async toEnable(row) {
|
|
|
const action = row.enable ? "禁用" : "启用";
|