From bb68991162e676be7ef903a2960766c0200df07c Mon Sep 17 00:00:00 2001 From: qirong <2032486488@qq.com> Date: 星期二, 17 十月 2023 16:03:26 +0800 Subject: [PATCH] 试卷导出 --- src/views/exam/paper/list.vue | 22 ++++++++++++++++++---- src/views/task/edit.vue | 8 +------- src/views/exam/question/list.vue | 3 +++ src/views/exam/personalSimulation/list.vue | 2 +- src/views/task/list.vue | 2 -- src/views/user/student/list.vue | 2 +- admin.zip | 0 7 files changed, 24 insertions(+), 15 deletions(-) diff --git a/admin.zip b/admin.zip index bb22504..888a53b 100644 --- a/admin.zip +++ b/admin.zip Binary files differ diff --git a/src/views/exam/paper/list.vue b/src/views/exam/paper/list.vue index 356bc5d..d5e558e 100644 --- a/src/views/exam/paper/list.vue +++ b/src/views/exam/paper/list.vue @@ -1,9 +1,7 @@ <template> <div class="app-container"> <el-form :model="queryParam" ref="queryForm" :inline="true"> - <el-form-item label="棰樼洰ID锛�"> - <el-input v-model="queryParam.id" clearable></el-input> - </el-form-item> + <el-form-item label="閮ㄩ棬锛�"> <el-select v-model="queryParam.level" placeholder="閮ㄩ棬" @change="levelChange" clearable> <el-option v-for="item in levelEnum" :key="item.key" :value="item.key" :label="item.value"></el-option> @@ -25,10 +23,11 @@ <el-table-column prop="subjectId" label="璇剧洰" :formatter="subjectFormatter" width="120px" /> <el-table-column prop="name" label="鍚嶇О" /> <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" width="160px"/> - <el-table-column label="鎿嶄綔" align="center" width="160px"> + <el-table-column label="鎿嶄綔" align="center" width="300px"> <template slot-scope="{row}"> <el-button size="mini" @click="$router.push({path:'/exam/paper/edit',query:{id:row.id}})" >缂栬緫</el-button> <el-button size="mini" type="danger" @click="deletePaper(row)" class="link-left">鍒犻櫎</el-button> + <el-button size="mini" type="danger" @click="handleExport(row)" class="link-left">瀵煎嚭</el-button> </template> </el-table-column> </el-table> @@ -66,6 +65,21 @@ this.subjectFilter = this.subjects }, methods: { + handleExport(row){ + let fileName = row.name +'.xls' + let url ='/api/admin/exam/paper/exportTemplatesId/'+row.id + var x = new XMLHttpRequest(); + x.open("GET", 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 = fileName; + a.click(); + }; + x.send(); + }, submitForm () { this.queryParam.pageIndex = 1 this.search() diff --git a/src/views/exam/personalSimulation/list.vue b/src/views/exam/personalSimulation/list.vue index 448f4df..dbc0187 100644 --- a/src/views/exam/personalSimulation/list.vue +++ b/src/views/exam/personalSimulation/list.vue @@ -71,7 +71,7 @@ methods: { handleExport(row){ let fileName = row.name +'.xls' - let url ='/api/admin/exam/count/exportTemplatesSheet/'+row.id + let url ='/api/admin/exam/count/exportTemplatesId/'+row.id var x = new XMLHttpRequest(); x.open("GET", url, true); x.responseType = "blob"; diff --git a/src/views/exam/question/list.vue b/src/views/exam/question/list.vue index 03f3b28..556372b 100644 --- a/src/views/exam/question/list.vue +++ b/src/views/exam/question/list.vue @@ -13,6 +13,9 @@ <el-option v-for="item in questionType" :key="item.key" :value="item.key" :label="item.value"></el-option> </el-select> </el-form-item> + <el-form-item label="棰樼洰鍚嶏細"> + <el-input v-model="queryParam.questionName" clearable></el-input> + </el-form-item> <el-form-item> <div style="display: flex"> <el-button type="primary" @click="submitForm">鏌ヨ</el-button> diff --git a/src/views/task/edit.vue b/src/views/task/edit.vue index bc7eee9..05eea2a 100644 --- a/src/views/task/edit.vue +++ b/src/views/task/edit.vue @@ -2,11 +2,7 @@ <div class="app-container"> <el-form :model="form" ref="form" label-width="100px" v-loading="formLoading" :rules="rules"> - <el-form-item label="閮ㄩ棬锛�" prop="gradeLevel" required> - <el-select v-model="form.gradeLevel" placeholder="閮ㄩ棬" @change="levelChange" > - <el-option v-for="item in levelEnum" :key="item.key" :value="item.key" :label="item.value"></el-option> - </el-select> - </el-form-item> + <el-form-item label="鏍囬锛�" prop="title" required> <el-input v-model="form.title"></el-input> </el-form-item> @@ -70,7 +66,6 @@ return { form: { id: null, - gradeLevel: null, title: '', paperItems: [] }, @@ -91,7 +86,6 @@ total: 0 }, rules: { - gradeLevel: [{ required: true, message: '璇疯緭鍏ラ儴闂�', trigger: 'change' }], title: [{ required: true, message: '璇疯緭鍏ヤ换鍔℃爣棰�', trigger: 'blur' }] } } diff --git a/src/views/task/list.vue b/src/views/task/list.vue index 13dc9c7..3408569 100644 --- a/src/views/task/list.vue +++ b/src/views/task/list.vue @@ -13,12 +13,10 @@ <el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%"> <el-table-column prop="title" label="鏍囬" /> - <el-table-column prop="gradeLevel" label="瀛︾骇" :formatter="levelFormatter"/> <el-table-column prop="createUserName" label="鍙戦�佷汉" width="100" /> <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" width="160px"/> <el-table-column label="鎿嶄綔" align="center" width="160px"> <template slot-scope="{row}"> - <el-button size="mini" @click="$router.push({path:'/task/edit',query:{id:row.id}})" >缂栬緫</el-button> <el-button size="mini" type="danger" @click="deleteTask(row)" class="link-left">鍒犻櫎</el-button> </template> </el-table-column> diff --git a/src/views/user/student/list.vue b/src/views/user/student/list.vue index 98b2a4a..e0bfb22 100644 --- a/src/views/user/student/list.vue +++ b/src/views/user/student/list.vue @@ -29,7 +29,7 @@ <el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%"> <el-table-column prop="userName" label="鐢ㄦ埛鍚�"/> <el-table-column prop="realName" label="鐪熷疄濮撳悕" /> - <el-table-column prop="userLevel" label="瀛︾骇" :formatter="levelFormatter"/> + <el-table-column prop="userLevel" label="閮ㄩ棬" :formatter="levelFormatter"/> <el-table-column prop="sex" label="鎬у埆" width="60px;" :formatter="sexFormatter"/> <el-table-column prop="phone" label="鎵嬫満鍙�"/> <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" width="160px"/> -- Gitblit v1.8.0