From 45d0a4203787f354932f8b145665826bbe0d7cf4 Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期五, 07 六月 2024 17:25:40 +0800
Subject: [PATCH] feat:成绩导出
---
src/views/Manage/ScoreInquiry/list.vue | 31 ++++++++++++++++++++++++++-----
1 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/src/views/Manage/ScoreInquiry/list.vue b/src/views/Manage/ScoreInquiry/list.vue
index 15d4720..ae22a47 100644
--- a/src/views/Manage/ScoreInquiry/list.vue
+++ b/src/views/Manage/ScoreInquiry/list.vue
@@ -14,25 +14,31 @@
</el-form-item>
<el-form-item>
<el-button style="width:100px;" type="primary" size="small" @click="search()">鏌ヨ</el-button>
+ <el-button style="width:100px;" type="danger" size="small" @click="handleExport()">瀵煎嚭</el-button>
</el-form-item>
</el-form>
</div>
<!-- 琛ㄦ牸 -->
<el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%">
- <el-table-column prop="paperName" label="璇曞嵎鍚嶇О" />
- <el-table-column prop="userName" label="鐢ㄦ埛鍚嶇О" />
+ <el-table-column prop="paperName" label="璇曞嵎鍚嶇О" align="center" />
+ <el-table-column prop="userName" label="鐢ㄦ埛鍚嶇О" align="center" />
<el-table-column label="寰楀垎" width="100px">
<template slot-scope="{row}">
{{ row.userScore }} / {{ row.paperScore }}
</template>
</el-table-column>
- <el-table-column label="棰樼洰瀵归敊" width="80px">
+ <el-table-column label="棰樼洰瀵归敊" width="100px" align="center">
<template slot-scope="{row}">
{{ row.questionCorrect }} / {{ row.questionCount }}
</template>
</el-table-column>
- <el-table-column prop="doTime" label="鑰楁椂" width="100px" />
- <el-table-column prop="createTime" label="鎻愪氦鏃堕棿" width="160px" />
+ <el-table-column prop="doTime" label="鑰楁椂" width="80px" align="center" />
+ <el-table-column prop="createTime" label="鎻愪氦鏃堕棿" width="160px" align="center" />
+ <el-table-column label="鎿嶄綔" width="200px" align="center">
+ <template slot-scope="{row}">
+ <el-button size="mini" @click="view(row)">璇︽儏</el-button>
+ </template>
+ </el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParam.pageIndex"
:limit.sync="queryParam.pageSize" @pagination="search" />
@@ -85,6 +91,21 @@
},
view(row) {
this.$router.push({ path: '/manage/answer-detail', query: { id: row.id } });
+ },
+ handleExport() {
+ let that = this
+ let url = '/api/admin/examPaperAnswer/exportExcel?examPaperId=' + this.queryParam.examPaperId + '&userName=' + this.queryParam.userName
+ var x = new XMLHttpRequest();
+ x.open("POST", url, true);
+ x.responseType = "blob";
+ x.onload = function () {
+ var url = window.URL.createObjectURL(x.response);
+ var a = document.createElement("a");
+ a.href = url;
+ a.download = that.tableData[0].paperName + '.xlsx';
+ a.click();
+ };
+ x.send();
}
}
};
--
Gitblit v1.8.0