feat: 统一列表模糊搜索行为

- 统一管理端和用户中心搜索参数及多字段包含匹配

- 修复聊天搜索竞态并优化部门重名路径展示

- 补充部门展开、模型空白词和聊天查询回归测试
This commit is contained in:
2026-08-13 22:29:59 +08:00
parent 765006747a
commit 64a85c6a5b
83 changed files with 1134 additions and 208 deletions

View File

@@ -91,8 +91,7 @@ watchListRouteState(route, documentCollectionListRouteSchema, (state) => {
pageSize: state.pageSize,
queryParams: {
categoryId: state.categoryId || undefined,
isQueryOr: true,
title: state.keyword || undefined,
keyword: state.keyword || undefined,
},
});
});
@@ -590,8 +589,7 @@ const handleSearch = (params: any) => {
searchKeyword.value = String(params || '');
pageDataRef.value.setQuery({
categoryId: selectedCategoryId.value || undefined,
title: searchKeyword.value || undefined,
isQueryOr: true,
keyword: searchKeyword.value || undefined,
});
};
const reloadKnowledgeList = () => {
@@ -631,8 +629,7 @@ const getCategoryList = async () => {
selectedCategoryId.value = '';
initialCategoryChangePending = false;
pageDataRef.value?.setQuery?.({
title: searchKeyword.value || undefined,
isQueryOr: true,
keyword: searchKeyword.value || undefined,
});
}
}
@@ -763,8 +760,7 @@ function changeCategory(category: any) {
selectedCategoryId.value = categoryId;
pageDataRef.value.setQuery({
categoryId: categoryId || undefined,
title: searchKeyword.value || undefined,
isQueryOr: true,
keyword: searchKeyword.value || undefined,
});
}
function handlePageStateChange(state: {
@@ -822,8 +818,7 @@ function handlePageStateChange(state: {
:initial-page-number="initialListState.pageNumber"
:initial-query-params="{
categoryId: initialListState.categoryId || undefined,
title: initialListState.keyword || undefined,
isQueryOr: true,
keyword: initialListState.keyword || undefined,
}"
@state-change="handlePageStateChange"
>

View File

@@ -100,7 +100,7 @@ defineExpose({
},
search(searchText: string) {
pageDataRef.value?.setQuery?.({
title: searchText,
keyword: searchText.trim() || undefined,
});
},
});

View File

@@ -91,7 +91,7 @@ const treeData = computed(() => [
const refreshList = () => {
const query: Record<string, any> = {};
if (searchKeyword.value.trim()) {
query.question = searchKeyword.value.trim();
query.keyword = searchKeyword.value.trim();
}
if (selectedCategoryId.value !== 'all') {
query.categoryId = selectedCategoryId.value;