@@ -45,7 +45,7 @@ export default function CoSttn() {
|
||||
|
||||
const [bdstTable, setBdstTable] = useState<DemandCompType[]>();
|
||||
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]);
|
||||
}}
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user