rt-sim-training-client/src/views/approval/lesson/detail.vue

102 lines
2.3 KiB
Vue
Raw Normal View History

2019-10-10 13:56:33 +08:00
<template>
2019-10-22 16:05:58 +08:00
<el-dialog
:title="this.$t('approval.courseDetails')"
:visible.sync="showDetail"
top="20px"
width="90%"
:before-do-close="doClose"
:close-on-click-modal="false"
>
<div>
<el-card v-loading="loading">
<div slot="header" style="text-align: center;">
<b>{{ $t('global.courseName') }}: {{ lessonName }}</b>
2019-10-12 17:14:03 +08:00
</div>
2019-10-22 16:05:58 +08:00
<div style="margin:50px">
<p style="font-size: 14px; margin-bottom: 20px"> {{ $t('approval.courseDescription') }}:
<span style="color: #808080 !important;">{{ lessonRemark }}</span>
</p>
</div>
</el-card>
<el-card v-loading="loading">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height -60 + 'px'}">
<el-table
:data="tableData"
row-key="id"
border
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column
prop="name"
border
:label="this.$t('approval.chapterTrainingName')"
/>
<el-table-column
prop="remarks"
border
:label="this.$t('approval.instructions')"
/>
</el-table>
</el-scrollbar>
</el-card>
</div>
</el-dialog>
2019-10-12 17:14:03 +08:00
2019-10-10 13:56:33 +08:00
</template>
<script>
2019-10-22 16:05:58 +08:00
import {reviewLessonDetail} from '@/api/designPlatform';
2019-10-12 17:14:03 +08:00
2019-10-22 16:05:58 +08:00
export default {
name: 'LessonApprovalDetail',
components: {
2019-10-10 13:56:33 +08:00
2019-10-22 16:05:58 +08:00
},
data() {
return {
loading: false,
tableData: [],
lessonName: '',
lessonRemark: '',
showDetail: false
};
},
computed: {
height() {
return this.$store.state.app.height - 260;
}
},
watch: {
2019-10-10 13:56:33 +08:00
2019-10-22 16:05:58 +08:00
},
created() {
},
mounted() {
// this.loadInitData();
},
beforeDestroy() {
2019-10-10 13:56:33 +08:00
2019-10-22 16:05:58 +08:00
},
methods: {
show(lessonId) {
this.showDetail = true;
this.loadInitData(lessonId);
},
loadInitData(lessonId) {
this.loading =true;
reviewLessonDetail(lessonId).then(response =>{
this.tableData = response.data[0].children;
this.lessonName = response.data[0].name;
this.lessonRemark = response.data[0].remarks;
this.loading = false;
}).catch(()=>{
this.$messageBox(this.$t('approval.failedToGetCourseData'));
});
},
doClose() {
}
}
};
2019-10-10 13:56:33 +08:00
</script>