| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParam" ref="queryForm" :inline="true"> |
| | | <el-form-item label="学科:" > |
| | | <el-select v-model="queryParam.subjectId" clearable> |
| | | <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-select v-model="queryParam.subjectId" placeholder="请选择科目" clearable multiple @change="search"> |
| | | <el-option v-for="item in subjects" :key="item.id" :value="item.id" :label="item.name"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="submitForm">查询</el-button> |
| | | <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 fit highlight-current-row style="width: 100%"> |
| | | <el-table-column prop="id" label="Id" width="100" /> |
| | | <el-table-column prop="paperName" label="试卷名称"/> |
| | | <el-table-column prop="userName" label="用户名称"/> |
| | | <el-table-column label="得分" width="100px" > |
| | | <el-table v-loading="listLoading" :data="tableData" border style="width: 100%;"> |
| | | <el-table-column align="center" prop="paperName" label="试卷名称" /> |
| | | <el-table-column align="center" prop="subjectName" label="科目" /> |
| | | <el-table-column align="center" prop="paperType" label="试卷类型" width="150px"> |
| | | <template slot-scope="{row}"> |
| | | {{row.userScore}} / {{row.paperScore}} |
| | | <span v-if="row.paperType === 1">固定试卷</span> |
| | | <span v-if="row.paperType === 2">随机试卷</span> |
| | | <span v-if="row.paperType === 3">顺序试卷</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="题目对错" width="80px" > |
| | | <el-table-column align="center" prop="questionCount" label="题目数量" width="100px" /> |
| | | <el-table-column align="center" prop="systemScore" label="总分" width="100px" /> |
| | | <el-table-column align="center" prop="suggestTime" label="建议时长" width="100px" /> |
| | | <el-table-column align="center" prop="personAnswerNum" label="参考人数" width="100px"> |
| | | <template slot-scope="{row}"> |
| | | {{row.questionCorrect}} / {{row.questionCount}} |
| | | <span>{{ row.personAnswerNum + "/" + row.personTotalNum }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="doTime" label="耗时" width="100px"/> |
| | | <el-table-column prop="createTime" label="提交时间" width="160px"/> |
| | | <el-table-column align="center" prop="userName" label="创建人" width="100px" /> |
| | | <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"/> |
| | | <pagination v-show="total > 0" :total="total" :page.sync="queryParam.pageIndex" |
| | | :limit.sync="queryParam.pageSize" @pagination="search" /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | |
| | | import { mapGetters, mapState, mapActions } from 'vuex' |
| | | import Pagination from '@/components/Pagination' |
| | | import examPaperAnswerApi from '@/api/examPaperAnwser' |
| | | import examPaperAnswerApi from '@/api/examPaperAnswer' |
| | | |
| | | export default { |
| | | components: { Pagination }, |
| | | data () { |
| | | return { |
| | | listLoading: true, |
| | | queryParam: { |
| | | subjectId: null, |
| | | name: '', |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | listLoading: false, |
| | | formLoading: false, |
| | | total: 0, |
| | | tableData: [], |
| | | total: 0 |
| | | } |
| | | visible: false |
| | | }; |
| | | }, |
| | | created () { |
| | | this.initSubject() |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | search () { |
| | | // 获取列表 |
| | | search() { |
| | | this.listLoading = true |
| | | examPaperAnswerApi.page(this.queryParam).then(data => { |
| | | const re = data.data |
| | | this.tableData = re.list |
| | | this.total = re.total |
| | | this.queryParam.pageIndex = re.pageNum |
| | | examPaperAnswerApi.pageExamPaper(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 |
| | | }) |
| | | }, |
| | | submitForm () { |
| | | this.queryParam.pageIndex = 1 |
| | | this.search() |
| | | view(row) { |
| | | this.$router.push({ path: '/answer/answer-list', query: { id: row.id } }); |
| | | }, |
| | | ...mapActions('exam', { initSubject: 'initSubject' }) |
| | | }, |