mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 03:46:44 +08:00
Merge branch 'master-20251023-tag' into test1024
This commit is contained in:
@@ -124,6 +124,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 新增:处理输入框获得焦点事件
|
// 新增:处理输入框获得焦点事件
|
||||||
async handleFocus() {
|
async handleFocus() {
|
||||||
|
console.log("-- handleFocus --- " + this.sysTypeList.length)
|
||||||
// 当输入框获得焦点时,加载默认的搜索结果
|
// 当输入框获得焦点时,加载默认的搜索结果
|
||||||
if (this.sysTypeList.length > 0) {
|
if (this.sysTypeList.length > 0) {
|
||||||
await this.doSearch('');
|
await this.doSearch('');
|
||||||
@@ -225,15 +226,17 @@ export default {
|
|||||||
// this.searchResults = []
|
// this.searchResults = []
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
|
console.log("---- doSearch ------ query = " + query )
|
||||||
this.loading = true
|
this.loading = true
|
||||||
try {
|
try {
|
||||||
// 获取 typeId:取 sysTypeList 最后一个有效的值
|
// 获取 typeId:取 sysTypeList 最后一个有效的值
|
||||||
const typeId = this.sysTypeList.length > 2 ? this.sysTypeList[2] :
|
const typeId = this.sysTypeList.length > 2 ? this.sysTypeList[2] :
|
||||||
this.sysTypeList.length > 1 ? this.sysTypeList[1] :
|
this.sysTypeList.length > 1 ? this.sysTypeList[1] :
|
||||||
this.sysTypeList.length > 0 ? this.sysTypeList[0] : null;
|
this.sysTypeList.length > 0 ? this.sysTypeList[0] : null;
|
||||||
|
console.log("---- doSearch searchTags ------ query = " + query + " , typeId = " + typeId )
|
||||||
const {result:tags} = await apiCourseTag.searchTags({tagName:query,typeId:typeId})
|
const {result:tags} = await apiCourseTag.searchTags({tagName:query,typeId:typeId})
|
||||||
|
console.log("-- searchTags 查询结果 tags = " + tags )
|
||||||
|
|
||||||
tags.forEach(item => {
|
tags.forEach(item => {
|
||||||
this.tagMap.set(item.id, item)
|
this.tagMap.set(item.id, item)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user