| | |
| | | export default { |
| | | page: query => post('/api/admin/examPaperAnswer/page', query), |
| | | pageExamPaper: query => post('/api/admin/examPaperAnswer/pageExamPaper', query), |
| | | pageUser: query => post('/api/admin/examPaperAnswer/pageUser', query), |
| | | read: id => post('/api/admin/examPaperAnswer/read/' + id) |
| | | } |
| | |
| | | alwaysShow: true, |
| | | children: [ |
| | | { |
| | | path: 'list', |
| | | path: 'answer-list', |
| | | component: () => import('@/views/answer/list'), |
| | | name: 'AnswerPageList', |
| | | meta: { title: '答卷列表', noCache: true } |
| | | }, |
| | | { |
| | | path: 'answer-list', |
| | | path: 'answer-info', |
| | | component: () => import('@/views/answer/info'), |
| | | name: 'answerList', |
| | | meta: { title: '答卷信息', noCache: true }, |
| | |
| | | name: 'answerDetail', |
| | | meta: { title: '答卷详情', noCache: true }, |
| | | hidden: true |
| | | }, |
| | | { |
| | | path: 'answer-user', |
| | | component: () => import('@/views/answer/user'), |
| | | name: 'AnswerPageList', |
| | | meta: { title: '答卷次数', noCache: true } |
| | | } |
| | | ] |
| | | }, |
| | |
| | | <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(); |
| | |
| | | <el-table v-loading="listLoading" :data="tableData" border style="width: 100%;"> |
| | | <el-table-column align="center" prop="examName" label="考试名称" /> |
| | | <el-table-column align="center" prop="paperName" label="试卷名称" /> |
| | | <el-table-column align="center" prop="subjectName" label="科目" /> |
| | | <!-- <el-table-column align="center" prop="subjectName" label="科目" /> --> |
| | | <el-table-column align="center" prop="paperType" label="试卷类型" width="150px"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.paperType === 1">固定试卷</span> |
| | |
| | | }) |
| | | }, |
| | | view(row) { |
| | | this.$router.push({ path: '/answer/answer-list', query: { id: row.id } }); |
| | | this.$router.push({ path: '/answer/answer-info', query: { id: row.id } }); |
| | | }, |
| | | ...mapActions('exam', { initSubject: 'initSubject' }) |
| | | }, |
New file |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :inline="true" :model="queryParam" class="demo-form-inline" label-width="80px"> |
| | | <el-form-item> |
| | | <el-input v-model="queryParam.name" placeholder="请输入姓名" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button style="width:100px;" type="primary" size="small" @click="search()">查询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-table v-loading="listLoading" :data="tableData" border style="width: 100%;"> |
| | | <el-table-column align="center" prop="userName" label="姓名" /> |
| | | <el-table-column align="center" prop="examCount" label="考试次数" /> |
| | | <el-table-column label="操作" 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" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { mapGetters, mapState, mapActions } from 'vuex' |
| | | import Pagination from '@/components/Pagination' |
| | | import examPaperAnswerApi from '@/api/examPaperAnswer' |
| | | |
| | | export default { |
| | | components: { Pagination }, |
| | | data () { |
| | | return { |
| | | listLoading: true, |
| | | queryParam: { |
| | | name: '', |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | formLoading: false, |
| | | total: 0, |
| | | tableData: [], |
| | | visible: false |
| | | }; |
| | | }, |
| | | created () { |
| | | this.initSubject() |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | // 获取列表 |
| | | search() { |
| | | this.listLoading = true |
| | | examPaperAnswerApi.pageUser(this.queryParam).then(re => { |
| | | this.tableData = re.data.list |
| | | this.total = re.data.total |
| | | this.queryParam.pageSize = re.data.pageSize |
| | | this.queryParam.pageIndex = re.data.pageNum |
| | | this.listLoading = false |
| | | }) |
| | | }, |
| | | view(row) { |
| | | this.$router.push({ path: '/answer/answer-info', query: { userId: row.id } }); |
| | | }, |
| | | ...mapActions('exam', { initSubject: 'initSubject' }) |
| | | }, |
| | | computed: { |
| | | ...mapGetters('enumItem', ['enumFormat']), |
| | | ...mapGetters('exam', ['subjectEnumFormat']), |
| | | ...mapState('exam', { subjects: state => state.subjects }) |
| | | } |
| | | } |
| | | </script> |