diff --git a/apps/st/src/components/statistics/verification/GeneralVerificationManagement.tsx b/apps/st/src/components/statistics/verification/GeneralVerificationManagement.tsx index face7555d..474b2993b 100644 --- a/apps/st/src/components/statistics/verification/GeneralVerificationManagement.tsx +++ b/apps/st/src/components/statistics/verification/GeneralVerificationManagement.tsx @@ -1,30 +1,30 @@ "use client"; -import { useState, useEffect, useMemo } from 'react'; - -import { CodeSelectWithAll } from '@/entities/code'; -import { - Button, - Label, - Select, - SelectTrigger, - SelectContent, - SelectValue, - SelectItem, - DataTable, -} from "@common/components"; -import { LoadingWithAnimation } from '@common/components'; -import { NoData } from '@/shared/ui/no-data'; -import DetailComponent from './generalVerification/DetailComponent'; -import RegistDialog from './generalVerification/RegistDialog'; +import { useEffect, useMemo, useState } from "react"; import { getCoreRowModel, useReactTable } from "@tanstack/react-table"; -import { getGeneralVerificationColumns } from '@/components/util/column/management/GeneralVerificationColumn'; -import type { GeneralverificationList } from '@/entities/statistics/model/general-verification-interface'; -import { generalverificationApiService } from '@/entities/statistics/api/general-verification-service'; -import { useAlertStore } from '@/shared/lib'; +import { useAlertStore } from "@/shared/lib"; +import { NoData } from "@/shared/ui/no-data"; +import { CodeSelectWithAll } from "@/entities/code"; +import { generalverificationApiService } from "@/entities/statistics/api/general-verification-service"; +import type { GeneralverificationList } from "@/entities/statistics/model/general-verification-interface"; +import { + Button, + DataTable, + Label, + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@common/components"; +import { LoadingWithAnimation } from "@common/components"; +import DetailComponent from "./generalVerification/DetailComponent"; +import RegistDialog from "./generalVerification/RegistDialog"; + +import { getGeneralVerificationColumns } from "@/components/util/column/management/GeneralVerificationColumn"; const GeneralVerificationManagement = () => { const [searchValues, setSearchValues] = useState<{ @@ -32,12 +32,16 @@ const GeneralVerificationManagement = () => { useYn: string; vrfcClsfCd: string; }>({ - statsCd: '', - useYn: '', - vrfcClsfCd: '', + statsCd: "", + useYn: "", + vrfcClsfCd: "", }); - const [vrfcMasterData, setVrfcMasterData] = useState([]); - const [rowSelection, setRowSelection] = useState>({}); + const [vrfcMasterData, setVrfcMasterData] = useState< + GeneralverificationList[] + >([]); + const [rowSelection, setRowSelection] = useState>( + {}, + ); const [isLoading, setIsLoading] = useState(false); const [selectedVrfcRow, setSelectedVrfcRow] = useState(null); const [showRegistForm, setShowRegistForm] = useState(false); @@ -53,21 +57,26 @@ const GeneralVerificationManagement = () => { trgtStatsCd: searchValues.statsCd, vrfcClsfCd: searchValues.vrfcClsfCd, useYn: searchValues.useYn, - }).filter(([, value]) => value !== '' && value !== 'ALL') + }).filter(([, value]) => value !== "" && value !== "ALL"), ); - const response = await generalverificationApiService.getGeneralverificationList(params); + const response = + await generalverificationApiService.getGeneralverificationList( + params, + ); - if (response.status === 'success') { + if (response.status === "success") { setVrfcMasterData(response.data); setRowSelection({}); setSelectedVrfcRow(null); setShowRegistForm(false); } else { - alert(response.message || '데이터 조회 중 오류가 발생했습니다.'); + alert( + response.message || "데이터 조회 중 오류가 발생했습니다.", + ); } } catch { - alert('데이터 조회 중 오류가 발생했습니다.'); + alert("데이터 조회 중 오류가 발생했습니다."); } finally { setIsLoading(false); } @@ -98,48 +107,67 @@ const GeneralVerificationManagement = () => { setSelectedVrfcRow(null); handleSearch(); setShowRegistForm(false); - } + }; useEffect(() => { handleSearch(); }, []); return ( -
-
-
-
- + <> +
+
+
+ setSearchValues({ ...searchValues, statsCd: value })} + onValueChange={(value) => + setSearchValues({ + ...searchValues, + statsCd: value, + }) + } placeholder="전체" className="w-[16rem]" />
-
- - + setSearchValues({ + ...searchValues, + vrfcClsfCd: value, + }) + } + > 전체 - 도단위 검증 - 시단위 검증 + + 도단위 검증 + + + 시단위 검증 +
-
- - + setSearchValues({ + ...searchValues, + useYn: value, + }) + } + > @@ -150,53 +178,64 @@ const GeneralVerificationManagement = () => {
-
- - -
-
-
-
-
- - - -
-
-
-
-

일반 검증 목록

-
-
- {isLoading && ( -
-
- -
-
- )} - {isLoading ? null - : - vrfcMasterData.length > 0 ? - handleVrfcMasterRowClick(value)} /> - : -
- -
- } -
-
-
+
+
+
+

