提交 3cda328b authored 作者: matian's avatar matian

代码提交

上级 3791d0b1
......@@ -4,14 +4,15 @@
<div :class="`paper-title active${row.ranking}`">{{ row.ranking }}</div>
</template>
<template v-slot:table_operate="{ row }">
<el-button type="text" @click="toDetail(row)" v-if="tabActive === 'finished'">查看</el-button>
<el-button type="text" @click="toReview(row)" v-else-if="tabActive === 'toEvaluate'">批阅</el-button>
<el-button type="text" @click="toDetail(row)" v-if="tabActive === '2'">查看</el-button>
<el-button type="text" @click="toReview(row)" v-else-if="tabActive === '1'">批阅</el-button>
<div v-else>-</div>
</template>
</app-list>
</template>
<script>
import { getScoreRanking } from '../api'
export default {
data() {
return {}
......@@ -30,7 +31,11 @@ export default {
// 列表配置
tableOptions() {
return {
data: this.scoreRanking.list,
remote: {
httpRequest: getScoreRanking,
params: Object.assign({ status: this.tabActive }, this.scoreRanking),
callback: this.handleCallback
},
columns: [
{ label: '排名', slots: 'paper_title', prop: 'ranking', align: 'center' },
{ label: '姓名', prop: 'personal_name', align: 'center', minWidth: 150 },
......@@ -43,6 +48,17 @@ export default {
}
}
},
watch: {
tabActive(nv) {
console.log(nv)
this.tableOptions.remote.params.status = nv
console.log(this.tableOptions.remote.params, '=123')
this.$refs.list.refetch()
}
},
mounted() {
console.log(this.tabActive, '-87888')
},
methods: {
toDetail(data) {
this.$router.push({
......@@ -70,6 +86,10 @@ export default {
columns.prop = '-' + columns.prop
this.$parent.$parent.$parent.$parent.getScoreRanking()
}
},
handleCallback(val) {
this.$emit('resCount', val)
return val.list
}
}
}
......
......@@ -11,25 +11,26 @@
>导出</el-button
>
</div>
<el-tabs v-model="tabActive" @tab-click="handleClick">
<el-tab-pane :label="`已完成${scoreRanking.checked_count}`" name="finished">
<RankingAll :tabActive="tabActive" :scoreRanking="scoreRanking" />
<el-tabs v-model="tabActive">
<el-tab-pane :label="`已完成${count.checked_count}`" name="finished">
<!-- <RankingAll :tabActive="tabActive" :scoreRanking="scoreRanking" /> -->
</el-tab-pane>
<el-tab-pane :label="`待评价${scoreRanking.commit_count}`" name="toEvaluate" lazy>
<RankingAll :tabActive="tabActive" :scoreRanking="scoreRanking" />
<el-tab-pane :label="`待评价${count.commit_count}`" name="toEvaluate" lazy>
<!-- <RankingAll :tabActive="tabActive" :scoreRanking="scoreRanking" /> -->
</el-tab-pane>
<el-tab-pane :label="`未作答${scoreRanking.no_sheet_count}`" name="noAnswer" lazy>
<RankingAll :scoreRanking="scoreRanking" />
<el-tab-pane :label="`未作答${count.no_sheet_count}`" name="noAnswer" lazy>
<!-- <RankingAll :scoreRanking="scoreRanking" /> -->
</el-tab-pane>
<el-tab-pane :label="`未提交${scoreRanking.cache_count}`" name="toSubmit" lazy>
<RankingAll :scoreRanking="scoreRanking" />
<el-tab-pane :label="`未提交${count.cache_count}`" name="toSubmit" lazy>
<!-- <RankingAll :scoreRanking="scoreRanking" /> -->
</el-tab-pane>
<RankingAll :tabActive="tabStatus" :scoreRanking="scoreRanking" @resCount="handleResCount" />
</el-tabs>
</el-card>
</template>
<script>
import { getScoreRanking, exportScoreList } from '../api'
import { exportScoreList } from '../api'
import RankingAll from './RankingAll.vue'
export default {
components: { RankingAll },
......@@ -59,11 +60,24 @@ export default {
data() {
return {
tabActive: 'finished',
scoreRanking: {}
scoreRanking: {
course_id: this.course_id,
examination_id: this.examination_id,
chapter_id: this.chapter_id,
type: this.type,
// status: this.status,ƒ
class_id: this.classValue
},
count: {
checked_count: 0,
commit_count: 0,
no_sheet_count: 0,
cache_count: 0
}
}
},
computed: {
status() {
tabStatus() {
if (this.tabActive === 'finished') {
return '2'
} else if (this.tabActive === 'toEvaluate') {
......@@ -75,24 +89,25 @@ export default {
}
}
},
created() {
this.getScoreRanking()
},
// created() {
// this.getScoreRanking()
// },
methods: {
getScoreRanking() {
const params = {
course_id: this.course_id,
examination_id: this.examination_id,
chapter_id: this.chapter_id,
type: this.type,
status: this.status,
class_id: this.classValue,
page_size: 10
}
getScoreRanking(params).then(res => {
this.scoreRanking = res.data
})
},
// getScoreRanking() {
// const params = {
// course_id: this.course_id,
// examination_id: this.examination_id,
// chapter_id: this.chapter_id,
// type: this.type,
// status: this.status,
// class_id: this.classValue,
// page_size: 10
// }
// getScoreRanking(params).then(res => {
// this.scoreRanking = res.data
// })
// },
handleClick(tab, event) {
if (tab.index === 1) {
// 待评价
......@@ -105,6 +120,9 @@ export default {
this.getScoreRanking()
}
},
handleResCount(val) {
this.count = val
},
// 导出
exportScore() {
const params = {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论