@@ -152,6 +152,7 @@ const AnnotationPage = () => {
152152 const PAGE_SIZE = 40 ;
153153 // 滚动加载
154154 const [ totalCount , setTotalCount ] = useState < number > ( 0 ) ;
155+ const [ serverPage , setServerPage ] = useState < number > ( 1 ) ;
155156 const currentPage = useRef < number > ( 1 ) ;
156157 if ( currentPage . current === 1 ) {
157158 currentPage . current = sample ?. data . inner_id ? Math . floor ( sample . data . inner_id / PAGE_SIZE ) + 1 : 1 ;
@@ -170,7 +171,7 @@ const AnnotationPage = () => {
170171
171172 currentPage . current += 1 ;
172173 setTotalCount ( meta_data ?. total ?? 0 ) ;
173-
174+ setServerPage ( meta_data ?. page ?? 1 ) ;
174175 return data ;
175176 } , [ routeParams . taskId ] ) ;
176177 const [ samples = [ ] as SampleResponse [ ] , loading , setSamples , svc ] = useScrollFetch (
@@ -180,14 +181,19 @@ const AnnotationPage = () => {
180181 document . querySelector ( '.labelu-audio__sidebar div' ) ||
181182 document . querySelector ( '.labelu-video__sidebar div' ) ,
182183 {
183- isEnd : ( ) => totalCount === samples . length ,
184+ isEnd : ( ) => totalCount === samples . length || serverPage === Math . ceil ( totalCount / PAGE_SIZE ) ,
184185 } ,
185186 ) ;
186187
187188 const leftSiderContent = useMemo ( ( ) => < SlideLoader /> , [ ] ) ;
188189
189190 const topActionContent = (
190- < AnnotationRightCorner totalSize = { totalCount } fetchNext = { svc } noSave = { ! ! searchParams . get ( 'noSave' ) } />
191+ < AnnotationRightCorner
192+ totalSize = { totalCount }
193+ fetchNext = { svc }
194+ isLastPage = { serverPage >= Math . ceil ( totalCount / PAGE_SIZE ) }
195+ noSave = { ! ! searchParams . get ( 'noSave' ) }
196+ />
191197 ) ;
192198
193199 const annotationContextValue = useMemo ( ( ) => {
0 commit comments