jyha product

This commit is contained in:
truthwing
2025-07-04 15:40:13 +09:00
parent df55c3fe12
commit cec35e6724
8 changed files with 439 additions and 178 deletions
@@ -1,22 +1,22 @@
"use client";
import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/TableHead";
import { useWrStore } from "@/app/store";
import type { rainChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList";
import type { TableUpperProps } from "@/app/store/common/type/header";
import { type rainChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList";
import { tableData } from "@/components/lib/func/commom";
import {
chRowspanTable,
headVisibleChange,
rainChkTableData
} from "@/components/lib/func/TableData";
import LoadingOverlay from "@common/business_components/ui/loadingBar";
import UiPageNations from "@common/business_components/ui/table/uiPageNations";
import {
Table,
TableBody,
TableHeader,
} from "@common/components/ui";
import { useCallback, useEffect, useState } from "react";
import UiPageNations from "@common/business_components/ui/table/uiPageNations";
export default function RainChkgdTable({
detailUp,
handleClick = () => { },
@@ -24,6 +24,7 @@ export default function RainChkgdTable({
rainChkData,
pageNation,
onPageChange,
pageCount,
}: {
detailUp: (data: rainChkZodType[]) => void;
handleClick?: (data: any) => void;
@@ -31,6 +32,7 @@ export default function RainChkgdTable({
rainChkData?: rainChkZodType[];
pageNation: number;
onPageChange: (page: number) => void;
pageCount: number;
}) {
const { code, rainChkgdn, rainChkSttn, getRainSttnExcel } = useWrStore((state) => state);
const [makeTableData, setMakeTableData] = useState<any[]>([]);
@@ -70,16 +72,12 @@ export default function RainChkgdTable({
}, [makeTableData, handleClick]);
useEffect(() =>{
},[rainChkgdn.rainChk])
useEffect(() => {
setSelectedIds([])// 셀렉트 초기화를 위한 작업
if (rainChkData) {
if (rainChkData && rainChkData.length > 0) {
const rainChg = rainChkData.map((item: any) => {
const rainChg = rainChkData?.map((item: any) => {
const bud = tableData([item.building], { code });
return {
...item,
@@ -89,6 +87,8 @@ export default function RainChkgdTable({
});
setMakeTableData(rainChkTableData(rainChg));
} else {
setMakeTableData([]);
}
}, [rainChkData, code]);
@@ -167,16 +167,15 @@ export default function RainChkgdTable({
} else {
setHeadList({
headList: rainChkgdn.rainChkgdnHeadList,
upHeadList: rainChkgdn.rainHeadNm
upHeadList: rainChkgdn.rainMainHeadNm
})
}
}, [rainChkSttn.isSttn, rainChkgdn.rainChkgdnHeadList, rainChkSttn.rainChkgdnHeadList]);
return (
<>
<LoadingOverlay isLoading={rainChkgdn.isLoading}></LoadingOverlay>
<Table variant="secondary">
<TableHeader className="font-bold">
{headMakeprfmnc(
@@ -197,9 +196,9 @@ export default function RainChkgdTable({
</TableBody>
</Table>
<UiPageNations
total={rainChkData?.length ?? 0}
total={pageCount}
cur={pageNation}
pageSize={20}
pageSize={rainPageSize}
onPageChange={onPageChange}
/>
</>
@@ -1,20 +1,22 @@
"use client";
import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/TableHead";
import { useWrStore } from "@/app/store";
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList";
import type {
rswtChkZodType,
rswtrChkDetailsZodType,
} from "@/app/store/prfmncReg/chkgdnReg/rswrtChkgdn";
import type { TableUpperProps } from "@/app/store/common/type/header";
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList";
import {
rswtPageSize,
type rswtChkZodType,
type rswtrChkDetailsZodType,
} from "@/app/store/prfmncReg/chkgdnReg/rswrtChkgdn";
import { tableData } from "@/components/lib/func/commom";
import {
chRowspanTable,
rswtChkTableData,
} from "@/components/lib/func/TableData";
import LoadingOverlay from "@common/business_components/ui/loadingBar";
import UiPageNations from "@common/business_components/ui/table/uiPageNations";
import { Table, TableBody, TableHeader } from "@common/components/ui";
import { useCallback, useEffect, useState } from "react";
import UiPageNations from "@common/business_components/ui/table/uiPageNations";
export default function RswtChkgdTable({
detaiRswtlUpdate,
@@ -23,6 +25,7 @@ export default function RswtChkgdTable({
rswtChkData,
pageNation,
onPageChange,
pageCount,
}: {
detaiRswtlUpdate: (data: rswtrChkDetailsZodType[]) => void;
handleRswtClick?: (data: any) => void;
@@ -30,6 +33,7 @@ export default function RswtChkgdTable({
rswtChkData: rswtChkZodType[];
pageNation: number;
onPageChange: (page: number) => void;
pageCount: number;
}) {
const { code, rswtChkgdn, rswtChkSttn, rswtChkgdnInit, rswtChkPolAndGuide, getRswtSttnExcel } = useWrStore(
(state) => state
@@ -133,6 +137,7 @@ export default function RswtChkgdTable({
return (
<>
<LoadingOverlay isLoading={rswtChkgdn.isLoading}></LoadingOverlay>
<Table variant="secondary">
<TableHeader className="font-bold">
{headMakeprfmnc(headList?.headList, headList?.upHeadList)}
@@ -150,9 +155,9 @@ export default function RswtChkgdTable({
</TableBody>
</Table>
<UiPageNations
total={rswtChkData?.length ?? 0}
total={pageCount}
cur={pageNation}
pageSize={20}
pageSize={rswtPageSize}
onPageChange={onPageChange}
/>
</>