diff --git a/web/src/views/KnowledgeBase/index.tsx b/web/src/views/KnowledgeBase/index.tsx index cef520ab..1ad6997b 100644 --- a/web/src/views/KnowledgeBase/index.tsx +++ b/web/src/views/KnowledgeBase/index.tsx @@ -334,6 +334,18 @@ const KnowledgeBaseManagement: FC = () => { setHasMore(hasNext); buildModelMenus(list, isLoadMore); + + // 首次加载后,检查是否需要自动加载更多(解决无滚动条问题) + if (!isLoadMore && hasNext) { + setTimeout(() => { + const scrollDiv = document.getElementById('scrollableDiv'); + if (scrollDiv && scrollDiv.scrollHeight <= scrollDiv.clientHeight) { + console.log('No scrollbar detected, auto-loading more data'); + setPage(2); + fetchData(2, true); + } + }, 100); + } } catch (error) { console.error('Failed to fetch knowledge base list:', error); if (!isLoadMore) { @@ -532,10 +544,10 @@ const KnowledgeBaseManagement: FC = () => { {t('common.loading')}} + hasMore={hasMore} + loader={loading && data.length > 0 ?
{t('common.loading')}
: null} endMessage={ - data.length > 0 ? ( + data.length > 0 && !hasMore ? (
{t('common.noMoreData')}