@@ -131,12 +131,6 @@ <h3 id="successRate">-</h3>
131131 </ table >
132132 </ div >
133133
134- <!-- 分页 -->
135- < nav aria-label ="用户列表分页 ">
136- < ul class ="pagination justify-content-center " id ="pagination ">
137- <!-- 分页将通过JavaScript动态生成 -->
138- </ ul >
139- </ nav >
140134 </ div >
141135 </ div >
142136
@@ -331,15 +325,12 @@ <h5 class="modal-title">编辑用户</h5>
331325}
332326
333327// 加载用户列表
334- function loadUserList ( page = 1 ) {
335- console . log ( '开始请求用户列表API, 页码:' , page ) ;
328+ function loadUserList ( ) {
329+ console . log ( '开始请求用户列表API' ) ;
336330 const search = $ ( '#searchInput' ) . val ( ) || '' ;
337331 const status = $ ( '#statusFilter' ) . val ( ) || '' ;
338332
339- const params = {
340- page : page ,
341- per_page : 10
342- } ;
333+ const params = { } ;
343334
344335 // 只有在有值时才添加搜索和状态参数
345336 if ( search ) {
@@ -356,12 +347,10 @@ <h5 class="modal-title">编辑用户</h5>
356347 console . log ( '用户列表API响应:' , response ) ;
357348 if ( response . success && response . data ) {
358349 renderUserTable ( response . data . users || [ ] ) ;
359- renderPagination ( response . data . pagination || { current_page : 1 , total_pages : 1 , total_items : 0 , per_page : 10 } ) ;
360350 console . log ( '用户列表渲染完成' ) ;
361351 } else {
362352 console . error ( '用户列表API返回失败:' , response . message || '未知错误' ) ;
363353 renderUserTable ( [ ] ) ;
364- renderPagination ( { current_page : 1 , total_pages : 1 , total_items : 0 , per_page : 10 } ) ;
365354 if ( typeof showToast === 'function' ) {
366355 showToast ( '加载用户列表失败: ' + ( response . message || '未知错误' ) , 'error' ) ;
367356 }
@@ -371,7 +360,6 @@ <h5 class="modal-title">编辑用户</h5>
371360 console . error ( '用户列表API请求失败:' , error , 'status:' , status , 'xhr:' , xhr ) ;
372361 console . error ( '响应文本:' , xhr . responseText ) ;
373362 renderUserTable ( [ ] ) ;
374- renderPagination ( { current_page : 1 , total_pages : 1 , total_items : 0 , per_page : 10 } ) ;
375363 if ( typeof showToast === 'function' ) {
376364 showToast ( '加载用户列表失败: 网络错误' , 'error' ) ;
377365 }
@@ -441,32 +429,6 @@ <h5 class="modal-title">编辑用户</h5>
441429 console . log ( '用户表格渲染完成:' , users . length , '个用户' ) ;
442430}
443431
444- // 渲染分页
445- function renderPagination ( pagination ) {
446- const nav = $ ( '#pagination' ) ;
447- nav . empty ( ) ;
448-
449- if ( pagination . total_pages <= 1 ) return ;
450-
451- // 上一页
452- if ( pagination . current_page > 1 ) {
453- nav . append ( `<li class="page-item"><a class="page-link" href="#" onclick="loadUserList(${ pagination . current_page - 1 } )">上一页</a></li>` ) ;
454- }
455-
456- // 页码
457- for ( let i = 1 ; i <= pagination . total_pages ; i ++ ) {
458- if ( i === pagination . current_page ) {
459- nav . append ( `<li class="page-item active"><span class="page-link">${ i } </span></li>` ) ;
460- } else {
461- nav . append ( `<li class="page-item"><a class="page-link" href="#" onclick="loadUserList(${ i } )">${ i } </a></li>` ) ;
462- }
463- }
464-
465- // 下一页
466- if ( pagination . current_page < pagination . total_pages ) {
467- nav . append ( `<li class="page-item"><a class="page-link" href="#" onclick="loadUserList(${ pagination . current_page + 1 } )">下一页</a></li>` ) ;
468- }
469- }
470432
471433// 更新批量操作按钮状态
472434function updateBatchButtons ( ) {
0 commit comments