From 90c2724f7a7a8598838f74f9f225dad0e2c45759 Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Mon, 10 Nov 2025 14:51:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Course/SmartTagHint.vue | 33 ++++++++++++++------------ src/components/Course/courseTag.vue | 7 +----- 2 files changed, 19 insertions(+), 21 deletions(-) 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 }