feat: 问题修复

This commit is contained in:
cgd_mac 2022-02-25 19:11:20 +08:00
parent 609df93e42
commit 9835434ab9
3 changed files with 46 additions and 17 deletions

View File

@ -17,7 +17,7 @@
</a-col>
<a-col class="title-info">
<span class="label">开始时间</span>
<span class="value">{{ data.startDate }}</span>
<span class="value">{{ data.startDate | dayjs }}</span>
</a-col>
<a-col class="title-info">
<span class="label">学习状态</span>

View File

@ -1,7 +1,7 @@
<template>
<div>
<a-row style="margin-bottom: 20px;">
<a-button @click="handlerExam" type="primary">写作业</a-button>
<a-row style="margin-bottom: 15px;">
<a-button icon="plus" @click="handlerExam" type="primary">写作业</a-button>
</a-row>
<template v-if="dataList && dataList.length > 0">
<a-card v-for="(item, index) in dataList" :key="index" style="margin-bottom: 15px;">

View File

@ -1,9 +1,15 @@
<template>
<div>
<a-table :columns="columns" :data-source="dataList">
<a-row style="margin-bottom: 15px;">
<a-button icon="plus" @click="handlerGoExam" type="primary">模拟测试</a-button>
</a-row>
<a-table :columns="columns" :data-source="dataList" rowKey="id">
<template slot="timeSlot" slot-scope="text, record">
{{ record.timeSlot }}<a-button @click="handlerGoExam(record)" style="margin-left: 6px;" type="primary" size="small">进入考试</a-button>
{{ record.timeSlot }}
</template>
<span slot="action" slot-scope="text, record">
<a @click="handlerDetail(record)">查看详情</a>
</span>
</a-table>
</div>
</template>
@ -15,14 +21,29 @@ export default {
return {
columns: [
{ dataIndex: 'testName', title: '课程' },
{ dataIndex: 'assessMode', title: '考核方式' },
{ dataIndex: 'testManner', title: '考试方式' },
{ dataIndex: 'submitWay', title: '提交形式' },
{ dataIndex: 'timeSlot', title: '考试时间段', scopedSlots: { customRender: 'timeSlot' } },
{ dataIndex: 'examTime', title: '考试时长' }
{ dataIndex: 'assessMode', title: '考核方式', align: 'center' },
{ dataIndex: 'testManner', title: '考试方式', align: 'center' },
{ dataIndex: 'submitWay', title: '提交形式', align: 'center' },
{
dataIndex: 'timeSlot',
title: '考试时间段',
align: 'center',
scopedSlots: { customRender: 'timeSlot' }
},
{
dataIndex: 'examTime',
title: '考试时长',
align: 'center',
customRender: value => `${value || 0}分钟`
},
{
title: '操作',
width: '150px',
dataIndex: 'action',
scopedSlots: { customRender: 'action' }
}
],
dataList: [
]
dataList: []
}
},
mounted () {
@ -31,16 +52,24 @@ export default {
methods: {
initData () {
const { person } = this.$store.state.user
reqSimulateTestList({ personId: person.id, projectId: this.$route.query.courseId }).then(res => {
// console.log('', res)
this.dataList = res.data
})
reqSimulateTestList({ personId: person.id, projectId: this.$route.query.courseId }).then(
res => {
// console.log('', res)
this.dataList = res.data
}
)
},
handlerGoExam (row) {
handlerGoExam () {
this.$router.push({
path: '/myexamDetail',
query: { type: 'test', projectId: this.$route.query.courseId }
})
},
handlerDetail (data) {
this.$router.push({
path: '/myreport',
query: { type: 'practice', reportId: data.reportId }
})
}
}
}