st: feat: 일반검증 관리 기능 작업 중

This commit is contained in:
2026-03-17 10:07:08 +09:00
parent f575e3b677
commit 685ba15baa
11 changed files with 1144 additions and 117 deletions
@@ -1,10 +1,14 @@
import dayjs from "dayjs";
import { useState } from "react";
import type { ColumnDef } from "@tanstack/react-table";
import { Button } from "@common/components";
import type { GeneralverificationList } from "@/entities/statistics/model/general-verification-interface";
export const GeneralVerificationColumn: ColumnDef<GeneralverificationList>[] = [
import { Button } from "@common/components";
import RegistDialog from "@/components/statistics/verification/generalVerification/RegistDialog";
export const getGeneralVerificationColumns = (
onUpdateSuccess?: () => void,
): ColumnDef<GeneralverificationList>[] => [
{
id: "no",
header: "NO",
@@ -14,21 +18,20 @@ export const GeneralVerificationColumn: ColumnDef<GeneralverificationList>[] = [
return totalRows - (pageIndex * pageSize + row.index);
},
},
// {
// accessorKey: "vrfcSn",
// header: "일련번호",
// },
{
accessorKey: "vrfSn",
header: "일련번호",
enableHiding: true,
},
{
accessorKey: "tabNm",
accessorKey: "trgtStatsNm",
header: "통계항목",
},
{
accessorKey: "vrfNm",
accessorKey: "vrfcNm",
header: "검증명",
},
{
accessorKey: "vrfClsCd",
accessorKey: "vrfcClsfNm",
header: "검증분류",
},
{
@@ -48,15 +51,31 @@ export const GeneralVerificationColumn: ColumnDef<GeneralverificationList>[] = [
header: "관리",
cell: ({ row }) => (
<div onClick={(e) => e.stopPropagation()}>
<GeneralVerificationManageButton vrfSn={row.original.vrfSn} />
<GeneralVerificationManageButton
vrfcSn={row.original.vrfcSn}
onSuccess={onUpdateSuccess}
/>
</div>
),
},
];
const GeneralVerificationManageButton = ({ vrfSn }: { vrfSn: number }) => {
const GeneralVerificationManageButton = ({
vrfcSn,
onSuccess,
}: {
vrfcSn: string;
onSuccess?: () => void;
}) => {
const [dialogOpen, setDialogOpen] = useState(false);
return (
<Button size="sm" >관리</Button>
<RegistDialog
open={dialogOpen}
onOpenChange={setDialogOpen}
vrfcSn={vrfcSn}
onSuccess={onSuccess}
>
<Button size="sm">관리</Button>
</RegistDialog>
);
};