[st] chore: 검증 항목 관리 테이블 컬럼 수정

This commit is contained in:
2026-02-11 15:45:51 +09:00
parent fbe355f6cf
commit 3b23113955
3 changed files with 207 additions and 122 deletions
@@ -1,15 +1,9 @@
import { ValueType } from "realgrid";
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",
@@ -18,16 +12,16 @@ export const hbArticleColumnInfo: ColumnInfo = {
sortdisable: false,
},
{
name: "vrfcNm",
fieldName: "vrfcNm",
header: { text: "검증명" },
name: "vrfcItmNm",
fieldName: "vrfcItmNm",
header: { text: "검증 항목" },
editable: false,
sortdisable: false,
},
{
name: "dataBlck",
fieldName: "dataBlck",
header: { text: "데이터블럭" },
name: "tblNm",
fieldName: "tblNm",
header: { text: "테이블" },
editable: false,
sortdisable: false,
},
@@ -39,41 +33,111 @@ export const hbArticleColumnInfo: ColumnInfo = {
sortdisable: false,
},
{
name: "cmpDataBlck",
fieldName: "cmpDataBlck",
header: { text: "비교 데이터블럭" },
name: "percentileVal",
fieldName: "percentileVal",
header: { text: "Percentile" },
editable: false,
sortdisable: false,
valueType: ValueType.NUMBER,
dataFormat: "#,##0.##",
},
{
name: "aVal",
fieldName: "aVal",
header: { text: "A" },
editable: false,
sortdisable: false,
valueType: ValueType.NUMBER,
dataFormat: "#,##0.###",
},
{
name: "cVal",
fieldName: "cVal",
header: { text: "C" },
editable: false,
sortdisable: false,
valueType: ValueType.NUMBER,
dataFormat: "#,##0.###",
},
{
name: "regNm",
fieldName: "regNm",
header: { text: "등록자" },
editable: false,
sortdisable: false,
},
{
name: "cmpColNm",
fieldName: "cmpColNm",
header: { text: "비교 컬럼명" },
editable: false,
sortdisable: false,
},
{
name: "bscRul",
fieldName: "bscRul",
header: { text: "기본규칙" },
name: "regDt",
fieldName: "regDt",
header: { text: "등록일" },
editable: false,
sortdisable: false,
},
],
columnLayout: [
"no",
"statsItmNm",
"vrfcNm",
"dataBlck",
"vrfcItmNm",
"tblNm",
"colNm",
"cmpDataBlck",
"cmpColNm",
"bscRul",
"percentileVal",
"aVal",
"cVal",
"regNm",
"regDt",
],
};
/** I-MR 탭 그리드 컬럼 설정 */
export const imrArticleColumnInfo: ColumnInfo = {
columns: [
{
name: "statsItmNm",
fieldName: "statsItmNm",
header: { text: "통계 항목" },
editable: false,
sortdisable: false,
},
{
name: "vrfcNm",
fieldName: "vrfcNm",
header: { text: "검증명" },
editable: false,
sortdisable: false,
},
{
name: "tblNm",
fieldName: "tblNm",
header: { text: "테이블명" },
editable: false,
sortdisable: false,
},
{
name: "colNm",
fieldName: "colNm",
header: { text: "컬럼명" },
editable: false,
sortdisable: false,
},
{
name: "regNm",
fieldName: "regNm",
header: { text: "등록자" },
editable: false,
sortdisable: false,
},
{
name: "regDt",
fieldName: "regDt",
header: { text: "등록일" },
editable: false,
sortdisable: false,
},
],
columnLayout: ["statsItmNm", "vrfcNm", "tblNm", "colNm", "regNm", "regDt"],
};
/** Validation 탭 그리드 컬럼 설정 */
export const validationArticleColumnInfo: ColumnInfo = {
columns: [
{
name: "no",
@@ -97,9 +161,9 @@ export const imrArticleColumnInfo: ColumnInfo = {
sortdisable: false,
},
{
name: "dataBlck",
fieldName: "dataBlck",
header: { text: "데이터블럭" },
name: "tblNm",
fieldName: "tblNm",
header: { text: "테이블명" },
editable: false,
sortdisable: false,
},
@@ -111,9 +175,9 @@ export const imrArticleColumnInfo: ColumnInfo = {
sortdisable: false,
},
{
name: "cmpDataBlck",
fieldName: "cmpDataBlck",
header: { text: "비교 데이터블럭" },
name: "cmpTblNm",
fieldName: "cmpTblNm",
header: { text: "비교 테이블명" },
editable: false,
sortdisable: false,
},
@@ -136,45 +200,10 @@ export const imrArticleColumnInfo: ColumnInfo = {
"no",
"statsItmNm",
"vrfcNm",
"dataBlck",
"tblNm",
"colNm",
"cmpDataBlck",
"cmpTblNm",
"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"],
};
@@ -1,51 +1,57 @@
/** H-B 탭 검증 항목 */
export interface HBArticleItem {
/** 순번 */
no: string;
/** 통계 항목명 */
statsItmNm: string;
/** 검증명 */
vrfcNm: string;
/** 데이터블럭 */
dataBlck: string;
/** 검증 항목명 */
vrfcItmNm: string;
/** 테이블명 */
tblNm: string;
/** 컬럼명 */
colNm: string;
/** 비교 데이터블럭 */
cmpDataBlck: string;
/** 비교 컬럼명 */
cmpColNm: string;
/** 기본규칙 */
bscRul: string;
/** Percentile 값 */
percentileVal: number;
/** A 값 */
aVal: number;
/** C 값 */
cVal: number;
/** 등록자명 */
regNm: string;
/** 등록 일시 */
regDt: string;
}
/** I-MR 탭 검증 항목 */
export interface IMRArticleItem {
/** 순번 */
no: string;
/** 통계 항목명 */
statsItmNm: string;
/** 검증명 */
vrfcNm: string;
/** 데이터블럭 */
dataBlck: string;
/** 테이블명 */
tblNm: string;
/** 컬럼명 */
colNm: string;
/** 비교 데이터블럭 */
cmpDataBlck: string;
/** 등록자명 */
regNm: string;
/** 등록 일시 */
regDt: string;
}
/** Validation 탭 검증 항목 */
export interface ValidationArticleItem {
/** 순번 */
no: string;
/** 통계항목명 */
statsItmNm: string;
/** 검증명 */
vrfcNm: string;
/** 테이블명 */
tblNm: string;
/** 컬럼명 */
colNm: string;
/** 비교 테이블명 */
cmpTblNm: string;
/** 비교 컬럼명 */
cmpColNm: string;
/** 기본규칙 */
bscRul: string;
}
/** Validation 탭 검증 항목 */
export interface ValidationArticleItem {
/** 통계항목 */
statsItmNm: string;
/** 검증명 */
vrfcNm: string;
/** 데이터블럭 */
dataBlck: string;
/** 컬럼명 */
colNm: string;
}
@@ -17,6 +17,15 @@ const HB_STATS_ITEMS = [
"물 재이용",
];
const HB_VERIFICATION_ITEMS = [
"행정구역 보급률",
"유역환경청별 보급률",
"관로연장",
"처리용량",
"방류량",
"펌프용량",
];
const IMR_STATS_ITEMS = [
"하수도 보급률",
"하수관로",
@@ -47,18 +56,57 @@ const VERIFICATION_NAMES = [
"유지보수",
];
const TABLE_NAMES = [
"tb_stats_drng_sys",
"tb_stats_ppline",
"tb_stats_fclt",
"tb_stats_pump_stt",
"tb_stats_sewg_trtm",
];
const COLUMN_NAMES = [
"drng_sys_rate",
"ppline_len",
"fclt_cpct",
"pump_cpct",
"trtm_qty",
"popl_cnt",
];
const BASIC_RULES = [
"값 > 0",
"값 >= 0",
"값 != NULL",
"범위: 0-100",
"A > B",
];
function formatDateTime(date: Date): string {
const y = date.getFullYear();
const m = String(date.getMonth() + 1).padStart(2, "0");
const d = String(date.getDate()).padStart(2, "0");
const h = String(date.getHours()).padStart(2, "0");
const min = String(date.getMinutes()).padStart(2, "0");
return `${y}-${m}-${d} ${h}:${min}`;
}
/** 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: "",
vrfcItmNm: faker.helpers.arrayElement(HB_VERIFICATION_ITEMS),
tblNm: faker.helpers.arrayElement(TABLE_NAMES),
colNm: faker.helpers.arrayElement(COLUMN_NAMES),
percentileVal: faker.number.float({
min: 0,
max: 100,
fractionDigits: 2,
}),
aVal: faker.number.float({ min: 0, max: 10, fractionDigits: 3 }),
cVal: faker.number.float({ min: 0, max: 10, fractionDigits: 3 }),
regNm: faker.person.fullName(),
regDt: formatDateTime(faker.date.recent({ days: 90 })),
}));
}
@@ -66,27 +114,29 @@ export function createHBArticleMock(count = 10): HBArticleItem[] {
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: "",
tblNm: faker.helpers.arrayElement(TABLE_NAMES),
colNm: faker.helpers.arrayElement(COLUMN_NAMES),
regNm: faker.person.fullName(),
regDt: formatDateTime(faker.date.recent({ days: 90 })),
}));
}
/** Validation 탭 목데이터 생성 */
export function createValidationArticleMock(
count = 4,
count = 6,
): ValidationArticleItem[] {
faker.seed(300);
return Array.from({ length: count }, (_, index) => ({
no: `${index + 1}`,
statsItmNm: faker.helpers.arrayElement(VALIDATION_STATS_ITEMS),
vrfcNm: faker.helpers.arrayElement(VERIFICATION_NAMES),
dataBlck: "",
colNm: "",
tblNm: faker.helpers.arrayElement(TABLE_NAMES),
colNm: faker.helpers.arrayElement(COLUMN_NAMES),
cmpTblNm: faker.helpers.arrayElement(TABLE_NAMES),
cmpColNm: faker.helpers.arrayElement(COLUMN_NAMES),
bscRul: faker.helpers.arrayElement(BASIC_RULES),
}));
}
@@ -97,4 +147,4 @@ export const hbArticleMockData = createHBArticleMock(10);
export const imrArticleMockData = createIMRArticleMock(10);
/** Validation 탭 기본 목데이터 */
export const validationArticleMockData = createValidationArticleMock(4);
export const validationArticleMockData = createValidationArticleMock(6);