<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" size="small" placeholder="请输入姓名" clearable @input="search()"></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>
|