提交 ebd09796 authored 作者: lihuihui's avatar lihuihui

update:对接考试数据详情

上级 bcb2d9a7
<template> <template>
<div> <div>
<!-- <div class="exam-detail" v-for="(data, index) in examData" :key="index"> <div class="exam-detail" v-for="(data, index) in examData" :key="index">
<div class="title-type">{{ questionTypeText[data.question_type] }}</div> <div class="title-type">{{ questionTypeText[data.question_type] }}</div>
<template v-for="pItem in data.list"> <template v-for="pItem in data.list">
<question-list-item <question-list-item
...@@ -10,13 +10,6 @@ ...@@ -10,13 +10,6 @@
:key="item.id" :key="item.id"
></question-list-item> ></question-list-item>
</template> </template>
</div> -->
<div class="exam-detail" v-if="examData.length">
<!-- <div class="title-type">{{ questionTypeText[examData[0].question_type] }}</div> -->
<question-list-item
:data="examData[0].list[0][0]"
:question="examData[0]"
></question-list-item>
</div> </div>
</div> </div>
</template> </template>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</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 === 'finished'">查看</el-button>
<el-button type="text" @click="toDetail(row)" v-else-if="tabActive === 'toEvaluate'">批阅</el-button> <el-button type="text" @click="toReview(row)" v-else-if="tabActive === 'toEvaluate'">批阅</el-button>
<div v-else>-</div> <div v-else>-</div>
</template> </template>
</app-list> </app-list>
...@@ -43,7 +43,24 @@ export default { ...@@ -43,7 +43,24 @@ export default {
} }
}, },
methods: { methods: {
toDetail() {}, toDetail(data) {
this.$router.push({
path: '/teacher/data/exam/examData/classDetail',
query: {
id: data.id
}
})
},
toReview(data) {
this.$router.push({
path: '/teacher/exam/exam/review',
query: {
sheet_id: data.id,
stu_id: data.student_id
}
})
console.log(data)
},
// 根据首次缴费时间排序 // 根据首次缴费时间排序
sortChange(columns) { sortChange(columns) {
if (columns.order === 'ascending') { if (columns.order === 'ascending') {
......
...@@ -6,7 +6,7 @@ const routes = [ ...@@ -6,7 +6,7 @@ const routes = [
{ path: '/teacher/data/exam', component: () => import('./views/List.vue') }, { path: '/teacher/data/exam', component: () => import('./views/List.vue') },
{ path: '/teacher/data/exam/class', component: () => import('./views/ClassList.vue') }, { path: '/teacher/data/exam/class', component: () => import('./views/ClassList.vue') },
{ path: '/teacher/data/exam/PersonalList', component: () => import('./views/PersonalList.vue') }, { path: '/teacher/data/exam/PersonalList', component: () => import('./views/PersonalList.vue') },
{ path: '/teacher/data/exam/classDetail', component: () => import('./views/ClassDetail.vue') }, { path: '/teacher/data/exam/examData/classDetail', component: () => import('./views/ClassDetail.vue') },
{ path: '/teacher/data/exam/examData', component: () => import('./views/ExamData.vue') }, { path: '/teacher/data/exam/examData', component: () => import('./views/ExamData.vue') },
{ path: '/teacher/data/exam/examData/topicData', component: () => import('./views/TopicData.vue') } { path: '/teacher/data/exam/examData/topicData', component: () => import('./views/TopicData.vue') }
] ]
......
...@@ -19,14 +19,14 @@ export default { ...@@ -19,14 +19,14 @@ export default {
examData: [], examData: [],
infoData: [ infoData: [
[ [
{ title: '考生姓名', value: '王大坝' }, { title: '考生姓名', value: '王大坝', key: 'personal_name' },
{ title: '学号', value: 'test001' }, { title: '学号', value: 'test001', key: 'sno' },
{ title: '分数', value: '100' } { title: '分数', value: '100', key: 'score' }
], ],
[ [
{ title: '提交日期', value: '2021-11-30 10:43:00' }, { title: '提交日期', value: '2021-11-30 10:43:00', key: 'created_time' },
{ title: '批改日期', value: '2021-11-30 10:43:00' }, { title: '批改日期', value: '2021-11-30 10:43:00', key: 'updated_time' },
{ title: '状态', value: '已批阅' } { title: '状态', value: '已批阅', key: 'status' }
] ]
] ]
} }
...@@ -37,8 +37,16 @@ export default { ...@@ -37,8 +37,16 @@ export default {
}, },
methods: { methods: {
getTopic() { getTopic() {
api.getReviewDetails({ sheet_id: '6869950724323672064' }).then(response => { api.getReviewDetails({ sheet_id: this.$route.query.id }).then(response => {
this.data = JSON.parse(response.data).sheet this.data = JSON.parse(response.data).sheet
const status = { 3: '考卷生成', 0: '已缓存', 1: '已提交', 2: '已批阅' }
this.infoData = this.infoData.reduce((a, b) => {
a.push(b.map(item => {
item.key === 'status' ? item.value = status[this.data[item.key]] : item.value = this.data[item.key]
return item
}))
return a
}, [])
this.setExamData() this.setExamData()
}) })
}, },
......
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
}, },
methods: { methods: {
getTopic() { getTopic() {
api.getReviewDetails({ sheet_id: '6869950724323672064' }).then(response => { api.getReviewDetails({ sheet_id: this.$route.query.id }).then(response => {
this.data = JSON.parse(response.data).sheet this.data = JSON.parse(response.data).sheet
this.setExamData() this.setExamData()
}) })
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论