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

代码提交

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