From 9da828b92e5afe8cd27daa61c517a9b7c03f70e7 Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Fri, 20 Jun 2025 14:59:34 +0900 Subject: [PATCH] =?UTF-8?q?=EC=88=98=EC=9A=94=EC=B2=98=20=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=20=ED=8E=98=EC=9D=B4=EC=A7=80=EC=B2=98=EB=A6=AC=20(?= =?UTF-8?q?=EC=A7=84=ED=96=89=EC=A4=91)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/matMng/coMng/coSttn/page.tsx | 4 ++-- apps/wr/app/store/matDmd/coSttn/index.tsx | 17 ++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/apps/wr/app/matMng/coMng/coSttn/page.tsx b/apps/wr/app/matMng/coMng/coSttn/page.tsx index b33a7a138..163195756 100644 --- a/apps/wr/app/matMng/coMng/coSttn/page.tsx +++ b/apps/wr/app/matMng/coMng/coSttn/page.tsx @@ -45,7 +45,7 @@ export default function CoSttn() { const [bdstTable, setBdstTable] = useState(); const [pageNation, setPageNation] = useState(1); - const { coSttnRes } = coSttn; + const { coSttnRes, coSttnResCount } = coSttn; const [isDmdModal, setIsDmdModal] = useState<{ isMoal: boolean; data: DemandCompType; @@ -209,7 +209,7 @@ export default function CoSttn() { tableData={bdstTable || []} headlist={coSttn.coSttHeadList} pageSize={bdstTable?.length ? Math.ceil(bdstTable.length / 13) : 0} - total={bdstTable?.length || 10000} + total={ coSttnResCount || 0 } cellClick={(index: number | undefined, headId: string) => { setUpdateData(coSttnRes[index as number]); }} diff --git a/apps/wr/app/store/matDmd/coSttn/index.tsx b/apps/wr/app/store/matDmd/coSttn/index.tsx index 4b8c60436..0de37bbfc 100644 --- a/apps/wr/app/store/matDmd/coSttn/index.tsx +++ b/apps/wr/app/store/matDmd/coSttn/index.tsx @@ -1,5 +1,5 @@ import type { CommonTableProps } from "@/app/store/common/type/header"; -import { fetchType, getFetch } from "@/components/lib/api"; +import { fetchType, getFetch, getFetchWithCount } from "@/components/lib/api"; import { coSttHeadListExport, coSttNodeListExport } from "./headList"; import { excelCoSttnParsing } from "./excel"; import type { DemandCompType } from "@common/business_components/ui"; @@ -17,6 +17,7 @@ export type coSttnState = { coSttNodeList: CommonTableProps[]; excelList: []; isInit: boolean; + coSttnResCount: number; }; }; @@ -35,6 +36,7 @@ export const coSttnStateExport: coSttnState = { coSttnRes: coSttnRes, excelList: [], isInit: false, + coSttnResCount: 0, }, }; @@ -46,19 +48,19 @@ export const coSttnActionsExport: (set: any) => coSttnActions = ( coSttnInit: async (pageNo:string, pageCnt:string, con: string) => { try { - const coSttnRes = await getFetch( + const coSttnRes = await getFetchWithCount( fetchType.WR, `/reuseFc/request/${pageNo}/${pageCnt}/${con}` ); - set((state: coSttnState) => { return { ...state, coSttn: { ...state.coSttn, - coSttnRes: coSttnRes, + coSttnRes: coSttnRes.data, isInit: false, + coSttnResCount: coSttnRes.count, }, }; }); @@ -68,12 +70,12 @@ export const coSttnActionsExport: (set: any) => coSttnActions = ( }, coSttnSearch: async (pageNo:string, pageCnt:string, con: string) => { try { - const coSttnRes = await getFetch( + const coSttnRes = await getFetchWithCount( fetchType.WR, `/reuseFc/request/${pageNo}/${pageCnt}/${con}` ); if (Number(pageCnt) >= 10000) { - const coExcel = excelCoSttnParsing(coSttnRes); + const coExcel = excelCoSttnParsing(coSttnRes.data); set((state: coSttnState) => { return { ...state, @@ -90,8 +92,9 @@ export const coSttnActionsExport: (set: any) => coSttnActions = ( ...state, coSttn: { ...state.coSttn, - coSttnRes: coSttnRes, + coSttnRes: coSttnRes.data, isInit: false, + coSttnResCount : coSttnRes.count, }, }; });