diff --git a/src/views/portal/course/qualityCourse.vue b/src/views/portal/course/qualityCourse.vue index 7921f98f..63901ed4 100644 --- a/src/views/portal/course/qualityCourse.vue +++ b/src/views/portal/course/qualityCourse.vue @@ -329,7 +329,7 @@ export default { }, // 取消搜索条件标签展示 - stagList() { //计算出选择的内容 + /*stagList() { //计算出选择的内容 let list = []; if (this.keyword) { list.push({ @@ -360,6 +360,77 @@ export default { list.push(one); } }) + return list; + },*/ + + stagList() { + let list = []; + + // 关键词 + if (this.keyword) { + list.push({ + type: 0, + id: 'keyword', + name: this.keyword, + tagName: this.keyword, + checked: true + }); + } + + // 课程类型 + this.ctypeList.forEach(item => { + if (item.checked) { + list.push({ + ...item, + tagName: item.name + }); + } + }); + + // 热点标签 - 这是关键修复 + this.hotTagsList.forEach(item => { + if (item.checked) { + list.push({ + ...item, + name: item.tagName || item.name, + tagName: item.tagName || item.name, + type: 14 + }); + } + }); + + // 三级分类 + this.oneList.forEach(one => { + var twoChildChecked = false; + one.children.forEach(two => { + if (two.checked) { + twoChildChecked = true; + } + var threeChildChecked = false; + two.children.forEach(three => { + if (three.checked) { + list.push({ + ...three, + tagName: three.name + }); + threeChildChecked = true; + } + }); + if (two.checked && !threeChildChecked) { + list.push({ + ...two, + tagName: two.name + }); + } + }); + if (one.checked && !twoChildChecked) { + list.push({ + ...one, + tagName: one.name + }); + } + }); + return list; }, ctypeTagAll() {