|
@@ -259,6 +259,9 @@ const handleMenuClick = (menu) => {
|
|
|
currentOpenedMenu.value = menu.id
|
|
currentOpenedMenu.value = menu.id
|
|
|
saveActiveState(menu.id, menu.id)
|
|
saveActiveState(menu.id, menu.id)
|
|
|
|
|
|
|
|
|
|
+ // 清空搜索框内容
|
|
|
|
|
+ SearchInput.value = ''
|
|
|
|
|
+
|
|
|
// 如果该菜单下有课程数据,设置默认选中第一项
|
|
// 如果该菜单下有课程数据,设置默认选中第一项
|
|
|
if (menu.data && menu.data.length > 0) {
|
|
if (menu.data && menu.data.length > 0) {
|
|
|
currentActiveIndex.value = menu.id + '-1'
|
|
currentActiveIndex.value = menu.id + '-1'
|
|
@@ -375,7 +378,8 @@ const querySearch = (queryString, cb) => {
|
|
|
? data.filter(item => {
|
|
? data.filter(item => {
|
|
|
// 课程标题和序号查询
|
|
// 课程标题和序号查询
|
|
|
return item.ctType.toLowerCase().includes(queryString.toLowerCase()) ||
|
|
return item.ctType.toLowerCase().includes(queryString.toLowerCase()) ||
|
|
|
- item.ctTypeSort.includes(queryString)
|
|
|
|
|
|
|
+ // 类型检查,确保ctTypeSort是字符串类型
|
|
|
|
|
+ (item.ctTypeSort && item.ctTypeSort.toString().includes(queryString))
|
|
|
})
|
|
})
|
|
|
: data
|
|
: data
|
|
|
cb(results)
|
|
cb(results)
|
|
@@ -397,7 +401,8 @@ const filteredTitles = computed(() => {
|
|
|
}
|
|
}
|
|
|
return data.filter(title =>
|
|
return data.filter(title =>
|
|
|
title.ctType.toLowerCase().includes(SearchInput.value.toLowerCase()) ||
|
|
title.ctType.toLowerCase().includes(SearchInput.value.toLowerCase()) ||
|
|
|
- title.ctTypeSort.includes(SearchInput.value)
|
|
|
|
|
|
|
+ // 类型检查,确保ctTypeSort是字符串类型
|
|
|
|
|
+ (title.ctTypeSort && title.ctTypeSort.toString().includes(SearchInput.value))
|
|
|
)
|
|
)
|
|
|
})
|
|
})
|
|
|
|
|
|