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() {
|
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);
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user