| | |
| | | <div> |
| | | <el-form :inline="true" :model="queryParam" class="demo-form-inline" label-width="80px"> |
| | | <el-form-item> |
| | | <el-input v-model="queryParam.examName" placeholder="请输入考试名称" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-input v-model="queryParam.userName" placeholder="请输入用户名称" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | listLoading: true, |
| | | queryParam: { |
| | | examId: '', |
| | | userId: '', |
| | | userName: '', |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | |
| | | }; |
| | | }, |
| | | created() { |
| | | this.queryParam.examId = this.$route.query.id |
| | | this.search() |
| | | this.queryParam.examId = this.$route.query.id; |
| | | this.queryParam.userId = this.$route.query.userId; |
| | | this.search(); |
| | | }, |
| | | methods: { |
| | | // 获取列表 |
| | |
| | | }, |
| | | handleExport() { |
| | | let that = this |
| | | let url = '/api/admin/examPaperAnswer/exportExcel?examId=' + this.queryParam.examId + '&userName=' + this.queryParam.userName |
| | | let url = '/api/admin/examPaperAnswer/exportExcel?userName=' + this.queryParam.userName; |
| | | if (this.queryParam.userId) url += '&userId=' + this.queryParam.userId; |
| | | if (this.queryParam.examId) url += '&examId=' + this.queryParam.examId; |
| | | var x = new XMLHttpRequest(); |
| | | x.open("POST", url, true); |
| | | x.responseType = "blob"; |
| | |
| | | var url = window.URL.createObjectURL(x.response); |
| | | var a = document.createElement("a"); |
| | | a.href = url; |
| | | a.download = that.tableData[0].examName + '.xlsx'; |
| | | if (that.queryParam.examId) a.download = that.tableData[0].examName + '.xlsx'; |
| | | if (that.queryParam.userId) a.download = that.tableData[0].userName + '.xlsx'; |
| | | a.click(); |
| | | }; |
| | | x.send(); |