From 5446a8a6568e5f46fe6f990c8beabed8797b09f4 Mon Sep 17 00:00:00 2001 From: bicochan Date: Thu, 12 Mar 2026 16:56:39 +0900 Subject: [PATCH] =?UTF-8?q?[st]=20feat:=20=EA=B2=80=EC=A6=9D=20=ED=95=AD?= =?UTF-8?q?=EB=AA=A9=20=EB=93=B1=EB=A1=9D=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VerificationArticleManagement.tsx | 42 ++++++- .../verification/VerificationTargetDialog.tsx | 114 ++++++++++++------ 2 files changed, 115 insertions(+), 41 deletions(-) diff --git a/apps/st/src/components/statistics/verification/VerificationArticleManagement.tsx b/apps/st/src/components/statistics/verification/VerificationArticleManagement.tsx index b852b1496..d919a6823 100644 --- a/apps/st/src/components/statistics/verification/VerificationArticleManagement.tsx +++ b/apps/st/src/components/statistics/verification/VerificationArticleManagement.tsx @@ -108,6 +108,30 @@ function VerificationArticleManagement() { }); } + const saveMutation = useMutation({ + mutationFn: (data: VerificationTargetManagementResponse) => + verificationTargetManagementApi.saveVerificationTargetManagement({ + vrfcMthdCd: data.vrfcMthdCd || activeTab, + statsCd: data.statsCd, + schmNm: data.schmNm, + tblNm: data.tblNm, + colNm: data.colNm, + pkColNm: data.pkColNm, + ipcrCntVl: data.ipcrCntVl, + pctlCrtrVl: data.pctlCrtrVl, + scopCntCntVl: data.scopCntCntVl, + thrsCntVl: data.thrsCntVl, + useYn: data.useYn, + vrfcTrgtNm: data.vrfcTrgtNm, + }), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: [ENDPOINT.STATVERIFY_SERVICE.VRFCTGT_MNG], + }); + setDialogOpen(false); + }, + }); + const updateMutation = useMutation({ mutationFn: (data: VerificationTargetManagementResponse) => verificationTargetManagementApi.updateVerificationTargetManagement( @@ -155,6 +179,11 @@ function VerificationArticleManagement() { setDialogOpen(true); } + function handleRegister() { + setSelectedData(null); + setDialogOpen(true); + } + function handleSubmit(e: React.FormEvent) { e.preventDefault(); handleSearch(); @@ -162,7 +191,11 @@ function VerificationArticleManagement() { async function handleSave(data: VerificationTargetManagementResponse) { if (await confirm("저장하시겠습니까?")) { - updateMutation.mutate(data); + if (data.vrfcTrgtSn) { + updateMutation.mutate(data); + } else { + saveMutation.mutate(data); + } } } @@ -219,6 +252,13 @@ function VerificationArticleManagement() {
+ - + {data && ( + + )}