|
|
@@ -11,7 +11,7 @@
|
|
11
|
11
|
filterable
|
|
12
|
12
|
style="width: 200px"
|
|
13
|
13
|
>
|
|
14
|
|
- <el-option v-for="item in courseTopicOptions" :key="item" :label="item" :value="item" />
|
|
|
14
|
+ <el-option v-for="item in courseTopicOptions" :key="item.code" :label="item.name" :value="item.code" />
|
|
15
|
15
|
</el-select>
|
|
16
|
16
|
</el-form-item>
|
|
17
|
17
|
<el-form-item prop="courseTitle">
|
|
|
@@ -41,7 +41,11 @@
|
|
41
|
41
|
<span>{{ introSummary(scope.row.courseIntro) }}</span>
|
|
42
|
42
|
</template>
|
|
43
|
43
|
</el-table-column>
|
|
44
|
|
- <el-table-column :label="tsT('colCourseTopic')" prop="courseTopic" align="center" width="120" :show-overflow-tooltip="true" />
|
|
|
44
|
+ <el-table-column :label="tsT('colCourseTopic')" align="center" width="120" :show-overflow-tooltip="true">
|
|
|
45
|
+ <template slot-scope="scope">
|
|
|
46
|
+ <span>{{ courseTopicLabel(scope.row.courseTopic) }}</span>
|
|
|
47
|
+ </template>
|
|
|
48
|
+ </el-table-column>
|
|
45
|
49
|
<el-table-column :label="tsT('colVideoFile')" align="center" min-width="140" :show-overflow-tooltip="true">
|
|
46
|
50
|
<template slot-scope="scope">
|
|
47
|
51
|
<span>{{ videoFileLabel(scope.row) }}</span>
|
|
|
@@ -71,7 +75,7 @@
|
|
71
|
75
|
<el-dialog :title="tsCommon('viewTitle')" :visible.sync="viewOpen" width="720px" append-to-body @close="onViewClose">
|
|
72
|
76
|
<el-descriptions v-if="viewRow.id" :column="1" border size="small">
|
|
73
|
77
|
<el-descriptions-item :label="tsT('viewCourseTitle')">{{ viewRow.courseTitle || dash }}</el-descriptions-item>
|
|
74
|
|
- <el-descriptions-item :label="tsT('viewCourseTopic')">{{ viewRow.courseTopic || dash }}</el-descriptions-item>
|
|
|
78
|
+ <el-descriptions-item :label="tsT('viewCourseTopic')">{{ courseTopicLabel(viewRow.courseTopic) }}</el-descriptions-item>
|
|
75
|
79
|
<el-descriptions-item :label="tsT('viewCourseIntro')">
|
|
76
|
80
|
<span class="view-text-pre">{{ viewRow.courseIntro || dash }}</span>
|
|
77
|
81
|
</el-descriptions-item>
|
|
|
@@ -112,13 +116,12 @@
|
|
112
|
116
|
|
|
113
|
117
|
<script>
|
|
114
|
118
|
import techServiceLocaleMixin from "@/mixins/techServiceLocaleMixin"
|
|
115
|
|
-import {
|
|
116
|
|
- listOnlineTrainingCourse,
|
|
117
|
|
- getOnlineTrainingCourse,
|
|
118
|
|
- listOnlineTrainingCourseTopics
|
|
119
|
|
-} from "@/api/techService/onlineTrainingCourse"
|
|
|
119
|
+import { listOnlineTrainingCourse, getOnlineTrainingCourse } from "@/api/techService/onlineTrainingCourse"
|
|
|
120
|
+import { listInformationCategoryChildren } from "@/api/category/informationCategory"
|
|
120
|
121
|
|
|
121
|
122
|
const INTRO_SUMMARY_LEN = 50
|
|
|
123
|
+const COURSE_TOPIC_PARENT_CODE = "005"
|
|
|
124
|
+const COURSE_TOPIC_CATEGORY_TYPE = "8"
|
|
122
|
125
|
|
|
123
|
126
|
export default {
|
|
124
|
127
|
name: "OnlineTrainingCourse",
|
|
|
@@ -163,7 +166,7 @@ export default {
|
|
163
|
166
|
},
|
|
164
|
167
|
methods: {
|
|
165
|
168
|
loadCourseTopics() {
|
|
166
|
|
- listOnlineTrainingCourseTopics()
|
|
|
169
|
+ listInformationCategoryChildren(COURSE_TOPIC_PARENT_CODE, COURSE_TOPIC_CATEGORY_TYPE)
|
|
167
|
170
|
.then((res) => {
|
|
168
|
171
|
this.courseTopicOptions = Array.isArray(res.data) ? res.data : []
|
|
169
|
172
|
})
|
|
|
@@ -171,6 +174,17 @@ export default {
|
|
171
|
174
|
this.courseTopicOptions = []
|
|
172
|
175
|
})
|
|
173
|
176
|
},
|
|
|
177
|
+ courseTopicLabel(val) {
|
|
|
178
|
+ if (val == null || val === "") {
|
|
|
179
|
+ return this.dash
|
|
|
180
|
+ }
|
|
|
181
|
+ const key = String(val).trim()
|
|
|
182
|
+ const item = this.courseTopicOptions.find((o) => String(o.code) === key)
|
|
|
183
|
+ if (item && item.name) {
|
|
|
184
|
+ return item.name
|
|
|
185
|
+ }
|
|
|
186
|
+ return key
|
|
|
187
|
+ },
|
|
174
|
188
|
introSummary(text) {
|
|
175
|
189
|
if (text == null || text === "") {
|
|
176
|
190
|
return this.dash
|