Commit e8d52700 authored by liwei's avatar liwei

修改了课程标签相关的bug

parent 95e724bf
......@@ -7,4 +7,5 @@ export default {
'DIFFICULTY_GRADE': 'difficulty_grade', // 难度等级
'COURSE_TYPE': 'course_type',
'COURSE_DIMENSIONS': 'course_dimensions',
'INTELLIGENT_CLASSROOM': 'intelligent_classroom'
}
......@@ -119,28 +119,37 @@
</div> -->
<div
v-if="courseTags.length > 1"
v-if="courseLabelList.length >= 1"
class="tag"
>{{ courseTags[0].label }}
>{{ courseLabelList[0] }}
</div>
<div
v-if="courseTags.length > 2"
v-if="courseLabelList.length >= 2"
class="tag"
>{{ courseTags[1].label }}
>{{ courseLabelList[1] }}
</div>
<div
v-if="courseTags.length > 3"
v-if="courseLabelList.length >= 3"
class="tag"
>{{ courseTags[2].label }}
>{{ courseLabelList[2] }}
</div>
<div
v-if="courseTags.length > 4"
v-if="courseLabelList.length >= 4"
class="tag"
>{{ courseTags[3].label }}
>{{ courseLabelList[3] }}
</div>
<div
v-if="courseLabelList.length >= 5"
class="tag"
>{{ courseLabelList[4] }}
</div>
<div
v-if="courseLabelList.length >= 6"
class="tag"
>{{ courseLabelList[5] }}
</div>
<div
v-if="courseTags.length > 4"
v-if="courseLabelList.length > 6"
class="tag"
>...
</div>
......@@ -821,7 +830,11 @@ export default {
// 组装标签数据
const tagTypes = [
{ values: this.courseDetails.tecClassify, labels: this.courseDetails.tecClassifyLabels, type: '技术分类' },
{ values: this.courseDetails.jobClassify, labels: this.courseDetails.jobClassifyLabels, type: '岗位分类' }
{ values: this.courseDetails.jobClassify, labels: this.courseDetails.jobClassifyLabels, type: '岗位分类' },
{ values: this.courseDetails.difficultyClassify, labels: this.courseDetails.difficultyClassifyLabels, type: '难度等级' },
{ values: this.courseDetails.enterpriseCourseDimensions, labels: this.courseDetails.courseDimensionsLabels, type: '课程维度' },
{ values: this.courseDetails.intelligentClassroom, labels: this.courseDetails.intelligentClassroomLabels, type: '智联课堂' },
{ values: this.courseDetails.courseType, labels: this.courseDetails.courseTypeLabels, type: '前沿课程分类' }
]
tagTypes.forEach(({ values, labels }) => {
if (!values || !labels) return
......@@ -833,6 +846,7 @@ export default {
this.courseTags.push(...tags)
})
this.courseLabelList = this.courseTags.map(item => item.label)
this.courseLabelList = this.courseLabelList.filter(item => item !== '' && item !== undefined)
// 获取课程讲师详情
if (this.courseDetails && this.courseDetails.lessonTeaName) {
cmsLecturerDetail(this.courseDetails.lessonTeaName).then(response => {
......
......@@ -232,6 +232,9 @@ export default {
},
data() {
return {
courseTypeOptions: [],
courseDimensionsOptions: [],
intelligentClassroomOptions: [],
openDialog: false,
hover: false,
timer: null,
......@@ -516,8 +519,9 @@ export default {
}
}
}
console.log('response:',response)
this.courseList = response.rows
// console.log('this.courseList:',this.courseList)
console.log('this.courseList111111:', this.courseList)
this.getDictData()// 获取字典数据
})
},
......@@ -525,6 +529,10 @@ export default {
getDictData() {
this.getDifficultyGrade() // 课程等级字典
this.getTecClassifyGrade() // 技术分类字典
this.getJobClassify() // 岗位分类字典
this.getCourseType() // 前沿课堂字典
this.getCourseDimensions() // 课程维度字典
this.getIntelligentClassroom() // 智联课堂字典
},
/** 课程等级字典*/
getDifficultyGrade() {
......@@ -549,7 +557,7 @@ export default {
this.$set(item, 'tecNameList', [])
}
})
this.getJobClassify() // 岗位分类字典
// this.getJobClassify() // 岗位分类字典
})
},
/** 岗位分类字典*/
......@@ -561,16 +569,64 @@ export default {
const jobList = item.jobClassify.split(',') // 岗位分类List
const jobNameList = jobList.map(items => this.jobOptions.find(i => i.dictValue === items).dictLabel)
this.$set(item, 'jobNameList', jobNameList)
// console.log('tecNameList', item.tecNameList)
// console.log('jobNameList', item.jobNameList)
this.$set(item, 'mergeList', item.tecNameList.concat(item.jobNameList))
// console.log('mergeList', item.mergeList)
// this.$set(item, 'mergeList', item.tecNameList.concat(item.jobNameList))
} else {
this.$set(item, 'mergeList', [])
}
})
})
},
/** 前沿课堂分类字典*/
getCourseType() {
getDict('course_type').then(res => {
this.courseTypeOptions = res.data // 前沿课堂分类字典
this.courseList.forEach(item => { // 循环课程list
if (item.courseType && item.courseType.split(',').length > 0) { // 岗位分类字段可能没有也可能多个
const courseTypeList = item.courseType.split(',') // 岗位分类List
const courseTypeNameList = courseTypeList.map(items => this.courseTypeOptions.find(i => i.dictValue === items).dictLabel)
this.$set(item, 'courseTypeNameList', courseTypeNameList)
} else {
this.$set(item, 'courseTypeNameList', [])
}
})
})
},
/** 课程维度分类字典*/
getCourseDimensions() {
getDict('course_dimensions').then(res => {
this.courseDimensionsOptions = res.data // 前沿课堂分类字典
this.courseList.forEach(item => { // 循环课程list
if (item.enterpriseCourseDimensions && item.enterpriseCourseDimensions.split(',').length > 0) { // 岗位分类字段可能没有也可能多个
const courseDimensionsList = item.enterpriseCourseDimensions.split(',') // 岗位分类List
const courseDimensionsNameList = courseDimensionsList.map(items => this.courseDimensionsOptions.find(i => i.dictValue === items).dictLabel)
this.$set(item, 'courseDimensionsNameList', courseDimensionsNameList)
} else {
this.$set(item, 'courseDimensionsNameList', [])
}
})
})
},
/** 智联课堂分类字典*/
getIntelligentClassroom() {
getDict('intelligent_classroom').then(res => {
this.intelligentClassroomOptions = res.data // 前沿课堂分类字典
this.courseList.forEach(item => { // 循环课程list
if (item.intelligentClassroom && item.intelligentClassroom.split(',').length > 0) { // 岗位分类字段可能没有也可能多个
const intelligentClassroomList = item.intelligentClassroom.split(',') // 岗位分类List
const intelligentClassroomNameList = intelligentClassroomList.map(items => this.intelligentClassroomOptions.find(i => i.dictValue === items).dictLabel)
this.$set(item, 'intelligentClassroomNameList', intelligentClassroomNameList)
} else {
this.$set(item, 'intelligentClassroomNameList', [])
}
})
this.getAllType()
})
},
getAllType() {
this.courseList.forEach(item => { // 循环课程list
this.$set(item, 'mergeList', item.tecNameList.concat(item.jobNameList).concat(item.level).concat(item.courseTypeNameList).concat(item.courseDimensionsNameList).concat(item.intelligentClassroomNameList))
})
},
/** 一进入页面自动滚动到最顶部*/
handleToTop() {
window.scrollTo({
......
......@@ -164,6 +164,7 @@ import NavList from '@/views/homePage/components/NavList/index'
import { pagingBLesson, queryUnitAdmin, queryUserStudyInfo } from '@/views/learningCenter/teamMembers/aips'
import { deleteBanner } from '@/views/learningCenter/IPUser/apis'
import { selectFavorites } from '@/api/personalCenter'
import { getInfo } from '@/api/user'
export default {
name: 'Index',
components: {
......@@ -212,7 +213,7 @@ export default {
],
backTop: require('@/assets/image/top.png'),
suggestion: require('@/assets/image/suggestion.png'),
avatar: require('@/assets/image/ipuerLogo.png')
avatar: ''
}
},
computed: {
......@@ -234,6 +235,12 @@ export default {
this.getUnitAdmin() // 查询单位管理员信息
this.getCourseList() // 查询课程list
this.handleSelectFavoritesNum() // 查询收藏课程数量
if (this.$store.getters.avatar === null || this.$store.getters.avatar === '' || this.$store.getters.avatar === undefined){
this.avatar = require('@/assets/image/ipuerLogo.png')
} else {
this.avatar = this.$store.getters.avatar
}
},
mounted() {
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment