| | |
| | | <el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%"> |
| | | <el-table-column prop="subjectId" label="课目" :formatter="subjectFormatter" width="120px" /> |
| | | <el-table-column prop="name" label="名称" /> |
| | | <el-table-column label="操作" align="center" width="160px"> |
| | | <el-table-column label="操作" align="center" width="260px"> |
| | | <template slot-scope="{row}"> |
| | | <el-button size="mini" @click="$router.push({path:'/exam/personalSimulation/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> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapGetters, mapState, mapActions } from 'vuex' |
| | | import { mapActions, mapGetters, mapState } from 'vuex' |
| | | import Pagination from '@/components/Pagination' |
| | | import examPaperApi from '@/api/examPaper' |
| | | |
| | |
| | | this.subjectFilter = this.subjects |
| | | }, |
| | | methods: { |
| | | handleExport(row){ |
| | | let fileName = row.name +'.xls' |
| | | let url ='/api/admin/exam/count/exportTemplatesSheet/'+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(); |
| | | |
| | | // examPaperApi.uploadEnrolmentsa(row.id).then(res=> { |
| | | // console.log(res) |
| | | |
| | | |
| | | |
| | | // const link = document.createElement('a'); //创建一个a标签 |
| | | // const blob = new Blob([res.data]);//这里res.data根据返回值来定的.data是blob对象 |
| | | // link.style.display = 'none'; |
| | | // link.href = URL.createObjectURL(blob); //将后端返回的数据通过blob转换为一个地址 |
| | | // //设置下载下来后文件的名字以及文件格式 |
| | | // link.setAttribute( |
| | | // 'download', |
| | | // `xxx.` + `xlsx`, |
| | | // ); |
| | | // document.body.appendChild(link); |
| | | // link.click(); //下载该文件 |
| | | // document.body.removeChild(link); |
| | | |
| | | // }) |
| | | }, |
| | | submitForm () { |
| | | this.queryParam.pageIndex = 1 |
| | | this.search() |