fix(WEB): 페이지네이션 개선 및 거래처관리 페이지 수정
- IntegratedListTemplateV2: 1페이지여도 페이지네이션 영역 항상 표시 - 거래처관리: externalPagination 추가로 서버 페이지네이션 정보 전달 - 거래처관리: handlePageChange Hooks 순서 에러 수정 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -253,6 +253,12 @@ export default function CustomerAccountManagementPage() {
|
||||
});
|
||||
}, [currentPage, itemsPerPage, searchTerm, filterType, fetchClients, loadTotalStats]);
|
||||
|
||||
// 페이지 변경 핸들러 (Hooks 순서 보장을 위해 조건부 return 전에 정의)
|
||||
const handlePageChange = useCallback((page: number) => {
|
||||
setCurrentPage(page);
|
||||
setSelectedItems(new Set()); // 페이지 변경 시 선택 초기화
|
||||
}, []);
|
||||
|
||||
// 핸들러 - 페이지 기반 네비게이션
|
||||
const handleAddNew = () => {
|
||||
router.push("/sales/client-management-sales-admin/new");
|
||||
@@ -611,6 +617,8 @@ export default function CustomerAccountManagementPage() {
|
||||
|
||||
itemsPerPage,
|
||||
|
||||
// 서버 사이드 페이지네이션 + 클라이언트 사이드 탭 필터링
|
||||
// externalPagination으로 페이지네이션은 외부에서 제어
|
||||
clientSideFiltering: true,
|
||||
|
||||
searchFilter: (item, searchValue) => {
|
||||
@@ -695,6 +703,13 @@ export default function CustomerAccountManagementPage() {
|
||||
config={clientManagementConfig}
|
||||
initialData={clients}
|
||||
initialTotalCount={pagination?.total || clients.length}
|
||||
externalPagination={{
|
||||
currentPage,
|
||||
totalPages,
|
||||
totalItems: pagination?.total || clients.length,
|
||||
itemsPerPage,
|
||||
onPageChange: handlePageChange,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user