From a25ea0c4babb0ae4d27eb2abe899b3b6d030cbe1 Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Wed, 29 Oct 2025 14:46:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E5=9C=A8=E7=BA=BF=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E5=89=8D=E5=88=9B=E5=BB=BA=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Course/courseForm.vue | 2 +- src/components/Course/courseTag.vue | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/Course/courseForm.vue b/src/components/Course/courseForm.vue index 8da89517..138b4ef1 100644 --- a/src/components/Course/courseForm.vue +++ b/src/components/Course/courseForm.vue @@ -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(',') || '' diff --git a/src/components/Course/courseTag.vue b/src/components/Course/courseTag.vue index ef8e802c..698deb61 100644 --- a/src/components/Course/courseTag.vue +++ b/src/components/Course/courseTag.vue @@ -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) })