提示测试

This commit is contained in:
670788339
2025-11-10 14:51:53 +08:00
parent 2ab809a70f
commit 90c2724f7a
2 changed files with 19 additions and 21 deletions

View File

@@ -85,24 +85,27 @@ export default {
async fetchSuggestedTags() { async fetchSuggestedTags() {
try { try {
// 基于分类获取推荐标签 // 基于分类获取推荐标签
if (this.sysTypeList.length > 0) { // if (this.sysTypeList.length > 0) {
const typeId = this.sysTypeList[this.sysTypeList.length - 1]; // const typeId = this.sysTypeList[this.sysTypeList.length - 1];
const { result } = await apiCourseTag.getTagsByCategory(typeId); // const { result } = await apiCourseTag.getTagsByCategory(typeId);
this.categoryBasedTags = result.slice(0, 3); // this.categoryBasedTags = result.slice(0, 3);
} // this.categoryBasedTags = ['园区物联','工业互联网','智能制造解决方案'];
// }
this.nameBasedTags = ['园区物联','工业互联网','智能制造解决方案'];
this.categoryBasedTags = ['工业互联网','中祥英工业互联网','智能制造解决方案'];
this.categoryBasedTags = ['工业互联网','中祥英工业互联网','智能制造解决方案'];
// 基于课程名称关键词获取推荐 // 基于课程名称关键词获取推荐
if (this.courseName) { // if (this.courseName) {
const keywords = this.extractKeywords(this.courseName); // const keywords = this.extractKeywords(this.courseName);
if (keywords.length > 0) { // if (keywords.length > 0) {
const { result } = await apiCourseTag.getTagsByKeywords(keywords); // const { result } = await apiCourseTag.getTagsByKeywords(keywords);
this.nameBasedTags = result.slice(0, 3); // this.nameBasedTags = result.slice(0, 3);
} // }
} // }
// 获取热门标签 // 获取热门标签
const { result } = await apiCourseTag.getHotTags(); // const { result } = await apiCourseTag.getHotTags();
this.hotTags = result.slice(0, 3); // this.hotTags = result.slice(0, 3);
} catch (error) { } catch (error) {
console.error('获取推荐标签失败:', error); console.error('获取推荐标签失败:', error);

View File

@@ -105,8 +105,7 @@ export default {
}, },
created() { created() {
this.debouncedSearch = debounce(this.doSearch, 500) this.debouncedSearch = debounce(this.doSearch, 500)
console.log("----------sysTypeList.length---------->"+this.sysTypeList.length) this.showSmartMatching();
console.log("----------sysTypeList.length---------->"+(this.sysTypeList.length===0))
}, },
// 添加:挂载时初始化标签数据 // 添加:挂载时初始化标签数据
mounted() { mounted() {
@@ -365,10 +364,6 @@ export default {
if (tags.length === 0) { if (tags.length === 0) {
this.$message.info('无此标签,按回车键创建') this.$message.info('无此标签,按回车键创建')
} }
// 如果有查询词,显示智能匹配提示
if (query.trim()) {
this.showSmartMatching(query);
}
} finally { } finally {
this.loading = false this.loading = false
} }