<template>
|
<div class="app-container">
|
<el-form :model="queryParam" ref="queryForm" :inline="true " style="display: flex">
|
<el-form-item label="考试时间:" >
|
<el-date-picker
|
v-model="timeRange"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
type="daterange"
|
@change="updateTime"
|
range-separator="至"
|
start-placeholder="开始日期"
|
end-placeholder="结束日期">
|
</el-date-picker>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" @click="search">查询</el-button>
|
</el-form-item>
|
</el-form>
|
|
<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="counts" label="考试次数" width="160px"/>
|
<el-table-column label="操作" align="center" width="300px">
|
<template slot-scope="{row}">
|
<el-button size="mini"
|
@click="$router.push({path:'/answer/achievementStatistics/gradeDetails',query:{id:row.id, userId:row.userId, createUser:row.createUser, start:queryParam.start, end: queryParam.end}})" >
|
查看</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/examPaperAnwser'
|
import AchievementStatistics from "@/api/AchievementStatistics";
|
|
export default {
|
components: { Pagination },
|
data () {
|
return {
|
timeRange: [],
|
avgSource: null,
|
queryParam: {
|
start: null,
|
end: null,
|
subjectId: null,
|
pageIndex: 1,
|
pageSize: 10
|
},
|
listLoading: false,
|
tableData: [],
|
total: 0
|
}
|
},
|
created () {
|
this.initSubject()
|
this.search()
|
},
|
methods: {
|
updateTime (value) {
|
if (value && value.length > 0) {
|
if (this.timeRange && this.timeRange.length > 0) {
|
this.queryParam.start = this.timeRange[0]
|
this.queryParam.end = this.timeRange[1]
|
}
|
} else {
|
this.queryParam.start = null
|
this.queryParam.end = null
|
}
|
},
|
search () {
|
this.listLoading = true
|
AchievementStatistics.page(this.queryParam).then(data => {
|
const re = data.response
|
this.avgSource = re.list[0].avgSource
|
this.tableData = re.list
|
this.total = re.total
|
this.queryParam.pageIndex = re.pageNum
|
this.listLoading = false
|
})
|
},
|
...mapActions('exam', { initSubject: 'initSubject' })
|
},
|
computed: {
|
...mapGetters('enumItem', ['enumFormat']),
|
...mapGetters('exam', ['subjectEnumFormat']),
|
...mapState('exam', { subjects: state => state.subjects })
|
}
|
}
|
</script>
|