mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-12 12:26:44 +08:00
提示测试
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user