File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed
Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -20,14 +20,14 @@ export const usePaginationStore = defineStore('pagination', {
2020 // 设置当前路由
2121 setCurrentRoute ( route ) {
2222 this . currentRoute = route ;
23- // 如果不是点播页面 ,清除统计信息
24- if ( route !== '/video' ) {
23+ // 如果不是点播页面或搜索页面 ,清除统计信息
24+ if ( route !== '/video' && route !== '/search' ) {
2525 this . clearStats ( ) ;
2626 }
2727 }
2828 } ,
2929 getters : {
30- // 是否应该显示统计信息(在点播页面且有统计文本 )
31- shouldShow : ( state ) => state . isVisible && state . currentRoute === '/video'
30+ // 是否应该显示统计信息(在点播页面或搜索页面且有统计文本 )
31+ shouldShow : ( state ) => state . isVisible && ( state . currentRoute === '/video' || state . currentRoute === '/search' )
3232 }
3333} ) ;
Original file line number Diff line number Diff line change @@ -693,15 +693,26 @@ export default defineComponent({
693693
694694 // 更新全局统计信息
695695 const updateGlobalStats = () => {
696+ console .log (' [updateGlobalStats] 更新全局统计信息' );
696697 if (! activeSource .value || ! searchResults .value [activeSource .value ]) {
697- paginationStore .updateStats (0 , 0 , 0 );
698+ paginationStore .updateStats (' ' );
698699 return ;
699700 }
700701
701702 const totalResults = searchResults .value [activeSource .value ].length ;
702703 const displayedResults = Math .min (displayedCount .value , totalResults);
704+ const sourceName = getSourceName (activeSource .value );
703705
704- paginationStore .updateStats (displayedResults, totalResults, 1 );
706+ let statsText = ` 搜索"${ searchKeyword .value } ":${ sourceName} - 已显示${ displayedResults} 条,共${ totalResults} 条` ;
707+ // 检查是否还有更多数据可以加载
708+ const hasMore = hasMoreData .value ;
709+ if (hasMore) {
710+ statsText += ' ,可继续加载' ;
711+ } else if (totalResults > 0 ) {
712+ statsText += ' ,已全部加载' ;
713+ }
714+ console .log (' [updateGlobalStats] <statsText>:' , statsText);
715+ paginationStore .updateStats (statsText);
705716 };
706717
707718 // ActionRenderer相关方法
You can’t perform that action at this time.
0 commit comments