注释在线保存前创建标签

This commit is contained in:
670788339
2025-10-29 14:46:25 +08:00
parent e55aa09409
commit a25ea0c4ba
2 changed files with 9 additions and 3 deletions

View File

@@ -1212,7 +1212,7 @@ export default {
console.log("courseForm 保存课程信息 this.showTags = " + this.showTags);
console.log("courseForm 保存课程信息 this.courseInfo.tags = " + this.courseInfo.tags);
if (this.showTags.length > 0) {
this.courseInfo.tags = this.showTags.join();
this.courseInfo.tags = this.courseInfo.tags.join();
}
console.log("courseForm 保存课程信息 this.courseInfo.tags = " + this.courseInfo.tags);
this.courseInfo.keywords = this.tips.join(',') || ''

View File

@@ -142,7 +142,7 @@ export default {
handleEnterKey(event) {
const inputVal = event.target.value?.trim()
if (!this.searchResults.length && inputVal && this.selectedTags.length < this.maxTags) {
this.createNewTag(event.target.value.trim())
// this.createNewTag(event.target.value.trim())
event.target.value = ''
}
},
@@ -198,7 +198,13 @@ export default {
this.loading = true
try {
const {result:tags} = await apiCourseTag.searchTags({tagName:query})
try {
// 获取 typeId取 sysTypeList 最后一个有效的值
const typeId = this.sysTypeList.length > 2 ? this.sysTypeList[2] :
this.sysTypeList.length > 1 ? this.sysTypeList[1] :
this.sysTypeList.length > 0 ? this.sysTypeList[0] : null;
const {result:tags} = await apiCourseTag.searchTags({tagName:query,typeId:typeId})
tags.forEach(item => {
this.tagMap.set(item.id, item)
})