diff --git a/src/components/Course/SmartTagHint.vue b/src/components/Course/SmartTagHint.vue index af108802..a6ee84fb 100644 --- a/src/components/Course/SmartTagHint.vue +++ b/src/components/Course/SmartTagHint.vue @@ -85,24 +85,27 @@ export default { async fetchSuggestedTags() { try { // 基于分类获取推荐标签 - if (this.sysTypeList.length > 0) { - const typeId = this.sysTypeList[this.sysTypeList.length - 1]; - const { result } = await apiCourseTag.getTagsByCategory(typeId); - this.categoryBasedTags = result.slice(0, 3); - } - + // if (this.sysTypeList.length > 0) { + // const typeId = this.sysTypeList[this.sysTypeList.length - 1]; + // const { result } = await apiCourseTag.getTagsByCategory(typeId); + // this.categoryBasedTags = result.slice(0, 3); + // this.categoryBasedTags = ['园区物联','工业互联网','智能制造解决方案']; + // } + this.nameBasedTags = ['园区物联','工业互联网','智能制造解决方案']; + this.categoryBasedTags = ['工业互联网','中祥英工业互联网','智能制造解决方案']; + this.categoryBasedTags = ['工业互联网','中祥英工业互联网','智能制造解决方案']; // 基于课程名称关键词获取推荐 - if (this.courseName) { - const keywords = this.extractKeywords(this.courseName); - if (keywords.length > 0) { - const { result } = await apiCourseTag.getTagsByKeywords(keywords); - this.nameBasedTags = result.slice(0, 3); - } - } + // if (this.courseName) { + // const keywords = this.extractKeywords(this.courseName); + // if (keywords.length > 0) { + // const { result } = await apiCourseTag.getTagsByKeywords(keywords); + // this.nameBasedTags = result.slice(0, 3); + // } + // } // 获取热门标签 - const { result } = await apiCourseTag.getHotTags(); - this.hotTags = result.slice(0, 3); + // const { result } = await apiCourseTag.getHotTags(); + // this.hotTags = result.slice(0, 3); } catch (error) { console.error('获取推荐标签失败:', error); diff --git a/src/components/Course/courseTag.vue b/src/components/Course/courseTag.vue index 3c0e63b1..5c97932f 100644 --- a/src/components/Course/courseTag.vue +++ b/src/components/Course/courseTag.vue @@ -105,8 +105,7 @@ export default { }, created() { this.debouncedSearch = debounce(this.doSearch, 500) - console.log("----------sysTypeList.length---------->"+this.sysTypeList.length) - console.log("----------sysTypeList.length---------->"+(this.sysTypeList.length===0)) + this.showSmartMatching(); }, // 添加:挂载时初始化标签数据 mounted() { @@ -365,10 +364,6 @@ export default { if (tags.length === 0) { this.$message.info('无此标签,按回车键创建') } - // 如果有查询词,显示智能匹配提示 - if (query.trim()) { - this.showSmartMatching(query); - } } finally { this.loading = false }