fix: 페이지네이션 로직 개선 및 상세 로그 추가
- 모든 관리 화면(회사, 장비, 입고지, 유지보수)의 페이지네이션 로직 통일 - Controller에서 전체 데이터 로드, View에서만 페이지네이션 처리 - 각 화면에 상세한 터미널 로그 추가로 데이터 로드 상태 추적 가능 - 회사 DTO에 지점 정보 포함 기능 추가 - 전체 79개 회사 중 14개만 표시되던 문제 해결
This commit is contained in:
@@ -253,6 +253,14 @@ class _CompanyListRedesignState extends State<CompanyListRedesign> {
|
||||
final int startIndex = (_currentPage - 1) * _pageSize;
|
||||
final int endIndex = startIndex + _pageSize;
|
||||
|
||||
// 디버그 로그 추가
|
||||
print('🔍 [VIEW DEBUG] 화면 페이지네이션 상태');
|
||||
print(' • filteredCompanies 수: ${controller.filteredCompanies.length}개');
|
||||
print(' • displayCompanies 수: ${displayCompanies.length}개 (지점 포함)');
|
||||
print(' • 현재 페이지: $_currentPage');
|
||||
print(' • 페이지 크기: $_pageSize');
|
||||
print(' • startIndex: $startIndex, endIndex: $endIndex');
|
||||
|
||||
// startIndex가 displayCompanies.length보다 크거나 같으면 첫 페이지로 리셋
|
||||
if (startIndex >= displayCompanies.length && displayCompanies.isNotEmpty) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
@@ -265,9 +273,11 @@ class _CompanyListRedesignState extends State<CompanyListRedesign> {
|
||||
final List<Map<String, dynamic>> pagedCompanies = displayCompanies.isEmpty
|
||||
? []
|
||||
: displayCompanies.sublist(
|
||||
startIndex.clamp(0, displayCompanies.length - 1),
|
||||
startIndex.clamp(0, displayCompanies.length),
|
||||
endIndex.clamp(0, displayCompanies.length),
|
||||
);
|
||||
|
||||
print(' • 화면에 표시될 항목 수: ${pagedCompanies.length}개');
|
||||
|
||||
// 로딩 상태
|
||||
if (controller.isLoading && controller.companies.isEmpty) {
|
||||
|
||||
Reference in New Issue
Block a user