提交 6ec7fc37 authored 作者: matian's avatar matian

代码提交

上级 82c204f9
......@@ -12,6 +12,7 @@
</template>
<script>
import { getClassList } from '../api'
export default {
data() {
return {}
......@@ -21,32 +22,20 @@ export default {
type: String,
default: ''
},
classList: {
paramList: {
type: Object,
default: () => {}
},
course_id: {
type: String,
default: ''
},
examination_id: {
type: String,
default: ''
},
chapter_id: {
type: String,
default: ''
},
type: {
type: String,
default: ''
}
},
computed: {
// 列表配置
tableOptions() {
return {
data: this.classList.list,
remote: {
httpRequest: getClassList,
params: Object.assign({ status: this.tabActive, sort: '' }, this.paramList),
callback: this.handleCallback
},
columns: [
{
label: '排名',
......@@ -66,31 +55,32 @@ export default {
}
}
},
mounted() {
},
methods: {
toPersonal(row) {
this.$router.push({
path: '/teacher/data/exam/PersonalList',
query: {
class_id: row.class_id,
params: {
course_id: this.course_id,
examination_id: this.examination_id,
chapter_id: this.chapter_id,
type: this.type
}
course_id: this.paramList.course_id,
examination_id: this.paramList.examination_id,
chapter_id: this.paramList.chapter_id,
type: this.paramList.type,
status: this.tabActive
}
})
},
sortChange(columns) {
if (columns.order === 'ascending') {
this.$parent.$parent.$parent.$parent.getClassList()
return columns.prop
this.tableOptions.remote.params.sort = columns.prop
} else {
columns.prop = '-' + columns.prop
this.$parent.$parent.$parent.$parent.getClassList()
this.tableOptions.remote.params.sort = columns.prop
}
this.$refs.list.refetch()
},
handleCallback(val) {
this.$emit('resCount', val)
return val.list
}
}
}
......
......@@ -33,7 +33,7 @@ export default {
return {
remote: {
httpRequest: getScoreRanking,
params: Object.assign({ status: this.tabActive }, this.scoreRanking),
params: Object.assign({ status: this.tabActive, sort: '' }, this.scoreRanking),
callback: this.handleCallback
},
columns: [
......@@ -58,9 +58,6 @@ export default {
// })
}
},
mounted() {
console.log(this.tabActive, '-87888')
},
methods: {
toDetail(data) {
this.$router.push({
......@@ -82,12 +79,12 @@ export default {
// 根据首次缴费时间排序
sortChange(columns) {
if (columns.order === 'ascending') {
this.$parent.$parent.$parent.$parent.getScoreRanking()
return columns.prop
this.tableOptions.remote.params.sort = columns.prop
} else {
columns.prop = '-' + columns.prop
this.$parent.$parent.$parent.$parent.getScoreRanking()
this.tableOptions.remote.params.sort = columns.prop
}
this.$refs.list.refetch()
},
handleCallback(val) {
this.$emit('resCount', val)
......
......@@ -12,18 +12,10 @@
>
</div>
<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="`待评价${count.commit_count}`" name="toEvaluate" lazy>
<!-- <RankingAll :tabActive="tabActive" :scoreRanking="scoreRanking" /> -->
</el-tab-pane>
<el-tab-pane :label="`未作答${count.no_sheet_count}`" name="noAnswer" lazy>
<!-- <RankingAll :scoreRanking="scoreRanking" /> -->
</el-tab-pane>
<el-tab-pane :label="`未提交${count.cache_count}`" name="toSubmit" lazy>
<!-- <RankingAll :scoreRanking="scoreRanking" /> -->
</el-tab-pane>
<el-tab-pane :label="`已完成${count.checked_count}`" name="finished"> </el-tab-pane>
<el-tab-pane :label="`待评价${count.commit_count}`" name="toEvaluate" lazy> </el-tab-pane>
<el-tab-pane :label="`未作答${count.no_sheet_count}`" name="noAnswer" lazy> </el-tab-pane>
<el-tab-pane :label="`未提交${count.cache_count}`" name="toSubmit" lazy> </el-tab-pane>
<RankingAll :tabActive="tabStatus" :scoreRanking="scoreRanking" @resCount="handleResCount" :key="tabStatus" />
</el-tabs>
</el-card>
......@@ -35,22 +27,6 @@ import RankingAll from './RankingAll.vue'
export default {
components: { RankingAll },
props: {
examination_id: {
type: String,
default: ''
},
course_id: {
type: String,
default: ''
},
chapter_id: {
type: String,
default: ''
},
type: {
type: String,
default: ''
},
dataInfo: {},
classValue: {
type: String,
......@@ -65,7 +41,6 @@ export default {
examination_id: this.examination_id,
chapter_id: this.chapter_id,
type: this.type,
// status: this.status,ƒ
class_id: this.classValue
},
count: {
......@@ -89,25 +64,7 @@ export default {
}
}
},
// 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
// })
// },
handleClick(tab, event) {
if (tab.index === 1) {
// 待评价
......
......@@ -6,43 +6,12 @@
班级排名
</h1>
<el-button type="text" style="float: right; margin-top: -40px" @click="exportClassList">导出</el-button>
<el-tabs v-model="tabActive" style="margin-top: 30px" @tab-click="handleClick">
<el-tab-pane :label="`已结束${classList.checked_count}`" name="finished">
<Finished
:classList="classList"
:course_id="$route.query.course_id"
:examination_id="$route.query.examination_id"
:chapter_id="$route.query.chapter_id"
:type="$route.query.type"
/>
</el-tab-pane>
<el-tab-pane :label="`待评价${classList.commit_count}`" name="toEvaluate" lazy>
<Finished
:classList="classList"
:course_id="$route.query.course_id"
:examination_id="$route.query.examination_id"
:chapter_id="$route.query.chapter_id"
:type="$route.query.type"
/>
</el-tab-pane>
<el-tab-pane :label="`未作答${classList.no_sheet_count}`" name="noAnswer" lazy>
<Finished
:classList="classList"
:course_id="$route.query.course_id"
:examination_id="$route.query.examination_id"
:chapter_id="$route.query.chapter_id"
:type="$route.query.type"
/>
</el-tab-pane>
<el-tab-pane :label="`未提交${classList.cache_count}`" name="toSubmit" lazy>
<Finished
:classList="classList"
:course_id="$route.query.course_id"
:examination_id="$route.query.examination_id"
:chapter_id="$route.query.chapter_id"
:type="$route.query.type"
/>
</el-tab-pane>
<el-tabs v-model="tabActive" style="margin-top: 30px">
<el-tab-pane :label="`已结束${count.checked_count}`" name="finished"> </el-tab-pane>
<el-tab-pane :label="`待评价${count.commit_count}`" name="toEvaluate" lazy> </el-tab-pane>
<el-tab-pane :label="`未作答${count.no_sheet_count}`" name="noAnswer" lazy> </el-tab-pane>
<el-tab-pane :label="`未提交${count.cache_count}`" name="toSubmit" lazy> </el-tab-pane>
<Finished :paramList="paramList" :tabActive="tabStatus" :key="tabStatus" @resCount="handleResCount" />
</el-tabs>
</app-card>
</div>
......@@ -50,18 +19,29 @@
<script>
import Finished from '../components/Finished.vue'
import { getClassList, exportClassList } from '../api'
import { exportClassList } from '../api'
export default {
components: { Finished },
data() {
return {
tabActive: 'finished',
classList: {}
paramList: {
course_id: this.$route.query.course_id,
examination_id: this.$route.query.examination_id,
chapter_id: this.$route.query.chapter_id,
type: this.$route.query.type
},
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') {
......@@ -73,33 +53,21 @@ export default {
}
}
},
created() {
this.getClassList()
},
methods: {
getClassList() {
const params = {
course_id: this.$route.query.course_id,
examination_id: this.$route.query.examination_id,
chapter_id: this.$route.query.chapter_id,
type: this.$route.query.type,
status: this.status
}
getClassList(params).then(res => {
this.classList = res.data
})
},
handleClick(tab, event) {
if (tab.index === 1) {
// 待评价
this.getClassList()
} else if (tab.index === 2) {
// 未作答
this.getClassList()
} else {
this.getClassList()
}
handleResCount(val) {
this.count = val
},
// handleClick(tab, event) {
// if (tab.index === 1) {
// // 待评价
// this.getClassList()
// } else if (tab.index === 2) {
// // 未作答
// this.getClassList()
// } else {
// this.getClassList()
// }
// },
// 导出
exportClassList() {
const params = {
......
......@@ -25,17 +25,17 @@ export default {
remote: {
httpRequest: getClassDetail,
params: {
type: this.$route.query.params.type,
course_id: this.$route.query.params.course_id,
examination_id: this.$route.query.params.examination_id,
chapter_id: this.$route.query.params.chapter_id,
type: this.$route.query.type,
course_id: this.$route.query.course_id,
examination_id: this.$route.query.examination_id,
chapter_id: this.$route.query.chapter_id,
class_id: this.$route.query.class_id,
status: this.$route.query.params.status
status: this.$route.query.status
}
},
filters: [{ type: 'input', prop: 'personal_name', placeholder: '学生姓名', label: '学生姓名' }],
columns: [
{ label: '学生姓名', prop: 'personal_name', slots: 'table-name' },
{ label: '学生姓名', prop: 'personal_name', align: 'center' },
{ label: '总得分', prop: 'score', align: 'center', sortable: 'custom' },
{ label: '主观题得分', prop: 'subjective', align: 'center', sortable: 'custom' },
{ label: '客观题得分', prop: 'objective', align: 'center', sortable: 'custom' },
......@@ -48,12 +48,12 @@ export default {
},
methods: {
toExamData(row) {
// this.$router.push({
// path: '/teacher/data/exam/classDetail',
// query: {
// row: row
// }
// })
this.$router.push({
path: '/teacher/data/exam/examData/classDetail',
query: {
id: row.id
}
})
},
sortChange(columns) {
if (columns.order === 'ascending') {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论