From c439d3e58aef86c69f16d899facff5c959f4b273 Mon Sep 17 00:00:00 2001 From: bicochan Date: Mon, 9 Feb 2026 13:56:33 +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=EA=B4=80=EB=A6=AC=20=EB=A0=88=EC=9D=B4=EC=95=84?= =?UTF-8?q?=EC=9B=83=20=EC=9E=91=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VerificationArticleManagement.tsx | 173 +++++++++++++++++ .../model/verification-article-column.ts | 180 ++++++++++++++++++ .../model/verification-article-interface.ts | 51 +++++ .../model/verification-article-mock.ts | 100 ++++++++++ 4 files changed, 504 insertions(+) create mode 100644 apps/st/src/components/statistics/verification/VerificationArticleManagement.tsx create mode 100644 apps/st/src/entities/statistics/model/verification-article-column.ts create mode 100644 apps/st/src/entities/statistics/model/verification-article-interface.ts create mode 100644 apps/st/src/entities/statistics/model/verification-article-mock.ts diff --git a/apps/st/src/components/statistics/verification/VerificationArticleManagement.tsx b/apps/st/src/components/statistics/verification/VerificationArticleManagement.tsx new file mode 100644 index 000000000..a09a5cbb6 --- /dev/null +++ b/apps/st/src/components/statistics/verification/VerificationArticleManagement.tsx @@ -0,0 +1,173 @@ +"use client"; + +import DataGrid from "@/components/module/DataGrid"; +import { + hbArticleColumnInfo, + imrArticleColumnInfo, + validationArticleColumnInfo, +} from "@/entities/statistics/model/verification-article-column"; +import { + hbArticleMockData, + imrArticleMockData, + validationArticleMockData, +} from "@/entities/statistics/model/verification-article-mock"; +import { + Button, + Input, + Label, + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, + Tabs, + TabsContent, + TabsList, + TabsTrigger, +} from "@common/components"; +import { useState } from "react"; + +const VerificationArticleManagement = () => { + const [statsItm, setStatsItm] = useState("통계항목"); + const [vrfcNm, setVrfcNm] = useState(""); + + // 각 탭별 데이터 + const [hbRowData, setHbRowData] = useState< + Record[] + >(hbArticleMockData as unknown as Record[]); + + const [imrRowData, setImrRowData] = useState< + Record[] + >(imrArticleMockData as unknown as Record[]); + + const [validationRowData, setValidationRowData] = useState< + Record[] + >( + validationArticleMockData as unknown as Record< + string, + string | number + >[], + ); + + const handleSearch = () => { + console.log("조회", { statsItm, vrfcNm }); + }; + + const handleReset = () => { + setStatsItm("통계항목"); + setVrfcNm(""); + }; + + const handleInitialize = () => { + console.log("초기화"); + }; + + const handleSave = () => { + console.log("저장"); + }; + + const handleDelete = () => { + console.log("등록"); + }; + + return ( + + {/* 탭 리스트 */} + + H-B + I-MR + Validation + + +
+
+
+ + +
+ +
+ + setVrfcNm(e.target.value)} + placeholder="검증명" + className="w-[20rem]" + /> +
+ +
+ + +
+
+
+ + {/* H-B 탭 콘텐츠 */} + + {/* 데이터 그리드 */} + + + + {/* I-MR 탭 콘텐츠 */} + + {/* 데이터 그리드 */} + + + + {/* Validation 탭 콘텐츠 */} + + {/* 데이터 그리드 */} + + +
+ ); +}; + +export default VerificationArticleManagement; diff --git a/apps/st/src/entities/statistics/model/verification-article-column.ts b/apps/st/src/entities/statistics/model/verification-article-column.ts new file mode 100644 index 000000000..d9c679f03 --- /dev/null +++ b/apps/st/src/entities/statistics/model/verification-article-column.ts @@ -0,0 +1,180 @@ +import type { ColumnInfo } from "@rsone/components"; + +/** H-B 탭 그리드 컬럼 설정 */ +export const hbArticleColumnInfo: ColumnInfo = { + columns: [ + { + name: "no", + fieldName: "no", + header: { text: "순번" }, + editable: false, + sortdisable: false, + }, + { + name: "statsItmNm", + fieldName: "statsItmNm", + header: { text: "통계 항목" }, + editable: false, + sortdisable: false, + }, + { + name: "vrfcNm", + fieldName: "vrfcNm", + header: { text: "검증명" }, + editable: false, + sortdisable: false, + }, + { + name: "dataBlck", + fieldName: "dataBlck", + header: { text: "데이터블럭" }, + editable: false, + sortdisable: false, + }, + { + name: "colNm", + fieldName: "colNm", + header: { text: "컬럼명" }, + editable: false, + sortdisable: false, + }, + { + name: "cmpDataBlck", + fieldName: "cmpDataBlck", + header: { text: "비교 데이터블럭" }, + editable: false, + sortdisable: false, + }, + { + name: "cmpColNm", + fieldName: "cmpColNm", + header: { text: "비교 컬럼명" }, + editable: false, + sortdisable: false, + }, + { + name: "bscRul", + fieldName: "bscRul", + header: { text: "기본규칙" }, + editable: false, + sortdisable: false, + }, + ], + columnLayout: [ + "no", + "statsItmNm", + "vrfcNm", + "dataBlck", + "colNm", + "cmpDataBlck", + "cmpColNm", + "bscRul", + ], +}; + +/** I-MR 탭 그리드 컬럼 설정 */ +export const imrArticleColumnInfo: ColumnInfo = { + columns: [ + { + name: "no", + fieldName: "no", + header: { text: "순번" }, + editable: false, + sortdisable: false, + }, + { + name: "statsItmNm", + fieldName: "statsItmNm", + header: { text: "통계 항목" }, + editable: false, + sortdisable: false, + }, + { + name: "vrfcNm", + fieldName: "vrfcNm", + header: { text: "검증명" }, + editable: false, + sortdisable: false, + }, + { + name: "dataBlck", + fieldName: "dataBlck", + header: { text: "데이터블럭" }, + editable: false, + sortdisable: false, + }, + { + name: "colNm", + fieldName: "colNm", + header: { text: "컬럼명" }, + editable: false, + sortdisable: false, + }, + { + name: "cmpDataBlck", + fieldName: "cmpDataBlck", + header: { text: "비교 데이터블럭" }, + editable: false, + sortdisable: false, + }, + { + name: "cmpColNm", + fieldName: "cmpColNm", + header: { text: "비교 컬럼명" }, + editable: false, + sortdisable: false, + }, + { + name: "bscRul", + fieldName: "bscRul", + header: { text: "기본규칙" }, + editable: false, + sortdisable: false, + }, + ], + columnLayout: [ + "no", + "statsItmNm", + "vrfcNm", + "dataBlck", + "colNm", + "cmpDataBlck", + "cmpColNm", + "bscRul", + ], +}; + +/** Validation 탭 그리드 컬럼 설정 */ +export const validationArticleColumnInfo: ColumnInfo = { + columns: [ + { + name: "statsItmNm", + fieldName: "statsItmNm", + header: { text: "통계항목" }, + editable: false, + sortdisable: false, + }, + { + name: "vrfcNm", + fieldName: "vrfcNm", + header: { text: "검증명" }, + editable: false, + sortdisable: false, + }, + { + name: "dataBlck", + fieldName: "dataBlck", + header: { text: "데이터블럭" }, + editable: false, + sortdisable: false, + }, + { + name: "colNm", + fieldName: "colNm", + header: { text: "컬럼명" }, + editable: false, + sortdisable: false, + }, + ], + columnLayout: ["statsItmNm", "vrfcNm", "dataBlck", "colNm"], +}; diff --git a/apps/st/src/entities/statistics/model/verification-article-interface.ts b/apps/st/src/entities/statistics/model/verification-article-interface.ts new file mode 100644 index 000000000..150498fcb --- /dev/null +++ b/apps/st/src/entities/statistics/model/verification-article-interface.ts @@ -0,0 +1,51 @@ +/** H-B 탭 검증 항목 */ +export interface HBArticleItem { + /** 순번 */ + no: string; + /** 통계 항목명 */ + statsItmNm: string; + /** 검증명 */ + vrfcNm: string; + /** 데이터블럭 */ + dataBlck: string; + /** 컬럼명 */ + colNm: string; + /** 비교 데이터블럭 */ + cmpDataBlck: string; + /** 비교 컬럼명 */ + cmpColNm: string; + /** 기본규칙 */ + bscRul: string; +} + +/** I-MR 탭 검증 항목 */ +export interface IMRArticleItem { + /** 순번 */ + no: string; + /** 통계 항목명 */ + statsItmNm: string; + /** 검증명 */ + vrfcNm: string; + /** 데이터블럭 */ + dataBlck: string; + /** 컬럼명 */ + colNm: string; + /** 비교 데이터블럭 */ + cmpDataBlck: string; + /** 비교 컬럼명 */ + cmpColNm: string; + /** 기본규칙 */ + bscRul: string; +} + +/** Validation 탭 검증 항목 */ +export interface ValidationArticleItem { + /** 통계항목 */ + statsItmNm: string; + /** 검증명 */ + vrfcNm: string; + /** 데이터블럭 */ + dataBlck: string; + /** 컬럼명 */ + colNm: string; +} diff --git a/apps/st/src/entities/statistics/model/verification-article-mock.ts b/apps/st/src/entities/statistics/model/verification-article-mock.ts new file mode 100644 index 000000000..49de3d74e --- /dev/null +++ b/apps/st/src/entities/statistics/model/verification-article-mock.ts @@ -0,0 +1,100 @@ +import { fakerKO as faker } from "@faker-js/faker"; +import type { + HBArticleItem, + IMRArticleItem, + ValidationArticleItem, +} from "./verification-article-interface"; + +const HB_STATS_ITEMS = [ + "하수도 보급률", + "하수관로", + "하수처리시설 및 방류량보고", + "펌프장", + "공공하수처리시설", + "분뇨처리시설", + "개인하수처리시설", + "하수도재정", + "물 재이용", +]; + +const IMR_STATS_ITEMS = [ + "하수도 보급률", + "하수관로", + "하수처리시설 및 방류량보고", + "펌프장", + "공공하수처리시설", + "분뇨처리시설", + "개인하수처리시설", + "하수도재정", + "물 재이용", +]; + +const VALIDATION_STATS_ITEMS = [ + "하수관로 유지관리", + "하수저류시설 및 빗물펌프장", + "공공하수처리시설", + "분뇨처리시설", + "개인하수처리시설", + "하수도재정", +]; + +const VERIFICATION_NAMES = [ + "제정별 사업비", + "관로길이", + "공란검증", + "범위검증", + "논리검증", + "유지보수", +]; + +/** H-B 탭 목데이터 생성 */ +export function createHBArticleMock(count = 10): HBArticleItem[] { + faker.seed(100); + return Array.from({ length: count }, (_, index) => ({ + no: `H-B`, + statsItmNm: faker.helpers.arrayElement(HB_STATS_ITEMS), + vrfcNm: faker.helpers.arrayElement(VERIFICATION_NAMES), + dataBlck: `2025-02-01`, + colNm: "", + cmpDataBlck: "", + cmpColNm: "", + bscRul: "", + })); +} + +/** I-MR 탭 목데이터 생성 */ +export function createIMRArticleMock(count = 10): IMRArticleItem[] { + faker.seed(200); + return Array.from({ length: count }, (_, index) => ({ + no: `I-MR`, + statsItmNm: faker.helpers.arrayElement(IMR_STATS_ITEMS), + vrfcNm: faker.helpers.arrayElement(VERIFICATION_NAMES), + dataBlck: `2025-02-01`, + colNm: "", + cmpDataBlck: "", + cmpColNm: "", + bscRul: "", + })); +} + +/** Validation 탭 목데이터 생성 */ +export function createValidationArticleMock( + count = 4, +): ValidationArticleItem[] { + faker.seed(300); + return Array.from({ length: count }, (_, index) => ({ + statsItmNm: faker.helpers.arrayElement(VALIDATION_STATS_ITEMS), + vrfcNm: faker.helpers.arrayElement(VERIFICATION_NAMES), + dataBlck: "", + colNm: "", + })); +} + +/** H-B 탭 기본 목데이터 */ +export const hbArticleMockData = createHBArticleMock(10); + +/** I-MR 탭 기본 목데이터 */ +export const imrArticleMockData = createIMRArticleMock(10); + +/** Validation 탭 기본 목데이터 */ +export const validationArticleMockData = createValidationArticleMock(4);