提交 ce0cc898 authored 作者: matian's avatar matian

feat:分数排名增加接口

上级 a01b06bc
......@@ -10,7 +10,6 @@
<script>
import { getClassList, exportClass } from '../api'
// import queryString from 'query-string'
export default {
computed: {
......
<template>
<app-container>
<app-list v-bind="tableOptions" ref="list">
<app-list v-bind="tableOptions" ref="list" @sort-change="sortChange">
<!-- 操作 -->
<template v-slot:table-img="{ row }">
<img :src="row.course_picture" alt="" style="width: 100px; height: 100px" />
......@@ -60,6 +60,16 @@ export default {
this.getCourseNameList()
},
methods: {
sortChange(columns) {
console.log(columns, '123')
if (columns.order === 'ascending') {
this.tableOptions.remote.params.sort = columns.prop
} else {
columns.prop = '-' + columns.prop
this.tableOptions.remote.params.sort = columns.prop
}
this.$refs.list.refetch()
},
// 获取课程名称
getCourseNameList() {
getCourseNameList().then(res => {
......
......@@ -29,3 +29,9 @@ export function getExamList(params) {
export function getExamDataInfo(params) {
return httpRequest.get('/api/zy/v3-teacher/statistics/sheet-basic-info', { params })
}
/**
* 考试数据-看板(分数排名)
*/
export function getScoreRanking(params) {
return httpRequest.get('/api/zy/v3-teacher/statistics/sheet-score-ranking', { params })
}
<template>
<app-container>
<app-list v-bind="tableOptions" ref="list">
<app-list v-bind="tableOptions" ref="list" @sort-change="sortChange">
<template v-slot:table-name="{ row }">
<el-button type="text" @click="toPersonal(row)">{{ row.class_name }}</el-button>
</template>
......@@ -58,6 +58,7 @@ export default {
})
},
sortChange(columns) {
console.log(columns, '123')
if (columns.order === 'ascending') {
this.tableOptions.remote.params.sort = columns.prop
} else {
......
......@@ -20,55 +20,24 @@ export default {
tabActive: {
type: String,
default: ''
},
scoreRanking: {
type: Object,
default: () => {}
}
},
computed: {
// 列表配置
tableOptions() {
return {
remote: {},
data: this.scoreRanking.list,
columns: [
{ label: '排名', slots: 'paper_title', prop: 'paper_title', align: 'center' },
{ label: '姓名', prop: 'class_name', align: 'center' },
{ label: '客观题', prop: 'cankao_num', align: 'center', sortable: 'custom', minWidth: 100 },
{ label: '主观题', prop: 'efw', align: 'center', sortable: true, minWidth: 100 },
{ label: '总分', prop: 'average_num', align: 'center', sortable: true },
{ label: '姓名', prop: 'personal_name', align: 'center' },
{ label: '客观题', prop: 'subjective', align: 'center', sortable: 'custom', minWidth: 100 },
{ label: '主观题', prop: 'objective', align: 'center', sortable: true, minWidth: 100 },
{ label: '总分', prop: 'score', align: 'center', sortable: true },
{ label: '操作', slots: 'table_operate', align: 'center' }
],
data: [
{
paper_title: '1',
class_name: '1w1e'
},
{
paper_title: '2',
class_name: '1w1e'
},
{
paper_title: '3',
class_name: '1w1e'
},
{
class_name: '1w1e'
},
{
class_name: '1w1e'
},
{
class_name: '1w1e'
},
{
class_name: '1w1e'
},
{
class_name: '1w1e'
},
{
class_name: '1w1e'
},
{
class_name: '1w1e'
}
]
}
}
......
......@@ -6,45 +6,83 @@
</div>
<el-tabs v-model="tabActive" @tab-click="handleClick">
<el-tab-pane label="已完成" name="finished">
<RankingAll :tabActive="tabActive" />
<RankingAll :tabActive="tabActive" :scoreRanking="scoreRanking" />
</el-tab-pane>
<el-tab-pane label="待评价" name="toEvaluate" lazy>
<RankingAll :tabActive="tabActive" />
<RankingAll :tabActive="tabActive" :scoreRanking="scoreRanking" />
</el-tab-pane>
<el-tab-pane label="未作答" name="noAnswer" lazy>
<RankingAll />
<RankingAll :scoreRanking="scoreRanking" />
</el-tab-pane>
<el-tab-pane label="待提交" name="toSubmit" lazy>
<RankingAll />
<RankingAll :scoreRanking="scoreRanking" />
</el-tab-pane>
</el-tabs>
</el-card>
</template>
<script>
import { getScoreRanking } from '../api'
import RankingAll from './RankingAll.vue'
export default {
components: { RankingAll },
props: {
examination_id: {
type: String,
default: ''
},
course_id: {
type: String,
default: ''
}
},
data() {
return {
tabActive: 'finished'
tabActive: 'finished',
scoreRanking: {}
// status: '1'
}
},
computed: {
status() {
if (this.tabActive === 'finished') {
return '2'
} else if (this.tabActive === 'toEvaluate') {
return '1'
} else if (this.tabActive === 'noAnswer') {
return '100'
} else {
return '0'
}
}
},
created() {
// 已结束
this.getScoreRanking()
},
methods: {
getScoreRanking() {
const params = {
course_id: this.course_id,
examination_id: this.examination_id,
type: 'examination',
status: this.status
}
getScoreRanking(params).then(res => {
this.scoreRanking = res.data
console.log(this.scoreRanking, 'jfdsf')
})
},
handleClick(tab, event) {
// console.log(tab, event)
if (tab.index === 1) {
// 待评价
alert('111')
this.getScoreRanking()
} else if (tab.index === 2) {
// 未作答
alert('222')
this.getScoreRanking()
} else {
// 未提交
alert('333')
this.getScoreRanking()
}
}
}
......
......@@ -19,7 +19,9 @@
<el-col :span="7"><score :dataInfo="dataInfo" /></el-col>
</el-row>
<el-row :gutter="10" class="row-bg">
<el-col :span="12" class="col"><ScoreRanking /></el-col>
<el-col :span="12" class="col"
><ScoreRanking :course_id="$route.query.course_id" :examination_id="$route.query.examination_id"
/></el-col>
<el-col :span="11"><TitleData /></el-col>
</el-row>
<el-row :gutter="10" class="row-bg">
......@@ -68,7 +70,8 @@ export default {
}
],
value: '',
dataInfo: {}
dataInfo: {},
scoreRanking: {} // 分数排名
}
},
created() {
......
......@@ -63,7 +63,7 @@ export default {
{ label: '最低分', prop: 'min', align: 'center' },
{ label: '题目总数', prop: 'question_num', align: 'center' },
{ label: '及格率', prop: 'pass_rate', align: 'center' },
{ label: '操作', slots: 'table-operate', align: 'center', width: '150' }
{ label: '操作', slots: 'table-operate', align: 'center', minWidth: 150 }
]
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论