From 6c7e308453d1955506db6f24dd9b1e65caadfdaf Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 11 六月 2024 18:04:59 +0800
Subject: [PATCH] 阅卷

---
 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