+ 일반 검증 목록 +

+ + + +
+
+ {isLoading && ( +
+
+ +
+
+ )} + {isLoading ? null : vrfcMasterData.length > 0 ? ( + + handleVrfcMasterRowClick(value) + } + /> + ) : ( +
+ +
+ )} +
+
+ +
+ ); }; -export default GeneralVerificationManagement; \ No newline at end of file +export default GeneralVerificationManagement; diff --git a/apps/st/src/components/statistics/verification/VerificationArticleManagement.tsx b/apps/st/src/components/statistics/verification/VerificationArticleManagement.tsx index a7fc97019..c91b520ce 100644 --- a/apps/st/src/components/statistics/verification/VerificationArticleManagement.tsx +++ b/apps/st/src/components/statistics/verification/VerificationArticleManagement.tsx @@ -19,6 +19,7 @@ import type { } from "@/entities/statistics/model/verification-target-management-interface"; import { Button, + cn, Dialog, DialogContent, DialogFooter, @@ -32,6 +33,7 @@ import { TabsTrigger, } from "@common/components"; +import GeneralVerificationManagement from "./GeneralVerificationManagement"; import { VerificationTargetDialog } from "./VerificationTargetDialog"; import DataGrid from "@/components/module/DataGrid"; @@ -39,9 +41,9 @@ import DataGrid from "@/components/module/DataGrid"; const TAB_CONFIG = { HB: { value: "HB", label: "H-B", columnInfo: hbArticleColumnInfo }, IMR: { value: "IMR", label: "I-MR", columnInfo: imrArticleColumnInfo }, - VV: { - value: "VV", - label: "Validation", + GENERAL: { + value: "GENERAL", + label: "일반", columnInfo: validationArticleColumnInfo, }, } as const; @@ -253,83 +255,90 @@ function VerificationArticleManagement() { ))} + {activeTab !== "GENERAL" && ( +
+
+
+
+ + +
-
- -
-
- - -
+
+ + + setVrfcTrgtNm(e.target.value) + } + placeholder="검증명" + className="w-[20rem]" + /> +
-
- - - setVrfcTrgtNm(e.target.value) - } - placeholder="검증명" - className="w-[20rem]" - /> +
+ + + + +
- -
- - - - -
-
- -
+ +
+ )} {Object.entries(TAB_CONFIG).map(([key, config]) => ( - - {}} - onRowClick={handleRowClick} - isExcelImport={false} - /> + + {activeTab !== "GENERAL" ? ( + {}} + onRowClick={handleRowClick} + isExcelImport={false} + /> + ) : ( + + )} ))}