mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-08 02:16:43 +08:00
注释在线保存前创建标签
This commit is contained in:
@@ -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(',') || ''
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user