2019-10-22 13:40:42 +08:00
|
|
|
<template>
|
|
|
|
<div style="height: 100%; padding-bottom: 20px">
|
|
|
|
<el-card>
|
|
|
|
<div slot="header" style="text-align: center;">
|
2019-10-23 13:33:09 +08:00
|
|
|
<b>{{ $t('global.examSystem') }}</b>
|
2019-10-22 13:40:42 +08:00
|
|
|
</div>
|
|
|
|
</el-card>
|
|
|
|
<el-card v-loading="loading">
|
|
|
|
<el-table
|
|
|
|
:data="tableData"
|
|
|
|
border
|
|
|
|
style="width: 100%"
|
|
|
|
>
|
|
|
|
<el-table-column
|
|
|
|
prop="name"
|
2019-10-23 13:33:09 +08:00
|
|
|
:label="this.$t('exam.courseName')"
|
2019-10-22 13:40:42 +08:00
|
|
|
/>
|
|
|
|
<el-table-column
|
|
|
|
prop="remarks"
|
|
|
|
show-overflow-tooltip
|
2019-10-23 13:33:09 +08:00
|
|
|
:label="this.$t('exam.courseDescription')"
|
2019-10-22 13:40:42 +08:00
|
|
|
/>
|
|
|
|
<el-table-column
|
2019-10-23 13:33:09 +08:00
|
|
|
:label="this.$t('global.operate')"
|
2019-10-22 13:40:42 +08:00
|
|
|
>
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<el-button size="mini" type="primary" @click="goLesson(scope.row)">
|
2019-10-23 13:33:09 +08:00
|
|
|
{{ $t('exam.enterTheExam') }}
|
2019-10-22 13:40:42 +08:00
|
|
|
</el-button>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-card>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { getSubSystemDetail } from '@/api/trainingPlatform';
|
|
|
|
import { UrlConfig } from '@/router/index';
|
2019-10-22 18:49:46 +08:00
|
|
|
import localStore from 'storejs';
|
2019-10-22 13:40:42 +08:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'ExamHome',
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
tableData: [],
|
|
|
|
loading: false
|
|
|
|
};
|
|
|
|
},
|
2019-10-22 18:18:21 +08:00
|
|
|
watch: {
|
2019-10-25 13:16:07 +08:00
|
|
|
'$route.params.subSystem': function(newVal) {
|
2019-10-22 18:18:21 +08:00
|
|
|
this.loadInitPage();
|
|
|
|
}
|
|
|
|
},
|
2019-10-22 13:40:42 +08:00
|
|
|
mounted() {
|
|
|
|
this.loadInitPage();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
loadInitPage() {
|
|
|
|
if (this.$route.params.subSystem) {
|
|
|
|
getSubSystemDetail(this.$route.params.subSystem).then(resp =>{
|
|
|
|
if (resp.data) {
|
|
|
|
this.tableData = resp.data.lessonList;
|
|
|
|
}
|
|
|
|
}).catch(()=>{
|
2019-10-23 13:33:09 +08:00
|
|
|
this.$messageBox(this.$t('error.obtainCourseInformationFailed'));
|
2019-10-22 13:40:42 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
goLesson(row) {
|
2019-10-22 18:49:46 +08:00
|
|
|
localStore.set('examDetail'+this.$route.params.subSystem, `${UrlConfig.trainingPlatform.course}/${this.$route.params.subSystem}?lessonId=${row.id}`);
|
2019-10-22 13:40:42 +08:00
|
|
|
this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.params.subSystem}`, query: {lessonId: row.id}});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|