Merge remote-tracking branch 'origin/iipbs/st/dev' into feature/sein

This commit is contained in:
yangsein
2026-06-15 14:53:01 +09:00
346 changed files with 39428 additions and 8615 deletions
@@ -6,7 +6,7 @@ interface AddArticleButtonProps {
const AddArticleButton = ({ addArticleFunc }: AddArticleButtonProps) => {
return (
<Button className="h-[3.2rem] w-[96px]" onClick={addArticleFunc}>
<Button className="h-[3.2rem] w-[96px]" color="white" onClick={addArticleFunc}>
<i className="ri-add-fill" />
<span>항목 추가</span>
</Button>
@@ -6,7 +6,7 @@ interface DeleteArticleButtonProps {
const DeleteArticleButton = ({ deleteArticleFunc }: DeleteArticleButtonProps) => {
return (
<Button className="h-[3.2rem] w-[96px]" color="red" onClick={deleteArticleFunc}>
<Button className="h-[3.2rem] w-[96px]" color="white" onClick={deleteArticleFunc}>
<i className="ri-subtract-fill"></i>
<span>항목 제거</span>
</Button>
+51 -1
View File
@@ -6,7 +6,7 @@
}
/* 셀 클래스가 있으면 위 기본색보다 우선 (같은 specificity + 나중 규칙) */
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-readonly {
@apply !bg-[#f9f8f8] !text-[#666];
@apply !bg-[#f0f0f0] !text-[#666];
}
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-verify-error {
@apply !bg-[#ffe6e6] !text-[#c00];
@@ -154,6 +154,24 @@
@apply !bg-[#fff7bf];
}
/*
* 검증 오류 셀(rg-cell-verify-error / -imr) 최우선 적용.
* 클래스 이중화로 specificity를 한 단계 올려 동일 specificity의 다른 셀 클래스
* (rg-cell-rowtype-*, rg-cell-total, rg-cell-readonly 등)보다 항상 이김.
*/
.rg-grid .rg-body .rg-data-cell.rg-cell-verify-error.rg-cell-verify-error,
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-verify-error.rg-cell-verify-error,
.rg-grid .rg-fixed-body .rg-data-cell.rg-cell-verify-error.rg-cell-verify-error,
.rg-grid .rg-fixed-body .rg-data-row .rg-data-cell.rg-cell-verify-error.rg-cell-verify-error {
@apply !bg-[#ffe6e6] !text-[#c00];
}
.rg-grid .rg-body .rg-data-cell.rg-cell-verify-error-imr.rg-cell-verify-error-imr,
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-verify-error-imr.rg-cell-verify-error-imr,
.rg-grid .rg-fixed-body .rg-data-cell.rg-cell-verify-error-imr.rg-cell-verify-error-imr,
.rg-grid .rg-fixed-body .rg-data-row .rg-data-cell.rg-cell-verify-error-imr.rg-cell-verify-error-imr {
@apply !bg-[#fff7bf] !text-[#b45309];
}
/* 진행상황: 소프트 인라인 요약 (툴바와 자연스럽게 blend) */
.data-grid-status-bubble {
@apply rounded-lg border border-slate-200/80 bg-white px-8 py-2.5;
@@ -336,3 +354,35 @@
background-color: #6bafae !important;
color: #ffffff !important;
}
.rg-grid .rg-body .rg-data-cell.rg-cell-verify-error.rg-cell-verify-error,
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-verify-error.rg-cell-verify-error,
.rg-grid .rg-fixed-body .rg-data-cell.rg-cell-verify-error.rg-cell-verify-error,
.rg-grid .rg-fixed-body .rg-data-row .rg-data-cell.rg-cell-verify-error.rg-cell-verify-error {
background-color: #ffe6e6 !important;
color: #c00 !important;
}
.rg-grid .rg-body .rg-data-cell.rg-cell-verify-error-imr.rg-cell-verify-error-imr,
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-verify-error-imr.rg-cell-verify-error-imr,
.rg-grid .rg-fixed-body .rg-data-cell.rg-cell-verify-error-imr.rg-cell-verify-error-imr,
.rg-grid .rg-fixed-body .rg-data-row .rg-data-cell.rg-cell-verify-error-imr.rg-cell-verify-error-imr {
background-color: #fff7bf !important;
color: #b45309 !important;
}
/* dark theme에서도 검증 오류 색을 유지하고 싶다면 동일 색 유지(가독성 우선) */
[data-theme="black"] .rg-grid .rg-body .rg-data-cell.rg-cell-verify-error.rg-cell-verify-error,
[data-theme="black"] .rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-verify-error.rg-cell-verify-error,
[data-theme="black"] .rg-grid .rg-fixed-body .rg-data-cell.rg-cell-verify-error.rg-cell-verify-error,
[data-theme="black"] .rg-grid .rg-fixed-body .rg-data-row .rg-data-cell.rg-cell-verify-error.rg-cell-verify-error {
background-color: #ffe6e6 !important;
color: #c00 !important;
}
[data-theme="black"] .rg-grid .rg-body .rg-data-cell.rg-cell-verify-error-imr.rg-cell-verify-error-imr,
[data-theme="black"] .rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-verify-error-imr.rg-cell-verify-error-imr,
[data-theme="black"] .rg-grid .rg-fixed-body .rg-data-cell.rg-cell-verify-error-imr.rg-cell-verify-error-imr,
[data-theme="black"] .rg-grid .rg-fixed-body .rg-data-row .rg-data-cell.rg-cell-verify-error-imr.rg-cell-verify-error-imr {
background-color: #fff7bf !important;
color: #b45309 !important;
}
@@ -43,8 +43,10 @@ function buildFieldsFromColumns(columns: { fieldName: string; valueType?: ValueT
const hasNumeratorDenominator = "numeratorFields" in col.computed && col.computed.numeratorFields.length > 0 && col.computed.denominatorFields.length > 0;
const hasMaxOfFieldAndSum = "baseField" in col.computed && "sumFields" in col.computed && col.computed.sumFields.length > 0;
const hasDifferenceOfSums = "minuendFields" in col.computed && "subtrahendFields" in col.computed && col.computed.minuendFields.length > 0;
const hasHalfSumOfSums = col.computed.type === "halfSumOfSums" && "firstSumFields" in col.computed && "secondSumFields" in col.computed && col.computed.firstSumFields.length > 0 && col.computed.secondSumFields.length > 0;
const hasSumOfTwoHalfSumOfSums = col.computed.type === "sumOfTwoHalfSumOfSums" && "firstHalfSum" in col.computed && "secondHalfSum" in col.computed && col.computed.firstHalfSum.firstSumFields.length > 0 && col.computed.firstHalfSum.secondSumFields.length > 0 && col.computed.secondHalfSum.firstSumFields.length > 0 && col.computed.secondHalfSum.secondSumFields.length > 0;
const hasSumOfMaxGroups = "groups" in col.computed && Array.isArray(col.computed.groups) && col.computed.groups.length > 0;
if (hasFields || hasNumeratorDenominator || hasMaxOfFieldAndSum || hasDifferenceOfSums || hasSumOfMaxGroups) {
if (hasFields || hasNumeratorDenominator || hasMaxOfFieldAndSum || hasDifferenceOfSums || hasHalfSumOfSums || hasSumOfTwoHalfSumOfSums || hasSumOfMaxGroups) {
field.valueCallback = getComputedValueCallback(col.computed) as (prod: unknown, dataRow: number, fieldName: string, fieldNames: string[], values: unknown[]) => number;
}
}
+390 -79
View File
@@ -21,6 +21,7 @@ import type {
import { getComputedValueCallback } from "@/components/util/grid/computedFieldCallbacks";
import {
getExcelImportColumnFieldNames,
prepareGridColumnsForExcelExport,
restoreGridColumnsAfterExcelExport,
shouldPrepareColumnsForExcelExport,
@@ -33,7 +34,7 @@ declare module "realgrid" {
setOptions(options: {
footer?: { visible?: boolean };
summaryMode?: "aggregate" | "statistical" | "none";
checkBar?: { visible?: boolean };
checkBar?: { visible?: boolean; exclusive?: boolean };
}): void;
}
}
@@ -52,6 +53,142 @@ if (typeof window !== "undefined") {
RealGrid.setLicenseKey(process.env.NEXT_PUBLIC_ST_REALGRID_KEY || "");
function isDropDownEditorColumn(column: {
editor?: { type?: string };
values?: string[];
}): boolean {
const type = column.editor?.type;
return (
type === "dropdown" ||
type === "list" ||
type === "dropDown" ||
(column.values != null && column.values.length > 0)
);
}
type GridViewWithSetColumnProperty = {
setColumnProperty?: (col: string, key: string, value: unknown) => void;
};
type GridViewWithEditOptions = {
setEditOptions?: (options: { commitWhenLeave?: boolean }) => void;
};
/** 포커스가 그리드 밖으로 나갈 때 편집 중인 값을 자동 commit */
function applyDefaultGridEditOptions(
gridView: GridViewWithEditOptions | null | undefined,
) {
gridView?.setEditOptions?.({ commitWhenLeave: true });
}
function isDateEditorColumn(column: {
editor?: { type?: string };
}): boolean {
return column.editor?.type === "date";
}
/** RealGrid 날짜(date) 편집기 컬럼 속성 적용 */
function applyColumnDateEditorProperties(
gridView: GridViewWithSetColumnProperty,
column: import("../type/DataGrid.type").ColumnConfig,
) {
if (!gridView.setColumnProperty) return;
const fmt =
column.datetimeFormat ??
column.editor?.datetimeFormat ??
"yyyy-MM-dd";
gridView.setColumnProperty(column.name, "datetimeFormat", fmt);
gridView.setColumnProperty(column.name, "editor", {
type: "date",
datetimeFormat: fmt,
dropDownWhenClick: column.editor?.dropDownWhenClick ?? true,
showToday: column.editor?.showToday ?? true,
});
gridView.setColumnProperty(column.name, "editButtonVisibility", "always");
}
/** RealGrid 드롭다운·날짜 등 컬럼 편집기 속성 적용 */
function applyColumnListEditorProperties(
gridView: GridViewWithSetColumnProperty,
column: import("../type/DataGrid.type").ColumnConfig,
) {
if (!gridView.setColumnProperty) return;
if (isDateEditorColumn(column)) {
applyColumnDateEditorProperties(gridView, column);
return;
}
const values = column.values ?? column.editor?.values;
const labels = column.labels ?? column.editor?.labels ?? values;
const isDropDown = isDropDownEditorColumn(column);
if (!isDropDown) {
if (column.editor) {
gridView.setColumnProperty(column.name, "editor", column.editor);
}
return;
}
if (values?.length) {
gridView.setColumnProperty(column.name, "values", values);
gridView.setColumnProperty(column.name, "labels", labels ?? values);
}
if (column.lookupDisplay) {
gridView.setColumnProperty(column.name, "lookupDisplay", true);
}
gridView.setColumnProperty(column.name, "editor", {
type: "dropdown",
domainOnly: column.editor?.domainOnly ?? true,
textReadOnly: column.editor?.textReadOnly ?? true,
commitOnSelect: column.editor?.commitOnSelect ?? true,
dropDownWhenClick: column.editor?.dropDownWhenClick ?? true,
values,
labels: labels ?? values,
});
gridView.setColumnProperty(column.name, "editButtonVisibility", "always");
}
/** 그리드 마운트·데이터 로드 후 드롭다운 컬럼 재적용용 */
export function applyDropDownColumnToGrid(
gridView: GridViewWithSetColumnProperty | null | undefined,
columnName: string,
options: string[],
) {
if (!gridView?.setColumnProperty || options.length === 0) return;
(
gridView as {
setEditOptions?: (opts: { editable?: boolean }) => void;
}
).setEditOptions?.({ editable: true });
gridView.setColumnProperty(columnName, "editable", true);
gridView.setColumnProperty(columnName, "values", options);
gridView.setColumnProperty(columnName, "labels", options);
gridView.setColumnProperty(columnName, "lookupDisplay", true);
gridView.setColumnProperty(columnName, "editor", {
type: "dropdown",
domainOnly: true,
textReadOnly: true,
commitOnSelect: true,
dropDownWhenClick: true,
values: options,
labels: options,
});
gridView.setColumnProperty(columnName, "editButtonVisibility", "always");
(gridView as { refresh?: () => void }).refresh?.();
}
function reapplyListEditorsOnGrid(
gridView: GridViewWithSetColumnProperty | null | undefined,
cols: import("../type/DataGrid.type").ColumnConfig[],
) {
if (!gridView) return;
cols.forEach((col) => applyColumnListEditorProperties(gridView, col));
if (cols.some((c) => isDropDownEditorColumn(c) || isDateEditorColumn(c))) {
(gridView as { refresh?: () => void }).refresh?.();
}
}
type GridViewWithCheckApi = {
checkItem?: (itemIndex: number, checked: boolean, exclusive?: boolean) => void;
checkRow?: (dataRow: number, checked: boolean, exclusive?: boolean) => void;
@@ -321,10 +458,33 @@ function sortRowsGroupPreserving(
}
/** columnInfo → RealGrid DataField 배열 (computed → valueCallback 포함, setFields용) */
function getDecimalPlacesFromDataFormat(dataFormat?: string): number | null {
if (!dataFormat) return null;
const match = dataFormat.match(/\.(0+|#+)/);
const decimalToken = match?.[1];
if (decimalToken) return decimalToken.length;
// #,##0 등 정수 포맷 — 소수부 없음 → 0자리 절삭(내림)
if (/[#0]/.test(dataFormat)) return 0;
return null;
}
function truncateByDecimalPlaces(value: number, decimalPlaces: number): number {
if (!Number.isFinite(value)) return 0;
if (decimalPlaces < 0) return value;
const factor = 10 ** decimalPlaces;
const scaled = value * factor;
// 절삭(truncate): 반올림 없이 소수점 이하를 버린다.
const truncated = scaled >= 0 ? Math.floor(scaled) : Math.ceil(scaled);
return truncated / factor;
}
function buildFieldsFromColumns(
columns: {
fieldName: string;
valueType?: ValueType;
dataFormat?: string;
datetimeFormat?: string;
editor?: { type?: string; datetimeFormat?: string };
computed?: import("../type/DataGrid.type").ComputedFieldConfig;
}[],
) {
@@ -332,6 +492,7 @@ function buildFieldsFromColumns(
const field: {
fieldName: string;
dataType: string;
datetimeFormat?: string;
valueCallback?: (
prod: unknown,
dataRow: number,
@@ -341,8 +502,19 @@ function buildFieldsFromColumns(
) => number;
} = {
fieldName: col.fieldName,
dataType: col.valueType === ValueType.NUMBER ? "number" : "text",
dataType:
col.editor?.type === "date"
? "datetime"
: col.valueType === ValueType.NUMBER
? "number"
: "text",
};
if (col.editor?.type === "date") {
field.datetimeFormat =
col.datetimeFormat ??
col.editor.datetimeFormat ??
"yyyy-MM-dd";
}
if (col.computed) {
const hasFields =
"fields" in col.computed && col.computed.fields.length > 0;
@@ -358,18 +530,52 @@ function buildFieldsFromColumns(
"minuendFields" in col.computed &&
"subtrahendFields" in col.computed &&
col.computed.minuendFields.length > 0;
const hasHalfSumOfSums =
col.computed.type === "halfSumOfSums" &&
"firstSumFields" in col.computed &&
"secondSumFields" in col.computed &&
col.computed.firstSumFields.length > 0 &&
col.computed.secondSumFields.length > 0;
const hasSumOfTwoHalfSumOfSums =
col.computed.type === "sumOfTwoHalfSumOfSums" &&
"firstHalfSum" in col.computed &&
"secondHalfSum" in col.computed &&
col.computed.firstHalfSum.firstSumFields.length > 0 &&
col.computed.firstHalfSum.secondSumFields.length > 0 &&
col.computed.secondHalfSum.firstSumFields.length > 0 &&
col.computed.secondHalfSum.secondSumFields.length > 0;
const hasSumOfMaxGroups =
col.computed.type === "sumOfMaxOfFieldAndSumGroups" &&
"groups" in col.computed &&
Array.isArray(col.computed.groups) &&
col.computed.groups.length > 0;
const hasPumpGrossPpqty =
col.computed.type === "pumpGrossPpqty" &&
"pumpGroups" in col.computed &&
col.computed.pumpGroups.length > 0;
const hasBodPrcsRt =
col.computed.type === "bodPrcsRt" &&
"inflwField" in col.computed &&
"dschgField" in col.computed;
const hasQuotientRatioPercent =
col.computed.type === "quotientRatioPercent" &&
"numeratorQuotient" in col.computed &&
"denominatorQuotient" in col.computed &&
col.computed.numeratorQuotient.length === 2 &&
col.computed.denominatorQuotient.length === 2;
if (
hasFields ||
hasNumeratorDenominator ||
hasMaxOfFieldAndSum ||
hasDifferenceOfSums ||
hasSumOfMaxGroups
hasHalfSumOfSums ||
hasSumOfTwoHalfSumOfSums ||
hasSumOfMaxGroups ||
hasPumpGrossPpqty ||
hasBodPrcsRt ||
hasQuotientRatioPercent
) {
field.valueCallback = getComputedValueCallback(
const computedCallback = getComputedValueCallback(
col.computed,
) as (
prod: unknown,
@@ -378,6 +584,24 @@ function buildFieldsFromColumns(
fieldNames: string[],
values: unknown[],
) => number;
const decimalPlaces = getDecimalPlacesFromDataFormat(col.dataFormat);
field.valueCallback = (
prod: unknown,
dataRow: number,
fieldName: string,
fieldNames: string[],
values: unknown[],
) => {
const computedValue = computedCallback(
prod,
dataRow,
fieldName,
fieldNames,
values,
);
if (decimalPlaces == null) return computedValue;
return truncateByDecimalPlaces(computedValue, decimalPlaces);
};
}
}
return field;
@@ -436,6 +660,7 @@ const DataGrid = ({
const onItemAllCheckedRef =
useRef<typeof onItemAllChecked>(onItemAllChecked);
const isSyncingChecksFromRowDataRef = useRef(false);
const columnsFieldsSigRef = useRef("");
columnsRef.current = columns;
rowDataRef.current = rowData;
cellStyleCallbackRef.current = cellStyleCallback;
@@ -488,20 +713,6 @@ const DataGrid = ({
.find((s) => s.menuEngNm === activeTabId)?.menuKornNm ||
"export";
// 엑셀 import 시 매칭을 위해 헤더에 fieldName 포함 (예: "합계 (swgeProcZoneInnerSm)")
const originalHeaders: Map<string, string> = new Map();
columns.forEach((col) => {
if (col.fieldName && gridView.columnByName) {
const gridCol = gridView.columnByName(col.name);
if (gridCol && gridCol.header) {
const originalText = gridCol.header.text || "";
originalHeaders.set(col.name, originalText);
const headerWithFieldName = `${originalText} (${col.fieldName})`;
gridCol.header.text = headerWithFieldName;
}
}
});
// exportGrid 호출 전에 columnLayout 정규화 (col 속성 추가)
const normalizeLayoutForExport = (
layout: ColumnLayoutItem[],
@@ -595,20 +806,6 @@ const DataGrid = ({
excelExportVisibilitySnapshot,
);
}
// 헤더 원복
columns.forEach((col) => {
if (col.fieldName && gridView.columnByName) {
const gridCol = gridView.columnByName(col.name);
if (
gridCol &&
gridCol.header &&
originalHeaders.has(col.name)
) {
gridCol.header.text =
originalHeaders.get(col.name) || "";
}
}
});
// columnLayout 원복 (footerUserSpans 유지)
if (normalizedLayout && !layoutRestored) {
layoutRestored = true;
@@ -710,36 +907,11 @@ const DataGrid = ({
: headerStartRow;
const dataStartRow = maxHeaderRowIndex + 1;
// 엑셀 컬럼 인덱스 → 그리드 fieldName 매핑
const headerToFieldNameMap = new Map<string, string>();
headers.forEach((headerText, colIndex) => {
let fieldName: string | null = null;
// 헤더에 fieldName이 포함된 경우 (예: "합계 (swgeProcZoneInnerSm)")
const fieldNameMatch = headerText.match(
/\(([a-zA-Z_][a-zA-Z0-9_]*)\)$/,
);
if (fieldNameMatch && fieldNameMatch[1]) {
const extractedFieldName = fieldNameMatch[1];
if (
columns.find(
(c) => c.fieldName === extractedFieldName,
)
) {
fieldName = extractedFieldName;
}
}
// 매칭 실패 시 원본 헤더 텍스트 사용
if (!fieldName) {
console.warn(
`엑셀 컬럼 ${colIndex + 1} (헤더: "${headerText}") 매칭 실패 → 헤더 텍스트를 fieldName으로 사용`,
);
fieldName = headerText;
}
headerToFieldNameMap.set(headerText, fieldName);
});
// 엑셀 N번째 열 → 그리드 N번째 fieldName (보내기 컬럼 순서 기준)
const excelColumnFieldNames = getExcelImportColumnFieldNames(
columns,
columnLayout,
);
// 데이터 행 읽기
const dataRows: Record<string, string | number>[] = [];
@@ -757,12 +929,8 @@ const DataGrid = ({
worksheet[
XLSX.utils.encode_cell({ r: row, c: col })
];
const headerName =
headers[colIndex] || `Column${colIndex + 1}`;
// 헤더 텍스트를 fieldName으로 변환
const fieldName =
headerToFieldNameMap.get(headerName) ||
headerName;
const fieldName = excelColumnFieldNames[colIndex];
if (!fieldName) continue;
let cellValue: string | number = "";
if (
@@ -844,6 +1012,22 @@ const DataGrid = ({
const gridView = gridRef.current.gridView;
const dataProvider = gridRef.current.dataProvider;
applyDefaultGridEditOptions(gridView as GridViewWithEditOptions);
const columnsFieldsSig = columns.map((c) => c.fieldName).join("\u0001");
if (columnsFieldsSig !== columnsFieldsSigRef.current) {
columnsFieldsSigRef.current = columnsFieldsSig;
const dpForFields = dataProvider as {
setFields?: (f: unknown[]) => void;
setRows?: (r: Record<string, string | number>[]) => void;
};
try {
dpForFields.setFields?.(buildFieldsFromColumns(columns));
dpForFields.setRows?.(rowDataRef.current);
} catch (e) {
console.warn("setFields sync:", e);
}
}
// mergeCells: true인 컬럼이 있으면 onSorting에서 클라이언트 정렬로 처리
const hasMergeCells = columns.some((col) => col.mergeCells === true);
@@ -894,15 +1078,16 @@ const DataGrid = ({
(gridView.header as { showTooltip?: boolean }).showTooltip = true;
}
columns.forEach((column) => {
(
gridView as {
setColumnProperty?: (
col: string,
key: string,
value: unknown,
) => void;
}
).setColumnProperty?.(
const gv = gridView as GridViewWithSetColumnProperty;
const exists =
typeof (
gridView as { columnByName?: (name: string) => unknown }
).columnByName === "function" &&
(gridView as { columnByName: (name: string) => unknown }).columnByName(
column.name,
) != null;
if (!exists) return;
gv.setColumnProperty?.(
column.name,
"header",
realGridHeaderWithTooltip({
@@ -910,7 +1095,16 @@ const DataGrid = ({
tooltip: resolveColumnTooltip(column),
}),
);
gv.setColumnProperty?.(
column.name,
"editable",
column.editable !== false,
);
applyColumnListEditorProperties(gv, column);
});
if (columns.some((c) => isDropDownEditorColumn(c))) {
(gridView as { refresh?: () => void }).refresh?.();
}
(
gridView as {
onShowHeaderTooltip?: (
@@ -953,7 +1147,7 @@ const DataGrid = ({
// 헤더 체크박스 표시 여부 설정
gridView.setOptions({
checkBar: { visible: showHeaderCheckbox },
checkBar: { visible: showHeaderCheckbox, exclusive: false },
rowIndicator: { visible: false },
});
@@ -1033,10 +1227,63 @@ const DataGrid = ({
const hasFooterUserSpans = checkFooterUserSpans(columnLayout);
if (hasFooterUserSpans) {
const validColumnNames = new Set(columns.map((c) => c.name));
const sanitizeColumnLayout = (
layout: unknown[],
): unknown[] => {
const result: unknown[] = [];
for (const item of layout) {
if (typeof item === "string") {
if (validColumnNames.has(item)) {
result.push(item);
}
continue;
}
if (!item || typeof item !== "object") continue;
if ("column" in item) {
const columnName = (item as { column?: unknown }).column;
if (
typeof columnName === "string" &&
validColumnNames.has(columnName)
) {
result.push(item);
}
continue;
}
if ("items" in item && Array.isArray((item as { items?: unknown[] }).items)) {
const nextItems = sanitizeColumnLayout(
(item as { items: unknown[] }).items,
);
if (nextItems.length > 0) {
result.push({
...(item as Record<string, unknown>),
items: nextItems,
});
}
continue;
}
result.push(item);
}
return result;
};
// setColumnLayout은 그리드가 완전히 렌더링된 후 호출해야 함
setTimeout(() => {
if (gridRef.current?.gridView && columnLayout) {
gridRef.current.gridView.setColumnLayout?.(columnLayout);
const safeLayout = sanitizeColumnLayout(columnLayout as unknown[]);
if (safeLayout.length === 0) return;
try {
(
gridRef.current.gridView.setColumnLayout as
| ((layout: unknown) => void)
| undefined
)?.(safeLayout);
} catch (e) {
console.warn("setColumnLayout skipped due to invalid columns:", e);
}
}
}, 100);
}
@@ -1095,6 +1342,12 @@ const DataGrid = ({
(currentGridView as GridViewWithSetColumns).setColumns?.(
columnsWithFooter,
);
columns.forEach((col) =>
applyColumnListEditorProperties(
currentGridView as GridViewWithSetColumnProperty,
col,
),
);
applyFooterSettings(currentGridView);
if (hasFooterUserSpans) {
currentGridView.setColumnLayout?.(columnLayout);
@@ -1499,6 +1752,28 @@ const DataGrid = ({
autoGenerateField={true}
layout={columnLayout}
rows={rowData}
onRGDataColumnsChanged={(grid) => {
const dp = gridRef.current?.dataProvider as
| {
setFields?: (f: unknown[]) => void;
setRows?: (
r: Record<string, string | number>[],
) => void;
}
| undefined;
try {
dp?.setFields?.(
buildFieldsFromColumns(columnsRef.current),
);
dp?.setRows?.(rowDataRef.current);
} catch (e) {
console.warn("onRGDataColumnsChanged setFields:", e);
}
reapplyListEditorsOnGrid(
grid as GridViewWithSetColumnProperty,
columnsRef.current,
);
}}
onInitialized={(grid) => {
if (!grid) return;
(
@@ -1533,11 +1808,17 @@ const DataGrid = ({
dataProvider.setFields(
buildFieldsFromColumns(columns),
);
columnsFieldsSigRef.current = columns
.map((c) => c.fieldName)
.join("\u0001");
}
if (dataProvider?.setRows)
dataProvider.setRows(rowData);
if (getGridRef) getGridRef.current = gridRef.current;
const gridView = gridRef.current?.gridView ?? grid;
applyDefaultGridEditOptions(
gridView as GridViewWithEditOptions,
);
if (!gridView?.columnByName) return;
setTimeout(() => {
const gv = gridRef.current?.gridView;
@@ -1653,6 +1934,10 @@ const DataGrid = ({
tooltip: resolveColumnTooltip(column),
}),
);
applyColumnListEditorProperties(
gv as GridViewWithSetColumnProperty,
column,
);
if (cellTooltipCallbackRef.current) {
(
gv as {
@@ -1727,6 +2012,32 @@ const DataGrid = ({
tooltip: resolveColumnTooltip(column),
})}
editable={column.editable}
{...(column.editor != null && {
editor: column.editor,
})}
{...(column.values != null && {
values: column.values,
})}
{...(column.labels != null && {
labels: column.labels,
})}
{...(column.lookupDisplay === true && {
lookupDisplay: true,
})}
{...(isDateEditorColumn(column) && {
field: {
fieldName: column.fieldName,
dataType: ValueType.DATETIME,
datetimeFormat:
column.datetimeFormat ??
column.editor?.datetimeFormat ??
"yyyy-MM-dd",
},
datetimeFormat:
column.datetimeFormat ??
column.editor?.datetimeFormat ??
"yyyy-MM-dd",
})}
{...(column.width != null && {
width: column.width,
})}
@@ -33,7 +33,7 @@ import DataGrid from "@/components/module/DataGrid";
import { VerificationResultHistoryPagination } from "@/components/module/VerificationResultHistoryPagination";
import type { CellStyleCallbackParams, ColumnInfo } from "@/components/type/DataGrid.type";
/** 통계 입력 현황 > 행 클릭 시 예외처리(prcsYn=3) 내역만 조회 */
/** 통계 입력 현황 > 행 클릭 시 사용자예외처리(prcsYn=2) 내역만 조회 */
export interface ExceptionProcessingHistoryQueryContext {
sewerBzmnCd: string;
ctpvNm: string;
@@ -92,13 +92,15 @@ function exceptionPrcsYnNmCellStyle({ fieldName, row }: CellStyleCallbackParams)
const exceptionHistoryColumnInfo: ColumnInfo = {
columns: [
{ name: "ctpvNm", fieldName: "ctpvNm", header: { text: "시도" }, editable: false },
{ name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false },
{ name: "admdstNm", fieldName: "admdstNm", header: { text: "행정구역" }, editable: false },
{ name: "vrfcTrgtNm", fieldName: "vrfcTrgtNm", header: { text: "검증대상" }, editable: false },
{ name: "rsnExpln", fieldName: "rsnExpln", header: { text: "사유" }, editable: false },
{ name: "nowVlCn", fieldName: "nowVlCn", header: { text: "입력값" }, editable: false },
{ name: "compVlCn", fieldName: "compVlCn", header: { text: "기준값" }, editable: false },
{ name: "prcsYnNm", fieldName: "prcsYnNm", header: { text: "처리여부" }, editable: false },
{ name: "pbcpAprvYn", fieldName: "pbcpAprvYn", header: { text: "공단승인여부" }, editable: false },
{ name: "stVrfRjtComNm", fieldName: "stVrfRjtComNm", header: { text: "반려상태" }, editable: false },
{ name: "prcsOpnnExpln", fieldName: "prcsOpnnExpln", header: { text: "처리의견" }, editable: false },
{ name: "rjctOpnnCn", fieldName: "rjctOpnnCn", header: { text: "반려의견" }, editable: false },
{ name: "regDt", fieldName: "regDt", header: { text: "등록일시" }, editable: false },
{ name: "mdfcnDt", fieldName: "mdfcnDt", header: { text: "갱신일시" }, editable: false },
{
@@ -114,13 +116,15 @@ const exceptionHistoryColumnInfo: ColumnInfo = {
],
columnLayout: [
"ctpvNm",
"sggNm",
"admdstNm",
"vrfcTrgtNm",
"rsnExpln",
"nowVlCn",
"compVlCn",
"prcsYnNm",
"pbcpAprvYn",
"stVrfRjtComNm",
"prcsOpnnExpln",
"rjctOpnnCn",
"regDt",
"mdfcnDt",
"individualReject",
@@ -190,9 +194,9 @@ export function ExceptionProcessingHistoryDialog({
sggNm: queryContext.sggNm,
statsYr: queryContext.statsYr,
statsCd: queryContext.statsCd,
pbcpAprvYn: "N",
vrfcMthdCd,
prcsYnList: PRCS_YN_LIST,
rejectCodeList: "0,1,2",
page: pageIndex + 1,
size: 30,
};
@@ -308,14 +312,16 @@ export function ExceptionProcessingHistoryDialog({
const mapRows = (entries: VerificationResultReportItem[]): ExceptionHistoryGridRow[] =>
entries.map((item) => ({
ctpvNm: item.ctpvNm,
sggNm: item.sggNm,
admdstNm: item.admdstNm ?? item.sggNm ?? "-",
vrfcTrgtNm: item.vrfcTrgtNm,
rsnExpln: item.rsnExpln,
nowVlCn: item.nowVlCn ?? "-",
compVlCn: item.compVlCn ?? "-",
prcsYnNm: item.prcsYnNm ?? "-",
stVrfRjtComNm: item.stVrfRjtComNm ?? "-",
prcsOpnnExpln: item.prcsOpnnExpln ?? "-",
rjctOpnnCn: item.rjctOpnnCn ?? "-",
prcsYn: item.prcsYn ?? "",
pbcpAprvYn: item.pbcpAprvYn,
regDt: (item.regDt ?? "").slice(0, 16),
mdfcnDt: (item.mdfcnDt ?? "").slice(0, 16),
individualReject: "개별 반려",
+63 -29
View File
@@ -41,12 +41,53 @@ const getSggListFetcher = async (
key: [string, string, string, string],
): Promise<ApiResponse<Sgg[]>> => {
const gugunSkipYn = doList.includes(key[3]) ? "N" : "Y";
return statisticsApi.getSggAllList(key[1], {
return statisticsApi.getSggList(key[1], {
instSeCd: key[2],
gugunSkipYn,
});
};
function buildSearchFormValues(
props: SearchFormProps,
sidoList: ApiResponse<SearchCondition> | undefined,
defaultYear: number,
): SearchFormValues {
const d = props.defaultValues;
const initialClsfCd: SearchFormClsfCd =
d?.clsfCd === "ALL" || d?.clsfCd === "INPT" || d?.clsfCd === "VRFC"
? d.clsfCd
: "ALL";
if (d?.sido) {
return {
sido: d.sido,
gugun: d.gugun || "",
year: d.year || defaultYear.toString(),
order: d.order || "",
fctName: d.fctName || "",
bsnmCd: d.bsnmCd || "",
isDetail: false,
isSummary: d.isSummary || "",
clsfCd: initialClsfCd,
};
}
const first = sidoList?.data?.sidoList?.[0];
const useFirstSido = (props.sido ?? defaultSearchFormProps.sido) && first;
return {
sido: useFirstSido ? first.sido : "",
gugun: "",
year: d?.year || defaultYear.toString(),
order: d?.order || "",
fctName: d?.fctName || "",
bsnmCd: useFirstSido ? first.bsnmCd : "",
isDetail: false,
isSummary: d?.isSummary || "",
clsfCd: initialClsfCd,
};
}
const SearchForm = (props: SearchFormProps = {}) => {
const { setMessage: alert } = useAlertStore((state) => state);
const userInfo = useUserStore((state) => state.userInfo);
@@ -82,23 +123,27 @@ const SearchForm = (props: SearchFormProps = {}) => {
},
);
const initialClsfCd: SearchFormClsfCd = (() => {
const d = props.defaultValues?.clsfCd;
if (d === "ALL" || d === "INPT" || d === "VRFC") return d;
return "ALL";
})();
// 마운트 시 SWR 캐시의 시도 목록으로 초기값 설정 (탭 닫았다 열 때 API 재호출 없이 동작)
const [values, setValues] = useState<SearchFormValues>(() =>
buildSearchFormValues(props, sidoList, defaultYear),
);
const [values, setValues] = useState<SearchFormValues>({
sido: props.defaultValues?.sido || "",
gugun: props.defaultValues?.gugun || "",
year: props.defaultValues?.year || defaultYear.toString(),
order: props.defaultValues?.order || "",
fctName: props.defaultValues?.fctName || "",
bsnmCd: props.defaultValues?.bsnmCd || "",
isDetail: false,
isSummary: props.defaultValues?.isSummary || "",
clsfCd: initialClsfCd,
});
// 최초 진입만 시도 API가 늦게 오는 경우
useEffect(() => {
if (props.defaultValues?.sido) return;
const first = sidoList?.data?.sidoList?.[0];
if (!first || !mergedProps.sido) return;
setValues((prev) =>
prev.sido
? prev
: {
...prev,
sido: first.sido,
gugun: "",
bsnmCd: first.bsnmCd,
},
);
}, [sidoList, props.defaultValues?.sido, mergedProps.sido]);
const sggKey: [string, string, string, string] | null =
values.sido && values.sido !== "ALL"
@@ -133,18 +178,7 @@ const SearchForm = (props: SearchFormProps = {}) => {
};
const handleReset = () => {
const resetValues: SearchFormValues = {
sido: "",
gugun: "",
year: String(defaultYear),
order: "",
fctName: "",
bsnmCd: "",
isDetail: false,
isSummary: "",
clsfCd: "ALL",
};
setValues(resetValues);
setValues(buildSearchFormValues(props, sidoList, defaultYear));
props.onReset?.();
};
@@ -116,7 +116,7 @@ const getSidoListFetcher = async (): Promise<ApiResponse<SearchCondition>> => {
const getSggAllListFetcher = async (
key: [string, string],
): Promise<ApiResponse<Sgg[]>> => {
return statisticsApi.getSggAllList(key[1]);
return statisticsApi.getSggList(key[1]);
};
type SidoSggFacilityNameSearchFormProps = {
@@ -292,17 +292,12 @@ const SidoSggFacilityNameSearchForm = ({
return;
}
const ctpvNm = String(row.ctpvNm ?? sido);
const sggNm = String(
row.sggNm ?? (gugun !== "ALL" && gugun ? gugun : ""),
);
const params: SeweragePipeFacilityAdminAreaListRequest = {
statsYr: statsYr.trim(),
swtrmtFcltCd,
sewerBzmnCd: initialSearchValues?.bsnmCd || '',
ctpvNm,
...(doNameList.includes(ctpvNm) ? { sggNm } : {}),
ctpvNm: initialSidoValue || '',
...(doNameList.includes(initialSidoValue) ? { sggNm: initialGugunValue } : {}),
};
try {
+11 -49
View File
@@ -17,6 +17,7 @@ import SplitDataGrid from "./SplitDataGrid";
import { getComputedValueCallback } from "@/components/util/grid/computedFieldCallbacks"
import {
getExcelImportColumnFieldNames,
prepareGridColumnsForExcelExport,
restoreGridColumnsAfterExcelExport,
shouldPrepareColumnsForExcelExport,
@@ -222,8 +223,10 @@ function buildFieldsFromColumns(columns: { fieldName: string; valueType?: ValueT
const hasNumeratorDenominator = "numeratorFields" in col.computed && col.computed.numeratorFields.length > 0 && col.computed.denominatorFields.length > 0;
const hasMaxOfFieldAndSum = "baseField" in col.computed && "sumFields" in col.computed && col.computed.sumFields.length > 0;
const hasDifferenceOfSums = "minuendFields" in col.computed && "subtrahendFields" in col.computed && col.computed.minuendFields.length > 0;
const hasHalfSumOfSums = col.computed.type === "halfSumOfSums" && "firstSumFields" in col.computed && "secondSumFields" in col.computed && col.computed.firstSumFields.length > 0 && col.computed.secondSumFields.length > 0;
const hasSumOfTwoHalfSumOfSums = col.computed.type === "sumOfTwoHalfSumOfSums" && "firstHalfSum" in col.computed && "secondHalfSum" in col.computed && col.computed.firstHalfSum.firstSumFields.length > 0 && col.computed.firstHalfSum.secondSumFields.length > 0 && col.computed.secondHalfSum.firstSumFields.length > 0 && col.computed.secondHalfSum.secondSumFields.length > 0;
const hasSumOfMaxGroups = "groups" in col.computed && Array.isArray(col.computed.groups) && col.computed.groups.length > 0;
if (hasFields || hasNumeratorDenominator || hasMaxOfFieldAndSum || hasDifferenceOfSums || hasSumOfMaxGroups) {
if (hasFields || hasNumeratorDenominator || hasMaxOfFieldAndSum || hasDifferenceOfSums || hasHalfSumOfSums || hasSumOfTwoHalfSumOfSums || hasSumOfMaxGroups) {
field.valueCallback = getComputedValueCallback(col.computed) as (prod: unknown, dataRow: number, fieldName: string, fieldNames: string[], values: unknown[]) => number;
}
}
@@ -373,20 +376,6 @@ const TabDataGrid = ({
const columns = columnInfoItem.columns || [];
const columnLayout = columnInfoItem.columnLayout || [];
// 엑셀 import 시 매칭을 위해 헤더에 fieldName 포함 (예: "합계 (swgeProcZoneInnerSm)")
const originalHeaders: Map<string, string> = new Map();
columns.forEach((col) => {
if (col.fieldName && gridView.columnByName) {
const gridCol = gridView.columnByName(col.name);
if (gridCol && gridCol.header) {
const originalText = gridCol.header.text || '';
originalHeaders.set(col.name, originalText);
const headerWithFieldName = `${originalText} (${col.fieldName})`;
gridCol.header.text = headerWithFieldName;
}
}
});
// exportGrid 호출 전에 columnLayout 정규화 (col 속성 추가)
const normalizeLayoutForExport = (layout: ColumnLayoutItem[]): ColumnLayoutItem[] => {
return layout.map(item => {
@@ -452,15 +441,6 @@ const TabDataGrid = ({
if (excelExportVisibilitySnapshot) {
restoreGridColumnsAfterExcelExport(gridView, excelExportVisibilitySnapshot);
}
// 헤더 원복
columns.forEach((col) => {
if (col.fieldName && gridView.columnByName) {
const gridCol = gridView.columnByName(col.name);
if (gridCol && gridCol.header && originalHeaders.has(col.name)) {
gridCol.header.text = originalHeaders.get(col.name) || '';
}
}
});
// columnLayout 원복 (footerUserSpans 유지)
if (normalizedLayout && !layoutRestored) {
layoutRestored = true;
@@ -546,29 +526,12 @@ const TabDataGrid = ({
const maxHeaderRowIndex = headerRowIndexes.length > 0 ? Math.max(...headerRowIndexes) : headerStartRow;
const dataStartRow = maxHeaderRowIndex + 1;
// 엑셀 컬럼 인덱스 → 그리드 fieldName 매핑
const headerToFieldNameMap = new Map<string, string>();
const columns = columnInfoItem.columns || [];
headers.forEach((headerText, colIndex) => {
let fieldName: string | null = null;
// 헤더에 fieldName이 포함된 경우 (예: "합계 (swgeProcZoneInnerSm)")
const fieldNameMatch = headerText.match(/\(([a-zA-Z_][a-zA-Z0-9_]*)\)$/);
if (fieldNameMatch && fieldNameMatch[1]) {
const extractedFieldName = fieldNameMatch[1];
if (columns.find(c => c.fieldName === extractedFieldName)) {
fieldName = extractedFieldName;
}
}
// 매칭 실패 시 원본 헤더 텍스트 사용
if (!fieldName) {
console.warn(`엑셀 컬럼 ${colIndex + 1} (헤더: "${headerText}") 매칭 실패 → 헤더 텍스트를 fieldName으로 사용`);
fieldName = headerText;
}
headerToFieldNameMap.set(headerText, fieldName);
});
const columnLayout = columnInfoItem.columnLayout || [];
const excelColumnFieldNames = getExcelImportColumnFieldNames(
columns,
columnLayout,
);
// 데이터 행 읽기
const dataRows: Record<string, string | number>[] = [];
@@ -579,9 +542,8 @@ const TabDataGrid = ({
for (let colIndex = 0; colIndex < headers.length; colIndex++) {
const col = range.s.c + colIndex;
const cell = worksheet[XLSX.utils.encode_cell({ r: row, c: col })];
const headerName = headers[colIndex] || `Column${colIndex + 1}`;
// 헤더 텍스트를 fieldName으로 변환
const fieldName = headerToFieldNameMap.get(headerName) || headerName;
const fieldName = excelColumnFieldNames[colIndex];
if (!fieldName) continue;
let cellValue: string | number = '';
if (cell && cell.v !== undefined && cell.v !== null) {
@@ -92,13 +92,12 @@ const verificationSubmitResultColumnInfo: ColumnInfo = {
{ name: "vrfcMthdNm", fieldName: "vrfcMthdNm", header: { text: "구분" }, editable: false },
{ name: "vrfcMthdCd", fieldName: "vrfcMthdCd", header: { text: "검증유형코드" }, editable: false, visible: false },
{ name: "ctpvNm", fieldName: "ctpvNm", header: { text: "시도" }, editable: false },
{ name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false },
{ name: "admdstNm", fieldName: "admdstNm", header: { text: "행정구역" }, editable: false },
{ name: "vrfcTrgtNm", fieldName: "vrfcTrgtNm", header: { text: "검증대상" }, editable: false },
{ name: "rsnExpln", fieldName: "rsnExpln", header: { text: "사유" }, editable: false },
{ name: "nowVlCn", fieldName: "nowVlCn", header: { text: "입력값" }, editable: false },
{ name: "compVlCn", fieldName: "compVlCn", header: { text: "기준값" }, editable: false },
{ name: "prcsYn", fieldName: "prcsYn", header: { text: "처리여부" }, editable: false },
{ name: "pbcpAprvYn", fieldName: "pbcpAprvYn", header: { text: "공단승인여부" }, editable: false },
{ name: "regDt", fieldName: "regDt", header: { text: "등록일시" }, editable: false },
{ name: "mdfcnDt", fieldName: "mdfcnDt", header: { text: "갱신일시" }, editable: false },
{
@@ -111,13 +110,12 @@ const verificationSubmitResultColumnInfo: ColumnInfo = {
columnLayout: [
"vrfcMthdNm",
"ctpvNm",
"sggNm",
"admdstNm",
"vrfcTrgtNm",
"rsnExpln",
"nowVlCn",
"compVlCn",
"prcsYn",
"pbcpAprvYn",
"regDt",
"mdfcnDt",
"prcsOpnnExpln",
@@ -202,13 +200,12 @@ export function VerificationResultDialog({
vrfcMthdCd,
vrfcMthdNm: VRFC_MTHD_NAME_MAP[vrfcMthdCd] ?? item.vrfcMthdNm,
ctpvNm: item.ctpvNm,
sggNm: item.sggNm,
admdstNm: item.admdstNm ?? item.sggNm ?? "-",
vrfcTrgtNm: item.vrfcTrgtNm,
rsnExpln: item.rsnExpln,
nowVlCn: item.nowVlCn ?? "-",
compVlCn: item.compVlCn ?? "-",
prcsYn: PRCS_YN_LABEL[item.prcsYn] ?? item.prcsYn,
pbcpAprvYn: item.pbcpAprvYn,
prcsYn: item.prcsYnNm ?? PRCS_YN_LABEL[item.prcsYn] ?? item.prcsYn,
regDt: (item.regDt ?? "").slice(0, 16),
mdfcnDt: (item.mdfcnDt ?? "").slice(0, 16),
prcsOpnnExpln: item.prcsOpnnExpln ?? "",
@@ -226,9 +223,9 @@ export function VerificationResultDialog({
sggNm: stableQueryContext.sggNm,
statsYr: stableQueryContext.statsYr,
statsCd: stableQueryContext.statsCd,
pbcpAprvYn: "N",
vrfcMthdCd,
prcsYnList: "0",
rejectCodeList: "0,1,2",
page: page + 1,
size: 10000,
};
@@ -137,13 +137,15 @@ function verificationPrcsYnNmCellStyle({ fieldName, row }: CellStyleCallbackPara
const verificationResultColumnInfo: ColumnInfo = {
columns: [
{ name: "ctpvNm", fieldName: "ctpvNm", header: { text: "시도" }, editable: false },
{ name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false },
{ name: "admdstNm", fieldName: "admdstNm", header: { text: "행정구역" }, editable: false },
{ name: "vrfcTrgtNm", fieldName: "vrfcTrgtNm", header: { text: "검증대상" }, editable: false },
{ name: "rsnExpln", fieldName: "rsnExpln", header: { text: "사유" }, editable: false },
{ name: "nowVlCn", fieldName: "nowVlCn", header: { text: "입력값" }, editable: false },
{ name: "compVlCn", fieldName: "compVlCn", header: { text: "기준값" }, editable: false },
{ name: "prcsYnNm", fieldName: "prcsYnNm", header: { text: "처리여부" }, editable: false },
{ name: "pbcpAprvYn", fieldName: "pbcpAprvYn", header: { text: "공단승인여부" }, editable: false },
{ name: "stVrfRjtComNm", fieldName: "stVrfRjtComNm", header: { text: "반려상태" }, editable: false },
{ name: "prcsOpnnExpln", fieldName: "prcsOpnnExpln", header: { text: "처리의견" }, editable: false },
{ name: "rjctOpnnCn", fieldName: "rjctOpnnCn", header: { text: "반려의견" }, editable: false },
{ name: "regDt", fieldName: "regDt", header: { text: "등록일시" }, editable: false },
{ name: "mdfcnDt", fieldName: "mdfcnDt", header: { text: "갱신일시" }, editable: false },
{ name: "prcsYn", fieldName: "prcsYn", header: { text: "검증결과상태코드" }, editable: false, visible: false },
@@ -151,13 +153,15 @@ const verificationResultColumnInfo: ColumnInfo = {
],
columnLayout: [
"ctpvNm",
"sggNm",
"admdstNm",
"vrfcTrgtNm",
"rsnExpln",
"nowVlCn",
"compVlCn",
"prcsYnNm",
"pbcpAprvYn",
"stVrfRjtComNm",
"prcsOpnnExpln",
"rjctOpnnCn",
"regDt",
"mdfcnDt",
"prcsYn",
@@ -177,6 +181,8 @@ export interface VerificationResultHistoryDialogProps {
} | null;
title?: string;
emptyMessage?: string;
/** 예외 제출 취소 API 성공 후 부모(입력 화면)에서 메인 데이터를 다시 조회할 때 사용 */
onExceptionResetSubmitted?: () => void | Promise<void>;
}
export function VerificationResultHistoryDialog({
@@ -185,6 +191,7 @@ export function VerificationResultHistoryDialog({
queryContext,
title = "검증 결과 내역",
emptyMessage = "표시할 검증 결과가 없습니다.",
onExceptionResetSubmitted,
}: VerificationResultHistoryDialogProps) {
const stableQueryContext = useMemo(() => {
if (!queryContext) return null;
@@ -247,9 +254,9 @@ export function VerificationResultHistoryDialog({
sggNm: stableQueryContext.sggNm,
statsYr: stableQueryContext.statsYr,
statsCd: stableQueryContext.statsCd,
pbcpAprvYn: "N",
vrfcMthdCd,
prcsYnList: "0,2,3",
prcsYnList: "0,2",
rejectCodeList: "0,1,2",
page: pageIndex + 1,
size: PAGE_SIZE,
};
@@ -378,14 +385,16 @@ export function VerificationResultHistoryDialog({
vrfcSn: item.vrfcSn,
__checked: isChecked ? 1 : 0,
ctpvNm: item.ctpvNm,
sggNm: item.sggNm,
admdstNm: item.admdstNm ?? item.sggNm ?? "-",
vrfcTrgtNm: item.vrfcTrgtNm,
rsnExpln: item.rsnExpln,
nowVlCn: item.nowVlCn ?? "-",
compVlCn: item.compVlCn ?? "-",
prcsYnNm: item.prcsYnNm ?? "-",
stVrfRjtComNm: item.stVrfRjtComNm ?? "-",
prcsOpnnExpln: item.prcsOpnnExpln ?? "-",
rjctOpnnCn: item.rjctOpnnCn ?? "-",
prcsYn: item.prcsYn ?? "",
pbcpAprvYn: item.pbcpAprvYn,
regDt: (item.regDt ?? "").slice(0, 16),
mdfcnDt: (item.mdfcnDt ?? "").slice(0, 16),
};
@@ -453,12 +462,28 @@ export function VerificationResultHistoryDialog({
alert("예외 제출 취소 처리되었습니다.");
setCheckedVrfcByTab((prev) => ({ ...prev, [tab]: new Map() }));
await loadTabPage(tab, tabPages[tab].pageIndex);
try {
await onExceptionResetSubmitted?.();
} catch {
alert(
"예외 제출 취소는 완료되었으나 화면 데이터를 다시 불러오지 못했습니다. 조회로 새로고침 해주세요.",
);
}
} catch {
alert("예외 제출 취소 처리 중 오류가 발생했습니다.");
} finally {
setResetSubmitting(false);
}
}, [activeTab, alert, checkedVrfcByTab, entriesByTab, loadTabPage, stableQueryContext, tabPages]);
}, [
activeTab,
alert,
checkedVrfcByTab,
entriesByTab,
loadTabPage,
onExceptionResetSubmitted,
stableQueryContext,
tabPages,
]);
const renderActiveTabPanel = (tab: VerificationHistoryTabKey) => {
const entries = entriesByTab[tab];
@@ -34,8 +34,8 @@ export async function hasAnyPostSubmitVerificationResult(
sggNm: ctx.sggNm,
statsYr: ctx.statsYr,
statsCd: ctx.statsCd,
pbcpAprvYn: "N" as const,
prcsYnList: "0",
rejectCodeList: "0,1,2",
page: 1,
size: 1,
};
@@ -1,11 +1,20 @@
"use client";
import { useCallback, useState } from "react";
import { useQueries } from "@tanstack/react-query";
import { useCallback, useEffect, useState } from "react";
import {
type InfiniteData,
keepPreviousData,
useInfiniteQuery,
useQueryClient,
} from "@tanstack/react-query";
import { useTabStore as useGridTabStore } from "@rsone/components";
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import type { VerificationResultReportItem } from "@/entities/statistics/model/statistics-interface";
import { verificationInputReportApi } from "@/entities/statistics/api/verification-input-report-service";
import type {
VerificationInputReportItem,
VerificationInputReportResponse,
VerificationInputReportTypeCountingInfo,
} from "@/entities/statistics/model/verification-input-report-interface";
import { useAlertStore, useMenuStore } from "@/shared/lib";
import {
findMenuItemByUrlPath,
@@ -23,7 +32,9 @@ import {
TabsContent,
TabsList,
TabsTrigger,
Label,
} from "@common/components";
import { CodeSelectWithAll } from "@/entities/code";
type VerificationReportTabKey = "NV" | "IMR" | "HB";
@@ -45,6 +56,77 @@ const TYPE_CODE_NAME_MAP: Record<string, string> = {
HB: "HB",
};
const PAGE_SIZE = 100;
const SCROLL_LOAD_THRESHOLD_PX = 120;
function getNextVerificationInputReportPage(
lastPage: VerificationInputReportResponse,
): number | undefined {
const pageInfo = lastPage?.data?.pageInfo;
if (!pageInfo) return undefined;
const { currentPage, totalPages } = pageInfo;
if (currentPage + 1 <= totalPages) return currentPage + 1;
return undefined;
}
function flattenVerificationInputReportResults(
data: InfiniteData<VerificationInputReportResponse> | undefined,
): VerificationInputReportItem[] {
return (
data?.pages.flatMap((page) => page?.data?.verifyResultList ?? []) ?? []
);
}
function getVerifyTypeCountingInfo(
data: InfiniteData<VerificationInputReportResponse> | undefined,
): VerificationInputReportTypeCountingInfo | null {
return data?.pages[0]?.data?.verifyTypeCountingInfo ?? null;
}
function formatReportItemTitle(item: VerificationInputReportItem): string {
return item.statsNm?.trim() || item.vrfcTrgtNm?.trim() || item.statsCd;
}
function formatReportItemRegion(item: VerificationInputReportItem): string {
const parts = [item.ctpvNm, item.sggNm].filter(
(v): v is string => Boolean(v?.trim()),
);
return parts.length > 0 ? parts.join(" ") : "-";
}
function useVerificationReportList(
statsYr: string,
statsCdQueryKey: string,
vrfcMthdCd: VerificationReportTabKey,
statsCd: string,
enabled: boolean,
) {
return useInfiniteQuery({
queryKey: [
"verificationInputReport",
statsYr,
vrfcMthdCd,
statsCdQueryKey,
],
initialPageParam: 1,
queryFn: ({ pageParam }) =>
verificationInputReportApi.getVerificationInputReport({
statsYr,
vrfcMthdCd,
page: pageParam,
size: PAGE_SIZE,
...(!(statsCd === "" || statsCd === "ALL") && { statsCd }),
}),
getNextPageParam: getNextVerificationInputReportPage,
placeholderData: keepPreviousData,
refetchOnWindowFocus: false,
// 탭 전환만으로는 재조회하지 않음(명시적 새로고침/조건 변경 시만 조회)
staleTime: Infinity,
refetchOnMount: false,
enabled,
});
}
type VerificationSelectionReportProps = {
onClose?: () => void;
};
@@ -52,6 +134,7 @@ type VerificationSelectionReportProps = {
const VerificationSelectionReport = ({
onClose,
}: VerificationSelectionReportProps) => {
const queryClient = useQueryClient();
const menuList = useTabStore((s) => s.menuList);
const addTab = useTabStore((s) => s.addTab);
const setCurrentMenuInfo = useMenuStore((s) => s.setCurrentMenuInfo);
@@ -61,82 +144,100 @@ const VerificationSelectionReport = ({
);
const alert = useAlertStore((s) => s.setMessage);
const [activeTab, setActiveTab] = useState<VerificationReportTabKey>("NV");
const [statsCd, setStatsCd] = useState<string>("ALL");
const [isFullReloading, setIsFullReloading] = useState(false);
const statsYr = String(dayjs().year() - 1);
const statsCdQueryKey =
statsCd === "" || statsCd === "ALL" ? "" : statsCd;
const baseRequest = {
const handleStatsCdChange = useCallback(
(nextStatsCd: string) => {
setStatsCd(nextStatsCd);
setActiveTab("NV");
setIsFullReloading(true);
// 통계항목 변경 시 모든 탭 캐시 제거 후 NV부터 다시 조회
void queryClient.removeQueries({
queryKey: ["verificationInputReport", statsYr],
});
},
[queryClient, statsYr],
);
const nvQuery = useVerificationReportList(
statsYr,
pbcpAprvYn: "N" as const,
page: 1,
size: 10000,
prcsYnList: "0",
statsCdQueryKey,
"NV",
statsCd,
activeTab === "NV",
);
const imrQuery = useVerificationReportList(
statsYr,
statsCdQueryKey,
"IMR",
statsCd,
activeTab === "IMR",
);
const hbQuery = useVerificationReportList(
statsYr,
statsCdQueryKey,
"HB",
statsCd,
activeTab === "HB",
);
const queryByTab = {
NV: nvQuery,
IMR: imrQuery,
HB: hbQuery,
} as const;
const activeQuery = queryByTab[activeTab];
const isRefreshing = activeQuery.isFetching && !activeQuery.isPending;
const error = activeQuery.error;
/** 통계항목 변경·최초 진입: 탭 영역 숨기고 카드 전체 로딩만 표시 */
const hideTabsSection =
isFullReloading ||
(activeTab === "NV" && !nvQuery.data && (nvQuery.isPending || nvQuery.isFetching));
useEffect(() => {
if (!isFullReloading) return;
if (nvQuery.isFetching) return;
if (nvQuery.isSuccess || nvQuery.isError) {
setIsFullReloading(false);
}
}, [isFullReloading, nvQuery.isFetching, nvQuery.isSuccess, nvQuery.isError]);
const handleRefresh = useCallback(() => {
setStatsCd("ALL");
setActiveTab("NV");
setIsFullReloading(true);
void queryClient.removeQueries({
queryKey: ["verificationInputReport", statsYr],
});
}, [queryClient, statsYr]);
const listsByTab: Record<VerificationReportTabKey, VerificationInputReportItem[]> = {
NV: flattenVerificationInputReportResults(nvQuery.data),
IMR: flattenVerificationInputReportResults(imrQuery.data),
HB: flattenVerificationInputReportResults(hbQuery.data),
};
const [nvQuery, imrQuery, hbQuery] = useQueries({
queries: [
{
queryKey: [
"verificationResultList",
statsYr,
"NV",
baseRequest.pbcpAprvYn,
baseRequest.page,
baseRequest.size,
baseRequest.prcsYnList,
],
queryFn: () =>
statisticsApi.getVerificationResultList({
...baseRequest,
vrfcMthdCd: "NV",
}),
},
{
queryKey: [
"verificationResultList",
statsYr,
"IMR",
baseRequest.pbcpAprvYn,
baseRequest.page,
baseRequest.size,
baseRequest.prcsYnList,
],
queryFn: () =>
statisticsApi.getVerificationResultList({
...baseRequest,
vrfcMthdCd: "IMR",
}),
},
{
queryKey: [
"verificationResultList",
statsYr,
"HB",
baseRequest.pbcpAprvYn,
baseRequest.page,
baseRequest.size,
baseRequest.prcsYnList,
],
queryFn: () =>
statisticsApi.getVerificationResultList({
...baseRequest,
vrfcMthdCd: "HB",
}),
},
],
});
const typeCountingInfo =
getVerifyTypeCountingInfo(nvQuery.data) ??
getVerifyTypeCountingInfo(imrQuery.data) ??
getVerifyTypeCountingInfo(hbQuery.data);
const isLoading =
nvQuery.isLoading || imrQuery.isLoading || hbQuery.isLoading;
const error = nvQuery.error ?? imrQuery.error ?? hbQuery.error;
const listsByTab: Record<VerificationReportTabKey, VerificationResultReportItem[]> = {
NV: nvQuery.data?.data?.verifyResultList ?? [],
IMR: imrQuery.data?.data?.verifyResultList ?? [],
HB: hbQuery.data?.data?.verifyResultList ?? [],
const totalCountByTab: Record<VerificationReportTabKey, number> = {
NV: typeCountingInfo?.nvCount ?? listsByTab.NV.length,
IMR: typeCountingInfo?.imrCount ?? listsByTab.IMR.length,
HB: typeCountingInfo?.hbCount ?? listsByTab.HB.length,
};
const openInputFromStatsCd = useCallback(
(item: VerificationResultReportItem) => {
(item: VerificationInputReportItem) => {
const nav = resolveInputPageNavigationFromStatsCd(item.statsCd);
if (!nav) {
alert(
@@ -182,12 +283,61 @@ const VerificationSelectionReport = ({
],
);
const handleListScroll = useCallback(
(
e: React.UIEvent<HTMLDivElement>,
hasNextPage: boolean,
isFetchingNextPage: boolean,
fetchNextPage: () => void,
) => {
const el = e.currentTarget;
const remaining =
el.scrollHeight - el.scrollTop - el.clientHeight;
if (remaining > SCROLL_LOAD_THRESHOLD_PX) return;
if (hasNextPage && !isFetchingNextPage) {
fetchNextPage();
}
},
[],
);
const isTabContentLoading = (tab: VerificationReportTabKey) => {
const query = queryByTab[tab];
return (
activeTab === tab &&
!hideTabsSection &&
(query.isPending ||
(query.isFetching && !query.isFetchingNextPage) ||
(!query.data && !query.error))
);
};
const renderResultList = (
typeCode: VerificationReportTabKey,
items: VerificationResultReportItem[],
items: VerificationInputReportItem[],
isTabLoading: boolean,
hasNextPage: boolean,
isFetchingNextPage: boolean,
fetchNextPage: () => void,
) => (
<div className="min-h-0 flex-1 overflow-y-auto p-2">
{items.length === 0 ? (
<div
className="min-h-0 flex-1 overflow-y-auto p-2"
onScroll={(e) =>
handleListScroll(
e,
hasNextPage,
isFetchingNextPage,
fetchNextPage,
)
}
>
{isTabLoading ? (
<div className="flex h-full min-h-[8rem] items-center justify-center">
<div className="relative size-[5rem]">
<LoadingWithAnimation color="primary" />
</div>
</div>
) : items.length === 0 && !isFetchingNextPage ? (
<div className="flex h-full min-h-[8rem] items-center justify-center text-lg text-muted-foreground">
항목이 없습니다.
</div>
@@ -209,7 +359,7 @@ const VerificationSelectionReport = ({
>
<div className="mb-2 flex items-center justify-between">
<span className="font-medium">
{item.statsNm}
{formatReportItemTitle(item)}
</span>
<Badge
color={
@@ -226,7 +376,7 @@ const VerificationSelectionReport = ({
{item.rsnExpln}
</p>
<div className="flex justify-between text-lg text-muted-foreground">
<span>{item.admdstNm}</span>
<span>{formatReportItemRegion(item)}</span>
<span>
현재: {item.nowVlCn ?? "-"} / 비교:{" "}
{item.compVlCn ?? "-"}
@@ -234,6 +384,13 @@ const VerificationSelectionReport = ({
</div>
</div>
))}
{isFetchingNextPage && (
<div className="flex justify-center py-3">
<div className="relative size-[3rem]">
<LoadingWithAnimation color="primary" />
</div>
</div>
)}
</div>
)}
</div>
@@ -241,9 +398,26 @@ const VerificationSelectionReport = ({
return (
<div className="w-1/5 bg-container p-4 !pb-2 flex border-r border-border">
<div className="card card-border flex-1 bg-background !px-0">
<div className="card card-border flex-1 bg-background !px-0 max-h-[1000px] flex flex-col">
<div className="border-b border-border flex justify-between">
<h2 className="text-[2.4rem] font-semibold text-title p-4 ">이상치 선별 보고서</h2>
<div className="flex justify-center items-center text-[2.4rem] ">
<h2 className="font-semibold text-title p-4 pr-1">이상치 선별 보고서</h2>
<span
role="button"
tabIndex={0}
aria-label="새로고침"
className={`text-gray-400 cursor-pointer hover:text-[#2094fa] ${isRefreshing ? "pointer-events-none opacity-50" : ""}`}
onClick={handleRefresh}
onKeyDown={(e) => {
if (e.key === "Enter" || e.key === " ") {
e.preventDefault();
handleRefresh();
}
}}
>
<i className="diveicon di-arrow-reflash" />
</span>
</div>
<span
role="button"
tabIndex={0}
@@ -260,37 +434,47 @@ const VerificationSelectionReport = ({
<i className="ri-close-line" />
</span>
</div>
<div className="card-body max-h-[calc(100%-3.25rem)] p-2.5">
{isLoading && (
<div className="flex items-center gap-2 pt-2.5 px-4">
<Label className="text-label shrink-0">통계항목</Label>
<CodeSelectWithAll
upCd="STITEM"
value={statsCd}
onValueChange={handleStatsCdChange}
placeholder="전체"
className="w-full"
/>
</div>
<div className="card-body p-2.5 flex-1 flex flex-col overflow-hidden relative min-h-0">
{hideTabsSection && (
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
<div className="relative size-[5rem]">
<LoadingWithAnimation color="primary" />
</div>
</div>
)}
{error && (
{!hideTabsSection && error && (
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
데이터를 불러올 수 없습니다.
</div>
)}
{!isLoading && !error && (
<section className="flex min-h-0 flex-1 flex-col h-[85rem]">
{!hideTabsSection && !error && (
<section className="flex min-h-0 flex-1 flex-col">
<Tabs
value={activeTab}
onValueChange={(value) =>
setActiveTab(value as VerificationReportTabKey)
}
className="flex min-h-0 flex-1 flex-col h-full"
className="flex min-h-0 flex-1 flex-col"
variant="default"
>
<TabsList className="grid w-full grid-cols-3 p-1">
<TabsList className="grid w-full grid-cols-3 p-1 shrink-0">
{VERIFICATION_REPORT_TABS.map((tab) => (
<TabsTrigger
key={tab.value}
value={tab.value}
className="!px-2 !py-2 text-[1.3rem] whitespace-normal"
>
{tab.label} ({listsByTab[tab.value].length})
{tab.label} ({totalCountByTab[tab.value]})
</TabsTrigger>
))}
</TabsList>
@@ -300,12 +484,14 @@ const VerificationSelectionReport = ({
value={tab.value}
className="mt-0 flex min-h-0 flex-1 flex-col p-0 data-[state=inactive]:hidden"
>
{activeTab === tab.value
? renderResultList(
tab.value,
listsByTab[tab.value],
)
: null}
{renderResultList(
tab.value,
listsByTab[tab.value],
isTabContentLoading(tab.value),
queryByTab[tab.value].hasNextPage ?? false,
queryByTab[tab.value].isFetchingNextPage,
queryByTab[tab.value].fetchNextPage,
)}
</TabsContent>
))}
</Tabs>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,4 @@
import { useEffect, useRef, useState } from 'react';
import { useEffect, useRef, useState, type Dispatch, type SetStateAction } from 'react';
import { useConfirm } from '@frontend-opensource/use-react-hooks';
@@ -157,7 +157,9 @@ const PublicSewageFacilityInp = () => {
const globalProgressVisible = useGlobalProgressStore((state) => state.visible);
const [isLoading, setIsLoading] = useState<boolean>(false);
const [hasSearched, setHasSearched] = useState(false);
const [isNotApplicable, setIsNotApplicable] = useState(false);
const [isNotApplicableByTab, setIsNotApplicableByTab] = useState<Map<string, boolean>>(
() => new Map(),
);
const [showIsNotApplicable, setShowIsNotApplicable] = useState(false);
const [searchValues, setSearchValues] = useState<SearchFormValues | null>(null);
const [lastSearchedValues, setLastSearchedValues] = useState<SearchFormValues | null>(null);
@@ -165,7 +167,7 @@ const PublicSewageFacilityInp = () => {
const [tabStatsCdMap, setTabStatsCdMap] = useState<Map<string, string>>(new Map());
/** 탭키별 `engColNm -> columnGuide` 캐시 */
const [columnGuidesByTab, setColumnGuidesByTab] = useState<Record<string, Record<string, string>>>({});
const [toolbarSnapshotByTab, setToolbarSnapshotByTab] = useState<Map<string, TabToolbarSnapshot>>(() => new Map());
const [_toolbarSnapshotByTab, setToolbarSnapshotByTab] = useState<Map<string, TabToolbarSnapshot>>(() => new Map());
const [inputPeriodEnterable, setInputPeriodEnterable] = useState(true);
const [periodCheckList, setPeriodCheckList] = useState<CheckInputPeriodItem[]>([]);
const [showDailog, setShowDailog] = useState<boolean>(false);
@@ -175,12 +177,25 @@ const PublicSewageFacilityInp = () => {
const [mainFacilityMappingSaveDialogKey, setMainFacilityMappingSaveDialogKey] = useState(0);
const [verificationResultDialogOpen, setVerificationResultDialogOpen] = useState(false);
const [verificationHistoryOpen, setVerificationHistoryOpen] = useState(false);
const isNotApplicable = isNotApplicableByTab.get('ST00060001') ?? false;
const setIsNotApplicable: Dispatch<SetStateAction<boolean>> = (next) => {
setIsNotApplicableByTab((prev) => {
const current = prev.get('ST00060001') ?? false;
const resolved =
typeof next === 'function'
? (next as (prevState: boolean) => boolean)(current)
: next;
const nextMap = new Map(prev);
nextMap.set('ST00060001', resolved);
return nextMap;
});
};
const periodEnterableRef = useRef(true);
const searchDoneRef = useRef(false);
/** ST00060001만: RealGrid 편집값이 state에 없을 수 있어 저장/제출 시 그리드에서 직접 읽음 */
const st60001GridGetRowsRef = useRef<(() => Record<string, string | number>[]) | null>(null);
const submitFunc = () => {
void (async () => {
if (activeTab !== 'ST00060001') {
@@ -191,10 +206,11 @@ const PublicSewageFacilityInp = () => {
alert('먼저 조회를 진행해주세요.');
return;
}
const treatAsNoApplicable = getNoApplicableForRequest() || isNotApplicable;
const currentData =
st60001GridGetRowsRef.current?.() ?? rowDataMap.get('ST00060001') ?? [];
if (!currentData || currentData.length === 0) {
alert('제출할 데이터가 없습니다.');
if (!treatAsNoApplicable && (!currentData || currentData.length === 0)) {
alert('해당사항 없음을 체크해주세요.');
return;
}
const verificationBlocked = getVerificationPeriodActionBlockedMessage(periodCheckList);
@@ -270,17 +286,20 @@ const PublicSewageFacilityInp = () => {
alert('먼저 조회를 진행해주세요.');
return;
}
const noApplicable = getNoApplicableForRequest();
const treatAsNoApplicable = noApplicable || isNotApplicable;
const currentData =
st60001GridGetRowsRef.current?.() ?? rowDataMap.get('ST00060001') ?? [];
if (!currentData || currentData.length === 0) {
alert('제출할 데이터가 없습니다.');
const submitList = treatAsNoApplicable ? [] : buildFacilitySaveList(currentData);
if (!treatAsNoApplicable && submitList.length === 0) {
alert('해당사항 없음을 체크해주세요.');
return;
}
try {
showGlobalProgress({ label: '서버에 요청 중...', progress: 0 });
const userInfo = await getUserInfo();
const submitList = buildFacilitySaveList(currentData);
const activeTabStatus = tabStatusInfoMap.get(activeTab) ?? null;
const statsCdForTab = tabStatsCdMap.get(activeTab) ?? activeTab;
const requestData = {
@@ -289,7 +308,7 @@ const PublicSewageFacilityInp = () => {
sggNm: lastSearchedValues.gugun === 'ALL' ? '' : lastSearchedValues.gugun ?? '',
sewerBzmnCd: lastSearchedValues.bsnmCd ?? '',
userId: userInfo.userUnqId,
noApplicable: getNoApplicableForRequest(),
noApplicable,
laePicNm: submitInfo.laePicNm,
laeKbrdrJbgdNm: submitInfo.laeKbrdrJbgdNm,
laeKbrdrDeptNm: submitInfo.laeKbrdrDeptNm,
@@ -408,6 +427,12 @@ const PublicSewageFacilityInp = () => {
const saveFunc = () => {
void (async () => {
const verificationBlocked = getVerificationPeriodActionBlockedMessage(periodCheckList);
if (verificationBlocked) {
alert(verificationBlocked);
return;
}
if (!lastSearchedValues || !searchParamRef.current) {
alert('먼저 조회를 진행해주세요.');
return;
@@ -419,13 +444,13 @@ const PublicSewageFacilityInp = () => {
statsCd: 'ST00060001',
statsYr: lastSearchedValues.year ?? ''
});
if (statusCodeResponse.status === 'success') {
if (!['0', '1', '4'].includes(statusCodeResponse.data)) {
const codeName = statusCodeResponse.data === '2' ? '제출' : (statusCodeResponse.data === '3' ? '승인' : '검증중');
alert(`공공 하수처리 시설 데이터가 ${codeName} 상태일 때는 중심 처리 시설 데이터를 변경할 수 없습니다.`);
return;
}
}
} else {
alert('오류가 발생했습니다.\n관리자에게 문의하세요')
}
@@ -505,17 +530,19 @@ const PublicSewageFacilityInp = () => {
if (!(await confirm('저장 하시겠습니까?'))) return;
if (activeTab === 'ST00060001') {
const noApplicable = getNoApplicableForRequest();
const treatAsNoApplicable = noApplicable || isNotApplicable;
const currentData =
st60001GridGetRowsRef.current?.() ?? rowDataMap.get('ST00060001') ?? [];
const saveList = treatAsNoApplicable ? [] : buildFacilitySaveList(currentData);
if (!treatAsNoApplicable && saveList.length === 0) {
alert('해당사항 없음을 체크해주세요.');
return;
}
try {
showGlobalProgress({ label: '저장 진행 중...', progress: 0 });
const userInfo = await getUserInfo();
const currentData =
st60001GridGetRowsRef.current?.() ?? rowDataMap.get('ST00060001') ?? [];
if (!currentData || currentData.length === 0) {
alert('저장할 데이터가 없습니다.');
return;
}
const saveList = buildFacilitySaveList(currentData);
const param: PublicSewageFacilitySaveRequest = {
statsYr: lastSearchedValues.year ?? '',
ctpvNm: lastSearchedValues.sido ?? '',
@@ -523,7 +550,7 @@ const PublicSewageFacilityInp = () => {
sewerBzmnCd: lastSearchedValues.bsnmCd ?? '',
userId: userInfo.userUnqId,
// superAdmin: isAdminInfo ? 'superAdmin' : '',
noApplicable: getNoApplicableForRequest(),
noApplicable,
saveList,
};
@@ -842,6 +869,11 @@ const PublicSewageFacilityInp = () => {
setLastSearchedValues(values);
searchDoneRef.current = true;
setHasSearched(true);
setIsNotApplicableByTab((prev) => {
const next = new Map(prev);
next.set('ST00060001', false);
return next;
});
setIsLoading(true);
const param = buildPublicSewageFacilityParams(values);
@@ -856,6 +888,19 @@ const PublicSewageFacilityInp = () => {
};
const handleActiveTabChange = async (tabKey: string) => {
const prevTabKey = activeTabRef.current;
if (prevTabKey === 'ST00060001') {
const latestRowsInPrevTab =
st60001GridGetRowsRef.current?.() ?? rowDataMap.get('ST00060001') ?? [];
if (latestRowsInPrevTab.length > 0 || rowDataMap.has('ST00060001')) {
setRowDataMap((prev) => {
const next = new Map(prev);
next.set('ST00060001', latestRowsInPrevTab);
return next;
});
}
}
activeTabRef.current = tabKey;
setActiveTab(tabKey);
@@ -871,7 +916,7 @@ const PublicSewageFacilityInp = () => {
const handleReset = () => {
setIsLoading(false);
setHasSearched(false);
setIsNotApplicable(false);
setIsNotApplicableByTab(new Map());
setShowIsNotApplicable(false);
setRowDataMap(new Map());
@@ -1062,7 +1107,7 @@ const PublicSewageFacilityInp = () => {
onValuesChange={setSearchValues}
/>
{showActionToolbarCard && (
<div className="card !py-0">
<div className="card !py-0">
<div className="flex justify-end items-center gap-[0.6rem] mx-[0.6rem]">
{!isMainFacilityTab && (
<VerificationResultButton
@@ -1072,8 +1117,8 @@ const PublicSewageFacilityInp = () => {
{showEnterableToolbarButtons && !isMainFacilityTab && (
<>
{showIsNotApplicable && <NotApplicableCheckButton isCheck={isNotApplicable} setIsCheck={setIsNotApplicable} />}
<UpdateOperateDataButton updateOperateDataButtonFunc={updateOperateDataButtonFunc} />
<SubmitButton submitFunc={submitFunc} />
<UpdateOperateDataButton updateOperateDataButtonFunc={updateOperateDataButtonFunc} />
<SubmitButton submitFunc={submitFunc} />
</>
)}
{!isMainFacilityTab && activeTabStatus?.laeSbmsnSttsCd === '2' && (
@@ -1088,7 +1133,7 @@ const PublicSewageFacilityInp = () => {
<div className="relative size-[5rem]">
<LoadingWithAnimation color="primary" />
</div>
</div>
</div>
)}
<Tabs value={activeTab} onValueChange={(v) => void handleActiveTabChange(v)}>
<TabsList>
@@ -1099,171 +1144,176 @@ const PublicSewageFacilityInp = () => {
))}
</TabsList>
{PublicSewageFactInpColumnList.map((tab) => {
if (tab.isSplitGrid && tab.left && tab.right) {
const leftKey = tab.left.tabKey ?? `${tab.tabKey}_left`;
const rightKey = tab.right.tabKey ?? `${tab.tabKey}_right`;
{PublicSewageFactInpColumnList.map((tab) => {
if (tab.isSplitGrid && tab.left && tab.right) {
const leftKey = tab.left.tabKey ?? `${tab.tabKey}_left`;
const rightKey = tab.right.tabKey ?? `${tab.tabKey}_right`;
return (
<TabsContent key={tab.tabKey} value={tab.tabKey}>
<SplitDataGrid
leftColumnInfo={getGridColumnInfo(tab.left, tab.tabKey)}
rightColumnInfo={getGridColumnInfo(tab.right, tab.tabKey)}
leftFixedColumns={tab.left.fixedColumns}
rightFixedColumns={tab.right.fixedColumns}
showHeaderCheckbox={true}
enableSort={false}
leftRowData={rowDataMap.get(leftKey) ?? []}
rightRowData={rowDataMap.get(rightKey) ?? []}
leftOnRowClick={
tab.tabKey === 'ST00060002'
? (row) => {
void handleMainFacilityRowClick(row);
}
: undefined
}
leftCellStyleCallback={
tab.tabKey === 'ST00060002'
? leftMainFacilityCellStyleCallback
: undefined
}
rightOnItemChecked={
tab.tabKey === 'ST00060002'
? (itemIndex, checked) => {
setRowDataMap((prev) => {
const next = new Map(prev);
const rows = [...(next.get('MainFacilityTarget') ?? [])];
if (!rows[itemIndex]) return prev;
rows[itemIndex] = {
...rows[itemIndex],
__checked: checked ? 'Y' : '',
};
next.set('MainFacilityTarget', rows);
return next;
});
}
: undefined
}
rightOnItemAllChecked={
tab.tabKey === 'ST00060002'
? (checked) => {
setRowDataMap((prev) => {
const next = new Map(prev);
const rows = [...(next.get('MainFacilityTarget') ?? [])].map((r) => ({
...r,
__checked: checked ? 'Y' : '',
}));
next.set('MainFacilityTarget', rows);
return next;
});
}
: undefined
}
setLeftRowData={(updater) => {
setRowDataMap((prev) => {
const next = new Map(prev);
const cur = next.get(leftKey) ?? [];
const n =
typeof updater === 'function'
? (updater as (p: Record<string, string | number>[]) => Record<string, string | number>[])(cur)
: updater;
next.set(leftKey, n);
return next;
});
}}
setRightRowData={(updater) => {
setRowDataMap((prev) => {
const next = new Map(prev);
const cur = next.get(rightKey) ?? [];
const n =
typeof updater === 'function'
? (updater as (p: Record<string, string | number>[]) => Record<string, string | number>[])(cur)
: updater;
next.set(rightKey, n);
return next;
});
}}
/>
</TabsContent>
);
}
const gridColumnInfo = getGridColumnInfo(tab);
const tabStatus = tabStatusInfoMap.get(tab.tabKey) ?? null;
const tabEnterableForGrid = computeTabEnterable(
tabStatus,
inputPeriodEnterable,
);
const excelToolbarEnabledForTab =
tabRowDataExists(tab.tabKey) &&
tabEnterableForGrid &&
gugunOkOrNotDoList;
return (
<TabsContent key={tab.tabKey} value={tab.tabKey}>
<SplitDataGrid
leftColumnInfo={getGridColumnInfo(tab.left, tab.tabKey)}
rightColumnInfo={getGridColumnInfo(tab.right, tab.tabKey)}
leftFixedColumns={tab.left.fixedColumns}
rightFixedColumns={tab.right.fixedColumns}
showHeaderCheckbox={true}
enableSort={false}
leftRowData={rowDataMap.get(leftKey) ?? []}
rightRowData={rowDataMap.get(rightKey) ?? []}
leftOnRowClick={
tab.tabKey === 'ST00060002'
? (row) => {
void handleMainFacilityRowClick(row);
}
: undefined
}
leftCellStyleCallback={
tab.tabKey === 'ST00060002'
? leftMainFacilityCellStyleCallback
: undefined
}
rightOnItemChecked={
tab.tabKey === 'ST00060002'
? (itemIndex, checked) => {
setRowDataMap((prev) => {
const next = new Map(prev);
const rows = [...(next.get('MainFacilityTarget') ?? [])];
if (!rows[itemIndex]) return prev;
rows[itemIndex] = {
...rows[itemIndex],
__checked: checked ? 'Y' : '',
};
next.set('MainFacilityTarget', rows);
return next;
});
}
: undefined
}
rightOnItemAllChecked={
tab.tabKey === 'ST00060002'
? (checked) => {
setRowDataMap((prev) => {
const next = new Map(prev);
const rows = [...(next.get('MainFacilityTarget') ?? [])].map((r) => ({
...r,
__checked: checked ? 'Y' : '',
}));
next.set('MainFacilityTarget', rows);
return next;
});
}
: undefined
}
setLeftRowData={(updater) => {
<DataGrid
key={tab.tabKey}
columnInfo={gridColumnInfo}
rowStartNum={tab.rowStartNum}
excelExportFileSuffix={tab.tabLabel || tab.tabKey}
fixedColumns={tab.fixedColumns}
statusInfo={tabStatus}
rowData={rowDataMap.get(tab.tabKey) ?? []}
setRowData={(updater) => {
setRowDataMap((prev) => {
const next = new Map(prev);
const cur = next.get(leftKey) ?? [];
const cur = next.get(tab.tabKey) ?? [];
const n =
typeof updater === 'function'
? (updater as (p: Record<string, string | number>[]) => Record<string, string | number>[])(cur)
: updater;
next.set(leftKey, n);
next.set(tab.tabKey, n);
return next;
});
}}
setRightRowData={(updater) => {
setRowDataMap((prev) => {
const next = new Map(prev);
const cur = next.get(rightKey) ?? [];
const n =
typeof updater === 'function'
? (updater as (p: Record<string, string | number>[]) => Record<string, string | number>[])(cur)
: updater;
next.set(rightKey, n);
return next;
});
getGridDataRef={
tab.tabKey === 'ST00060001' ? st60001GridGetRowsRef : undefined
}
isExcelImport={excelToolbarEnabledForTab}
isExcelExport
showHeaderCheckbox={false}
enableSort={false}
cellStyleCallback={({ row, fieldName }) => {
const verification = (row as GridRowWithVerification).verificationResult;
if (!verification) return;
const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) {
const hasImr = errors.some((e) => e.vrfcCd === "IMR" || e.vrfcCd === "HB");
return hasImr ? "rg-cell-verify-error-imr" : "rg-cell-verify-error";
}
}}
cellTooltipCallback={({ row, fieldName }) => {
const verification = (row as GridRowWithVerification).verificationResult;
if (!verification) return;
const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) {
return errors
.map((e) => {
const prefix =
e.vrfcCd === "IMR" ? "IMR검증 - " : (e.vrfcCd === "NV" ? "일반검증 - " : "HB검증 - ");
const comp = e.compVlCn ?? "";
const now = e.nowVlCn ?? "";
return `${prefix}${e.rsnExpln}
(검증 기준값: ${comp} / 현재 입력값: ${now})`;
})
.filter(Boolean)
.join("\n");
}
}}
/>
</TabsContent>
);
}
const gridColumnInfo = getGridColumnInfo(tab);
const tabStatus = tabStatusInfoMap.get(tab.tabKey) ?? null;
const tabEnterableForGrid = computeTabEnterable(
tabStatus,
inputPeriodEnterable,
);
const excelToolbarEnabledForTab =
tabRowDataExists(tab.tabKey) &&
tabEnterableForGrid &&
gugunOkOrNotDoList;
return (
<TabsContent key={tab.tabKey} value={tab.tabKey}>
<DataGrid
key={(tabEnterableForGrid || isAdminInfo) ? 'enterable' : 'readonly'}
columnInfo={gridColumnInfo}
rowStartNum={tab.rowStartNum}
excelExportFileSuffix={tab.tabLabel || tab.tabKey}
fixedColumns={tab.fixedColumns}
statusInfo={tabStatus}
rowData={rowDataMap.get(tab.tabKey) ?? []}
setRowData={(updater) => {
setRowDataMap((prev) => {
const next = new Map(prev);
const cur = next.get(tab.tabKey) ?? [];
const n =
typeof updater === 'function'
? (updater as (p: Record<string, string | number>[]) => Record<string, string | number>[])(cur)
: updater;
next.set(tab.tabKey, n);
return next;
});
}}
getGridDataRef={
tab.tabKey === 'ST00060001' ? st60001GridGetRowsRef : undefined
}
isExcelImport={excelToolbarEnabledForTab}
isExcelExport
showHeaderCheckbox={false}
enableSort={false}
cellStyleCallback={({ row, fieldName }) => {
const verification = (row as GridRowWithVerification).verificationResult;
if (!verification) return;
const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) {
const hasImr = errors.some((e) => e.vrfcCd === "IMR" || e.vrfcCd === "HB");
return hasImr ? "rg-cell-verify-error-imr" : "rg-cell-verify-error";
}
}}
cellTooltipCallback={({ row, fieldName }) => {
const verification = (row as GridRowWithVerification).verificationResult;
if (!verification) return;
const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) {
return errors
.map((e) => {
const prefix =
e.vrfcCd === "IMR" ? "IMR검증 - " : (e.vrfcCd === "NV" ? "일반검증 - " : "HB검증 - ");
const comp = e.compVlCn ?? "";
const now = e.nowVlCn ?? "";
return `${prefix}${e.rsnExpln}
(검증 기준값: ${comp} / 현재 입력값: ${now})`;
})
.filter(Boolean)
.join("\n");
}
}}
/>
</TabsContent>
);
})}
})}
</Tabs>
</div>
<VerificationResultHistoryDialog
open={verificationHistoryOpen}
onOpenChange={setVerificationHistoryOpen}
queryContext={verificationQueryContext}
onExceptionResetSubmitted={async () => {
const ctx = lastSearchedValues ?? searchValues;
if (!ctx || !searchParamRef.current) return;
await loadPublicSewageFacilityActiveTabData(activeTab, searchParamRef.current, ctx);
}}
/>
<SubmitDailog
open={showDailog}
File diff suppressed because it is too large Load Diff
@@ -396,6 +396,8 @@ const SewagePipeInp = () => {
values: SearchFormValues;
tabKey: string;
} | null>(null);
/** ST00020002 무데이터 안내/자동이동은 동일 조회조건에서 1회만 수행 */
const factInstallNoDataHandledKeyRef = useRef<string | null>(null);
const [verificationSearchDefaults, setVerificationSearchDefaults] =
useState<SearchFormValues | null>(null);
@@ -549,6 +551,12 @@ const SewagePipeInp = () => {
mergeIntoExistingMap: boolean,
updateLastSearchedValues: boolean,
): Promise<boolean> => {
const searchConditionKey = JSON.stringify({
statsYr: searchParam.statsYr ?? "",
ctpvNm: searchParam.ctpvNm ?? "",
sggNm: searchParam.sggNm ?? "",
sewerBzmnCd: searchParam.sewerBzmnCd ?? "",
});
const applyRowMap = (apply: (m: Map<string, Record<string, string | number>[]>) => void) => {
if (mergeIntoExistingMap) {
setRowDataMap((prev) => {
@@ -595,6 +603,23 @@ const SewagePipeInp = () => {
ctpvNm: commonInfo.ctpvNm,
...d,
}));
if (convertedData.length === 0) {
const alreadyHandledForSameSearch =
factInstallNoDataHandledKeyRef.current === searchConditionKey;
if (!alreadyHandledForSameSearch) {
factInstallNoDataHandledKeyRef.current = searchConditionKey;
alert("시설별 설치 현황에 조회된 데이터가 없습니다.\n시설별 현황 관리에서 설정해주세요");
activeTabRef.current = "ST00020006";
setActiveTab("ST00020006");
return await loadSewagePipeActiveTabData(
"ST00020006",
searchParam,
values,
true,
updateLastSearchedValues,
);
}
}
applyRowMap((m) => m.set('ST00020002', toGridRows(convertedData)));
setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo));
setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd));
@@ -795,7 +820,39 @@ const SewagePipeInp = () => {
}, [searchFormRemountKey]);
const getCurrentRowsForTab = (tabKey: string): Record<string, string | number>[] => {
switch (tabKey) {
case REGIONAL_FACT_TAB_KEY:
return getGridDataRef.current?.() ?? [];
case "ST00020002":
return getFactInstallGridDataRef.current?.() ?? [];
case "ST00020003":
return getPipeTypeGridDataRef.current?.() ?? [];
case "ST00020004":
return getPipeDiameterGridDataRef.current?.() ?? [];
case "ST00020005":
return getManholeGridDataRef.current?.() ?? [];
case "ST00020006":
return [
...(rowDataMap.get("treatmentPlantConnectionInp") ?? []),
...(rowDataMap.get("adminAreaConnectionInp") ?? []),
];
default:
return rowDataMap.get(tabKey) ?? [];
}
};
const handleActiveTabChange = async (tabKey: string) => {
const prevTabKey = activeTabRef.current;
const latestRowsInPrevTab = getCurrentRowsForTab(prevTabKey);
if (latestRowsInPrevTab.length > 0 || rowDataMap.has(prevTabKey)) {
setRowDataMap((prev) => {
const next = new Map(prev);
next.set(prevTabKey, latestRowsInPrevTab);
return next;
});
}
activeTabRef.current = tabKey;
setActiveTab(tabKey);
setStatsCd(tabStatsCdMap.get(tabKey) ?? "");
@@ -1735,7 +1792,7 @@ const SewagePipeInp = () => {
const maxYy = getManholeLastDataYear() % 100;
const saveList = currentData.map((d) => {
const yearlyStats = [];
const yearlyStats: SeweragePipeInputManholeStatusSaveYearlyStatItem[] = [];
for (let yy = minYy; yy <= maxYy; yy++) {
const year = 2000 + yy;
const wholKey = `yy${yy}WholMnhlCnt`;
@@ -1978,7 +2035,7 @@ const SewagePipeInp = () => {
return (
<TabsContent key={tabKey} value={tabKey}>
<DataGrid
key={(tabEnterableForGrid || isAdminInfo) ? "enterable" : "readonly"}
key={tabKey}
columnInfo={gridColumnInfo}
rowStartNum={info.rowStartNum}
excelExportFileSuffix={info.tabLabel || tabKey}
@@ -2062,6 +2119,12 @@ const SewagePipeInp = () => {
}
: null
}
onExceptionResetSubmitted={async () => {
const values = lastSearchedValues ?? searchValues;
if (!values?.year || !values?.sido || !values?.bsnmCd) return;
const refreshedParam = buildSewagePipeSearchParam(values);
await loadSewagePipeActiveTabData(activeTab, refreshedParam, values, true, false);
}}
/>
<SubmitDailog
open={showDailog}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,34 +1,539 @@
import { useState } from "react";
import { useEffect, useMemo, useRef, useState } from "react";
import SearchForm from "@/components/module/SearchForm";
import TabDataGrid from "@/components/module/TabDataGrid";
import SubmitButton from "@/components/button/SumitButton";
import SaveButton from "@/components/button/SaveButton";
import SubmitExceptionButton from "@/components/button/SubmitExceptionButton";
import { useConfirm } from "@frontend-opensource/use-react-hooks";
import { useAlertStore } from "@/shared/lib";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsInputSewerageFinanceApi } from "@/entities/statistics/api/input/statistics-input-sewerage-finance-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import type {
CauserBurdenItem,
SewerageChargeItem,
SewerageFinanceRequestParams,
SewerageFinanceSettleItem,
SewerageFinanceVerificationResult,
SewerageUsageFeeItem,
} from "@/entities/statistics/model/input/statistics-input-sewerage-finance-interface";
import { isInputPeriodCurrent } from "@/entities/statistics/model/input/statistics-sewage-supply-rate-input-interface";
import type { cancelSubmitRequest, SewerageStatusInfo } from "@/entities/statistics/model/statistics-interface";
import { LoadingWithAnimation, Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components";
import { getUserInfo } from "../../../../../../packages/common/components/src/api";
import CancelSubmitButton from "@/components/button/CancelSubmitButton";
import LastYearDataButton from "@/components/button/LastYearDataButton";
import SaveButton from "@/components/button/SaveButton";
import SubmitButton from "@/components/button/SumitButton";
import VerificationResultButton from "@/components/button/VerificationResultButton";
import DataGrid from "@/components/module/DataGrid";
import SearchForm from "@/components/module/SearchForm";
import { VerificationResultDialog } from "@/components/module/VerificationResultDialog";
import { VerificationResultHistoryDialog } from "@/components/module/VerificationResultHistoryDialog";
import type { ColumnConfig, ColumnInfo } from "@/components/type/DataGrid.type";
import type { SearchFormValues } from "@/components/type/SearchForm.type";
import { doList } from "@/components/util/column/input/DoList";
import { CauserBurdenInpColumn } from "@/components/util/column/input/sewerageFinance/CauserBurdenInpColumn";
import { SewerageChargeInpColumn } from "@/components/util/column/input/sewerageFinance/SewerageChargeInpColumn";
import { SewerageFinanceSettleInpColumn } from "@/components/util/column/input/sewerageFinance/SewerageFinanceSettleInpColumn";
import { SewerageUsageFeeInpColumn } from "@/components/util/column/input/sewerageFinance/SewerageUsageFeeInpColumn";
import { toGridRows } from "@/components/util/grid/gridFunction";
import { useAdminStore } from "@/store/admin-store";
import { SewerageFinanceSettleInpColumn } from "@/components/util/column/input/sewerageFinance/SewerageFinanceSettleInpColumn"
import { SewerageChargeInpColumn } from "@/components/util/column/input/sewerageFinance/SewerageChargeInpColumn"
import { SewerageUsageFeeInpColumn } from "@/components/util/column/input/sewerageFinance/SewerageUsageFeeInpColumn"
import { CauserBurdenInpColumn } from "@/components/util/column/input/sewerageFinance/CauserBurdenInpColumn"
const SewerageFinanceInpTabList = [
SewerageFinanceSettleInpColumn,
SewerageChargeInpColumn,
SewerageUsageFeeInpColumn,
CauserBurdenInpColumn,
] as const;
const firstTabKey = SewerageFinanceSettleInpColumn.tabKey;
const SEWERAGE_FINANCE_COLUMN_GUIDE_TAB_KEYS = Array.from(
new Set(SewerageFinanceInpTabList.map((tab) => tab.tabKey).filter(Boolean)),
);
type GridRowWithVerification = Record<string, string | number> & {
verificationResult?: SewerageFinanceVerificationResult;
};
type TabToolbarSnapshot = {
showSaveInToolbar: boolean;
showEnterableToolbarButtons: boolean;
showActionToolbarCard: boolean;
};
const toGridColumnInfo = (tab: (typeof SewerageFinanceInpTabList)[number]): ColumnInfo => ({
columns: tab.columns ?? [],
columnLayout: tab.columnLayout ?? [],
});
function buildSewerageFinanceSearchParam(
values: SearchFormValues,
overrides?: { mode?: string },
): SewerageFinanceRequestParams {
return {
statsYr: values.year,
sewerBzmnCd: values.bsnmCd,
ctpvNm: values.sido,
sggNm: values.gugun === "ALL" ? "" : values.gugun,
...(overrides?.mode ? { mode: overrides.mode } : {}),
};
}
const computeTabEnterable = (
statusInfo: SewerageStatusInfo | null | undefined,
periodEnterable: boolean,
): boolean => {
if (statusInfo?.laeSbmsnSttsCd) {
if (["2", "3"].includes(statusInfo.laeSbmsnSttsCd)) {
return false;
}
return periodEnterable;
}
return periodEnterable;
};
function buildGugunOkForToolbar(values: SearchFormValues | null): boolean {
return doList.includes(values?.bsnmCd || "")
? Boolean(values?.gugun && values.gugun !== "ALL")
: true;
}
function computeTabToolbarSnapshot(
statusInfo: SewerageStatusInfo | null,
hasRowData: boolean,
treatAsSearched: boolean,
searchContext: SearchFormValues | null,
periodEnterable: boolean,
isAdminInfo: boolean,
): TabToolbarSnapshot {
const gugunOk = buildGugunOkForToolbar(searchContext);
const enterable = computeTabEnterable(statusInfo, periodEnterable);
const isSubmitted = statusInfo?.laeSbmsnSttsCd === "2";
const showSaveInToolbar = (enterable || isAdminInfo) && gugunOk;
const showEnterableToolbarButtons = enterable && gugunOk;
const showSubmittedInInputPeriodToolbar = isSubmitted && periodEnterable && gugunOk;
const showActionToolbarCard =
(hasRowData || treatAsSearched) &&
(showSaveInToolbar ||
showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar ||
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
}
function tabRowDataExists(
m: Map<string, Record<string, string | number>[]>,
tabKey: string,
): boolean {
const rows = m.get(tabKey);
return Array.isArray(rows) && rows.length > 0;
}
function mapRegionalListToGridRows<
T extends { verificationResult?: SewerageFinanceVerificationResult },
>(list: T[], ctpvNm: string): GridRowWithVerification[] {
return list.map((item) => {
const { verificationResult, ...rest } = item;
const row = toGridRows([{ ctpvNm, ...rest }])[0] as GridRowWithVerification;
if (verificationResult) row.verificationResult = verificationResult;
return row;
});
}
// 하수도 통계 관리 > 09. 하수도재정
const SewerageFinanceInp = () => {
const { setMessage: alert } = useAlertStore((state) => state);
const { confirm } = useConfirm();
const { isAdminInfo } = useAdminStore();
// tab list
const SewerageFinanceInpTabList = [
SewerageFinanceSettleInpColumn,
SewerageChargeInpColumn,
SewerageUsageFeeInpColumn,
CauserBurdenInpColumn
];
const [isLoading, setIsLoading] = useState(false);
const [activeTab, setActiveTab] = useState<string>(firstTabKey);
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(
new Map(),
);
const [searchValues, setSearchValues] = useState<SearchFormValues | null>(null);
const [lastSearchedValues, setLastSearchedValues] = useState<SearchFormValues | null>(null);
const [hasSearched, setHasSearched] = useState(false);
const [inputPeriodEnterable, setInputPeriodEnterable] = useState(true);
const [tabStatusInfoMap, setTabStatusInfoMap] = useState<
Map<string, SewerageStatusInfo | null>
>(new Map());
const [tabStatsCdMap, setTabStatsCdMap] = useState<Map<string, string>>(new Map());
const [toolbarSnapshotByTab, setToolbarSnapshotByTab] = useState<
Map<string, TabToolbarSnapshot>
>(new Map());
const [columnGuidesByTab, setColumnGuidesByTab] = useState<
Record<string, Record<string, string>>
>({});
const [verificationHistoryOpen, setVerificationHistoryOpen] = useState(false);
const [verificationResultDialogOpen, setVerificationResultDialogOpen] = useState(false);
const submitExceptionFunc = () => {
// 예외 제출 로직
const searchParamRef = useRef<SewerageFinanceRequestParams | null>(null);
const searchDoneRef = useRef(false);
const periodEnterableRef = useRef(true);
const activeTabRef = useRef(activeTab);
const getGridDataRef = useRef<(() => Record<string, string | number>[]) | null>(null);
activeTabRef.current = activeTab;
useEffect(() => {
let cancelled = false;
void (async () => {
const entries = await Promise.all(
SEWERAGE_FINANCE_COLUMN_GUIDE_TAB_KEYS.map(async (tabKey) => {
try {
const res = await statisticsApi.getColumnGuides(tabKey);
if (res.status !== "success" || !Array.isArray(res.data)) {
return [tabKey, {}] as const;
}
const next: Record<string, string> = {};
for (const item of res.data) {
const key = item.engColNm?.trim();
const guide = item.columnGuide?.trim();
if (key && guide) next[key] = guide;
}
return [tabKey, next] as const;
} catch {
return [tabKey, {}] as const;
}
}),
);
if (cancelled) return;
setColumnGuidesByTab(Object.fromEntries(entries));
})();
return () => {
cancelled = true;
};
}, []);
const commitToolbarSnapshotForLoadedTab = (
tabKey: string,
statusInfo: SewerageStatusInfo | null,
hasRowData: boolean,
searchContext: SearchFormValues,
) => {
setToolbarSnapshotByTab((prev) => {
const next = new Map(prev);
next.set(
tabKey,
computeTabToolbarSnapshot(
statusInfo,
hasRowData,
searchDoneRef.current,
searchContext,
periodEnterableRef.current,
isAdminInfo,
),
);
return next;
});
};
const lastYearDataFunc = () => {
// 지난연도 데이터 가져오기 로직
const applyRowMap = (
mergeIntoExistingMap: boolean,
apply: (m: Map<string, Record<string, string | number>[]>) => void,
) => {
if (mergeIntoExistingMap) {
setRowDataMap((prev) => {
const next = new Map(prev);
apply(next);
return next;
});
} else {
const next = new Map<string, Record<string, string | number>[]>();
apply(next);
setRowDataMap(next);
}
};
const loadActiveTabData = async (
tabKey: string,
param: SewerageFinanceRequestParams,
searchContext: SearchFormValues,
mergeIntoExistingMap: boolean,
updateLastSearchedValues: boolean,
overrides?: { mode?: string },
): Promise<boolean> => {
const requestParam = overrides?.mode ? { ...param, mode: overrides.mode } : param;
if (tabKey === SewerageFinanceSettleInpColumn.tabKey) {
const response =
await statisticsInputSewerageFinanceApi.getSewerageFinanceSettleList(requestParam);
if (response.status !== "success" || !response.data) {
alert(response.message || "데이터 조회 중 오류가 발생했습니다.");
return false;
}
const { commonInfo, statusInfo, sewerageFinanceSettleList } = response.data;
const gridRows = mapRegionalListToGridRows(
(sewerageFinanceSettleList ?? []) as SewerageFinanceSettleItem[],
commonInfo.ctpvNm,
);
applyRowMap(mergeIntoExistingMap, (m) => {
m.set(SewerageFinanceSettleInpColumn.tabKey, gridRows);
});
setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, statusInfo));
setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd));
if (updateLastSearchedValues) setLastSearchedValues(searchContext);
commitToolbarSnapshotForLoadedTab(tabKey, statusInfo, gridRows.length > 0, searchContext);
return true;
}
if (tabKey === SewerageChargeInpColumn.tabKey) {
const response =
await statisticsInputSewerageFinanceApi.getSewerageChargeList(requestParam);
if (response.status !== "success" || !response.data) {
alert(response.message || "데이터 조회 중 오류가 발생했습니다.");
return false;
}
const { commonInfo, statusInfo, sewerageChargeList } = response.data;
const gridRows = mapRegionalListToGridRows(
(sewerageChargeList ?? []) as SewerageChargeItem[],
commonInfo.ctpvNm,
);
applyRowMap(mergeIntoExistingMap, (m) => {
m.set(SewerageChargeInpColumn.tabKey, gridRows);
});
setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, statusInfo));
setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd));
if (updateLastSearchedValues) setLastSearchedValues(searchContext);
commitToolbarSnapshotForLoadedTab(tabKey, statusInfo, gridRows.length > 0, searchContext);
return true;
}
if (tabKey === SewerageUsageFeeInpColumn.tabKey) {
const response =
await statisticsInputSewerageFinanceApi.getSewerageUsageFeeList(requestParam);
if (response.status !== "success" || !response.data) {
alert(response.message || "데이터 조회 중 오류가 발생했습니다.");
return false;
}
const { commonInfo, statusInfo, sewerageUsageFeeList } = response.data;
const gridRows = mapRegionalListToGridRows(
(sewerageUsageFeeList ?? []) as SewerageUsageFeeItem[],
commonInfo.ctpvNm,
);
applyRowMap(mergeIntoExistingMap, (m) => {
m.set(SewerageUsageFeeInpColumn.tabKey, gridRows);
});
setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, statusInfo));
setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd));
if (updateLastSearchedValues) setLastSearchedValues(searchContext);
commitToolbarSnapshotForLoadedTab(tabKey, statusInfo, gridRows.length > 0, searchContext);
return true;
}
if (tabKey === CauserBurdenInpColumn.tabKey) {
const response =
await statisticsInputSewerageFinanceApi.getCauserBurdenList(requestParam);
if (response.status !== "success" || !response.data) {
alert(response.message || "데이터 조회 중 오류가 발생했습니다.");
return false;
}
const { commonInfo, statusInfo, causerBurdenList } = response.data;
const gridRows = mapRegionalListToGridRows(
(causerBurdenList ?? []) as CauserBurdenItem[],
commonInfo.ctpvNm,
);
applyRowMap(mergeIntoExistingMap, (m) => {
m.set(CauserBurdenInpColumn.tabKey, gridRows);
});
setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, statusInfo));
setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd));
if (updateLastSearchedValues) setLastSearchedValues(searchContext);
commitToolbarSnapshotForLoadedTab(tabKey, statusInfo, gridRows.length > 0, searchContext);
return true;
}
alert("해당 탭 조회 API가 없습니다.");
return false;
};
const getTabGridRows = (tabKey: string): Record<string, string | number>[] =>
getGridDataRef.current?.() ?? rowDataMap.get(tabKey) ?? [];
const handleReset = () => {
setRowDataMap(new Map());
setTabStatusInfoMap(new Map());
setTabStatsCdMap(new Map());
setToolbarSnapshotByTab(new Map());
setActiveTab(firstTabKey);
activeTabRef.current = firstTabKey;
setLastSearchedValues(null);
setHasSearched(false);
setInputPeriodEnterable(true);
searchParamRef.current = null;
searchDoneRef.current = false;
periodEnterableRef.current = true;
};
const handleSearch = async (values: SearchFormValues) => {
if (!values.sido || values.sido === "ALL") {
alert("시도를 선택해주세요.");
return;
}
try {
const periodResponse = await statisticsInputSewSupplyRateApi.checkInputPeriod(
values.year || "",
);
if (periodResponse.status !== "success") {
alert(periodResponse.message);
return;
}
const periods = Array.isArray(periodResponse.data) ? periodResponse.data : [];
const periodOk = isInputPeriodCurrent(periods);
periodEnterableRef.current = periodOk;
setInputPeriodEnterable(periodOk);
const yearChangedFromLastSearch =
lastSearchedValues != null &&
(lastSearchedValues.year ?? "") !== (values.year ?? "");
if (yearChangedFromLastSearch) {
setRowDataMap(new Map());
setTabStatusInfoMap(new Map());
setTabStatsCdMap(new Map());
setToolbarSnapshotByTab(new Map());
activeTabRef.current = firstTabKey;
setActiveTab(firstTabKey);
}
setIsLoading(true);
searchDoneRef.current = true;
setHasSearched(true);
const searchParam = buildSewerageFinanceSearchParam(values);
searchParamRef.current = searchParam;
await loadActiveTabData(
activeTabRef.current,
searchParam,
values,
!yearChangedFromLastSearch,
true,
);
} catch {
alert("데이터 조회 중 오류가 발생했습니다.");
} finally {
setIsLoading(false);
}
};
const handleActiveTabChange = async (tabKey: string) => {
const prevTabKey = activeTabRef.current;
const latestRowsInPrevTab = getTabGridRows(prevTabKey);
if (latestRowsInPrevTab.length > 0 || rowDataMap.has(prevTabKey)) {
setRowDataMap((prev) => {
const next = new Map(prev);
next.set(prevTabKey, latestRowsInPrevTab);
return next;
});
}
activeTabRef.current = tabKey;
setActiveTab(tabKey);
if (!hasSearched || !lastSearchedValues || !searchParamRef.current) return;
if (tabRowDataExists(rowDataMap, tabKey)) return;
try {
setIsLoading(true);
await loadActiveTabData(
tabKey,
searchParamRef.current,
lastSearchedValues,
true,
false,
);
} catch {
alert("데이터 조회 중 오류가 발생했습니다.");
} finally {
setIsLoading(false);
}
};
const lastYearDataFunc = async () => {
const values = lastSearchedValues ?? searchValues;
if (!values?.sido || values.sido === "ALL") {
alert("시도를 선택해주세요.");
return;
}
if (!hasSearched) {
alert("먼저 데이터를 조회해주세요.");
return;
}
try {
setIsLoading(true);
const param = buildSewerageFinanceSearchParam(values, { mode: "PRE" });
await loadActiveTabData(
activeTabRef.current,
param,
values,
true,
false,
{ mode: "PRE" },
);
} catch {
alert("데이터 조회 중 오류가 발생했습니다.");
} finally {
setIsLoading(false);
}
};
const cnacelSubmitFunc = () => {
void (async () => {
try {
if (!(await confirm("제출된 내용을 취소하시겠습니까?"))) return;
if (!lastSearchedValues || !searchParamRef.current) {
alert("먼저 조회를 진행해주세요.");
return;
}
const userInfo = await getUserInfo();
const tabKey = activeTabRef.current;
const statsCdForTab = tabStatsCdMap.get(tabKey);
if (!statsCdForTab) {
alert("먼저 조회를 진행해주세요.");
return;
}
const requestData: cancelSubmitRequest = {
sewerBzmnCd: lastSearchedValues.bsnmCd ?? "",
ctpvNm: lastSearchedValues.sido ?? "",
sggNm:
lastSearchedValues.gugun === "ALL"
? ""
: (lastSearchedValues.gugun ?? ""),
statsYr: lastSearchedValues.year ?? "",
mdfrId: userInfo.userUnqId,
statsCd: statsCdForTab,
};
const response = await statisticsApi.cancelSubmit(requestData);
if (response.status === "success") {
setIsLoading(true);
await loadActiveTabData(
tabKey,
searchParamRef.current,
lastSearchedValues,
false,
false,
);
alert("제출 취소되었습니다.");
} else {
alert(response.message ?? "제출 취소 중 오류가 발생했습니다.");
}
} catch {
alert("제출 취소 중 오류가 발생했습니다.");
} finally {
setIsLoading(false);
}
})();
};
const submitFunc = () => {
@@ -39,26 +544,249 @@ const SewerageFinanceInp = () => {
// 저장 로직
};
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map());
const openVerificationHistoryDialog = () => {
const ctx = lastSearchedValues ?? searchValues;
const statsCd = tabStatsCdMap.get(activeTab);
if (!ctx?.year || !ctx?.sido || !ctx?.bsnmCd || !statsCd) {
alert("먼저 조회를 진행해주세요.");
return;
}
setVerificationHistoryOpen(true);
};
const verificationQueryContext = (() => {
const ctx = lastSearchedValues ?? searchValues;
const statsCd = tabStatsCdMap.get(activeTab);
if (!ctx?.year || !ctx?.sido || !ctx?.bsnmCd || !statsCd) return null;
return {
sewerBzmnCd: ctx.bsnmCd,
ctpvNm: ctx.sido,
sggNm: ctx.gugun === "ALL" ? "" : (ctx.gugun ?? ""),
statsYr: ctx.year,
statsCd,
};
})();
const columnInfoByTab = useMemo(() => {
const map = new Map<string, ColumnInfo>();
for (const tab of SewerageFinanceInpTabList) {
const tabKey = tab.tabKey;
const canEdit =
computeTabEnterable(
tabStatusInfoMap.get(tabKey) ?? null,
inputPeriodEnterable,
) || isAdminInfo;
const rawColumns = (tab.columns ?? []) as ColumnConfig[];
const base = canEdit
? rawColumns
: rawColumns.map((col) => ({ ...col, editable: false as const }));
const columns = base.map((col) => {
const guide = columnGuidesByTab[tabKey]?.[col.fieldName]?.trim();
return guide ? { ...col, tooltip: guide } : col;
});
map.set(tabKey, {
columns,
columnLayout: tab.columnLayout ?? [],
});
}
return map;
}, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, columnGuidesByTab]);
const activeTabStatus = tabStatusInfoMap.get(activeTab) ?? null;
const activeTabToolbar =
toolbarSnapshotByTab.get(activeTab) ??
computeTabToolbarSnapshot(
activeTabStatus,
tabRowDataExists(rowDataMap, activeTab),
hasSearched,
lastSearchedValues,
inputPeriodEnterable,
isAdminInfo,
);
const { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard } =
activeTabToolbar;
const verificationCellStyle = ({
fieldName,
row,
}: {
fieldName: string;
row: Record<string, string | number>;
}): string | undefined => {
const verification = (row as GridRowWithVerification).verificationResult;
if (!verification) return;
const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) {
const hasImr = errors.some((e) => e.vrfcCd === "IMR" || e.vrfcCd === "HB");
return hasImr ? "rg-cell-verify-error-imr" : "rg-cell-verify-error";
}
};
const verificationCellTooltip = ({
fieldName,
row,
}: {
fieldName: string;
row: Record<string, string | number>;
}): string | undefined => {
const verification = (row as GridRowWithVerification).verificationResult;
if (!verification) return;
const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) {
return errors
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "IMR검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "HB검증 - ";
return `${prefix}${e.rsnExpln}(검증 기준값: ${e.compVlCn} / 현재 입력값: ${e.nowVlCn})`;
})
.filter(Boolean)
.join("\n");
}
};
return (
<>
<SearchForm />
<div className="card !py-0">
<div className="flex justify-end items-center gap-[0.6rem] m-[0.6rem]">
<SubmitExceptionButton SubmitExceptionFunc={submitExceptionFunc} />
<LastYearDataButton getLastYearDataFunc={lastYearDataFunc} />
<SubmitButton submitFunc={submitFunc} />
<SaveButton saveFunc={saveFunc} />
<div className="relative">
<SearchForm
onSubmit={handleSearch}
onReset={handleReset}
onValuesChange={setSearchValues}
/>
{showActionToolbarCard && (
<div className="card !py-0">
<div className="flex justify-end items-center gap-[0.6rem] m-[0.6rem]">
<VerificationResultButton
VerificationResultButtonFunc={openVerificationHistoryDialog}
/>
{showEnterableToolbarButtons && (
<>
<LastYearDataButton
getLastYearDataFunc={() => void lastYearDataFunc()}
/>
<SubmitButton submitFunc={submitFunc} />
</>
)}
{activeTabStatus?.laeSbmsnSttsCd === "2" && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
</div>
</div>
)}
{isLoading && (
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
<div className="relative size-[5rem]">
<LoadingWithAnimation color="primary" />
</div>
</div>
)}
<div className="flex flex-col gap-[0.6rem] mx-[0.6rem]">
<Tabs
value={activeTab}
onValueChange={(v) => void handleActiveTabChange(v)}
className="w-full"
variant="default"
>
<TabsList>
{SewerageFinanceInpTabList.map((info) => (
<TabsTrigger key={info.tabKey} value={info.tabKey}>
{info.tabLabel || info.tabKey}
</TabsTrigger>
))}
</TabsList>
{SewerageFinanceInpTabList.map((info) => {
const tabKey = info.tabKey;
const rowData = rowDataMap.get(tabKey) ?? [];
const tabEnterableForGrid =
computeTabEnterable(
tabStatusInfoMap.get(tabKey) ?? null,
inputPeriodEnterable,
) || isAdminInfo;
const gugunOk = buildGugunOkForToolbar(lastSearchedValues);
const tabStatusInfo = tabStatusInfoMap.get(tabKey) ?? null;
return (
<TabsContent key={tabKey} value={tabKey}>
<DataGrid
key={`${tabKey}-${tabEnterableForGrid ? "enterable" : "readonly"}`}
columnInfo={
columnInfoByTab.get(tabKey) ?? toGridColumnInfo(info)
}
rowStartNum={info.rowStartNum}
excelExportFileSuffix={info.tabLabel || tabKey}
rowData={rowData}
setRowData={(updater) => {
setRowDataMap((prev) => {
const next = new Map(prev);
const cur = next.get(tabKey) ?? [];
const n =
typeof updater === "function"
? updater(cur)
: updater;
next.set(tabKey, n);
return next;
});
}}
showHeaderCheckbox={false}
fixedColumns={info.fixedColumns}
enableSort={false}
statusInfo={tabStatusInfo}
isExcelImport={
tabRowDataExists(rowDataMap, tabKey) &&
tabEnterableForGrid &&
gugunOk
}
isExcelExport
cellStyleCallback={verificationCellStyle}
cellTooltipCallback={verificationCellTooltip}
getGridDataRef={
activeTab === tabKey ? getGridDataRef : undefined
}
/>
</TabsContent>
);
})}
</Tabs>
</div>
</div>
<TabDataGrid
columnInfo={SewerageFinanceInpTabList}
rowDataMap={rowDataMap}
setRowDataMap={setRowDataMap}
<VerificationResultHistoryDialog
open={verificationHistoryOpen}
onOpenChange={setVerificationHistoryOpen}
queryContext={verificationQueryContext}
onExceptionResetSubmitted={async () => {
const values = lastSearchedValues ?? searchValues;
if (!values || !searchParamRef.current) return;
await loadActiveTabData(
activeTabRef.current,
searchParamRef.current,
values,
true,
false,
);
}}
/>
<VerificationResultDialog
open={verificationResultDialogOpen}
onOpenChange={setVerificationResultDialogOpen}
queryContext={verificationQueryContext}
onExceptionSubmitted={async () => {
const values = lastSearchedValues ?? searchValues;
if (!values || !searchParamRef.current) return;
await loadActiveTabData(
activeTabRef.current,
searchParamRef.current,
values,
true,
false,
);
}}
/>
</>
);
};
export default SewerageFinanceInp;
export default SewerageFinanceInp;
@@ -254,7 +254,6 @@ const SeweragePenetrationRateInp = () => {
...d,
ctpvNm: commonInfo.ctpvNm,
spcCtpnRgnCn: d.spcCtpnRgnCn === '' || d.spcCtpnRgnCn === null ? '해당없음' : d.spcCtpnRgnCn,
swagePplPsplyRt: commonInfo.swagePplPsplyRt,
}));
setRowData(
convertedData.map((d) => {
@@ -289,7 +288,8 @@ const SeweragePenetrationRateInp = () => {
} else {
alert(response.message);
}
} catch {
} catch (error) {
console.log(error);
alert('데이터 조회 중 오류가 발생했습니다.');
setRowData([]);
setStatusInfo(null);
@@ -791,11 +791,13 @@ const SeweragePenetrationRateInp = () => {
</div>
</div>
)}
{isLoading && !globalProgressVisible && <div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
<div className="relative size-[5rem]">
<LoadingWithAnimation color="primary" />
{isLoading && !globalProgressVisible &&
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
<div className="relative size-[5rem]">
<LoadingWithAnimation color="primary" />
</div>
</div>
</div>}
}
<DataGrid
key={(isEnterable || isAdminInfo) ? 'enterable' : 'readonly'}
columnInfo={columnInfo}
@@ -823,7 +825,7 @@ const SeweragePenetrationRateInp = () => {
if (Array.isArray(errors) && errors.length > 0) {
return errors
.map((e) => {
const prefix = e.vrfcCd === 'IMR' ? 'IMR검증 - ' : (e.vrfcCd === 'NM' ? '일반검증 - ' : 'HB검증 -');
const prefix = e.vrfcCd === 'IMR' ? 'IMR검증 - ' : (e.vrfcCd === 'NV' ? '일반검증 - ' : 'HB검증 -');
return `${prefix}${e.rsnExpln}
(검증 기준값: ${e.compVlCn} / 현재 입력값: ${e.nowVlCn})`;
})
@@ -860,6 +862,11 @@ const SeweragePenetrationRateInp = () => {
}
: null
}
onExceptionResetSubmitted={async () => {
const values = lastSearchedValues ?? searchValues;
if (!values) return;
await handleSearch(values);
}}
/>
<VerificationResultDialog
open={verificationResultDialogOpen}
@@ -196,6 +196,20 @@ const LogHistory = () => {
const handleSearch = async (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
if (startDate && endDate) {
const start = dayjs(startDate);
const end = dayjs(endDate);
if (start.isAfter(end, "day")) {
alert("시작일은 종료일보다 늦을 수 없습니다.");
return;
}
if (end.isBefore(start, "day")) {
alert("종료일은 시작일보다 빠를 수 없습니다.");
return;
}
}
await loadLogs(1);
};
@@ -1,6 +1,7 @@
"use client";
import { useEffect } from "react";
import { useEffect, useMemo, useState } from "react";
import { GridFitStyle } from "realgrid";
import {
Button,
@@ -10,9 +11,20 @@ import {
DialogFooter,
DialogHeader,
DialogTitle,
LoadingWithAnimation,
} from "@common/components";
import DataGrid from "@/components/module/DataGrid";
import type { ColumnInfo } from "@/components/type/DataGrid.type";
import {
alignLogDetailRowsToColumns,
buildLogHistoryDetailColumnInfo,
emptyLogHistoryDetailColumnInfo,
} from "@/components/util/column/management/LogHistoryDetailColumn";
import { toGridRows } from "@/components/util/grid/gridFunction";
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import type { StatisticsLogDetailRow } from "@/entities/statistics/model/statistics-interface";
import { useAlertStore } from "@/shared/lib";
export interface LogHistoryDetailDialogProps {
open: boolean;
@@ -25,24 +37,115 @@ export function LogHistoryDetailDialog({
onOpenChange,
row,
}: LogHistoryDetailDialogProps) {
const { setMessage: alert } = useAlertStore((state) => state);
const [isLoading, setIsLoading] = useState(false);
const [rowData, setRowData] = useState<Record<string, string | number>[]>(
[],
);
const [columnInfo, setColumnInfo] = useState<ColumnInfo>(
emptyLogHistoryDetailColumnInfo,
);
useEffect(() => {
if (!open || !row) return;
if (!open) {
setRowData([]);
setColumnInfo(emptyLogHistoryDetailColumnInfo);
setIsLoading(false);
return;
}
if (!row) return;
const sn = row.statsLogSn;
let cancelled = false;
void (async () => {
const response = await statisticsApi.getLogDetail(
sn !== undefined && sn !== null ? String(sn) : "",
);
console.log(response.data);
setIsLoading(true);
setRowData([]);
try {
const response = await statisticsApi.getLogDetail(
sn !== undefined && sn !== null ? String(sn) : "",
);
if (cancelled) return;
if (response.status !== "success") {
alert(
response.message ??
"로그 상세 정보를 불러오는데 실패했습니다.",
);
return;
}
const list = Array.isArray(response.data)
? response.data
: [];
const nextColumnInfo = buildLogHistoryDetailColumnInfo(list);
const nextRows = alignLogDetailRowsToColumns(
toGridRows(list as StatisticsLogDetailRow[]),
nextColumnInfo,
);
setColumnInfo(nextColumnInfo);
setRowData(nextRows);
} catch {
if (!cancelled) {
alert("로그 상세 정보를 불러오는데 실패했습니다.");
}
} finally {
if (!cancelled) setIsLoading(false);
}
})();
}, [open, row]);
return () => {
cancelled = true;
};
}, [open, row, alert]);
const gridRemountKey = useMemo(
() => columnInfo.columns.map((c) => c.fieldName).join("\u0001"),
[columnInfo],
);
const showGrid = !isLoading && rowData.length > 0;
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="max-w-[60rem]" aria-describedby={undefined}>
<DialogContent
className="max-w-[80%]"
aria-describedby={undefined}
>
<DialogHeader>
<DialogTitle />
<DialogTitle>로그 상세 정보</DialogTitle>
</DialogHeader>
<div className="relative min-h-[32rem]">
{isLoading && (
<div className="absolute inset-0 z-10 flex items-center justify-center rounded-lg bg-background/80">
<div className="relative size-[5rem]">
<LoadingWithAnimation color="primary" />
</div>
</div>
)}
{showGrid ? (
<DataGrid
key={gridRemountKey}
columnInfo={columnInfo}
rowData={rowData}
setRowData={setRowData}
isExcelImport={false}
isExcelExport={false}
enableSort={false}
gridHeight={55}
fitStyle={GridFitStyle.NONE}
/>
) : (
!isLoading && (
<p className="flex h-full items-center justify-center text-[1.3rem] text-muted-foreground">
표시할 상세 데이터가 없습니다.
</p>
)
)}
</div>
<DialogFooter>
<DialogClose asChild>
<Button size="lg" color="white" type="button">
@@ -213,6 +213,7 @@ function buildRowsFromStatusList(
statKeys: string[],
): Record<string, string | number>[] {
const rowMap = new Map<string, Record<string, string | number>>();
const rowOrder: string[] = [];
for (const item of statusList) {
const { sido, sgg } = splitSidoSggNm(item.sidoSggNm);
@@ -228,6 +229,7 @@ function buildRowsFromStatusList(
row[key] = "";
}
rowMap.set(rowKey, row);
rowOrder.push(rowKey);
}
const row = rowMap.get(rowKey)!;
@@ -236,11 +238,7 @@ function buildRowsFromStatusList(
}
}
return Array.from(rowMap.values()).sort((a, b) => {
const sidoCmp = String(a[SIDO_FIELD]).localeCompare(String(b[SIDO_FIELD]), "ko");
if (sidoCmp !== 0) return sidoCmp;
return String(a[SGG_FIELD]).localeCompare(String(b[SGG_FIELD]), "ko");
});
return rowOrder.map((key) => rowMap.get(key)!);
}
function buildUnSubmitDataRequest(
@@ -4,8 +4,6 @@ import { useEffect, useState } from "react";
import { Controller, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { Search } from "lucide-react";
import { Tooltip, TooltipContent, TooltipTrigger } from "@common/components";
import { CodeSelect } from "@/entities/code/ui/code-select";
import { verificationTargetManagementApi } from "@/entities/statistics/api/verification-target-management-service";
@@ -17,6 +15,14 @@ import {
type VerificationTargetManagementFormData,
verificationTargetManagementSchema,
} from "@/entities/statistics/model/verification-target-management-schema";
import {
Label,
RadioGroup,
RadioGroupItem,
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@common/components";
import {
Button,
Dialog,
@@ -321,16 +327,27 @@ export function VerificationTargetDialog({
{tabValue !== "IMR" && (
<TableRow>
<TableHead className="bg-muted font-medium">
<Tooltip>
<TooltipTrigger asChild>
<span className="inline-flex cursor-help items-center gap-1">
중요도 계수(μ)
<i className="diveicon di-info-circle text-muted-foreground" />
</span>
<span className="inline-flex cursor-help items-center gap-1">
중요도 계수(μ)
<i className="diveicon di-info-circle text-muted-foreground" />
</span>
</TooltipTrigger>
<TooltipContent>
<p>통계청(Statistics Canada) 등에서 기업 단위의 주기적 조사 데이터(수익, 매출, 생산량 등)에서 이상치(Outlier)를 탐지할 때, 데이터의 크기(규모)에 따라 이상치 판별 기준을 다르게 적용하기 위해 도입된 가중치 요인</p>
<p>
통계청(Statistics
Canada) 등에서 기업
단위의 주기적 조사
데이터(수익, 매출,
생산량 등)에서
이상치(Outlier)를 탐지할
때, 데이터의
크기(규모)에 따라 이상치
판별 기준을 다르게
적용하기 위해 도입된
가중치 요인
</p>
</TooltipContent>
</Tooltip>
</TableHead>
@@ -370,13 +387,19 @@ export function VerificationTargetDialog({
<TableHead className="bg-muted font-medium">
<Tooltip>
<TooltipTrigger asChild>
<span className="inline-flex cursor-help items-center gap-1">
백분위수 기준값(pct)
<i className="diveicon di-info-circle text-muted-foreground" />
</span>
<span className="inline-flex cursor-help items-center gap-1">
백분위수 기준값(pct)
<i className="diveicon di-info-circle text-muted-foreground" />
</span>
</TooltipTrigger>
<TooltipContent>
<p>데이터가 정규분포를 따르지 않아도, 데이터의 하위/상위 몇 % 위치를 기준으로 이상치 범위를 정할지 결정</p>
<p>
데이터가 정규분포를
따르지 않아도, 데이터의
하위/상위 몇 % 위치를
기준으로 이상치 범위를
정할지 결정
</p>
</TooltipContent>
</Tooltip>
</TableHead>
@@ -419,16 +442,23 @@ export function VerificationTargetDialog({
{tabValue !== "IMR" && (
<TableRow>
<TableHead className="bg-muted font-medium">
<Tooltip>
<TooltipTrigger asChild>
<span className="inline-flex cursor-help items-center gap-1">
스케일 조정 계수(A)
<i className="diveicon di-info-circle text-muted-foreground" />
</span>
<span className="inline-flex cursor-help items-center gap-1">
스케일 조정 계수(A)
<i className="diveicon di-info-circle text-muted-foreground" />
</span>
</TooltipTrigger>
<TooltipContent>
<p>데이터의 크기가 다른 경우, 특히 규모가 작은 업체가 이상치로 잘못 탐지되는 것을 막기 위해 변환된 비율(Symmetric Ratios)에 규모(size)의 영향을 보정하는 역할</p>
<p>
데이터의 크기가 다른
경우, 특히 규모가 작은
업체가 이상치로 잘못
탐지되는 것을 막기 위해
변환된 비율(Symmetric
Ratios)에 규모(size)의
영향을 보정하는 역할
</p>
</TooltipContent>
</Tooltip>
</TableHead>
@@ -465,16 +495,22 @@ export function VerificationTargetDialog({
)}
/>
</TableCell>
<TableHead className="bg-muted font-medium" >
<TableHead className="bg-muted font-medium">
<Tooltip>
<TooltipTrigger asChild>
<span className="inline-flex cursor-help items-center gap-1">
임계 계수(c)
<i className="diveicon di-info-circle text-muted-foreground" />
</span>
<span className="inline-flex cursor-help items-center gap-1">
임계 계수(c)
<i className="diveicon di-info-circle text-muted-foreground" />
</span>
</TooltipTrigger>
<TooltipContent>
<p>데이터의 분포가 중앙값(median)을 중심으로 얼마나 흩어져 있는지를 바탕으로 이상치 범위를 결정</p>
<p>
데이터의 분포가
중앙값(median)을
중심으로 얼마나 흩어져
있는지를 바탕으로 이상치
범위를 결정
</p>
</TooltipContent>
</Tooltip>
</TableHead>
@@ -513,6 +549,48 @@ export function VerificationTargetDialog({
</TableCell>
</TableRow>
)}
<TableRow>
<TableHead className="bg-muted font-medium">
사용 여부
</TableHead>
<TableCell colSpan={3}>
<Controller
name="useYn"
control={control}
render={({ field }) => (
<div className="space-y-1">
<RadioGroup
className="flex items-center"
{...field}
onValueChange={
field.onChange
}
>
<div className="flex items-center gap-1">
<RadioGroupItem
value="Y"
id="useY"
/>
<Label htmlFor="useY">
예
</Label>
</div>
<div className="flex items-center gap-1">
<RadioGroupItem
value="N"
id="useN"
/>
<Label htmlFor="useN">
아니오
</Label>
</div>
</RadioGroup>
</div>
)}
/>
</TableCell>
</TableRow>
</TableBody>
</Table>
@@ -612,4 +690,3 @@ export function VerificationTargetDialog({
</>
);
}
+50 -1
View File
@@ -116,12 +116,22 @@ export type DataFieldValueCallback = (
/** 계산 필드 설정 (computedFieldCallbacks.ts 참고) */
export type ComputedFieldConfig =
| { fields: string[]; type: "sum" | "avg" | "max" | "difference" }
| { fields: string[]; type: "sum" | "avg" | "max" | "difference" | "quotient" }
| {
minuendFields: string[];
subtrahendFields: string[];
type: "differenceOfSums";
}
| {
firstSumFields: string[];
secondSumFields: string[];
type: "halfSumOfSums";
}
| {
firstHalfSum: { firstSumFields: string[]; secondSumFields: string[] };
secondHalfSum: { firstSumFields: string[]; secondSumFields: string[] };
type: "sumOfTwoHalfSumOfSums";
}
| {
baseField: string;
sumFields: string[];
@@ -149,6 +159,25 @@ export type ComputedFieldConfig =
denominatorFields: string[];
thirdFields: string[];
type: "swrgInstlrtRate";
}
| {
pumpGroups: Array<{
pumpCntField: string;
rsrvPumpCntField: string;
perPpqtyField: string;
}>;
type: "pumpGrossPpqty";
}
| {
inflwField: string;
dschgField: string;
type: "bodPrcsRt";
}
| {
/** (quotient[0]/quotient[1]) / (denominatorQuotient[0]/denominatorQuotient[1]) × 100 */
numeratorQuotient: [string, string];
denominatorQuotient: [string, string];
type: "quotientRatioPercent";
};
export type ColumnConfig = {
@@ -175,6 +204,26 @@ export type ColumnConfig = {
sortPreserveGroupOrder?: SortPreserveGroupOrder;
valueType?: ValueType;
dataFormat?: string;
/** RealGrid 드롭다운 목록 값 (예: 시군구 `gugun`) */
values?: string[];
/** RealGrid 드롭다운 표시 라벨 (`values`와 동일 길이 권장) */
labels?: string[];
/** true이면 셀에 라벨 표시 */
lookupDisplay?: boolean;
/** RealGrid 날짜 표시 형식 (예: `yyyy-MM-dd`) */
datetimeFormat?: string;
/** RealGrid 셀 편집기 */
editor?: {
type?: "dropdown" | "list" | "date";
domainOnly?: boolean;
textReadOnly?: boolean;
commitOnSelect?: boolean;
dropDownWhenClick?: boolean;
showToday?: boolean;
datetimeFormat?: string;
values?: string[];
labels?: string[];
};
footer?:
| {
text?: string;
@@ -8,58 +8,83 @@ import { ValueType } from "realgrid";
export const ExcretaTreatFactInpColumn = {
columns: [
// 행정구역
{ name: 'sido', fieldName: '시도', header: { text: '시도' }, editable: false },
{ name: 'gugun', fieldName: '시군구', header: { text: '시군구' }, footer: { text: '합계' } },
{ name: 'ctpvNm', fieldName: 'ctpvNm', header: { text: '시도' }, footer: { text: '합계' }, editable: false },
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' } },
// 기본 정보
{ name: 'ecscs_nm', fieldName: '시설명', header: { text: '시설명' } },
{ name: 'locplcs', fieldName: '소재지', header: { text: '소재지' } },
{ name: 'telno', fieldName: '전화번호', header: { text: '전화번호' } },
{ name: 'fcltNm', fieldName: 'fcltNm', header: { text: '시설명' } },
{ name: 'fcltPstnCn', fieldName: 'fcltPstnCn', header: { text: '소재지' } },
{ name: 'telNo', fieldName: 'telNo', header: { text: '전화번호' } },
// 날짜 정보
{ name: 'comp_dt', fieldName: '준공일 yyyy-mm-dd', header: { text: '준공일 yyyy-mm-dd' } },
{ name: 'rn_dt', fieldName: '가동개시일 yyyy-mm-dd', header: { text: '가동개시일 yyyy-mm-dd' } },
{
name: 'cmptnStrtYmd',
fieldName: 'cmptnStrtYmd',
header: { text: '준공일 yyyy-mm-dd' },
datetimeFormat: 'yyyy-MM-dd',
editor: {
type: 'date' as const,
dropDownWhenClick: true,
datetimeFormat: 'yyyy-MM-dd',
},
},
{
name: 'oprtngStrtYmd',
fieldName: 'oprtngStrtYmd',
header: { text: '가동개시일 yyyy-mm-dd' },
datetimeFormat: 'yyyy-MM-dd',
editor: {
type: 'date' as const,
dropDownWhenClick: true,
datetimeFormat: 'yyyy-MM-dd',
},
},
// 사업비/용량 정보
{ name: 'wct', fieldName: '사업비(백만원)', header: { text: '사업비(백만원)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'ecscs_cpcty', fieldName: '시설용량(m³/일)', header: { text: '시설용량(m³/일)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'process_cpcty', fieldName: '처리량(m³/일)', header: { text: '처리량(m³/일)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'opr_daycnt', fieldName: '가동일수(일/년)', header: { text: '가동일수(일/년)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'wholPjtcoAmt', fieldName: 'wholPjtcoAmt', header: { text: '사업비(백만원)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'prcsFcltCpct', fieldName: 'prcsFcltCpct', header: { text: '시설용량(m³/일)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'cpct', fieldName: 'cpct', header: { text: '처리량(m³/일)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'oprtngDayCnt', fieldName: 'oprtngDayCnt', header: { text: '가동일수(일/년)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 처리 공법 및 연계
{ name: 'trt_msrc', fieldName: '처리공법', header: { text: '처리공법' } },
{ name: 'cntc_prcplt', fieldName: '연계처리장명', header: { text: '연계처리장명' } },
{ name: 'assct_trt_cpc', fieldName: '연계처리량(m³/일)', header: { text: '연계처리량(m³/일)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'prcsMthdExpln', fieldName: 'prcsMthdExpln', header: { text: '처리공법' } },
{ name: 'linkTmplntCn', fieldName: 'linkTmplntCn', header: { text: '연계처리장명' } },
{ name: 'linkPrcsQnt', fieldName: 'linkPrcsQnt', header: { text: '연계처리량(m³/일)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 유입수질
{ name: 'infl_wqlt_bod', fieldName: 'BOD', header: { text: 'BOD' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'infl_wqlt_toc', fieldName: 'TOC', header: { text: 'TOC' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'infl_wqlt_ss', fieldName: 'SS', header: { text: 'SS' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'infl_wqlt_tn', fieldName: 'T-N', header: { text: 'T-N' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
{ name: 'infl_wqlt_tp', fieldName: 'T-P', header: { text: 'T-P' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
{ name: 'infl_wqlt_clfgrpcnt', fieldName: '대장균군수', header: { text: '대장균군수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'inflwBodWqVl', fieldName: 'inflwBodWqVl', header: { text: 'BOD' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'inflwTocWqVl', fieldName: 'inflwTocWqVl', header: { text: 'TOC' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'inflwSsWqVl', fieldName: 'inflwSsWqVl', header: { text: 'SS' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'inflwTnWqVl', fieldName: 'inflwTnWqVl', header: { text: 'T-N' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
{ name: 'inflwTpWqVl', fieldName: 'inflwTpWqVl', header: { text: 'T-P' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
{ name: 'inflwClfgCnt', fieldName: 'inflwClfgCnt', header: { text: '대장균군수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 방류수질
{ name: 'effl_wqlt_bod', fieldName: 'BOD', header: { text: 'BOD' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'effl_wqlt_toc', fieldName: 'TOC', header: { text: 'TOC' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'effl_wqlt_ss', fieldName: 'SS', header: { text: 'SS' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'effl_wqlt_tn', fieldName: 'T-N', header: { text: 'T-N' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
{ name: 'effl_wqlt_tp', fieldName: 'T-P', header: { text: 'T-P' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
{ name: 'effl_wqlt_clfgrpcnt', fieldName: '대장균군수', header: { text: '대장균군수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'dschgBodWqVl', fieldName: 'dschgBodWqVl', header: { text: 'BOD' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'dschgTocWqVl', fieldName: 'dschgTocWqVl', header: { text: 'TOC' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'dschgSsWqVl', fieldName: 'dschgSsWqVl', header: { text: 'SS' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'dschgTnWqVl', fieldName: 'dschgTnWqVl', header: { text: 'T-N' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
{ name: 'dschgTpWqVl', fieldName: 'dschgTpWqVl', header: { text: 'T-P' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
{ name: 'dschgClfgCnt', fieldName: 'dschgClfgCnt', header: { text: '대장균군수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 방류수역
{ name: 'rvbsn', fieldName: '수계', header: { text: '수계' } },
{ name: 'bstrm', fieldName: '지류', header: { text: '지류' } },
{ name: 'lgbsn', fieldName: '중권역', header: { text: '중권역' } },
{ name: 'mdmbsn', fieldName: '소권역', header: { text: '소권역' } },
{ name: 'wtsysNm', fieldName: 'wtsysNm', header: { text: '수계' } },
{ name: 'trbtrNm', fieldName: 'trbtrNm', header: { text: '지류' } },
{ name: 'msirbCn', fieldName: 'msirbCn', header: { text: '중권역' } },
{ name: 'ssirbCn', fieldName: 'ssirbCn', header: { text: '소권역' } },
// 운영 정보
{ name: 'oper_mth', fieldName: '운영주체(자체/공기업/민간위탁)', header: { text: '운영주체(자체/공기업/민간위탁)' } },
{ name: 'cntc_prcplt_cpc', fieldName: '직원총수(명)', header: { text: '직원총수(명)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'safe_acdnt_co', fieldName: '안전사고건수(건/인/년)', header: { text: '안전사고건수(건/인/년)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'operMthdCdCn', fieldName: 'operMthdCdCn', header: { text: '운영주체(자체/공기업/민간위탁)' } },
{ name: 'wholNope', fieldName: 'wholNope', header: { text: '직원총수(명)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'sftyAcdntEvntcsCnt', fieldName: 'sftyAcdntEvntcsCnt', header: { text: '안전사고건수(건/인/년)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 비고
{ name: 'rmk', fieldName: '비고', header: { text: '비고' } },
{ name: 'rmrk', fieldName: 'rmrk', header: { text: '비고' } },
// Hidden Columns : 시스템 관리를 위한 값
{ name: 'admdstCd', fieldName: 'admdstCd', header: { text: '행정구역코드' }, visible: false, },
{ name: 'fcltSn', fieldName: 'fcltSn', header: { text: '시설일련번호' }, visible: false, },
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, visible: false },
],
columnLayout: [
@@ -67,41 +92,51 @@ export const ExcretaTreatFactInpColumn = {
name: 'adminGroup',
hideChildHeaders: false,
header: { text: '행정구역' },
items: ['sido', 'gugun'],
items: [
{ column: 'ctpvNm', footerUserSpans: [{ colspan: 2 }] },
'sggNm',
],
},
'ecscs_nm',
'locplcs',
'telno',
'comp_dt',
'rn_dt',
'wct',
'ecscs_cpcty',
'process_cpcty',
'opr_daycnt',
'trt_msrc',
'cntc_prcplt',
'assct_trt_cpc',
'fcltNm',
'fcltPstnCn',
'telNo',
'cmptnStrtYmd',
'oprtngStrtYmd',
'wholPjtcoAmt',
'prcsFcltCpct',
'cpct',
'oprtngDayCnt',
'prcsMthdExpln',
'linkTmplntCn',
'linkPrcsQnt',
{
name: 'influenceGroup',
hideChildHeaders: false,
header: { text: '유입수질(mg/L, 개/mL)' },
items: ['infl_wqlt_bod', 'infl_wqlt_toc', 'infl_wqlt_ss', 'infl_wqlt_tn', 'infl_wqlt_tp', 'infl_wqlt_clfgrpcnt'],
items: ['inflwBodWqVl', 'inflwTocWqVl', 'inflwSsWqVl', 'inflwTnWqVl', 'inflwTpWqVl', 'inflwClfgCnt'],
},
{
name: 'effluentGroup',
hideChildHeaders: false,
header: { text: '방류수질(mg/L, 개/mL)' },
items: ['effl_wqlt_bod', 'effl_wqlt_toc', 'effl_wqlt_ss', 'effl_wqlt_tn', 'effl_wqlt_tp', 'effl_wqlt_clfgrpcnt'],
items: ['dschgBodWqVl', 'dschgTocWqVl', 'dschgSsWqVl', 'dschgTnWqVl', 'dschgTpWqVl', 'dschgClfgCnt'],
},
{
name: 'dischargeGroup',
hideChildHeaders: false,
header: { text: '방류수역' },
items: ['rvbsn', 'bstrm', 'lgbsn', 'mdmbsn'],
items: ['wtsysNm', 'trbtrNm', 'msirbCn', 'ssirbCn'],
},
'oper_mth',
'cntc_prcplt_cpc',
'safe_acdnt_co',
'rmk',
]
'operMthdCdCn',
'wholNope',
'sftyAcdntEvntcsCnt',
'rmrk',
'admdstCd',
'fcltSn',
'admdstNm'
],
rowStartNum: 2,
fixedColumns: 2,
tabKey: 'ST00070001',
};
@@ -8,7 +8,7 @@ import { footerDecimal1, footerDecimal3,footerInt } from "@/components/util/grid
export const PublicSewageFactColumn = {
columns: [
// 행정구역
{ name: 'ctpvNm', fieldName: 'ctpvNm', header: { text: '시도' }, editable: false, styleName: 'rg-cell-readonly' },
{ name: 'ctpvNm', fieldName: 'ctpvNm', header: { text: '시도' }, footer: { text: '합계' }, editable: false, styleName: 'rg-cell-readonly' },
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' }, editable: false, footer: { text: '합계' }, styleName: 'rg-cell-readonly' },
// 시설명
@@ -18,7 +18,20 @@ export const PublicSewageFactColumn = {
{ name: 'fcltPstnCn', fieldName: 'fcltPstnCn', header: { text: '소재지' }, editable: false, styleName: 'rg-cell-readonly' },
// 시설용량
{ name: 'prcsFcltCpct', fieldName: 'prcsFcltCpct', header: { text: '시설용량(500m³/일 이상/미만)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0', styleName: 'rg-cell-total' },
{
name: 'prcsFcltCpct',
fieldName: 'prcsFcltCpct',
header: { text: '시설용량(500m³/일 이상/미만)' },
editable: false,
footer: footerDecimal1,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
styleName: 'rg-cell-total',
computed: {
fields: ['prcsFcltPhysCpct', 'prcsFcltBoilCpct', 'prcsFcltAltdCpct'],
type: 'sum' as const,
},
},
// (m³/일)
{ name: 'prcsFcltPhysCpct', fieldName: 'prcsFcltPhysCpct', header: { text: '물리적' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
@@ -56,8 +69,22 @@ export const PublicSewageFactColumn = {
{ name: 'dschgGrssClfgVl', fieldName: 'dschgGrssClfgVl', header: { text: '방류총대장균군수' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0', styleName: 'rg-cell-readonly' },
// 처리특성
{ name: 'prcsRt', fieldName: 'prcsRt', header: { text: '처리효율(%)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0', styleName: 'rg-cell-total' },
{ name: 'prcsLodQnt', fieldName: 'prcsLodQnt', header: { text: '처리부하량(kgBOD/D)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0', styleName: 'rg-cell-total' },
{
name: 'prcsRt',
fieldName: 'prcsRt',
header: { text: '처리효율(%)' },
editable: false,
footer: footerDecimal1,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
styleName: 'rg-cell-total',
computed: {
inflwField: 'inflwBodVl',
dschgField: 'dschgBodVl',
type: 'bodPrcsRt' as const,
},
},
{ name: 'prcsLodQnt', fieldName: 'prcsLodQnt', header: { text: '처리부하량(kgBOD/D)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0', styleName: 'rg-cell-readonly' },
{ name: 'prcsMthdExpln', fieldName: 'prcsMthdExpln', header: { text: '처리방법' }, editable: false, styleName: 'rg-cell-readonly' },
// 연계처리량
@@ -86,7 +113,20 @@ export const PublicSewageFactColumn = {
{ name: 'goalWqNo', fieldName: 'goalWqNo', header: { text: '목표수질(BOD)' }, editable: false, styleName: 'rg-cell-readonly' },
// 에너지 자립률
{ name: 'engySrlneRt', fieldName: 'engySrlneRt', header: { text: '에너지자립률(%)' }, editable: false, valueType: ValueType.NUMBER, dataFormat: '#,##0.0', styleName: 'rg-cell-readonly' },
{
name: 'engySrlneRt',
fieldName: 'engySrlneRt',
header: { text: '에너지자립률(%)' },
editable: false,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
styleName: 'rg-cell-total',
computed: {
numeratorFields: ['engyItslfPrdctnQnt'],
denominatorFields: ['anlEngyWholUseQnt'],
type: 'pblswrgPopltnSuprtRate' as const,
},
},
// 에너지 자체 생산량
{ name: 'engyItslfPrdctnQnt', fieldName: 'engyItslfPrdctnQnt', header: { text: '에너지자체생산량(TOE)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0', styleName: 'rg-cell-readonly' },
@@ -97,7 +137,7 @@ export const PublicSewageFactColumn = {
{ name: 'itslfEngyUseQnt', fieldName: 'itslfEngyUseQnt', header: { text: '자체 에너지사용량(TOE)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0', styleName: 'rg-cell-readonly' },
// 하수처리량당 CO2배출량
{ name: 'swtrmtEmsnQnt', fieldName: 'swtrmtEmsnQnt', header: { text: '하수처리량당 CO2배출량(kgCO2/m³)' }, editable: false, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000', styleName: 'rg-cell-total' },
{ name: 'swtrmtEmsnQnt', fieldName: 'swtrmtEmsnQnt', header: { text: '하수처리량당 CO2배출량(kgCO2/m³)' }, editable: false, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000', styleName: 'rg-cell-readonly' },
// 운영주체
{ name: 'operMnbdCn', fieldName: 'operMnbdCn', header: { text: '운영주체(자체/공기업/민간대행)' }, editable: false, styleName: 'rg-cell-readonly' },
@@ -123,7 +163,10 @@ export const PublicSewageFactColumn = {
name: 'administrative',
hideChildHeaders: false,
header: { text: '행정구역' },
items: ['ctpvNm', 'sggNm'],
items: [
{ column: 'ctpvNm', footerUserSpans: [{ colspan: 2 }] },
'sggNm',
],
},
'swtrmtFcltNm',
'fcltPstnCn',
@@ -1,6 +1,33 @@
import type { ColumnConfig } from "@/components/type/DataGrid.type";
import { footerInt, footerDecimal1, footerDecimal3 } from "@/components/util/grid/footerSummary";
import { ValueType } from "realgrid";
/** 펌프장 구분(`pumpSeNm`) */
export const PUMPING_STATION_PUMP_SE_VALUES = ["합류식", "분류식"] as const;
function dropdownColumn(
col: Pick<ColumnConfig, "name" | "fieldName" | "header"> &
Partial<ColumnConfig>,
options: readonly string[],
): ColumnConfig {
const values = [...options];
return {
...col,
values,
labels: values,
lookupDisplay: true,
editor: {
type: "dropdown",
domainOnly: true,
textReadOnly: true,
commitOnSelect: true,
dropDownWhenClick: true,
values,
labels: values,
},
};
}
/**
* 하수도 통계 관리 > 05. 펌프장
* 단일 Tab
@@ -8,69 +35,155 @@ import { ValueType } from "realgrid";
export const PumpingStationInpColumn = {
columns: [
// 행정구역
{ name: 'sido', fieldName: '시도', header: { text: '시도' }, editable: false },
{ name: 'sgg', fieldName: '시군구', header: { text: '시군구' }, footer: { text: '합계' } },
{ name: 'ctpvNm', fieldName: 'ctpvNm', header: { text: '시도' }, footer: { text: '합계' }, editable: false, styleName: 'rg-cell-readonly' },
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' } },
// 기본 정보
{ name: 'treatmentFacilityName', fieldName: '처리장명', header: { text: '처리장명' } },
{ name: 'facilityName', fieldName: '시설명', header: { text: '시설명' } },
{ name: 'classification', fieldName: '구분(합류식 분류식)', header: { text: '구분(합류식 분류식)' } },
{ name: 'location', fieldName: '위치', header: { text: '위치' } },
{ name: 'operationDate', fieldName: '가동 년월일 yyyy-mm-dd', header: { text: '가동 년월일 yyyy-mm-dd' } },
{ name: 'planDrainageArea', fieldName: '계획배수면적(㎢)', header: { text: '계획배수면적(㎢)' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
{ name: 'swtrmtFcltNm', fieldName: 'swtrmtFcltNm', header: { text: '처리장명' } },
{ name: 'fcltNm', fieldName: 'fcltNm', header: { text: '시설명' } },
dropdownColumn(
{ name: 'pumpSeNm', fieldName: 'pumpSeNm', header: { text: '구분(합류식 분류식)' } },
PUMPING_STATION_PUMP_SE_VALUES,
),
{ name: 'fcltPstnCn', fieldName: 'fcltPstnCn', header: { text: '위치' } },
{
name: 'oprtngStrtYmd',
fieldName: 'oprtngStrtYmd',
header: { text: '가동 년월일 yyyy-mm-dd' },
datetimeFormat: 'yyyy-MM-dd',
editor: {
type: 'date' as const,
dropDownWhenClick: true,
datetimeFormat: 'yyyy-MM-dd',
},
},
{ name: 'planMltvArea', fieldName: 'planMltvArea', header: { text: '계획배수면적(㎢)' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
// 계획시간 대 최대배수량
{ name: 'fairWeatherFlow', fieldName: '청천시(A)', header: { text: '청천시(A)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'rainyWeatherFlow', fieldName: '우천시(B)', header: { text: '우천시(B)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'rainwaterFlow', fieldName: '우수량(B-A)', header: { text: '우수량(B-A)' }, footer: footerDecimal1, editable: false, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'sndyArea', fieldName: 'sndyArea', header: { text: '청천시(A)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'rainArea', fieldName: 'rainArea', header: { text: '우천시(B)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{
name: 'exlnQnt',
fieldName: 'exlnQnt',
header: { text: '우수량(B-A)' },
footer: footerDecimal1,
editable: false,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
computed: { fields: ['rainArea', 'sndyArea'], type: 'difference' as const },
styleName: 'rg-cell-total',
},
// 배수능력 > 총 양수량 (오수)
{ name: 'sewageTotalPumpCapacity', fieldName: '총양수량(m³/min)', header: { text: '총양수량(m³/min)' }, footer: footerDecimal1, editable: false, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{
name: 'drtwPumpGrssPpqty',
fieldName: 'drtwPumpGrssPpqty',
header: { text: '총양수량(m³/min)' },
footer: footerDecimal1,
editable: false,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
styleName: 'rg-cell-total',
computed: {
type: 'pumpGrossPpqty' as const,
pumpGroups: [
{
pumpCntField: 'drtwPumpN1Cnt',
rsrvPumpCntField: 'drtwPumpN1RsrvCnt',
perPpqtyField: 'drtwPumpN1Ppqty',
},
{
pumpCntField: 'drtwPumpN2Cnt',
rsrvPumpCntField: 'drtwPumpN2RsrvCnt',
perPpqtyField: 'drtwPumpN2Ppqty',
},
{
pumpCntField: 'drtwPumpN3Cnt',
rsrvPumpCntField: 'drtwPumpN3RsrvCnt',
perPpqtyField: 'drtwPumpN3Ppqty',
},
],
},
},
// 배수능력 > 오수펌프(1)
{ name: 'sewagePump1Diameter', fieldName: '오수펌프(1) 구경(mm)', header: { text: '구경(mm)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'sewagePump1Capacity', fieldName: '오수펌프(1) 대당 양수량(m³/min·대)', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'sewagePump1Count', fieldName: '오수펌프(1) 펌프대수', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'sewagePump1Reserve', fieldName: '오수펌프(1) 예비펌프대수', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'drtwPumpN1DmtrArea', fieldName: 'drtwPumpN1DmtrArea', header: { text: '구경(mm)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'drtwPumpN1Ppqty', fieldName: 'drtwPumpN1Ppqty', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'drtwPumpN1Cnt', fieldName: 'drtwPumpN1Cnt', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'drtwPumpN1RsrvCnt', fieldName: 'drtwPumpN1RsrvCnt', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 배수능력 > 오수펌프(2)
{ name: 'sewagePump2Diameter', fieldName: '오수펌프(2) 구경(mm)', header: { text: '구경(mm)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'sewagePump2Capacity', fieldName: '오수펌프(2) 대당 양수량(m³/min·대)', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'sewagePump2Count', fieldName: '오수펌프(2) 펌프대수', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'sewagePump2Reserve', fieldName: '오수펌프(2) 예비펌프대수', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'drtwPumpN2DmtrArea', fieldName: 'drtwPumpN2DmtrArea', header: { text: '구경(mm)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'drtwPumpN2Ppqty', fieldName: 'drtwPumpN2Ppqty', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'drtwPumpN2Cnt', fieldName: 'drtwPumpN2Cnt', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'drtwPumpN2RsrvCnt', fieldName: 'drtwPumpN2RsrvCnt', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 배수능력 > 오수펌프(3)
{ name: 'sewagePump3Diameter', fieldName: '오수펌프(3) 구경(mm)', header: { text: '구경(mm)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'sewagePump3Capacity', fieldName: '오수펌프(3) 대당 양수량(m³/min·대)', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'sewagePump3Count', fieldName: '오수펌프(3) 펌프대수', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'sewagePump3Reserve', fieldName: '오수펌프(3) 예비펌프대수', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'drtwPumpN3DmtrArea', fieldName: 'drtwPumpN3DmtrArea', header: { text: '구경(mm)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'drtwPumpN3Ppqty', fieldName: 'drtwPumpN3Ppqty', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'drtwPumpN3Cnt', fieldName: 'drtwPumpN3Cnt', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'drtwPumpN3RsrvCnt', fieldName: 'drtwPumpN3RsrvCnt', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 배수능력 > 총 양수량 (우수)
{ name: 'rainwaterTotalPumpCapacity', fieldName: '총양수량(m³/min)', header: { text: '총양수량(m³/min)' }, footer: footerDecimal1, editable: false, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{
name: 'exlnPumpGrssPpqty',
fieldName: 'exlnPumpGrssPpqty',
header: { text: '총양수량(m³/min)' },
footer: footerDecimal1,
editable: false,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
styleName: 'rg-cell-total',
computed: {
type: 'pumpGrossPpqty' as const,
pumpGroups: [
{
pumpCntField: 'exlnPumpN1Cnt',
rsrvPumpCntField: 'exlnPumpN1RsrvCnt',
perPpqtyField: 'exlnPumpN1Ppqty',
},
{
pumpCntField: 'exlnPumpN2Cnt',
rsrvPumpCntField: 'exlnPumpN2RsrvCnt',
perPpqtyField: 'exlnPumpN2Ppqty',
},
{
pumpCntField: 'exlnPumpN3Cnt',
rsrvPumpCntField: 'exlnPumpN3RsrvCnt',
perPpqtyField: 'exlnPumpN3Ppqty',
},
],
},
},
// 배수능력 > 우수펌프(1)
{ name: 'rainwaterPump1Diameter', fieldName: '우수펌프(1) 구경(mm)', header: { text: '구경(mm)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'rainwaterPump1Capacity', fieldName: '우수펌프(1) 대당 양수량(m³/min·대)', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'rainwaterPump1Count', fieldName: '우수펌프(1) 펌프대수', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'rainwaterPump1Reserve', fieldName: '우수펌프(1) 예비펌프대수', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'exlnPumpN1DmtrArea', fieldName: 'exlnPumpN1DmtrArea', header: { text: '구경(mm)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'exlnPumpN1Ppqty', fieldName: 'exlnPumpN1Ppqty', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'exlnPumpN1Cnt', fieldName: 'exlnPumpN1Cnt', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'exlnPumpN1RsrvCnt', fieldName: 'exlnPumpN1RsrvCnt', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 배수능력 > 우수펌프(2)
{ name: 'rainwaterPump2Diameter', fieldName: '우수펌프(2) 구경(mm)', header: { text: '구경(mm)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'rainwaterPump2Capacity', fieldName: '우수펌프(2) 대당 양수량(m³/min·대)', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'rainwaterPump2Count', fieldName: '우수펌프(2) 펌프대수', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'rainwaterPump2Reserve', fieldName: '우수펌프(2) 예비펌프대수', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'exlnPumpN2DmtrArea', fieldName: 'exlnPumpN2DmtrArea', header: { text: '구경(mm)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'exlnPumpN2Ppqty', fieldName: 'exlnPumpN2Ppqty', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'exlnPumpN2Cnt', fieldName: 'exlnPumpN2Cnt', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'exlnPumpN2RsrvCnt', fieldName: 'exlnPumpN2RsrvCnt', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 배수능력 > 우수펌프(3)
{ name: 'rainwaterPump3Diameter', fieldName: '우수펌프(3) 구경(mm)', header: { text: '구경(mm)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'rainwaterPump3Capacity', fieldName: '우수펌프(3) 대당 양수량(m³/min·대)', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'rainwaterPump3Count', fieldName: '우수펌프(3) 펌프대수', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'rainwaterPump3Reserve', fieldName: '우수펌프(3) 예비펌프대수', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'exlnPumpN3DmtrArea', fieldName: 'exlnPumpN3DmtrArea', header: { text: '구경(mm)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'exlnPumpN3Ppqty', fieldName: 'exlnPumpN3Ppqty', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'exlnPumpN3Cnt', fieldName: 'exlnPumpN3Cnt', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'exlnPumpN3RsrvCnt', fieldName: 'exlnPumpN3RsrvCnt', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 연간전력 사용량
{ name: 'annualPowerUsage', fieldName: '연간전력사용량(kWh/년)', header: { text: '연간전력사용량(kWh/년)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'anlElpwrUseQnt', fieldName: 'anlElpwrUseQnt', header: { text: '연간전력사용량(kWh/년)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 비고
{ name: 'remarks', fieldName: '비고', header: { text: '비고' } },
{ name: 'rmrk', fieldName: 'rmrk', header: { text: '비고' } },
// Hidden Columns : 시스템 관리를 위한 값
{ name: 'admdstCd', fieldName: 'admdstCd', header: { text: '행정구역코드' }, visible: false, },
{ name: 'fcltSn', fieldName: 'fcltSn', header: { text: '시설일련번호' }, visible: false, },
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, visible: false },
],
columnLayout: [
@@ -78,66 +191,75 @@ export const PumpingStationInpColumn = {
name: 'administrativeArea',
hideChildHeaders: false,
header: { text: '행정구역' },
items: ['sido', 'sgg'],
items: [
{ column: 'ctpvNm', footerUserSpans: [{ colspan: 2 }] },
'sggNm',
],
},
'treatmentFacilityName',
'facilityName',
'classification',
'location',
'operationDate',
'planDrainageArea',
'swtrmtFcltNm',
'fcltNm',
'pumpSeNm',
'fcltPstnCn',
'oprtngStrtYmd',
'planMltvArea',
{
name: 'planFlowGroup',
hideChildHeaders: false,
header: { text: '계획시간대최대배수량(m³/hr)' },
items: ['fairWeatherFlow', 'rainyWeatherFlow', 'rainwaterFlow'],
items: ['sndyArea', 'rainArea', 'exlnQnt'],
},
{
name: 'drainageCapability',
hideChildHeaders: false,
header: { text: '배수능력' },
items: [
'sewageTotalPumpCapacity',
'drtwPumpGrssPpqty',
{
name: 'sewagePump1Group',
hideChildHeaders: false,
header: { text: '오수펌프(1)' },
items: ['sewagePump1Diameter', 'sewagePump1Capacity', 'sewagePump1Count', 'sewagePump1Reserve'],
items: ['drtwPumpN1DmtrArea', 'drtwPumpN1Ppqty', 'drtwPumpN1Cnt', 'drtwPumpN1RsrvCnt'],
},
{
name: 'sewagePump2Group',
hideChildHeaders: false,
header: { text: '오수펌프(2)' },
items: ['sewagePump2Diameter', 'sewagePump2Capacity', 'sewagePump2Count', 'sewagePump2Reserve'],
items: ['drtwPumpN2DmtrArea', 'drtwPumpN2Ppqty', 'drtwPumpN2Cnt', 'drtwPumpN2RsrvCnt'],
},
{
name: 'sewagePump3Group',
hideChildHeaders: false,
header: { text: '오수펌프(3)' },
items: ['sewagePump3Diameter', 'sewagePump3Capacity', 'sewagePump3Count', 'sewagePump3Reserve'],
items: ['drtwPumpN3DmtrArea', 'drtwPumpN3Ppqty', 'drtwPumpN3Cnt', 'drtwPumpN3RsrvCnt'],
},
'rainwaterTotalPumpCapacity',
'exlnPumpGrssPpqty',
{
name: 'rainwaterPump1Group',
hideChildHeaders: false,
header: { text: '우수펌프(1)' },
items: ['rainwaterPump1Diameter', 'rainwaterPump1Capacity', 'rainwaterPump1Count', 'rainwaterPump1Reserve'],
items: ['exlnPumpN1DmtrArea', 'exlnPumpN1Ppqty', 'exlnPumpN1Cnt', 'exlnPumpN1RsrvCnt'],
},
{
name: 'rainwaterPump2Group',
hideChildHeaders: false,
header: { text: '우수펌프(2)' },
items: ['rainwaterPump2Diameter', 'rainwaterPump2Capacity', 'rainwaterPump2Count', 'rainwaterPump2Reserve'],
items: ['exlnPumpN2DmtrArea', 'exlnPumpN2Ppqty', 'exlnPumpN2Cnt', 'exlnPumpN2RsrvCnt'],
},
{
name: 'rainwaterPump3Group',
hideChildHeaders: false,
header: { text: '우수펌프(3)' },
items: ['rainwaterPump3Diameter', 'rainwaterPump3Capacity', 'rainwaterPump3Count', 'rainwaterPump3Reserve'],
items: ['exlnPumpN3DmtrArea', 'exlnPumpN3Ppqty', 'exlnPumpN3Cnt', 'exlnPumpN3RsrvCnt'],
},
],
},
'annualPowerUsage',
'remarks',
]
'anlElpwrUseQnt',
'rmrk',
'admdstCd',
'fcltSn',
'admdstNm'
],
rowStartNum: 3,
fixedColumns: 3,
tabKey: 'ST00050001',
};
@@ -5,66 +5,64 @@ import { ValueType } from "realgrid";
export const PrivateSewageDesigStatusInpColumn = {
columns: [
// 행정구역
{ name: 'SIDO', fieldName: '시도', header: { text: '시도' }, editable: false },
{ name: 'GUGUN', fieldName: '시군구', header: { text: '시군구' }, editable: false, footer: { text: '합계' } },
{ name: 'ctpvNm', fieldName: 'ctpvNm', header: { text: '시도' }, footer: { text: '합계' }, editable: false, styleName: 'rg-cell-readonly' },
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' }, editable: false, styleName: 'rg-cell-readonly' },
// 개인하수도관리지역공고현황
{ name: 'MGMT_AR', fieldName: '공고지역(개소)', header: { text: '공고지역(개소)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'APPN_SCOPE', fieldName: '지정범위(㎢)', header: { text: '지정범위(㎢)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'indvSwagePbancRgnCnt', fieldName: 'indvSwagePbancRgnCnt', header: { text: '공고지역(개소)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'indvSwageDsgnScpLen', fieldName: 'indvSwageDsgnScpLen', header: { text: '지정범위(㎢)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 개인하수도관리지역공고현황 > 정화조
{ name: 'STTY_CNT', fieldName: '개소수', header: { text: '개소수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'STTY_CPC', fieldName: '처리용량(인/일)', header: { text: '처리용량(인/일)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'spctnkGrssFcltCnt', fieldName: 'spctnkGrssFcltCnt', header: { text: '개소수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'spctnkQnt', fieldName: 'spctnkQnt', header: { text: '처리용량(인/일)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 개인하수도관리지역공고현황 > 오수시설
{ name: 'WRRTN_CNT', fieldName: '개소수', header: { text: '개소수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'WRRTN_CPC', fieldName: '처리용량(m³/일)', header: { text: '처리용량(m³/일)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'drtwPrcsFcltGrssFcltCnt', fieldName: 'drtwPrcsFcltGrssFcltCnt', header: { text: '개소수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'drtwPrcsFcltQnt', fieldName: 'drtwPrcsFcltQnt', header: { text: '처리용량(m³/일)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 비고
{ name: 'RMK', fieldName: '비고', header: { text: '비고' } },
{ name: 'rmrk', fieldName: 'rmrk', header: { text: '비고' } },
// 검증 필드 (hidden)
{ name: 'CHK_MGMT_AR', fieldName: 'CHK_MGMT_AR', header: { text: '' } },
{ name: 'CHK_APPN_SCOPE', fieldName: 'CHK_APPN_SCOPE', header: { text: '' } },
{ name: 'CHK_STTY_CNT', fieldName: 'CHK_STTY_CNT', header: { text: '' } },
{ name: 'CHK_STTY_CPC', fieldName: 'CHK_STTY_CPC', header: { text: '' } },
{ name: 'CHK_WRRTN_CNT', fieldName: 'CHK_WRRTN_CNT', header: { text: '' } },
{ name: 'CHK_WRRTN_CPC', fieldName: 'CHK_WRRTN_CPC', header: { text: '' } },
{ name: 'WRTER_OPINION', fieldName: '사용자의견', header: { text: '사용자의견' } },
{ name: 'CHCKER_OPINION', fieldName: '검토자의견', header: { text: '검토자의견' } },
// hidden
{ name: 'admdstCd', fieldName: 'admdstCd', header: { text: '행정구역코드' }, visible: false, },
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, visible: false },
],
columnLayout: [
{
name: 'group_admin',
header: { text: '행정구역' },
items: ['SIDO', 'GUGUN']
items: [
{ column: 'ctpvNm', footerUserSpans: [{ colspan: 2 }] },
'sggNm',
],
},
{
name: 'group_notice',
header: { text: '개인하수도관리지역공고현황 (하수도법제34조의2)' },
items: [
'MGMT_AR',
'APPN_SCOPE',
'indvSwagePbancRgnCnt',
'indvSwageDsgnScpLen',
{
name: 'group_septic',
header: { text: '정화조' },
items: [
'STTY_CNT',
'STTY_CPC'
'spctnkGrssFcltCnt',
'spctnkQnt'
]
},
{
name: 'group_sewage',
header: { text: '오수시설' },
items: [
'WRRTN_CNT',
'WRRTN_CPC'
'drtwPrcsFcltGrssFcltCnt',
'drtwPrcsFcltQnt'
]
}
]
},
'RMK'
'rmrk',
'admdstCd',
'admdstNm'
],
rowStartNum: 3,
fixedColumns: 1,
@@ -5,182 +5,316 @@ import { ValueType } from "realgrid";
export const SepticTankStatusInpColumn = {
columns: [
// 행정구역
{ name: 'SIDO', fieldName: '시도', header: { text: '시도' }, editable: false },
{ name: 'GUGUN', fieldName: '시군구', header: { text: '시군구' }, editable: false, footer: { text: '합계' } },
{ name: 'ctpvNm', fieldName: 'ctpvNm', header: { text: '시도' }, footer: { text: '합계' }, editable: false, styleName: 'rg-cell-readonly' },
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' }, editable: false, styleName: 'rg-cell-readonly' },
// 총 시설 수
{ name: 'TOT_FCLTY_CNT', fieldName: '총 시설 수 (A+D)', header: { text: '총 시설 수 (A+D)' }, editable: false, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 총 시설 수 — (B+C)/2 + (E+F)/2 = A + D
{
name: 'grssFcltCnt',
fieldName: 'grssFcltCnt',
header: { text: '총 시설 수 (A+D)' },
editable: false,
footer: footerInt,
valueType: ValueType.NUMBER,
dataFormat: '#,##0',
styleName: 'rg-cell-total',
computed: {
firstHalfSum: {
firstSumFields: [
'staaInsdSttkNprsflCnt',
'step1StaaInsdSttkFrcCnt',
'staaInsdSprktpFltrtbCnt',
'staaInsdAertMthdCnt',
'staaInsdCntcAertCnt',
'staaInsdEtcCnt',
],
secondSumFields: [
'step1StaaInsdNope',
'step2StaaInsdNope',
'step3StaaInsdNope',
'step4StaaInsdNope',
'step5StaaInsdNope',
'step6StaaInsdNope',
'step7StaaInsdNope',
'step8StaaInsdNope',
],
},
secondHalfSum: {
firstSumFields: [
'staaExcpSttkNprsflCnt',
'step1StaaExcpSttkFrcCnt',
'staaExcpSprktpFltrtbCnt',
'staaExcpAertMthdCnt',
'staaExcpCntcAertCnt',
'staaExcpEtcCnt',
],
secondSumFields: [
'step1StaaExcpNope',
'step2StaaExcpNope',
'step3StaaExcpNope',
'step4StaaExcpNope',
'step5StaaExcpNope',
'step6StaaExcpNope',
'step7StaaExcpNope',
'step8StaaExcpNope',
],
},
type: 'sumOfTwoHalfSumOfSums' as const,
},
},
// 하수처리구역 내 > 총계
{ name: 'SPZI_SM', fieldName: '총계 A=(B+C)/2', header: { text: '총계 A=(B+C)/2' }, editable: false, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{
name: 'staaInsdWhol',
fieldName: 'staaInsdWhol',
header: { text: '총계 A=(B+C)/2' },
editable: false,
footer: footerInt,
valueType: ValueType.NUMBER,
dataFormat: '#,##0',
styleName: 'rg-cell-total',
computed: {
firstSumFields: [
'staaInsdSttkNprsflCnt',
'step1StaaInsdSttkFrcCnt',
'staaInsdSprktpFltrtbCnt',
'staaInsdAertMthdCnt',
'staaInsdCntcAertCnt',
'staaInsdEtcCnt',
],
secondSumFields: [
'step1StaaInsdNope',
'step2StaaInsdNope',
'step3StaaInsdNope',
'step4StaaInsdNope',
'step5StaaInsdNope',
'step6StaaInsdNope',
'step7StaaInsdNope',
'step8StaaInsdNope',
],
type: 'halfSumOfSums' as const,
},
},
// 하수처리구역 내 > 처리방식별
{ name: 'SPZI_MTHD_SM', fieldName: '계(B)', header: { text: '계(B)' }, editable: false, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{
name: 'staaInsdPrcsMthByWhol',
fieldName: 'staaInsdPrcsMthByWhol',
header: { text: '계(B)' },
editable: false,
footer: footerInt,
valueType: ValueType.NUMBER,
dataFormat: '#,##0',
styleName: 'rg-cell-total',
computed: {
fields: [
'staaInsdSttkNprsflCnt',
'step1StaaInsdSttkFrcCnt',
'staaInsdSprktpFltrtbCnt',
'staaInsdAertMthdCnt',
'staaInsdCntcAertCnt',
'staaInsdEtcCnt',
],
type: 'sum' as const,
},
},
// 하수처리구역 내 > 처리방식별 > 부패탱크
{ name: 'SPZI_ROT_NPFL_CNT', fieldName: '자연유하', header: { text: '자연유하' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZI_ROT_ENFCT_PUMP_1', fieldName: '강제펌핑식', header: { text: '강제펌핑식' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'staaInsdSttkNprsflCnt', fieldName: 'staaInsdSttkNprsflCnt', header: { text: '자연유하' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step1StaaInsdSttkFrcCnt', fieldName: 'step1StaaInsdSttkFrcCnt', header: { text: '강제펌핑식' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 하수처리구역 내 > 처리방식별
{ name: 'SPZI_WTROT_NPFL_CNT', fieldName: '살수여상', header: { text: '살수여상' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZI_TFM', fieldName: '폭기방법', header: { text: '폭기방법' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZI_ARTM', fieldName: '접촉폭기', header: { text: '접촉폭기' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZI_CTARM', fieldName: '기타', header: { text: '기타' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'staaInsdSprktpFltrtbCnt', fieldName: 'staaInsdSprktpFltrtbCnt', header: { text: '살수여상' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'staaInsdAertMthdCnt', fieldName: 'staaInsdAertMthdCnt', header: { text: '폭기방법' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'staaInsdCntcAertCnt', fieldName: 'staaInsdCntcAertCnt', header: { text: '접촉폭기' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'staaInsdEtcCnt', fieldName: 'staaInsdEtcCnt', header: { text: '기타' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 하수처리구역 내 > 처리용량별
{ name: 'SPZI_PROC_CPC_SM', fieldName: '계(C)', header: { text: '계(C)' }, editable: false, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZI_PROC_CPC_1', fieldName: '10인조이하', header: { text: '10인조이하' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZI_PROC_CPC_2', fieldName: '11~20', header: { text: '11~20' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZI_PROC_CPC_3', fieldName: '21~30', header: { text: '21~30' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZI_PROC_CPC_4', fieldName: '31~50', header: { text: '31~50' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZI_PROC_CPC_5', fieldName: '51~199', header: { text: '51~199' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZI_PROC_CPC_6', fieldName: '200~499', header: { text: '200~499' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZI_PROC_CPC_7', fieldName: '500~999', header: { text: '500~999' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZI_PROC_CPC_8', fieldName: '1,000 이상', header: { text: '1,000 이상' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{
name: 'staaInsdPrcsCpctByWhol',
fieldName: 'staaInsdPrcsCpctByWhol',
header: { text: '계(C)' },
editable: false,
footer: footerInt,
valueType: ValueType.NUMBER,
dataFormat: '#,##0',
styleName: 'rg-cell-total',
computed: {
fields: [
'step1StaaInsdNope',
'step2StaaInsdNope',
'step3StaaInsdNope',
'step4StaaInsdNope',
'step5StaaInsdNope',
'step6StaaInsdNope',
'step7StaaInsdNope',
'step8StaaInsdNope',
],
type: 'sum' as const,
},
},
{ name: 'step1StaaInsdNope', fieldName: 'step1StaaInsdNope', header: { text: '10인조이하' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step2StaaInsdNope', fieldName: 'step2StaaInsdNope', header: { text: '11~20' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step3StaaInsdNope', fieldName: 'step3StaaInsdNope', header: { text: '21~30' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step4StaaInsdNope', fieldName: 'step4StaaInsdNope', header: { text: '31~50' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step5StaaInsdNope', fieldName: 'step5StaaInsdNope', header: { text: '51~199' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step6StaaInsdNope', fieldName: 'step6StaaInsdNope', header: { text: '200~499' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step7StaaInsdNope', fieldName: 'step7StaaInsdNope', header: { text: '500~999' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step8StaaInsdNope', fieldName: 'step8StaaInsdNope', header: { text: '1,000 이상' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 하수처리구역 외 > 총계
{ name: 'SPZO_SM', fieldName: '총계 D=(E+F)/2', header: { text: '총계 D=(E+F)/2' }, editable: false, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{
name: 'staaExcpWhol',
fieldName: 'staaExcpWhol',
header: { text: '총계 D=(E+F)/2' },
editable: false,
footer: footerInt,
valueType: ValueType.NUMBER,
dataFormat: '#,##0',
styleName: 'rg-cell-total',
computed: {
firstSumFields: [
'staaExcpSttkNprsflCnt',
'step1StaaExcpSttkFrcCnt',
'staaExcpSprktpFltrtbCnt',
'staaExcpAertMthdCnt',
'staaExcpCntcAertCnt',
'staaExcpEtcCnt',
],
secondSumFields: [
'step1StaaExcpNope',
'step2StaaExcpNope',
'step3StaaExcpNope',
'step4StaaExcpNope',
'step5StaaExcpNope',
'step6StaaExcpNope',
'step7StaaExcpNope',
'step8StaaExcpNope',
],
type: 'halfSumOfSums' as const,
},
},
// 하수처리구역 외 > 처리방식별
{ name: 'SPZO_MTHD_SM', fieldName: '계(E)', header: { text: '계(E)' }, editable: false, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{
name: 'staaExcpPrcsMthByWhol',
fieldName: 'staaExcpPrcsMthByWhol',
header: { text: '계(E)' },
editable: false,
footer: footerInt,
valueType: ValueType.NUMBER,
dataFormat: '#,##0',
styleName: 'rg-cell-total',
computed: {
fields: [
'staaExcpSttkNprsflCnt',
'step1StaaExcpSttkFrcCnt',
'staaExcpSprktpFltrtbCnt',
'staaExcpAertMthdCnt',
'staaExcpCntcAertCnt',
'staaExcpEtcCnt',
],
type: 'sum' as const,
},
},
// 하수처리구역 외 > 처리방식별 > 부패탱크
{ name: 'SPZO_ROT_NPFL_CNT', fieldName: '자연유하', header: { text: '자연유하' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZO_ROT_ENFCT_PUMP_1', fieldName: '강제펌핑식', header: { text: '강제펌핑식' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'staaExcpSttkNprsflCnt', fieldName: 'staaExcpSttkNprsflCnt', header: { text: '자연유하' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step1StaaExcpSttkFrcCnt', fieldName: 'step1StaaExcpSttkFrcCnt', header: { text: '강제펌핑식' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 하수처리구역 외 > 처리방식별
{ name: 'SPZO_WTROT_NPFL_CNT', fieldName: '살수여상', header: { text: '살수여상' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZO_TFM', fieldName: '폭기방법', header: { text: '폭기방법' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZO_ARTM', fieldName: '접촉폭기', header: { text: '접촉폭기' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZO_CTARM', fieldName: '기타', header: { text: '기타' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'staaExcpSprktpFltrtbCnt', fieldName: 'staaExcpSprktpFltrtbCnt', header: { text: '살수여상' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'staaExcpAertMthdCnt', fieldName: 'staaExcpAertMthdCnt', header: { text: '폭기방법' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'staaExcpCntcAertCnt', fieldName: 'staaExcpCntcAertCnt', header: { text: '접촉폭기' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'staaExcpEtcCnt', fieldName: 'staaExcpEtcCnt', header: { text: '기타' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 하수처리구역 외 > 처리용량별
{ name: 'SPZO_PROC_CPC_SM', fieldName: '계(F)', header: { text: '계(F)' }, editable: false, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZO_PROC_CPC_1', fieldName: '10인조이하', header: { text: '10인조이하' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZO_PROC_CPC_2', fieldName: '11~20', header: { text: '11~20' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZO_PROC_CPC_3', fieldName: '21~30', header: { text: '21~30' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZO_PROC_CPC_4', fieldName: '31~50', header: { text: '31~50' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZO_PROC_CPC_5', fieldName: '51~199', header: { text: '51~199' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZO_PROC_CPC_6', fieldName: '200~499', header: { text: '200~499' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZO_PROC_CPC_7', fieldName: '500~999', header: { text: '500~999' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SPZO_PROC_CPC_8', fieldName: '1,000 이상', header: { text: '1,000 이상' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{
name: 'staaExcpPrcsCpctByWhol',
fieldName: 'staaExcpPrcsCpctByWhol',
header: { text: '계(F)' },
editable: false,
footer: footerInt,
valueType: ValueType.NUMBER,
dataFormat: '#,##0',
styleName: 'rg-cell-total',
computed: {
fields: [
'step1StaaExcpNope',
'step2StaaExcpNope',
'step3StaaExcpNope',
'step4StaaExcpNope',
'step5StaaExcpNope',
'step6StaaExcpNope',
'step7StaaExcpNope',
'step8StaaExcpNope',
],
type: 'sum' as const,
},
},
{ name: 'step1StaaExcpNope', fieldName: 'step1StaaExcpNope', header: { text: '10인조이하' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step2StaaExcpNope', fieldName: 'step2StaaExcpNope', header: { text: '11~20' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step3StaaExcpNope', fieldName: 'step3StaaExcpNope', header: { text: '21~30' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step4StaaExcpNope', fieldName: 'step4StaaExcpNope', header: { text: '31~50' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step5StaaExcpNope', fieldName: 'step5StaaExcpNope', header: { text: '51~199' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step6StaaExcpNope', fieldName: 'step6StaaExcpNope', header: { text: '200~499' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step7StaaExcpNope', fieldName: 'step7StaaExcpNope', header: { text: '500~999' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step8StaaExcpNope', fieldName: 'step8StaaExcpNope', header: { text: '1,000 이상' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 비고
{ name: 'RMK', fieldName: '비고', header: { text: '비고' } },
{ name: 'rmrk', fieldName: 'rmrk', header: { text: '비고' } },
// hidden
{ name: 'WRTER_OPINION', fieldName: '사용자의견', header: { text: '사용자의견' } },
{ name: 'CHCKER_OPINION', fieldName: '검토자의견', header: { text: '검토자의견' } },
// 검증 필드 (검증 여부 표시용 - 빨간색 표시)
{ name: 'CHK_TOT_FCLTY_CNT', fieldName: 'CHK_TOT_FCLTY_CNT', header: { text: '' } },
{ name: 'CHK_SPZI_SM', fieldName: 'CHK_SPZI_SM', header: { text: '' } },
{ name: 'CHK_SPZI_MTHD_SM', fieldName: 'CHK_SPZI_MTHD_SM', header: { text: '' } },
{ name: 'CHK_SPZI_ROT_NPFL_CNT', fieldName: 'CHK_SPZI_ROT_NPFL_CNT', header: { text: '' } },
{ name: 'CHK_SPZI_ROT_ENFCT_PUMP_1', fieldName: 'CHK_SPZI_ROT_ENFCT_PUMP_1', header: { text: '' } },
{ name: 'CHK_SPZI_ROT_ENFCT_PUMP_2', fieldName: 'CHK_SPZI_ROT_ENFCT_PUMP_2', header: { text: '' } },
{ name: 'CHK_SPZI_ROT_ENFCT_PUMP_3', fieldName: 'CHK_SPZI_ROT_ENFCT_PUMP_3', header: { text: '' } },
{ name: 'CHK_SPZI_ROT_TANK_SM', fieldName: 'CHK_SPZI_ROT_TANK_SM', header: { text: '' } },
{ name: 'CHK_SPZI_IMHF_NPFL_CNT', fieldName: 'CHK_SPZI_IMHF_NPFL_CNT', header: { text: '' } },
{ name: 'CHK_SPZI_IMHF_ENFCT_PUMP_1', fieldName: 'CHK_SPZI_IMHF_ENFCT_PUMP_1', header: { text: '' } },
{ name: 'CHK_SPZI_IMHF_ENFCT_PUMP_2', fieldName: 'CHK_SPZI_IMHF_ENFCT_PUMP_2', header: { text: '' } },
{ name: 'CHK_SPZI_IMHF_ENFCT_PUMP_3', fieldName: 'CHK_SPZI_IMHF_ENFCT_PUMP_3', header: { text: '' } },
{ name: 'CHK_SPZI_IMHF_TANK_SM', fieldName: 'CHK_SPZI_IMHF_TANK_SM', header: { text: '' } },
{ name: 'CHK_SPZI_WTROT_NPFL_CNT', fieldName: 'CHK_SPZI_WTROT_NPFL_CNT', header: { text: '' } },
{ name: 'CHK_SPZI_WTROT_ENFCT_PUMP_1', fieldName: 'CHK_SPZI_WTROT_ENFCT_PUMP_1', header: { text: '' } },
{ name: 'CHK_SPZI_WTROT_ENFCT_PUMP_2', fieldName: 'CHK_SPZI_WTROT_ENFCT_PUMP_2', header: { text: '' } },
{ name: 'CHK_SPZI_WTROT_ENFCT_PUMP_3', fieldName: 'CHK_SPZI_WTROT_ENFCT_PUMP_3', header: { text: '' } },
{ name: 'CHK_SPZI_WTROT_TANK_SM', fieldName: 'CHK_SPZI_WTROT_TANK_SM', header: { text: '' } },
{ name: 'CHK_SPZI_TFM', fieldName: 'CHK_SPZI_TFM', header: { text: '' } },
{ name: 'CHK_SPZI_ARTM', fieldName: 'CHK_SPZI_ARTM', header: { text: '' } },
{ name: 'CHK_SPZI_CTARM', fieldName: 'CHK_SPZI_CTARM', header: { text: '' } },
{ name: 'CHK_SPZI_NPFL', fieldName: 'CHK_SPZI_NPFL', header: { text: '' } },
{ name: 'CHK_SPZI_ENFCT_PUMP', fieldName: 'CHK_SPZI_ENFCT_PUMP', header: { text: '' } },
{ name: 'CHK_SPZI_PROC_CPC_SM', fieldName: 'CHK_SPZI_PROC_CPC_SM', header: { text: '' } },
{ name: 'CHK_SPZI_PROC_CPC_1', fieldName: 'CHK_SPZI_PROC_CPC_1', header: { text: '' } },
{ name: 'CHK_SPZI_PROC_CPC_2', fieldName: 'CHK_SPZI_PROC_CPC_2', header: { text: '' } },
{ name: 'CHK_SPZI_PROC_CPC_3', fieldName: 'CHK_SPZI_PROC_CPC_3', header: { text: '' } },
{ name: 'CHK_SPZI_PROC_CPC_4', fieldName: 'CHK_SPZI_PROC_CPC_4', header: { text: '' } },
{ name: 'CHK_SPZI_PROC_CPC_5', fieldName: 'CHK_SPZI_PROC_CPC_5', header: { text: '' } },
{ name: 'CHK_SPZI_PROC_CPC_6', fieldName: 'CHK_SPZI_PROC_CPC_6', header: { text: '' } },
{ name: 'CHK_SPZI_PROC_CPC_7', fieldName: 'CHK_SPZI_PROC_CPC_7', header: { text: '' } },
{ name: 'CHK_SPZI_PROC_CPC_8', fieldName: 'CHK_SPZI_PROC_CPC_8', header: { text: '' } },
{ name: 'CHK_SPZO_SM', fieldName: 'CHK_SPZO_SM', header: { text: '' } },
{ name: 'CHK_SPZO_MTHD_SM', fieldName: 'CHK_SPZO_MTHD_SM', header: { text: '' } },
{ name: 'CHK_SPZO_ROT_NPFL_CNT', fieldName: 'CHK_SPZO_ROT_NPFL_CNT', header: { text: '' } },
{ name: 'CHK_SPZO_ROT_ENFCT_PUMP_1', fieldName: 'CHK_SPZO_ROT_ENFCT_PUMP_1', header: { text: '' } },
{ name: 'CHK_SPZO_ROT_ENFCT_PUMP_2', fieldName: 'CHK_SPZO_ROT_ENFCT_PUMP_2', header: { text: '' } },
{ name: 'CHK_SPZO_ROT_ENFCT_PUMP_3', fieldName: 'CHK_SPZO_ROT_ENFCT_PUMP_3', header: { text: '' } },
{ name: 'CHK_SPZO_ROT_TANK_SM', fieldName: 'CHK_SPZO_ROT_TANK_SM', header: { text: '' } },
{ name: 'CHK_SPZO_IMHF_NPFL_CNT', fieldName: 'CHK_SPZO_IMHF_NPFL_CNT', header: { text: '' } },
{ name: 'CHK_SPZO_IMHF_ENFCT_PUMP_1', fieldName: 'CHK_SPZO_IMHF_ENFCT_PUMP_1', header: { text: '' } },
{ name: 'CHK_SPZO_IMHF_ENFCT_PUMP_2', fieldName: 'CHK_SPZO_IMHF_ENFCT_PUMP_2', header: { text: '' } },
{ name: 'CHK_SPZO_IMHF_ENFCT_PUMP_3', fieldName: 'CHK_SPZO_IMHF_ENFCT_PUMP_3', header: { text: '' } },
{ name: 'CHK_SPZO_IMHF_TANK_SM', fieldName: 'CHK_SPZO_IMHF_TANK_SM', header: { text: '' } },
{ name: 'CHK_SPZO_WTROT_NPFL_CNT', fieldName: 'CHK_SPZO_WTROT_NPFL_CNT', header: { text: '' } },
{ name: 'CHK_SPZO_WTROT_ENFCT_PUMP_1', fieldName: 'CHK_SPZO_WTROT_ENFCT_PUMP_1', header: { text: '' } },
{ name: 'CHK_SPZO_WTROT_ENFCT_PUMP_2', fieldName: 'CHK_SPZO_WTROT_ENFCT_PUMP_2', header: { text: '' } },
{ name: 'CHK_SPZO_WTROT_ENFCT_PUMP_3', fieldName: 'CHK_SPZO_WTROT_ENFCT_PUMP_3', header: { text: '' } },
{ name: 'CHK_SPZO_WTROT_TANK_SM', fieldName: 'CHK_SPZO_WTROT_TANK_SM', header: { text: '' } },
{ name: 'CHK_SPZO_TFM', fieldName: 'CHK_SPZO_TFM', header: { text: '' } },
{ name: 'CHK_SPZO_ARTM', fieldName: 'CHK_SPZO_ARTM', header: { text: '' } },
{ name: 'CHK_SPZO_CTARM', fieldName: 'CHK_SPZO_CTARM', header: { text: '' } },
{ name: 'CHK_SPZO_NPFL', fieldName: 'CHK_SPZO_NPFL', header: { text: '' } },
{ name: 'CHK_SPZO_ENFCT_PUMP', fieldName: 'CHK_SPZO_ENFCT_PUMP', header: { text: '' } },
{ name: 'CHK_SPZO_PROC_CPC_SM', fieldName: 'CHK_SPZO_PROC_CPC_SM', header: { text: '' } },
{ name: 'CHK_SPZO_PROC_CPC_1', fieldName: 'CHK_SPZO_PROC_CPC_1', header: { text: '' } },
{ name: 'CHK_SPZO_PROC_CPC_2', fieldName: 'CHK_SPZO_PROC_CPC_2', header: { text: '' } },
{ name: 'CHK_SPZO_PROC_CPC_3', fieldName: 'CHK_SPZO_PROC_CPC_3', header: { text: '' } },
{ name: 'CHK_SPZO_PROC_CPC_4', fieldName: 'CHK_SPZO_PROC_CPC_4', header: { text: '' } },
{ name: 'CHK_SPZO_PROC_CPC_5', fieldName: 'CHK_SPZO_PROC_CPC_5', header: { text: '' } },
{ name: 'CHK_SPZO_PROC_CPC_6', fieldName: 'CHK_SPZO_PROC_CPC_6', header: { text: '' } },
{ name: 'CHK_SPZO_PROC_CPC_7', fieldName: 'CHK_SPZO_PROC_CPC_7', header: { text: '' } },
{ name: 'CHK_SPZO_PROC_CPC_8', fieldName: 'CHK_SPZO_PROC_CPC_8', header: { text: '' } },
{ name: 'admdstCd', fieldName: 'admdstCd', header: { text: '행정구역코드' }, visible: false, },
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, visible: false },
],
columnLayout: [
{
name: 'group_admin',
header: { text: '행정구역' },
items: ['SIDO', 'GUGUN']
items: [
{ column: 'ctpvNm', footerUserSpans: [{ colspan: 2 }] },
'sggNm',
],
},
'TOT_FCLTY_CNT',
'grssFcltCnt',
{
name: 'group_spzi',
header: { text: '하수처리구역 내' },
items: [
'SPZI_SM',
'staaInsdWhol',
{
name: 'group_spzi_mthd',
header: { text: '처리방식별' },
items: [
'SPZI_MTHD_SM',
'staaInsdPrcsMthByWhol',
{
name: 'group_spzi_rot',
header: { text: '부패탱크' },
items: [
'SPZI_ROT_NPFL_CNT',
'SPZI_ROT_ENFCT_PUMP_1'
'staaInsdSttkNprsflCnt',
'step1StaaInsdSttkFrcCnt'
]
},
'SPZI_WTROT_NPFL_CNT',
'SPZI_TFM',
'SPZI_ARTM',
'SPZI_CTARM'
'staaInsdSprktpFltrtbCnt',
'staaInsdAertMthdCnt',
'staaInsdCntcAertCnt',
'staaInsdEtcCnt'
]
},
{
name: 'group_spzi_proc',
header: { text: '처리용량별' },
items: [
'SPZI_PROC_CPC_SM',
'SPZI_PROC_CPC_1',
'SPZI_PROC_CPC_2',
'SPZI_PROC_CPC_3',
'SPZI_PROC_CPC_4',
'SPZI_PROC_CPC_5',
'SPZI_PROC_CPC_6',
'SPZI_PROC_CPC_7',
'SPZI_PROC_CPC_8'
'staaInsdPrcsCpctByWhol',
'step1StaaInsdNope',
'step2StaaInsdNope',
'step3StaaInsdNope',
'step4StaaInsdNope',
'step5StaaInsdNope',
'step6StaaInsdNope',
'step7StaaInsdNope',
'step8StaaInsdNope'
]
}
]
@@ -189,47 +323,49 @@ export const SepticTankStatusInpColumn = {
name: 'group_spzo',
header: { text: '하수처리구역 외' },
items: [
'SPZO_SM',
'staaExcpWhol',
{
name: 'group_spzo_mthd',
header: { text: '처리방식별' },
items: [
'SPZO_MTHD_SM',
'staaExcpPrcsMthByWhol',
{
name: 'group_spzo_rot',
header: { text: '부패탱크' },
items: [
'SPZO_ROT_NPFL_CNT',
'SPZO_ROT_ENFCT_PUMP_1'
'staaExcpSttkNprsflCnt',
'step1StaaExcpSttkFrcCnt'
]
},
'SPZO_WTROT_NPFL_CNT',
'SPZO_TFM',
'SPZO_ARTM',
'SPZO_CTARM'
'staaExcpSprktpFltrtbCnt',
'staaExcpAertMthdCnt',
'staaExcpCntcAertCnt',
'staaExcpEtcCnt'
]
},
{
name: 'group_spzo_proc',
header: { text: '처리용량별' },
items: [
'SPZO_PROC_CPC_SM',
'SPZO_PROC_CPC_1',
'SPZO_PROC_CPC_2',
'SPZO_PROC_CPC_3',
'SPZO_PROC_CPC_4',
'SPZO_PROC_CPC_5',
'SPZO_PROC_CPC_6',
'SPZO_PROC_CPC_7',
'SPZO_PROC_CPC_8'
'staaExcpPrcsCpctByWhol',
'step1StaaExcpNope',
'step2StaaExcpNope',
'step3StaaExcpNope',
'step4StaaExcpNope',
'step5StaaExcpNope',
'step6StaaExcpNope',
'step7StaaExcpNope',
'step8StaaExcpNope'
]
}
]
},
'RMK'
'rmrk',
'admdstCd',
'admdstNm'
],
rowStartNum: 4,
fixedColumns: 1,
tabKey: 'septicTankStatusInp',
tabKey: 'ST00080002',
tabLabel: '정화조 현황'
};
@@ -5,65 +5,119 @@ import { ValueType } from "realgrid";
export const SewageTreatFactStatusInpColumn = {
columns: [
// 행정구역
{ name: 'SIDO', fieldName: '시도', header: { text: '시도' }, editable: false },
{ name: 'GUGUN', fieldName: '시군구', header: { text: '시군구' }, editable: false, footer: { text: '합계' } },
{ name: 'ctpvNm', fieldName: 'ctpvNm', header: { text: '시도' }, footer: { text: '합계' }, editable: false, styleName: 'rg-cell-readonly' },
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' }, editable: false, styleName: 'rg-cell-readonly' },
// 총계
{ name: 'STTY_SM', fieldName: '총계', header: { text: '총계' }, editable: false, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{
name: 'wholDrtwPrcsFcltCnt',
fieldName: 'wholDrtwPrcsFcltCnt',
header: { text: '총계' },
editable: false,
footer: footerInt,
valueType: ValueType.NUMBER,
dataFormat: '#,##0',
styleName: 'rg-cell-total',
computed: {
fields: [
'step1StaaPrcsQnt',
'step2StaaPrcsQnt',
'step3StaaPrcsQnt',
'step4StaaPrcsQnt',
'step5StaaPrcsQnt',
'step6StaaPrcsQnt',
'step7StaaPrcsQnt',
'step1StaaExcpPrcsQnt',
'step2StaaExcpPrcsQnt',
'step3StaaExcpPrcsQnt',
'step4StaaExcpPrcsQnt',
'step5StaaExcpPrcsQnt',
'step6StaaExcpPrcsQnt',
'step7StaaExcpPrcsQnt',
],
type: 'sum' as const,
},
},
// 오수처리시설 > 하수처리구역 내(m³/일)
{ name: 'STTY_ZONE_INNER_SM', fieldName: '계', header: { text: '계' }, editable: false, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'STTY_ZONE_INNER_2', fieldName: '2이하', header: { text: '2이하' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'STTY_ZONE_INNER_3', fieldName: '3~10', header: { text: '3~10' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'STTY_ZONE_INNER_11', fieldName: '11~20', header: { text: '11~20' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'STTY_ZONE_INNER_21', fieldName: '21~50', header: { text: '21~50' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'STTY_ZONE_INNER_51', fieldName: '51~100', header: { text: '51~100' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'STTY_ZONE_INNER_101', fieldName: '101~500', header: { text: '101~500' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'STTY_ZONE_INNER_501', fieldName: '501이상', header: { text: '501이상' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{
name: 'wholStaaCnt',
fieldName: 'wholStaaCnt',
header: { text: '계' },
editable: false,
footer: footerInt,
valueType: ValueType.NUMBER,
dataFormat: '#,##0',
styleName: 'rg-cell-total',
computed: {
fields: [
'step1StaaPrcsQnt',
'step2StaaPrcsQnt',
'step3StaaPrcsQnt',
'step4StaaPrcsQnt',
'step5StaaPrcsQnt',
'step6StaaPrcsQnt',
'step7StaaPrcsQnt',
],
type: 'sum' as const,
},
},
{ name: 'step1StaaPrcsQnt', fieldName: 'step1StaaPrcsQnt', header: { text: '2이하' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step2StaaPrcsQnt', fieldName: 'step2StaaPrcsQnt', header: { text: '3~10' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step3StaaPrcsQnt', fieldName: 'step3StaaPrcsQnt', header: { text: '11~20' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step4StaaPrcsQnt', fieldName: 'step4StaaPrcsQnt', header: { text: '21~50' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step5StaaPrcsQnt', fieldName: 'step5StaaPrcsQnt', header: { text: '51~100' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step6StaaPrcsQnt', fieldName: 'step6StaaPrcsQnt', header: { text: '101~500' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step7StaaPrcsQnt', fieldName: 'step7StaaPrcsQnt', header: { text: '501이상' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 오수처리시설 > 하수처리구역 외(m³/일)
{ name: 'STTY_ZONE_OUTER_SM', fieldName: '계', header: { text: '계' }, editable: false, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'STTY_ZONE_OUTER_2', fieldName: '2이하', header: { text: '2이하' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'STTY_ZONE_OUTER_3', fieldName: '3~10', header: { text: '3~10' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'STTY_ZONE_OUTER_11', fieldName: '11~20', header: { text: '11~20' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'STTY_ZONE_OUTER_21', fieldName: '21~50', header: { text: '21~50' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'STTY_ZONE_OUTER_51', fieldName: '51~100', header: { text: '51~100' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'STTY_ZONE_OUTER_101', fieldName: '101~500', header: { text: '101~500' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'STTY_ZONE_OUTER_501', fieldName: '501이상', header: { text: '501이상' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{
name: 'staaExcpWhol',
fieldName: 'staaExcpWhol',
header: { text: '계' },
editable: false,
footer: footerInt,
valueType: ValueType.NUMBER,
dataFormat: '#,##0',
styleName: 'rg-cell-total',
computed: {
fields: [
'step1StaaExcpPrcsQnt',
'step2StaaExcpPrcsQnt',
'step3StaaExcpPrcsQnt',
'step4StaaExcpPrcsQnt',
'step5StaaExcpPrcsQnt',
'step6StaaExcpPrcsQnt',
'step7StaaExcpPrcsQnt',
],
type: 'sum' as const,
},
},
{ name: 'step1StaaExcpPrcsQnt', fieldName: 'step1StaaExcpPrcsQnt', header: { text: '2이하' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step2StaaExcpPrcsQnt', fieldName: 'step2StaaExcpPrcsQnt', header: { text: '3~10' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step3StaaExcpPrcsQnt', fieldName: 'step3StaaExcpPrcsQnt', header: { text: '11~20' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step4StaaExcpPrcsQnt', fieldName: 'step4StaaExcpPrcsQnt', header: { text: '21~50' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step5StaaExcpPrcsQnt', fieldName: 'step5StaaExcpPrcsQnt', header: { text: '51~100' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step6StaaExcpPrcsQnt', fieldName: 'step6StaaExcpPrcsQnt', header: { text: '101~500' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'step7StaaExcpPrcsQnt', fieldName: 'step7StaaExcpPrcsQnt', header: { text: '501이상' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 비고
{ name: 'RMK', fieldName: '비고', header: { text: '비고' } },
{ name: 'rmrk', fieldName: 'rmrk', header: { text: '비고' } },
// hidden
{ name: 'WRTER_OPINION', fieldName: '사용자의견', header: { text: '사용자의견' } },
{ name: 'CHCKER_OPINION', fieldName: '검토자의견', header: { text: '검토자의견' } },
// 검증 필드 (검증 여부 표시용, 빨간색 표시)
{ name: 'CHK_STTY_SM', fieldName: 'CHK_STTY_SM', header: { text: '' } },
{ name: 'CHK_STTY_ZONE_INNER_SM', fieldName: 'CHK_STTY_ZONE_INNER_SM', header: { text: '' } },
{ name: 'CHK_STTY_ZONE_INNER_2', fieldName: 'CHK_STTY_ZONE_INNER_2', header: { text: '' } },
{ name: 'CHK_STTY_ZONE_INNER_3', fieldName: 'CHK_STTY_ZONE_INNER_3', header: { text: '' } },
{ name: 'CHK_STTY_ZONE_INNER_11', fieldName: 'CHK_STTY_ZONE_INNER_11', header: { text: '' } },
{ name: 'CHK_STTY_ZONE_INNER_21', fieldName: 'CHK_STTY_ZONE_INNER_21', header: { text: '' } },
{ name: 'CHK_STTY_ZONE_INNER_51', fieldName: 'CHK_STTY_ZONE_INNER_51', header: { text: '' } },
{ name: 'CHK_STTY_ZONE_INNER_101', fieldName: 'CHK_STTY_ZONE_INNER_101', header: { text: '' } },
{ name: 'CHK_STTY_ZONE_INNER_501', fieldName: 'CHK_STTY_ZONE_INNER_501', header: { text: '' } },
{ name: 'CHK_STTY_ZONE_OUTER_SM', fieldName: 'CHK_STTY_ZONE_OUTER_SM', header: { text: '' } },
{ name: 'CHK_STTY_ZONE_OUTER_2', fieldName: 'CHK_STTY_ZONE_OUTER_2', header: { text: '' } },
{ name: 'CHK_STTY_ZONE_OUTER_3', fieldName: 'CHK_STTY_ZONE_OUTER_3', header: { text: '' } },
{ name: 'CHK_STTY_ZONE_OUTER_11', fieldName: 'CHK_STTY_ZONE_OUTER_11', header: { text: '' } },
{ name: 'CHK_STTY_ZONE_OUTER_21', fieldName: 'CHK_STTY_ZONE_OUTER_21', header: { text: '' } },
{ name: 'CHK_STTY_ZONE_OUTER_51', fieldName: 'CHK_STTY_ZONE_OUTER_51', header: { text: '' } },
{ name: 'CHK_STTY_ZONE_OUTER_101', fieldName: 'CHK_STTY_ZONE_OUTER_101', header: { text: '' } },
{ name: 'CHK_STTY_ZONE_OUTER_501', fieldName: 'CHK_STTY_ZONE_OUTER_501', header: { text: '' } },
{ name: 'admdstCd', fieldName: 'admdstCd', header: { text: '행정구역코드' }, visible: false, },
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, visible: false },
],
columnLayout: [
{
name: 'group_admin',
header: { text: '행정구역' },
items: ['SIDO', 'GUGUN']
items: [
{ column: 'ctpvNm', footerUserSpans: [{ colspan: 2 }] },
'sggNm',
],
},
'STTY_SM',
'wholDrtwPrcsFcltCnt',
{
name: 'group_stty',
header: { text: '오수처리시설' },
@@ -72,36 +126,38 @@ export const SewageTreatFactStatusInpColumn = {
name: 'group_inner',
header: { text: '하수처리구역 내(m³/일)' },
items: [
'STTY_ZONE_INNER_SM',
'STTY_ZONE_INNER_2',
'STTY_ZONE_INNER_3',
'STTY_ZONE_INNER_11',
'STTY_ZONE_INNER_21',
'STTY_ZONE_INNER_51',
'STTY_ZONE_INNER_101',
'STTY_ZONE_INNER_501'
'wholStaaCnt',
'step1StaaPrcsQnt',
'step2StaaPrcsQnt',
'step3StaaPrcsQnt',
'step4StaaPrcsQnt',
'step5StaaPrcsQnt',
'step6StaaPrcsQnt',
'step7StaaPrcsQnt'
]
},
{
name: 'group_outer',
header: { text: '하수처리구역 외(m³/일)' },
items: [
'STTY_ZONE_OUTER_SM',
'STTY_ZONE_OUTER_2',
'STTY_ZONE_OUTER_3',
'STTY_ZONE_OUTER_11',
'STTY_ZONE_OUTER_21',
'STTY_ZONE_OUTER_51',
'STTY_ZONE_OUTER_101',
'STTY_ZONE_OUTER_501'
'staaExcpWhol',
'step1StaaExcpPrcsQnt',
'step2StaaExcpPrcsQnt',
'step3StaaExcpPrcsQnt',
'step4StaaExcpPrcsQnt',
'step5StaaExcpPrcsQnt',
'step6StaaExcpPrcsQnt',
'step7StaaExcpPrcsQnt'
]
}
]
},
'RMK'
'rmrk',
'admdstCd',
'admdstNm'
],
rowStartNum: 3,
fixedColumns: 1,
tabKey: 'sewageTreatFactStatusInp',
tabKey: 'ST00080001',
tabLabel: '처리용량별 오수처리시설 현황'
};
@@ -1,26 +1,38 @@
import { ValueType } from "realgrid";
import { footerDecimal1, footerDecimal2,footerInt } from "@/components/util/grid/footerSummary";
import { footerDecimal1, footerDecimal2, footerInt } from "@/components/util/grid/footerSummary";
// 하수도 통계 관리 > 03.하수관로 유지관리 > tab 2. 관로준설
export const PipeDredgingStatusInpColumn = {
columns: [
// 행정구역
{ name: 'admdstCd', fieldName: 'admdstCd', header: { text: '행정구역코드' }, editable: false },
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구명' }, editable: false, footer: { text: '합계' } },
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, editable: false },
{ name: 'ctpvNm', fieldName: 'ctpvNm', header: { text: '시도' }, footer: { text: '합계' }, editable: false, styleName: 'rg-cell-readonly' },
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구명' }, editable: false, footer: { text: '합계' }, styleName: 'rg-cell-readonly' },
// 하수관로 총 시설연장
{ name: 'wholFcltPrlg', fieldName: 'wholFcltPrlg', header: { text: '하수관로총시설연장(m)' }, editable: false, footer: footerDecimal2, valueType: ValueType.NUMBER, dataFormat: '#,##0.00' },
{ name: 'wholFcltPrlg', fieldName: 'wholFcltPrlg', header: { text: '하수관로총시설연장(m)' }, editable: false, footer: footerDecimal2, valueType: ValueType.NUMBER, dataFormat: '#,##0.00', styleName: 'rg-cell-readonly' },
// 준설연장 및 개소수 > 관로(m)
{ name: 'wholSwagePpl', fieldName: 'wholSwagePpl', header: { text: '합계' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{
name: 'wholSwagePpl',
fieldName: 'wholSwagePpl',
header: { text: '합계' },
editable: false,
footer: footerDecimal1,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
styleName: 'rg-cell-total',
computed: {
fields: ['cbsysPplPrlg', 'sprsysExlnPrlg', 'sprsysDrtwPrlg'],
type: 'sum' as const,
},
},
{ name: 'cbsysPplPrlg', fieldName: 'cbsysPplPrlg', header: { text: '합류식' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 준설연장 및 개소수 > 관로(m) > 분류식
{ name: 'sprsysExlnPrlg', fieldName: 'sprsysExlnPrlg', header: { text: '우수' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'sprsysDrtwPrlg', fieldName: 'sprsysDrtwPrlg', header: { text: '오수' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 준설연장 및 개소수 > 맨홀, 오·우수받이, 토실·토구
{ name: 'mnhlCnt', fieldName: 'mnhlCnt', header: { text: '맨홀(개소)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'exlnDrtwRcvprpCnt', fieldName: 'exlnDrtwRcvprpCnt', header: { text: '오·우수받이(개소)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
@@ -28,8 +40,36 @@ export const PipeDredgingStatusInpColumn = {
// 계획 & 비율
{ name: 'drdgnPlanPrlg', fieldName: 'drdgnPlanPrlg', header: { text: '준설 계획 연장(m)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'drdgnTrgtCtrsDrdgnRt', fieldName: 'drdgnTrgtCtrsDrdgnRt', header: { text: '계획대비 준설율(%)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'wholPrlgCtrsDrdgnRt', fieldName: 'wholPrlgCtrsDrdgnRt', header: { text: '총시설연장대비 준설율(%)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{
name: 'drdgnTrgtCtrsDrdgnRt',
fieldName: 'drdgnTrgtCtrsDrdgnRt',
header: { text: '계획대비 준설율(%)' },
editable: false,
footer: footerDecimal1,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
styleName: 'rg-cell-total',
computed: {
numeratorFields: ['cbsysPplPrlg', 'sprsysExlnPrlg', 'sprsysDrtwPrlg'],
denominatorFields: ['drdgnPlanPrlg'],
type: 'pblswrgPopltnSuprtRate' as const,
},
},
{
name: 'wholPrlgCtrsDrdgnRt',
fieldName: 'wholPrlgCtrsDrdgnRt',
header: { text: '총시설연장대비 준설율(%)' },
editable: false,
footer: footerDecimal1,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
styleName: 'rg-cell-total',
computed: {
numeratorFields: ['drdgnPlanPrlg'],
denominatorFields: ['wholFcltPrlg'],
type: 'pblswrgPopltnSuprtRate' as const,
},
},
// 준설실적
{ name: 'drdgnAmt', fieldName: 'drdgnAmt', header: { text: '금액(백만원)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
@@ -37,17 +77,38 @@ export const PipeDredgingStatusInpColumn = {
// 준설토사처리
{ name: 'drdgnUntprcAmt', fieldName: 'drdgnUntprcAmt', header: { text: '준설토처리비(백만원)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'wholDrdgnPrcsQnt', fieldName: 'wholDrdgnPrcsQnt', header: { text: '처리량 계(톤)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{
name: 'wholDrdgnPrcsQnt',
fieldName: 'wholDrdgnPrcsQnt',
header: { text: '처리량 계(톤)' },
editable: false,
footer: footerDecimal1,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
styleName: 'rg-cell-total',
computed: {
fields: ['rclmQnt', 'oceanEmsnQnt', 'rcycQnt', 'etcQnt'],
type: 'sum' as const,
},
},
{ name: 'rclmQnt', fieldName: 'rclmQnt', header: { text: '매립' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'oceanEmsnQnt', fieldName: 'oceanEmsnQnt', header: { text: '해양투기' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'rcycQnt', fieldName: 'rcycQnt', header: { text: '재활용' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'etcQnt', fieldName: 'etcQnt', header: { text: '기타(소각, 고형화, 시멘트원료 등)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 비고
{ name: 'rmrk', fieldName: 'rmrk', header: { text: '비고' } },
{ name: 'admdstCd', fieldName: 'admdstCd', header: { text: '행정구역코드' }, editable: false, visible: false },
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, editable: false, visible: false },
],
columnLayout: [
{ name: 'group_admin', header: { text: '행정구역' }, items: ['admdstCd', 'sggNm', 'admdstNm'] },
{
name: 'group_admin', header: { text: '행정구역' },
items: [
{ column: 'ctpvNm', footerUserSpans: [{ colspan: 2 }] },
'sggNm',
],
},
'wholFcltPrlg',
{
name: 'group_dredge_info',
@@ -75,7 +136,9 @@ export const PipeDredgingStatusInpColumn = {
header: { text: '준설토사처리' },
items: ['drdgnUntprcAmt', 'wholDrdgnPrcsQnt', 'rclmQnt', 'oceanEmsnQnt', 'rcycQnt', 'etcQnt']
},
'rmrk'
'rmrk',
'admdstCd',
'admdstNm',
],
rowStartNum: 4,
fixedColumns: 1,
@@ -5,12 +5,24 @@ import { ValueType } from "realgrid";
export const RepairStatusInpColumn = {
columns: [
// 행정구역
{ name: 'admdstCd', fieldName: 'admdstCd', header: { text: '행정구역코드' }, editable: false },
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구명' }, editable: false, footer: { text: '합계' } },
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, editable: false },
{ name: 'ctpvNm', fieldName: 'ctpvNm', header: { text: '시도' }, footer: { text: '합계' }, editable: false, styleName: 'rg-cell-readonly' },
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구명' }, editable: false, footer: { text: '합계' }, styleName: 'rg-cell-readonly' },
// 개·보수관로 > 전체보수(m)
{ name: 'mendngWhol', fieldName: 'mendngWhol', header: { text: '소계' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{
name: 'mendngWhol',
fieldName: 'mendngWhol',
header: { text: '소계' },
editable: false,
footer: footerDecimal1,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
styleName: 'rg-cell-total',
computed: {
fields: ['cbsysMendngPrlg', 'sprsysExlnPrlg', 'sprsysDrtwPrlg'],
type: 'sum' as const,
},
},
{ name: 'cbsysMendngPrlg', fieldName: 'cbsysMendngPrlg', header: { text: '합류식' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 개·보수관로 > 전체보수(m) > 분류식
@@ -18,7 +30,20 @@ export const RepairStatusInpColumn = {
{ name: 'sprsysDrtwPrlg', fieldName: 'sprsysDrtwPrlg', header: { text: '오수' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 개·보수관로 > 부분보수(개소)
{ name: 'partMendngWhol', fieldName: 'partMendngWhol', header: { text: '소계' }, editable: false, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{
name: 'partMendngWhol',
fieldName: 'partMendngWhol',
header: { text: '소계' },
editable: false,
footer: footerInt,
valueType: ValueType.NUMBER,
dataFormat: '#,##0',
styleName: 'rg-cell-total',
computed: {
fields: ['cbsysPartMendngPrlg', 'sprsysExlnMendngPrlg', 'sprsysDrtwMendngPrlg'],
type: 'sum' as const,
},
},
{ name: 'cbsysPartMendngPrlg', fieldName: 'cbsysPartMendngPrlg', header: { text: '합류식' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 개·보수관로 > 부분보수(개소) > 분류식
@@ -45,12 +70,17 @@ export const RepairStatusInpColumn = {
// 비고
{ name: 'rmrk', fieldName: 'rmrk', header: { text: '비고' } },
{ name: 'admdstCd', fieldName: 'admdstCd', header: { text: '행정구역코드' }, editable: false, visible: false },
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, editable: false, visible: false },
],
columnLayout: [
{
name: 'group_admin',
header: { text: '행정구역' },
items: ['admdstCd', 'sggNm', 'admdstNm']
items: [
{ column: 'ctpvNm', footerUserSpans: [{ colspan: 2 }] },
'sggNm',
],
},
{
name: 'group_repair_main',
@@ -107,7 +137,9 @@ export const RepairStatusInpColumn = {
items: ['stofcbrCnt', 'otflCnt']
},
'cctvExmnPrlg',
'rmrk'
'rmrk',
'admdstCd',
'admdstNm',
],
rowStartNum: 4,
fixedColumns: 1,
@@ -1,93 +1,159 @@
import type { ColumnConfig } from "@/components/type/DataGrid.type";
import { footerInt, footerDecimal1, footerDecimal2, footerDecimal3 } from "@/components/util/grid/footerSummary";
import { ValueType } from "realgrid";
const RAINFALL_PUMP_FCLTY_KIND_VALUES = ["해당없음", "제1종", "제2종", "제3종"] as const;
const RAINFALL_PUMP_YN_VALUES = ["유", "무"] as const;
function dropdownColumn(
col: Pick<ColumnConfig, "name" | "fieldName" | "header"> &
Partial<ColumnConfig>,
options: readonly string[],
): ColumnConfig {
const values = [...options];
return {
...col,
values,
labels: values,
lookupDisplay: true,
editor: {
type: "dropdown",
domainOnly: true,
textReadOnly: true,
commitOnSelect: true,
dropDownWhenClick: true,
values,
labels: values,
},
};
}
// 하수도 통계 관리 > 04.하수저류시설 및 빗물펌프장 > tab 2: 빗물펌프장
export const RainfallPumpStationInpColumn = {
columns: [
// Hidden Columns : 시스템 관리를 위한 값
{ name: 'sidoCd', fieldName: '시도코드', header: { text: '시도코드' }, hidden: true },
{ name: 'adstDstrCd', fieldName: '행정구역코드', header: { text: '행정구역코드' }, hidden: true },
{ name: 'adstCd', fieldName: '행정코드', header: { text: '행정코드' }, hidden: true },
{ name: 'swgeStrgeFctSeq', fieldName: '시설SEQ', header: { text: '시설SEQ' }, hidden: true },
{ name: 'yr', fieldName: '년도', header: { text: '년도' }, hidden: true },
{ name: 'odr', fieldName: '차수', header: { text: '차수' }, hidden: true },
{ name: 'bsnmCd', fieldName: '사업자코드', header: { text: '사업자코드' }, hidden: true },
{ name: 'ctpvNm', fieldName: 'ctpvNm', header: { text: '시도' }, footer: { text: '합계' }, editable: false, styleName: 'rg-cell-readonly' },
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' } },
// Visible Columns
// 행정구역
{ name: 'sido', fieldName: '시도', header: { text: '시도' }, editable: false },
{ name: 'gugun', fieldName: '시군구', header: { text: '시군구' }, footer: { text: '합계' } },
{ name: 'fcltNm', fieldName: 'fcltNm', header: { text: '시설명' } },
{ name: 'fcltPstnCn', fieldName: 'fcltPstnCn', header: { text: '위치' } },
// 시설명
{ name: 'swgeStrgeNm', fieldName: '시설명', header: { text: '시설명' } },
dropdownColumn(
{ name: 'fcltyKndCn', fieldName: 'fcltyKndCn', header: { text: '시설물종류' } },
RAINFALL_PUMP_FCLTY_KIND_VALUES,
),
// 위치
{ name: 'addr', fieldName: '위치', header: { text: '위치' } },
// 시설물종류
{ name: 'facRes', fieldName: '시설물종류', header: { text: '시설물종류' } },
// 가동개시 년월일 yyyy-mm-dd
{ name: 'rnDt', fieldName: '가동개시 년월일 yyyy-mm-dd', header: { text: '가동개시 년월일 yyyy-mm-dd' } },
// 계획설계빈도
{ name: 'plDsgnFrqnc', fieldName: '계획설계빈도', header: { text: '계획설계빈도' } },
{
name: 'oprtngStrtYmd',
fieldName: 'oprtngStrtYmd',
header: { text: '가동개시 년월일 yyyy-mm-dd' },
datetimeFormat: 'yyyy-MM-dd',
editor: {
type: 'date',
dropDownWhenClick: true,
datetimeFormat: 'yyyy-MM-dd',
},
},
{ name: 'planDesignFreqCnt', fieldName: 'planDesignFreqCnt', header: { text: '계획설계빈도' } },
// 집수구역면적(㎢)
{ name: 'dgrAr', fieldName: '집수구역면적(㎢)', header: { text: '집수구역면적(㎢)' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
{ name: 'wtrStrgZoneArea', fieldName: 'wtrStrgZoneArea', header: { text: '집수구역면적(㎢)' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
// 유수지
{ name: 'revFnnc', fieldName: '유수지유무(유,무)', header: { text: '유수지유무(유,무)' } },
{ name: 'revCpcty', fieldName: '저류랑(m³)', header: { text: '저류랑(m³)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
dropdownColumn(
{ name: 'rsvrYn', fieldName: 'rsvrYn', header: { text: '유수지유무(유,무)' } },
RAINFALL_PUMP_YN_VALUES,
),
{ name: 'rsvrImpndQnt', fieldName: 'rsvrImpndQnt', header: { text: '저류랑(m³)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 흡수정
{ name: 'absCpcty', fieldName: '저류랑(m³)', header: { text: '저류랑(m³)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'abstnRgnImpdQnt', fieldName: 'abstnRgnImpdQnt', header: { text: '저류랑(m³)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 펌프시설 > 총양수량(m³/min)
{ name: 'wpCpcty', fieldName: '총양수량(m³/min)', header: { text: '총양수량(m³/min)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{
name: 'grssPpqty',
fieldName: 'grssPpqty',
header: { text: '총양수량(m³/min)' },
editable: false,
footer: footerDecimal1,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
styleName: 'rg-cell-total',
computed: {
type: 'pumpGrossPpqty' as const,
pumpGroups: [
{
pumpCntField: 'pumpFcltN1PumpCnt',
rsrvPumpCntField: 'pumpFcltN1RsrvPumpCnt',
perPpqtyField: 'pumpFcltN1PerPpqty',
},
{
pumpCntField: 'pumpFcltN2PumpCnt',
rsrvPumpCntField: 'pumpFcltN2RsrvPumpCnt',
perPpqtyField: 'pumpFcltN2PerPpqty',
},
{
pumpCntField: 'pumpFcltN3PumpCnt',
rsrvPumpCntField: 'pumpFcltN3RsrvPumpCnt',
perPpqtyField: 'pumpFcltN3PerPpqty',
},
],
},
},
// 펌프시설1
{ name: 'pumpCalbr', fieldName: '구경(mm)', header: { text: '구경(mm)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pumpHpCo', fieldName: '대당 양수량(m³/min·대)', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'pumpCo', fieldName: '펌프대수', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pumpPreparCo', fieldName: '예비펌프대수', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pumpFcltN1DmtrExpln', fieldName: 'pumpFcltN1DmtrExpln', header: { text: '구경(mm)' } },
{ name: 'pumpFcltN1PerPpqty', fieldName: 'pumpFcltN1PerPpqty', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'pumpFcltN1PumpCnt', fieldName: 'pumpFcltN1PumpCnt', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pumpFcltN1RsrvPumpCnt', fieldName: 'pumpFcltN1RsrvPumpCnt', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 펌프시설2
{ name: 'pumpCalbr2', fieldName: '구경(mm)', header: { text: '구경(mm)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pumpHpCo2', fieldName: '대당 양수량(m³/min·대)', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'pumpCo2', fieldName: '펌프대수', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pumpPreparCo2', fieldName: '예비펌프대수', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pumpFcltN2DmtrExpln', fieldName: 'pumpFcltN2DmtrExpln', header: { text: '구경(mm)' } },
{ name: 'pumpFcltN2PerPpqty', fieldName: 'pumpFcltN2PerPpqty', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'pumpFcltN2PumpCnt', fieldName: 'pumpFcltN2PumpCnt', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pumpFcltN2RsrvPumpCnt', fieldName: 'pumpFcltN2RsrvPumpCnt', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 펌프시설3
{ name: 'pumpCalbr3', fieldName: '구경(mm)', header: { text: '구경(mm)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pumpHpCo3', fieldName: '대당 양수량(m³/min·대)', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'pumpCo3', fieldName: '펌프대수', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pumpPreparCo3', fieldName: '예비펌프대수', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pumpFcltN3DmtrExpln', fieldName: 'pumpFcltN3DmtrExpln', header: { text: '구경(mm)' } },
{ name: 'pumpFcltN3PerPpqty', fieldName: 'pumpFcltN3PerPpqty', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'pumpFcltN3PumpCnt', fieldName: 'pumpFcltN3PumpCnt', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pumpFcltN3RsrvPumpCnt', fieldName: 'pumpFcltN3RsrvPumpCnt', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 부대시설
{ name: 'dorZeqpFnnc', fieldName: '전처리시설유무(유/무)', header: { text: '전처리시설유무(유/무)' } },
{ name: 'selfEtrqFnnc', fieldName: '탈취설비유무(유/무)', header: { text: '탈취설비유무(유/무)' } },
{ name: 'freFnnc', fieldName: '자가발전유무(유/무)', header: { text: '자가발전유무(유/무)' } },
dropdownColumn(
{ name: 'prcsgFcltYn', fieldName: 'prcsgFcltYn', header: { text: '전처리시설유무(유/무)' } },
RAINFALL_PUMP_YN_VALUES,
),
dropdownColumn(
{ name: 'ddrztnEqpmYn', fieldName: 'ddrztnEqpmYn', header: { text: '탈취설비유무(유/무)' } },
RAINFALL_PUMP_YN_VALUES,
),
dropdownColumn(
{ name: 'oslfEtgtYn', fieldName: 'oslfEtgtYn', header: { text: '자가발전유무(유/무)' } },
RAINFALL_PUMP_YN_VALUES,
),
// 방류수역
{ name: 'disWat', fieldName: '방류수역', header: { text: '방류수역' } },
{ name: 'dschgWtrsExpln', fieldName: 'dschgWtrsExpln', header: { text: '방류수역' } },
// 최종처분량(ton/년)
{ name: 'sdmtTreCpcty', fieldName: '침사', header: { text: '침사' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'iprtTreCpcty', fieldName: '협잡물', header: { text: '협잡물' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'prcptnLastDspsQnt', fieldName: 'prcptnLastDspsQnt', header: { text: '침사' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'ctmnLastDspsQnt', fieldName: 'ctmnLastDspsQnt', header: { text: '협잡물' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 최종처분방법
{ name: 'sdmtTreMth', fieldName: '침사', header: { text: '침사' } },
{ name: 'iprtTreMth', fieldName: '협잡물', header: { text: '협잡물' } },
{ name: 'prcptnLastDspsMthdExpln', fieldName: 'prcptnLastDspsMthdExpln', header: { text: '침사' } },
{ name: 'ctmnLastDspsMthdExpln', fieldName: 'ctmnLastDspsMthdExpln', header: { text: '협잡물' } },
// 운영실적
{ name: 'yrstpRnDyn', fieldName: '가동일수(일/년)', header: { text: '가동일수(일/년)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0' }, // 입력값 3자리만 가능
{ name: 'dsplcmntAmnt', fieldName: '총배수량(m³/년)', header: { text: '총배수량(m³/년)' }, footer: footerDecimal2, valueType: ValueType.NUMBER, dataFormat: '#,##0.00' },
{ name: 'oprtngDayCnt', fieldName: 'oprtngDayCnt', header: { text: '가동일수(일/년)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0' }, // 입력값 3자리만 가능
{ name: 'grssMltvQnt', fieldName: 'grssMltvQnt', header: { text: '총배수량(m³/년)' }, footer: footerDecimal2, valueType: ValueType.NUMBER, dataFormat: '#,##0.00' },
// 비고
{ name: 'rmk', fieldName: '비고', header: { text: '비고' } },
{ name: 'chckerOpinion', fieldName: '검토자의견', header: { text: '검토자의견' } },
{ name: 'wrterOpinion', fieldName: '사용자의견', header: { text: '사용자의견' } },
{ name: 'rmrk', fieldName: 'rmrk', header: { text: '비고' } },
// Hidden Columns : 시스템 관리를 위한 값
{ name: 'admdstCd', fieldName: 'admdstCd', header: { text: '행정구역코드' }, visible: false, },
{ name: 'fcltSn', fieldName: 'fcltSn', header: { text: '시설일련번호' }, visible: false, },
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, visible: false },
],
columnLayout: [
@@ -95,21 +161,24 @@ export const RainfallPumpStationInpColumn = {
name: 'adminArea',
hideChildHeaders: false,
header: { text: '행정구역' },
items: ['sido', 'gugun'],
items: [
{ column: 'ctpvNm', footerUserSpans: [{ colspan: 3 }] },
'sggNm',
],
},
'swgeStrgeNm',
'addr',
'facRes',
'rnDt',
'plDsgnFrqnc',
'dgrAr',
'fcltNm',
'fcltPstnCn',
'fcltyKndCn',
'oprtngStrtYmd',
'planDesignFreqCnt',
'wtrStrgZoneArea',
{
name: 'reservoir',
hideChildHeaders: false,
header: { text: '유수지' },
items: [
'revFnnc',
'revCpcty',
'rsvrYn',
'rsvrImpndQnt',
],
},
{
@@ -117,7 +186,7 @@ export const RainfallPumpStationInpColumn = {
hideChildHeaders: false,
header: { text: '흡수정' },
items: [
'absCpcty',
'abstnRgnImpdQnt',
],
},
{
@@ -125,16 +194,16 @@ export const RainfallPumpStationInpColumn = {
hideChildHeaders: false,
header: { text: '펌프시설' },
items: [
'wpCpcty',
'grssPpqty',
{
name: 'pumpSystem1',
hideChildHeaders: false,
header: { text: '펌프시설1' },
items: [
'pumpCalbr',
'pumpHpCo',
'pumpCo',
'pumpPreparCo',
'pumpFcltN1DmtrExpln',
'pumpFcltN1PerPpqty',
'pumpFcltN1PumpCnt',
'pumpFcltN1RsrvPumpCnt',
],
},
{
@@ -142,10 +211,10 @@ export const RainfallPumpStationInpColumn = {
hideChildHeaders: false,
header: { text: '펌프시설2' },
items: [
'pumpCalbr2',
'pumpHpCo2',
'pumpCo2',
'pumpPreparCo2',
'pumpFcltN2DmtrExpln',
'pumpFcltN2PerPpqty',
'pumpFcltN2PumpCnt',
'pumpFcltN2RsrvPumpCnt',
],
},
{
@@ -153,10 +222,10 @@ export const RainfallPumpStationInpColumn = {
hideChildHeaders: false,
header: { text: '펌프시설3' },
items: [
'pumpCalbr3',
'pumpHpCo3',
'pumpCo3',
'pumpPreparCo3',
'pumpFcltN3DmtrExpln',
'pumpFcltN3PerPpqty',
'pumpFcltN3PumpCnt',
'pumpFcltN3RsrvPumpCnt',
],
},
],
@@ -166,19 +235,19 @@ export const RainfallPumpStationInpColumn = {
hideChildHeaders: false,
header: { text: '부대시설' },
items: [
'dorZeqpFnnc',
'selfEtrqFnnc',
'freFnnc',
'prcsgFcltYn',
'ddrztnEqpmYn',
'oslfEtgtYn',
],
},
'disWat',
'dschgWtrsExpln',
{
name: 'finalDisposalAmount',
hideChildHeaders: false,
header: { text: '최종처분량(ton/년)' },
items: [
'sdmtTreCpcty',
'iprtTreCpcty',
'prcptnLastDspsQnt',
'ctmnLastDspsQnt',
],
},
{
@@ -186,8 +255,8 @@ export const RainfallPumpStationInpColumn = {
hideChildHeaders: false,
header: { text: '최종처분방법' },
items: [
'sdmtTreMth',
'iprtTreMth',
'prcptnLastDspsMthdExpln',
'ctmnLastDspsMthdExpln',
],
},
{
@@ -195,17 +264,18 @@ export const RainfallPumpStationInpColumn = {
hideChildHeaders: false,
header: { text: '운영실적' },
items: [
'yrstpRnDyn',
'dsplcmntAmnt',
'oprtngDayCnt',
'grssMltvQnt',
],
},
'rmk',
'chckerOpinion',
'wrterOpinion',
'rmrk',
'admdstCd',
'fcltSn',
'admdstNm'
],
rowStartNum: 3,
fixedColumns: 2,
tabKey: 'rainfallPumpStationInp',
tabKey: 'ST00040002',
tabLabel: '빗물펌프장',
};
@@ -1,92 +1,235 @@
import type { ColumnConfig } from "@/components/type/DataGrid.type";
import { footerInt, footerDecimal1, footerDecimal3 } from "@/components/util/grid/footerSummary";
import { ValueType } from "realgrid";
/** 설치목적 O/X 표기 */
export const SEWAGE_RESERVOIR_OX_YN_VALUES = ["O", "X"] as const;
/** 시설구조(ST00040001 `fcltStrctCn`) */
export const SEWAGE_RESERVOIR_FCLT_STRCT_VALUES = [
"일반지하식",
"지하터널식",
"기타",
] as const;
export const SEWAGE_RESERVOIR_YN_VALUES = ["유", "무"] as const;
export const SEWAGE_RESERVOIR_MLTV_MTH_VALUES = ["자연배수", "강제배수"] as const;
export const SEWAGE_RESERVOIR_IMPD_MTH_VALUES = ["직렬", "병렬"] as const;
export const SEWAGE_RESERVOIR_IMPD_PRCS_MTHD_VALUES = ["자체처리", "연계처리"] as const;
function dropdownColumn(
col: Pick<ColumnConfig, "name" | "fieldName" | "header"> &
Partial<ColumnConfig>,
options: readonly string[],
): ColumnConfig {
const values = [...options];
return {
...col,
values,
labels: values,
lookupDisplay: true,
editor: {
type: "dropdown",
domainOnly: true,
textReadOnly: true,
commitOnSelect: true,
dropDownWhenClick: true,
values,
labels: values,
},
};
}
function oxYnDropdownColumn(
col: Pick<ColumnConfig, "name" | "fieldName" | "header"> &
Partial<ColumnConfig>,
): ColumnConfig {
return dropdownColumn(col, SEWAGE_RESERVOIR_OX_YN_VALUES);
}
// 하수도 통계 관리 > 04.하수저류시설 및 빗물펌프장 > tab 1: 하수저류시설
export const SewageReservoirInpColumn = {
columns: [
// Hidden Columns : 시스템 관리를 위한 값
{ name: 'sidoCd', fieldName: '시도코드', header: { text: '시도코드' }, hidden: true },
{ name: 'adstDstrCd', fieldName: '행정구역코드', header: { text: '행정구역코드' }, hidden: true },
{ name: 'adstCd', fieldName: '행정코드', header: { text: '행정코드' }, hidden: true },
{ name: 'swgeStrgeFctSeq', fieldName: '시설SEQ', header: { text: '시설SEQ' }, hidden: true },
// Visible Columns
// 행정구역
{ name: 'sido', fieldName: '시도', header: { text: '시도' }, editable: false },
{ name: 'gugun', fieldName: '시군구', header: { text: '시군구' }, footer: { text: '합계' } },
// 행정구역
{ name: 'ctpvNm', fieldName: 'ctpvNm', header: { text: '시도' }, footer: { text: '합계' }, editable: false, styleName: 'rg-cell-readonly' },
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' } },
// 기본 정보
{ name: 'swgeStrgeNm', fieldName: '시설명', header: { text: '시설명' } },
{ name: 'addr', fieldName: '위치', header: { text: '위치' } },
{ name: 'rnDt', fieldName: '가동개시 년월일 yyyy-mm-dd', header: { text: '가동개시 년월일 yyyy-mm-dd' } },
{ name: 'designFrequency', fieldName: '계획설계빈도', header: { text: '계획설계빈도' } },
{ name: 'fcltNm', fieldName: 'fcltNm', header: { text: '시설명' } },
{ name: 'fcltPstnCn', fieldName: 'fcltPstnCn', header: { text: '위치' } },
{
name: 'oprtngStrtYmd',
fieldName: 'oprtngStrtYmd',
header: { text: '가동개시 년월일 yyyy-mm-dd' },
datetimeFormat: 'yyyy-MM-dd',
editor: {
type: 'date',
dropDownWhenClick: true,
datetimeFormat: 'yyyy-MM-dd',
},
},
{ name: 'planDesignFreqCnt', fieldName: 'planDesignFreqCnt', header: { text: '계획설계빈도' } },
// 설치목적
{ name: 'floodingPrevention', fieldName: '침수예방', header: { text: '침수예방' } },
{ name: 'waterQualityReduction', fieldName: '수질오염저감', header: { text: '수질오염저감' } },
{ name: 'sewerageReuseUse', fieldName: '하수재이용용도', header: { text: '하수재이용용도' } },
// 설치목적 (O/X)
oxYnDropdownColumn({
name: "fldngPrvtnYn",
fieldName: "fldngPrvtnYn",
header: { text: "침수예방" },
}),
oxYnDropdownColumn({
name: "wqPlltnMtgtYn",
fieldName: "wqPlltnMtgtYn",
header: { text: "수질오염저감" },
}),
oxYnDropdownColumn({
name: "rtlztnUsgYn",
fieldName: "rtlztnUsgYn",
header: { text: "하수재이용용도" },
}),
// 시설 구조
{ name: 'facilityStructure', fieldName: '시설구조(일반지하식,지하터널식,기타)', header: { text: '시설구조(일반지하식,지하터널식,기타)' } },
dropdownColumn(
{
name: "fcltStrctCn",
fieldName: "fcltStrctCn",
header: { text: "시설구조" },
},
SEWAGE_RESERVOIR_FCLT_STRCT_VALUES,
),
// 집수구역면적
{ name: 'catchmentAreaSize', fieldName: '집수구역면적(㎢)', header: { text: '집수구역면적(㎢)' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
{ name: 'wtrStrgZoneArea', fieldName: 'wtrStrgZoneArea', header: { text: '집수구역면적(㎢)' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
// 시설용량
{ name: 'facilityCapacity', fieldName: '시설용량(m³)', header: { text: '시설용량(m³)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'impdFcltCpct', fieldName: 'impdFcltCpct', header: { text: '시설용량(m³)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 펌프시설 > 총양수량
{ name: 'totalPumpingCapacity', fieldName: '총양수량(m³/min)', header: { text: '총양수량(m³/min)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{
name: 'grssPpqty',
fieldName: 'grssPpqty',
header: { text: '총양수량(m³/min)' },
editable: false,
footer: footerDecimal1,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
styleName: 'rg-cell-total',
computed: {
type: 'pumpGrossPpqty' as const,
pumpGroups: [
{
pumpCntField: 'pumpFcltN1PumpCnt',
rsrvPumpCntField: 'pumpFcltN1RsrvPumpCnt',
perPpqtyField: 'pumpFcltN1PerPpqty',
},
{
pumpCntField: 'pumpFcltN2PumpCnt',
rsrvPumpCntField: 'pumpFcltN2RsrvPumpCnt',
perPpqtyField: 'pumpFcltN2PerPpqty',
},
{
pumpCntField: 'pumpFcltN3PumpCnt',
rsrvPumpCntField: 'pumpFcltN3RsrvPumpCnt',
perPpqtyField: 'pumpFcltN3PerPpqty',
},
],
},
},
// 펌프시설 1
{ name: 'pump1Diameter', fieldName: '구경(mm)', header: { text: '구경(mm)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pump1PumpingCapacity', fieldName: '대당 양수량(m³/min·대)', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'pump1Count', fieldName: '펌프대수', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pump1StandbyCount', fieldName: '예비펌프대수', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pumpFcltN1DmtrExpln', fieldName: 'pumpFcltN1DmtrExpln', header: { text: '구경(mm)' } },
{ name: 'pumpFcltN1PerPpqty', fieldName: 'pumpFcltN1PerPpqty', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'pumpFcltN1PumpCnt', fieldName: 'pumpFcltN1PumpCnt', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pumpFcltN1RsrvPumpCnt', fieldName: 'pumpFcltN1RsrvPumpCnt', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 펌프시설 2
{ name: 'pump2Diameter', fieldName: '구경(mm)', header: { text: '구경(mm)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pump2PumpingCapacity', fieldName: '대당 양수량(m³/min·대)', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'pump2Count', fieldName: '펌프대수', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pump2StandbyCount', fieldName: '예비펌프대수', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pumpFcltN2DmtrExpln', fieldName: 'pumpFcltN2DmtrExpln', header: { text: '구경(mm)' } },
{ name: 'pumpFcltN2PerPpqty', fieldName: 'pumpFcltN2PerPpqty', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'pumpFcltN2PumpCnt', fieldName: 'pumpFcltN2PumpCnt', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pumpFcltN2RsrvPumpCnt', fieldName: 'pumpFcltN2RsrvPumpCnt', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 펌프시설 3
{ name: 'pump3Diameter', fieldName: '구경(mm)', header: { text: '구경(mm)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pump3PumpingCapacity', fieldName: '대당 양수량(m³/min·대)', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'pump3Count', fieldName: '펌프대수', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pump3StandbyCount', fieldName: '예비펌프대수', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pumpFcltN3DmtrExpln', fieldName: 'pumpFcltN3DmtrExpln', header: { text: '구경(mm)' } },
{ name: 'pumpFcltN3PerPpqty', fieldName: 'pumpFcltN3PerPpqty', header: { text: '대당 양수량(m³/min·대)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'pumpFcltN3PumpCnt', fieldName: 'pumpFcltN3PumpCnt', header: { text: '펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'pumpFcltN3RsrvPumpCnt', fieldName: 'pumpFcltN3RsrvPumpCnt', header: { text: '예비펌프대수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 부대시설
{ name: 'preprocessingFacility', fieldName: '전처리시설유무(유/무)', header: { text: '전처리시설유무(유/무)' } },
{ name: 'odorRemovalEquipment', fieldName: '탈취설비유무(유/무)', header: { text: '탈취설비유무(유/무)' } },
{ name: 'selfGenerationEquipment', fieldName: '자가발전유무(유/무)', header: { text: '자가발전유무(유/무)' } },
dropdownColumn(
{
name: "prcsgFcltYn",
fieldName: "prcsgFcltYn",
header: { text: "전처리시설유무(유/무)" },
},
SEWAGE_RESERVOIR_YN_VALUES,
),
dropdownColumn(
{
name: "ddrztnEqpmYn",
fieldName: "ddrztnEqpmYn",
header: { text: "탈취설비유무(유/무)" },
},
SEWAGE_RESERVOIR_YN_VALUES,
),
dropdownColumn(
{
name: "oslfEtgtYn",
fieldName: "oslfEtgtYn",
header: { text: "자가발전유무(유/무)" },
},
SEWAGE_RESERVOIR_YN_VALUES,
),
// 배수 방식
{ name: 'drainageMethod', fieldName: '배수방식(자연배수,강제배수)', header: { text: '배수방식(자연배수,강제배수)' } },
dropdownColumn(
{
name: "mltvMthCn",
fieldName: "mltvMthCn",
header: { text: "배수방식(자연배수,강제배수)" },
},
SEWAGE_RESERVOIR_MLTV_MTH_VALUES,
),
// 저류 방식
{ name: 'storageMethod', fieldName: '저류방식(직렬,병렬)', header: { text: '저류방식(직렬,병렬)' } },
dropdownColumn(
{
name: "impdMthCn",
fieldName: "impdMthCn",
header: { text: "저류방식(직렬,병렬)" },
},
SEWAGE_RESERVOIR_IMPD_MTH_VALUES,
),
// 저류수 처리방법
{ name: 'storageWaterTreatmentMethod', fieldName: '저류수처리방법(자체처리,연계처리)', header: { text: '저류수처리방법(자체처리,연계처리)' } },
dropdownColumn(
{
name: "impdPrcsMthdCn",
fieldName: "impdPrcsMthdCn",
header: { text: "저류수처리방법(자체처리,연계처리)" },
},
SEWAGE_RESERVOIR_IMPD_PRCS_MTHD_VALUES,
),
// 방류 수역
{ name: 'dischargeDestination', fieldName: '방류수역(또는 연계처리장명)', header: { text: '방류수역(또는 연계처리장명)' } },
{ name: 'dschgWtrsExpln', fieldName: 'dschgWtrsExpln', header: { text: '방류수역(또는 연계처리장명)' } },
// 최종처분량
{ name: 'sedimentDisposalAmount', fieldName: '침사', header: { text: '침사' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'debrisDisposalAmount', fieldName: '협잡물', header: { text: '협잡물' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'prcptnLastDspsQnt', fieldName: 'prcptnLastDspsQnt', header: { text: '침사' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'ctmnLastDspsQnt', fieldName: 'ctmnLastDspsQnt', header: { text: '협잡물' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 최종처분방법
{ name: 'sedimentDisposalMethod', fieldName: '침사', header: { text: '침사' } },
{ name: 'debrisDisposalMethod', fieldName: '협잡물', header: { text: '협잡물' } },
{ name: 'prcptnLastDspsMthdExpln', fieldName: 'prcptnLastDspsMthdExpln', header: { text: '침사' } },
{ name: 'ctmnLastDspsMthdExpln', fieldName: 'ctmnLastDspsMthdExpln', header: { text: '협잡물' } },
// 운영실적
{ name: 'operationDaysPerYear', fieldName: '가동일수(일/년)', header: { text: '가동일수(일/년)' }, valueType: ValueType.NUMBER }, // 3자리 수만 입력 가능
{ name: 'totalDischargePerYear', fieldName: '총배수량(m³/년)', header: { text: '총배수량(m³/년)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'oprtngDayCnt', fieldName: 'oprtngDayCnt', header: { text: '가동일수(일/년)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0' }, // 3자리 수만 입력 가능
{ name: 'grssMltvQnt', fieldName: 'grssMltvQnt', header: { text: '총배수량(m³/년)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
// 비고
{ name: 'remarks', fieldName: '비고', header: { text: '비고' } },
{ name: 'rmrk', fieldName: 'rmrk', header: { text: '비고' } },
// Hidden Columns : 시스템 관리를 위한 값
{ name: 'admdstCd', fieldName: 'admdstCd', header: { text: '행정구역코드' }, visible: false, },
{ name: 'fcltSn', fieldName: 'fcltSn', header: { text: '시설일련번호' }, visible: false, },
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, visible: false },
],
columnLayout: [
@@ -94,42 +237,45 @@ export const SewageReservoirInpColumn = {
name: 'adminArea',
hideChildHeaders: false,
header: { text: '행정구역' },
items: ['sido', 'gugun'],
items: [
{ column: 'ctpvNm', footerUserSpans: [{ colspan: 3 }] },
'sggNm',
],
},
'swgeStrgeNm',
'addr',
'rnDt',
'designFrequency',
'fcltNm',
'fcltPstnCn',
'oprtngStrtYmd',
'planDesignFreqCnt',
{
name: 'installationPurpose',
hideChildHeaders: false,
header: { text: '설치목적(O,X로 표기, 중복체크가능)' },
items: [
'floodingPrevention',
'waterQualityReduction',
'sewerageReuseUse',
'fldngPrvtnYn',
'wqPlltnMtgtYn',
'rtlztnUsgYn',
],
},
'facilityStructure',
'catchmentAreaSize',
'facilityCapacity',
'fcltStrctCn',
'wtrStrgZoneArea',
'impdFcltCpct',
{
name: 'pumpSystem',
hideChildHeaders: false,
header: { text: '펌프시설' },
items: [
'totalPumpingCapacity',
'grssPpqty',
{
name: 'pumpSystem1',
hideChildHeaders: false,
header: { text: '펌프시설1' },
items: [
'pump1Diameter',
'pump1PumpingCapacity',
'pump1Count',
'pump1StandbyCount',
'pumpFcltN1DmtrExpln',
'pumpFcltN1PerPpqty',
'pumpFcltN1PumpCnt',
'pumpFcltN1RsrvPumpCnt',
],
},
@@ -138,10 +284,10 @@ export const SewageReservoirInpColumn = {
hideChildHeaders: false,
header: { text: '펌프시설2' },
items: [
'pump2Diameter',
'pump2PumpingCapacity',
'pump2Count',
'pump2StandbyCount',
'pumpFcltN2DmtrExpln',
'pumpFcltN2PerPpqty',
'pumpFcltN2PumpCnt',
'pumpFcltN2RsrvPumpCnt',
],
},
@@ -150,10 +296,10 @@ export const SewageReservoirInpColumn = {
hideChildHeaders: false,
header: { text: '펌프시설3' },
items: [
'pump3Diameter',
'pump3PumpingCapacity',
'pump3Count',
'pump3StandbyCount',
'pumpFcltN3DmtrExpln',
'pumpFcltN3PerPpqty',
'pumpFcltN3PumpCnt',
'pumpFcltN3RsrvPumpCnt',
],
},
],
@@ -164,23 +310,23 @@ export const SewageReservoirInpColumn = {
hideChildHeaders: false,
header: { text: '부대시설' },
items: [
'preprocessingFacility',
'odorRemovalEquipment',
'selfGenerationEquipment',
'prcsgFcltYn',
'ddrztnEqpmYn',
'oslfEtgtYn',
],
},
'drainageMethod',
'storageMethod',
'storageWaterTreatmentMethod',
'dischargeDestination',
'mltvMthCn',
'impdMthCn',
'impdPrcsMthdCn',
'dschgWtrsExpln',
{
name: 'finalDisposalAmount',
hideChildHeaders: false,
header: { text: '최종처분량(ton/년)' },
items: [
'sedimentDisposalAmount',
'debrisDisposalAmount',
'prcptnLastDspsQnt',
'ctmnLastDspsQnt',
],
},
@@ -189,8 +335,8 @@ export const SewageReservoirInpColumn = {
hideChildHeaders: false,
header: { text: '최종처분방법' },
items: [
'sedimentDisposalMethod',
'debrisDisposalMethod',
'prcptnLastDspsMthdExpln',
'ctmnLastDspsMthdExpln',
],
},
@@ -199,15 +345,18 @@ export const SewageReservoirInpColumn = {
hideChildHeaders: false,
header: { text: '운영실적' },
items: [
'operationDaysPerYear',
'totalDischargePerYear',
'oprtngDayCnt',
'grssMltvQnt',
],
},
'remarks',
'rmrk',
'admdstCd',
'fcltSn',
'admdstNm'
],
rowStartNum: 3,
fixedColumns: 2,
tabKey: 'sewageReservoirInp',
tabKey: 'ST00040001',
tabLabel: '하수저류시설',
};
@@ -5,46 +5,72 @@ import { ValueType } from "realgrid";
export const CauserBurdenInpColumn = {
columns: [
// 행정구역
{ name: 'SIDO', fieldName: '시도', header: { text: '시도' }, editable: false },
{ name: 'GUGUN', fieldName: '시군구', header: { text: '시군구' }, editable: false, footer: { text: '합계' } },
{ name: 'ctpvNm', fieldName: 'ctpvNm', header: { text: '시도' }, footer: { text: '합계' }, editable: false },
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' } },
// 부과액
{ name: 'LEVY_CO', fieldName: '건수', header: { text: '건수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'LEVY_AMOUNT', fieldName: '금액(백만원)', header: { text: '금액(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'levyEvntcsCnt', fieldName: 'levyEvntcsCnt', header: { text: '건수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'levyAmt', fieldName: 'levyAmt', header: { text: '금액(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 대상별 징수현황 > 계
{ name: 'TRGET_LEV_STTUS_CO', fieldName: '건수', header: { text: '건수' }, editable: false, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'TRGET_LEV_STTUS_AMOUNT', fieldName: '금액(백만원)', header: { text: '금액(백만원)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{
name: 'trgtByWholClctnEvntcsCnt',
fieldName: 'trgtByWholClctnEvntcsCnt',
header: { text: '건수' },
editable: false,
footer: footerInt,
styleName: 'rg-cell-total',
valueType: ValueType.NUMBER,
dataFormat: '#,##0',
computed: {
fields: ['mltvEqpmEvntcsCnt', 'othrCstrnOthrActrCnt'],
type: 'sum' as const,
},
},
{
name: 'trgtByWholClctnAmt',
fieldName: 'trgtByWholClctnAmt',
header: { text: '금액(백만원)' },
editable: false,
footer: footerDecimal1,
styleName: 'rg-cell-total',
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
computed: {
fields: ['mltvEqpmAmt', 'othrCstrnOthrActrAmt'],
type: 'sum' as const,
},
},
// 대상별 징수현황 > 배수설비설치자
{ name: 'DRNG_EQP_CO', fieldName: '건수', header: { text: '건수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'DRNG_EQP_AMOUNT', fieldName: '금액(백만원)', header: { text: '금액(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'mltvEqpmEvntcsCnt', fieldName: 'mltvEqpmEvntcsCnt', header: { text: '건수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'mltvEqpmAmt', fieldName: 'mltvEqpmAmt', header: { text: '금액(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 대상별 징수현황 > 타공사·타행위자
{ name: 'CNTRWK_CO', fieldName: '건수', header: { text: '건수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'CNTRWK_AMOUNT', fieldName: '금액(백만원)', header: { text: '금액(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'othrCstrnOthrActrCnt', fieldName: 'othrCstrnOthrActrCnt', header: { text: '건수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'othrCstrnOthrActrAmt', fieldName: 'othrCstrnOthrActrAmt', header: { text: '금액(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 비고
{ name: 'RMK', fieldName: '비고', header: { text: '비고' } },
{ name: 'rmrk', fieldName: 'rmrk', header: { text: '비고' } },
// hidden
{ name: 'CHCKER_OPINION', fieldName: '검토자의견', header: { text: '검토자의견' } },
{ name: 'WRTER_OPINION', fieldName: '사용자의견', header: { text: '사용자의견' } },
// 참조 필드
{ name: 'AMNTBRNCSR', fieldName: 'AMNTBRNCSR', header: { text: 'AMNTBRNCSR' } },
{ name: 'admdstCd', fieldName: 'admdstCd', header: { text: '행정구역코드' }, visible: false, },
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, visible: false },
],
columnLayout: [
{
name: 'group_admin',
header: { text: '행정구역' },
items: ['SIDO', 'GUGUN']
items: [
{ column: 'ctpvNm', footerUserSpans: [{ colspan: 2 }] },
'sggNm',
],
},
{
name: 'group_assess',
header: { text: '부과액' },
items: ['LEVY_CO', 'LEVY_AMOUNT']
items: ['levyEvntcsCnt', 'levyAmt']
},
{
name: 'group_collection',
@@ -53,25 +79,27 @@ export const CauserBurdenInpColumn = {
{
name: 'coll_group_total',
header: { text: '계' },
items: ['TRGET_LEV_STTUS_CO', 'TRGET_LEV_STTUS_AMOUNT']
items: ['trgtByWholClctnEvntcsCnt', 'trgtByWholClctnAmt']
},
{
name: 'coll_group_inst',
header: { text: '배수설비설치자(하수도법 제61조 제1항)' },
items: ['DRNG_EQP_CO', 'DRNG_EQP_AMOUNT']
items: ['mltvEqpmEvntcsCnt', 'mltvEqpmAmt']
},
{
name: 'coll_group_otr',
header: { text: '타공사·타행위자(하수도법 제61조 제2항)' },
items: ['CNTRWK_CO', 'CNTRWK_AMOUNT']
items: ['othrCstrnOthrActrCnt', 'othrCstrnOthrActrAmt']
}
]
},
'RMK'
'rmrk',
'admdstCd',
'admdstNm'
],
rowStartNum: 3,
fixedColumns: 1,
tabKey: 'causerBurdenInp',
tabKey: 'ST00090004',
tabLabel: '원인자 부담금'
};
@@ -5,45 +5,86 @@ import { ValueType } from "realgrid";
export const SewerageChargeInpColumn = {
columns: [
// 행정구역
{ name: 'SIDO', fieldName: '시도', header: { text: '시도' }, editable: false },
{ name: 'GUGUN', fieldName: '시군구', header: { text: '시군구' }, editable: false, footer: { text: '합계' } },
{ name: 'ctpvNm', fieldName: 'ctpvNm', header: { text: '시도' }, footer: { text: '합계' }, editable: false },
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' } },
// 요금
{ name: 'FYER_LEVY_QY', fieldName: '연간조정량(m³)(A)', header: { text: '연간조정량(m³)(A)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'LEVY_AMOUNT', fieldName: '하수도사용료수익(원)(B)', header: { text: '하수도사용료수익(원)(B)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'AVRG_UNTPC', fieldName: 'm³당요금(원/m³) C=(B/A)', header: { text: 'm³당요금(원/m³) C=(B/A)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'anlLevyQnt', fieldName: 'anlLevyQnt', header: { text: '연간조정량(m³)(A)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'levyAmt', fieldName: 'levyAmt', header: { text: '하수도사용료수익(원)(B)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{
name: 'avgUntprcAmt',
fieldName: 'avgUntprcAmt',
header: { text: 'm³당요금(원/m³) C=(B/A)' },
editable: false,
footer: footerDecimal1,
styleName: 'rg-cell-total',
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
computed: {
fields: ['levyAmt', 'anlLevyQnt'],
type: 'quotient' as const,
},
},
{ name: 'SMRIZE_PRMPC', fieldName: '총괄원가(원)(D)', header: { text: '총괄원가(원)(D)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'SMRIZE_UNIT_PRMPC', fieldName: 'm³당원가(원/m³) E=(D/A)', header: { text: 'm³당원가(원/m³) E=(D/A)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'RLTY_RT', fieldName: '요금현실화율(%) F=(C/E*100)', header: { text: '요금현실화율(%) F=(C/E*100)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'grssPrmcoAmt', fieldName: 'grssPrmcoAmt', header: { text: '총괄원가(원)(D)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{
name: 'grssUnitPrmcoAmt',
fieldName: 'grssUnitPrmcoAmt',
header: { text: 'm³당원가(원/m³) E=(D/A)' },
editable: false,
footer: footerDecimal1,
styleName: 'rg-cell-total',
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
computed: {
fields: ['grssPrmcoAmt', 'anlLevyQnt'],
type: 'quotient' as const,
},
},
{
name: 'rlztnRt',
fieldName: 'rlztnRt',
header: { text: '요금현실화율(%) F=(C/E*100)' },
editable: false,
footer: footerDecimal1,
styleName: 'rg-cell-total',
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
computed: {
numeratorQuotient: ['levyAmt', 'anlLevyQnt'] as [string, string],
denominatorQuotient: ['grssPrmcoAmt', 'anlLevyQnt'] as [string, string],
type: 'quotientRatioPercent' as const,
},
},
// 비고
{ name: 'RMK', fieldName: '비고', header: { text: '비고' } },
{ name: 'rmrk', fieldName: '비고', header: { text: '비고' } },
// hidden
{ name: 'CHCKER_OPINION', fieldName: '검토자의견', header: { text: '검토자의견' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'WRTER_OPINION', fieldName: '사용자의견', header: { text: '사용자의견' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 참조 필드
{ name: 'SEWER_RNTFEE', fieldName: 'SEWER_RNTFEE', header: { text: 'SEWER_RNTFEE' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'C_LEVY_AMOUNT', fieldName: 'C_LEVY_AMOUNT', header: { text: 'C_LEVY_AMOUNT' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'admdstCd', fieldName: 'admdstCd', header: { text: '행정구역코드' }, visible: false, },
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, visible: false },
],
columnLayout: [
{
name: 'group_admin',
header: { text: '행정구역' },
items: ['SIDO', 'GUGUN']
items: [
{ column: 'ctpvNm', footerUserSpans: [{ colspan: 2 }] },
'sggNm',
],
},
'FYER_LEVY_QY',
'LEVY_AMOUNT',
'AVRG_UNTPC',
'SMRIZE_PRMPC',
'SMRIZE_UNIT_PRMPC',
'RLTY_RT',
'RMK'
'anlLevyQnt',
'levyAmt',
'avgUntprcAmt',
'grssPrmcoAmt',
'grssUnitPrmcoAmt',
'rlztnRt',
'rmrk',
'admdstCd',
'admdstNm'
],
rowStartNum: 2,
fixedColumns: 1,
tabKey: 'sewerageChargeInp',
tabKey: 'ST00090002',
tabLabel: '하수도 요금'
};
@@ -5,146 +5,238 @@ import { ValueType } from "realgrid";
export const SewerageFinanceSettleInpColumn = {
columns: [
// 행정구역
{ name: 'SIDO', fieldName: '시도', header: { text: '시도' }, editable: false },
{ name: 'GUGUN', fieldName: '시군구', header: { text: '시군구' }, editable: false, footer: { text: '합계' } },
{ name: 'ctpvNm', fieldName: 'ctpvNm', header: { text: '시도' }, footer: { text: '합계' }, editable: false },
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' } },
// 재정별 사업비
{ name: 'FNANC_WCT_SM', fieldName: '계', header: { text: '계' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'NTNXPN', fieldName: '중앙정부지원액', header: { text: '중앙정부지원액' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{
name: 'fnnByWholPjtcoAmt',
fieldName: 'fnnByWholPjtcoAmt',
header: { text: '계' },
editable: false,
footer: footerDecimal1,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
styleName: 'rg-cell-total',
computed: {
fields: [
'cnterGovSprtAmt',
'mctpvLcexpAmt',
'wareaSggLclAmt',
'sewerUseAmt',
'orgprBrdnAmt',
'etcIncmAmt',
'crfwAmt',
],
type: 'sum' as const,
},
},
{ name: 'cnterGovSprtAmt', fieldName: 'cnterGovSprtAmt', header: { text: '중앙정부지원액' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 재정별 사업비 > 지방비
{ name: 'LCLEXPNS', fieldName: '특·광역시, 도', header: { text: '특·광역시, 도' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'LCLTY_CT', fieldName: '시,군,구 지자체', header: { text: '시,군,구 지자체' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'mctpvLcexpAmt', fieldName: 'mctpvLcexpAmt', header: { text: '특·광역시, 도' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'wareaSggLclAmt', fieldName: 'wareaSggLclAmt', header: { text: '시,군,구 지자체' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 재정별 사업비
{ name: 'SEWER_RNTFEE', fieldName: '하수도사용료', header: { text: '하수도사용료' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'AMNTBRNCSR', fieldName: '원인자부담금', header: { text: '원인자부담금' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'ETC_INCME', fieldName: '기타잡수입', header: { text: '기타잡수입' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'CYFD_AMOUNT', fieldName: '이월액', header: { text: '이월액' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'sewerUseAmt', fieldName: 'sewerUseAmt', header: { text: '하수도사용료' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'orgprBrdnAmt', fieldName: 'orgprBrdnAmt', header: { text: '원인자부담금' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'etcIncmAmt', fieldName: 'etcIncmAmt', header: { text: '기타잡수입' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'crfwAmt', fieldName: 'crfwAmt', header: { text: '이월액' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 부채액
{ name: 'DEBT_AMOUNT', fieldName: '부채액(백만원)', header: { text: '부채액(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'lbltAmt', fieldName: 'lbltAmt', header: { text: '부채액(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 용도별사업비 > 계
{ name: 'PRPOS_WCT_SM', fieldName: '계', header: { text: '계' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{
name: 'usgByWholPjtcoAmt',
fieldName: 'usgByWholPjtcoAmt',
header: { text: '계' },
editable: false,
footer: footerDecimal1,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
styleName: 'rg-cell-total',
},
// 용도별사업비 > 처리장
{ name: 'PRCPLT_SM', fieldName: '소계', header: { text: '소계' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'PRCPLT_FCLTY', fieldName: '시설비', header: { text: '시설비' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'PRCPLT_RPAIR', fieldName: '개보수비', header: { text: '개보수비' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'PRCPLT_ORPNS', fieldName: '운영유지비', header: { text: '운영유지비' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'PRCPLT_ETC', fieldName: '기타', header: { text: '기타' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{
name: 'tmplntWholAmt',
fieldName: 'tmplntWholAmt',
header: { text: '소계' },
editable: false,
footer: footerDecimal1,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
styleName: 'rg-cell-total',
computed: {
fields: ['tmplntFcltAmt', 'tmplntMendngAmt', 'tmplntOperKeepAmt', 'tmplntEtcAmt'],
type: 'sum' as const,
},
},
{ name: 'tmplntFcltAmt', fieldName: 'tmplntFcltAmt', header: { text: '시설비' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'tmplntMendngAmt', fieldName: 'tmplntMendngAmt', header: { text: '개보수비' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'tmplntOperKeepAmt', fieldName: 'tmplntOperKeepAmt', header: { text: '운영유지비' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'tmplntEtcAmt', fieldName: 'tmplntEtcAmt', header: { text: '기타' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 용도별사업비 > 하수관로
{ name: 'SEWAGE_SM', fieldName: '소계', header: { text: '소계' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'SEWAGE_FCLTY', fieldName: '시설비', header: { text: '시설비' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'SEWAGE_RPAIR', fieldName: '개보수비', header: { text: '개보수비' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'SEWAGE_ORPNS', fieldName: '운영유지비', header: { text: '운영유지비' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'SEWAGE_ETC', fieldName: '기타', header: { text: '기타' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{
name: 'wholSwagePplAmt',
fieldName: 'wholSwagePplAmt',
header: { text: '소계' },
editable: false,
footer: footerDecimal1,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
styleName: 'rg-cell-total',
computed: {
fields: [
'swagePplFcltAmt',
'swagePplMendngAmt',
'swagePplOperKeepAmt',
'swagePplEtcAmt',
],
type: 'sum' as const,
},
},
{ name: 'swagePplFcltAmt', fieldName: 'swagePplFcltAmt', header: { text: '시설비' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'swagePplMendngAmt', fieldName: 'swagePplMendngAmt', header: { text: '개보수비' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'swagePplOperKeepAmt', fieldName: 'swagePplOperKeepAmt', header: { text: '운영유지비' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'swagePplEtcAmt', fieldName: 'swagePplEtcAmt', header: { text: '기타' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 용도별사업비 > 하수저류시설
{ name: 'SWGE_STRGE_SM', fieldName: '소계', header: { text: '소계' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'SWGE_STRGE_FCLTY', fieldName: '시설비', header: { text: '시설비' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'SWGE_STRGE_RPAIR', fieldName: '개보수비', header: { text: '개보수비' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'SWGE_STRGE_ORPNS', fieldName: '운영유지비', header: { text: '운영유지비' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'SWGE_STRGE_ETC', fieldName: '기타', header: { text: '기타' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{
name: 'wholSwageImpdFcltAmt',
fieldName: 'wholSwageImpdFcltAmt',
header: { text: '소계' },
editable: false,
footer: footerDecimal1,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
styleName: 'rg-cell-total',
computed: {
fields: [
'swageImpdFcltAmt',
'swageImpdMendngAmt',
'swageImpdOperKeepAmt',
'swageImpdFcltEtcAmt',
],
type: 'sum' as const,
},
},
{ name: 'swageImpdFcltAmt', fieldName: 'swageImpdFcltAmt', header: { text: '시설비' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'swageImpdMendngAmt', fieldName: 'swageImpdMendngAmt', header: { text: '개보수비' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'swageImpdOperKeepAmt', fieldName: 'swageImpdOperKeepAmt', header: { text: '운영유지비' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'swageImpdFcltEtcAmt', fieldName: 'swageImpdFcltEtcAmt', header: { text: '기타' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 용도별사업비 > 기타
{ name: 'ETC_SM', fieldName: '소계', header: { text: '소계' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'ACDNT_CYFD_AMOUNT', fieldName: '사고이월액', header: { text: '사고이월액' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'UNRCIV_AMOUNT', fieldName: '미수납액', header: { text: '미수납액' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'ETC_AMOUNT', fieldName: '기타', header: { text: '기타' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{
name: 'etcWholAmt',
fieldName: 'etcWholAmt',
header: { text: '소계' },
editable: false,
footer: footerDecimal1,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
styleName: 'rg-cell-total',
computed: {
fields: ['etcAcdntCrfwAmt', 'etcNrcpAmt', 'etcAmt'],
type: 'sum' as const,
},
},
{ name: 'etcAcdntCrfwAmt', fieldName: 'etcAcdntCrfwAmt', header: { text: '사고이월액' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'etcNrcpAmt', fieldName: 'etcNrcpAmt', header: { text: '미수납액' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'etcAmt', fieldName: 'etcAmt', header: { text: '기타' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 비고
{ name: 'RMK', fieldName: '비고', header: { text: '비고' } },
{ name: 'rmrk', fieldName: 'rmrk', header: { text: '비고' } },
// hidden
{ name: 'CHCKER_OPINION', fieldName: '검토자의견', header: { text: '검토자의견' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'WRTER_OPINION', fieldName: '사용자의견', header: { text: '사용자의견' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 참조 필드
{ name: 'B_LEVY_AMOUNT', fieldName: 'B_LEVY_AMOUNT', header: { text: 'B_LEVY_AMOUNT' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'C_LEVY_AMOUNT', fieldName: 'C_LEVY_AMOUNT', header: { text: 'C_LEVY_AMOUNT' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'D_LEVY_AMOUNT', fieldName: 'D_LEVY_AMOUNT', header: { text: 'D_LEVY_AMOUNT' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'admdstCd', fieldName: 'admdstCd', header: { text: '행정구역코드' }, visible: false, },
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, visible: false },
],
columnLayout: [
{
name: 'group_admin',
header: { text: '행정구역' },
items: ['SIDO', 'GUGUN']
items: [
{ column: 'ctpvNm', footerUserSpans: [{ colspan: 2 }] },
'sggNm',
],
},
{
name: 'group_finance',
header: { text: '재정별 사업비(백만원)' },
items: [
'FNANC_WCT_SM',
'NTNXPN',
'fnnByWholPjtcoAmt',
'cnterGovSprtAmt',
{
name: 'group_local_finance',
header: { text: '지방비' },
items: ['LCLEXPNS', 'LCLTY_CT']
items: ['mctpvLcexpAmt', 'wareaSggLclAmt']
},
'SEWER_RNTFEE',
'AMNTBRNCSR',
'ETC_INCME',
'CYFD_AMOUNT'
'sewerUseAmt',
'orgprBrdnAmt',
'etcIncmAmt',
'crfwAmt'
]
},
'DEBT_AMOUNT',
'lbltAmt',
{
name: 'group_purpose',
header: { text: '용도별사업비(백만원)' },
items: [
'PRPOS_WCT_SM',
'usgByWholPjtcoAmt',
{
name: 'group_treatment',
header: { text: '처리장' },
items: [
'PRCPLT_SM',
'PRCPLT_FCLTY',
'PRCPLT_RPAIR',
'PRCPLT_ORPNS',
'PRCPLT_ETC'
'tmplntWholAmt',
'tmplntFcltAmt',
'tmplntMendngAmt',
'tmplntOperKeepAmt',
'tmplntEtcAmt'
]
},
{
name: 'group_pipe',
header: { text: '하수관로' },
items: [
'SEWAGE_SM',
'SEWAGE_FCLTY',
'SEWAGE_RPAIR',
'SEWAGE_ORPNS',
'SEWAGE_ETC'
'wholSwagePplAmt',
'swagePplFcltAmt',
'swagePplMendngAmt',
'swagePplOperKeepAmt',
'swagePplEtcAmt'
]
},
{
name: 'group_storage',
header: { text: '하수저류시설' },
items: [
'SWGE_STRGE_SM',
'SWGE_STRGE_FCLTY',
'SWGE_STRGE_RPAIR',
'SWGE_STRGE_ORPNS',
'SWGE_STRGE_ETC'
'wholSwageImpdFcltAmt',
'swageImpdFcltAmt',
'swageImpdMendngAmt',
'swageImpdOperKeepAmt',
'swageImpdFcltEtcAmt'
]
},
{
name: 'group_etc_purpose',
header: { text: '기타' },
items: [
'ETC_SM',
'ACDNT_CYFD_AMOUNT',
'UNRCIV_AMOUNT',
'ETC_AMOUNT'
'etcWholAmt',
'etcAcdntCrfwAmt',
'etcNrcpAmt',
'etcAmt'
]
}
]
},
'RMK'
'rmrk',
'admdstCd',
'admdstNm'
],
rowStartNum: 3,
fixedColumns: 1,
tabKey: 'sewerageFinanceSettleInp',
tabKey: 'ST00090001',
tabLabel: '하수도재정 결산'
};
@@ -5,67 +5,108 @@ import { ValueType } from "realgrid";
export const SewerageUsageFeeInpColumn = {
columns: [
// 행정구역
{ name: 'SIDO', fieldName: '시도', header: { text: '시도' }, editable: false },
{ name: 'GUGUN', fieldName: '시군구', header: { text: '시군구' }, editable: false, footer: { text: '합계' } },
{ name: 'ctpvNm', fieldName: 'ctpvNm', header: { text: '시도' }, footer: { text: '합계' }, editable: false },
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' } },
// 총계 > 부과액
{ name: 'LEVY_AMOUNT', fieldName: '(백만원)', header: { text: '(백만원)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{
name: 'levyAmt',
fieldName: 'levyAmt',
header: { text: '(백만원)' },
editable: false,
footer: footerDecimal1,
styleName: 'rg-cell-total',
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
computed: {
fields: [
'hshusLevyAmt',
'taskFrLevyAmt',
'fbuLevyAmt',
'bthhsFrSpcs1LevyAmt',
'bthhsFrSpcs2LevyAmt',
'induLevyAmt',
'etcLevyAmt',
],
type: 'sum' as const,
},
},
// 총계 > 부과량
{ name: 'LEVY_QY', fieldName: '(천톤)', header: { text: '(천톤)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{
name: 'levyQnt',
fieldName: 'levyQnt',
header: { text: '(천톤)' },
editable: false,
footer: footerDecimal1,
styleName: 'rg-cell-total',
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
computed: {
fields: [
'hshusLevyQnt',
'taskFrLevyQnt',
'fbuLevyQnt',
'bthhsFrSpcs1LevyQnt',
'bthhsFrSpcs2LevyQnt',
'induLevyQnt',
'etcLevyQnt',
],
type: 'sum' as const,
},
},
// 가정용
{ name: 'HOME_LEVY_AMOUNT', fieldName: '(백만원)', header: { text: '(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'HOME_LEVY_QY', fieldName: '(천톤)', header: { text: '(천톤)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'HOME_UNTPC', fieldName: '(원/톤)', header: { text: '(원/톤)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'hshusLevyAmt', fieldName: 'hshusLevyAmt', header: { text: '(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'hshusLevyQnt', fieldName: 'hshusLevyQnt', header: { text: '(천톤)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'hshusUntprcAmt', fieldName: 'hshusUntprcAmt', header: { text: '(원/톤)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 업무용
{ name: 'JOB_LEVY_AMOUNT', fieldName: '(백만원)', header: { text: '(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'JOB_LEVY_QY', fieldName: '(천톤)', header: { text: '(천톤)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'JOB_UNTPC', fieldName: '(원/톤)', header: { text: '(원/톤)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'taskFrLevyAmt', fieldName: 'taskFrLevyAmt', header: { text: '(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'taskFrLevyQnt', fieldName: 'taskFrLevyQnt', header: { text: '(천톤)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'taskFrUntprcAmt', fieldName: 'taskFrUntprcAmt', header: { text: '(원/톤)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 영업용(일반용)
{ name: 'BSN_LEVY_AMOUNT', fieldName: '(백만원)', header: { text: '(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'BSN_LEVY_QY', fieldName: '(천톤)', header: { text: '(천톤)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'BSN_UNTPC', fieldName: '(원/톤)', header: { text: '(원/톤)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'fbuLevyAmt', fieldName: 'fbuLevyAmt', header: { text: '(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'fbuLevyQnt', fieldName: 'fbuLevyQnt', header: { text: '(천톤)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'fbuUntprcAmt', fieldName: 'fbuUntprcAmt', header: { text: '(원/톤)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 욕탕1종(대중탕용)
{ name: 'BATHS1_LEVY_AMOUNT', fieldName: '(백만원)', header: { text: '(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'BATHS1_LEVY_QY', fieldName: '(천톤)', header: { text: '(천톤)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'BATHS1_UNTPC', fieldName: '(원/톤)', header: { text: '(원/톤)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'bthhsFrSpcs1LevyAmt', fieldName: 'bthhsFrSpcs1LevyAmt', header: { text: '(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'bthhsFrSpcs1LevyQnt', fieldName: 'bthhsFrSpcs1LevyQnt', header: { text: '(천톤)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'bthhsFrSpcs1UntprcAmt', fieldName: 'bthhsFrSpcs1UntprcAmt', header: { text: '(원/톤)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 욕탕2종
{ name: 'PBBATH_LEVY_AMOUNT', fieldName: '(백만원)', header: { text: '(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'PBBATH_LEVY_QY', fieldName: '(천톤)', header: { text: '(천톤)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'PBBATH_UNTPC', fieldName: '(원/톤)', header: { text: '(원/톤)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'bthhsFrSpcs2LevyAmt', fieldName: 'bthhsFrSpcs2LevyAmt', header: { text: '(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'bthhsFrSpcs2LevyQnt', fieldName: 'bthhsFrSpcs2LevyQnt', header: { text: '(천톤)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'bthhsFrSpcs2UntprcAmt', fieldName: 'bthhsFrSpcs2UntprcAmt', header: { text: '(원/톤)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 산업 및 공업용
{ name: 'INDUST_LEVY_AMOUNT', fieldName: '(백만원)', header: { text: '(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'INDUST_LEVY_QY', fieldName: '(천톤)', header: { text: '(천톤)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'INDUST_UNTPC', fieldName: '(원/톤)', header: { text: '(원/톤)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'induLevyAmt', fieldName: 'induLevyAmt', header: { text: '(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'induLevyQnt', fieldName: 'induLevyQnt', header: { text: '(천톤)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'induUntprcAmt', fieldName: 'induUntprcAmt', header: { text: '(원/톤)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 기타
{ name: 'ETC_LEVY_AMOUNT', fieldName: '(백만원)', header: { text: '(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'ETC_LEVY_QY', fieldName: '(천톤)', header: { text: '(천톤)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'ETC_UNTPC', fieldName: '(원/톤)', header: { text: '(원/톤)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'etcLevyAmt', fieldName: 'etcLevyAmt', header: { text: '(백만원)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'etcLevyQnt', fieldName: 'etcLevyQnt', header: { text: '(천톤)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'etcLevyUntprcAmt', fieldName: 'etcLevyUntprcAmt', header: { text: '(원/톤)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
// 비고
{ name: 'RMK', fieldName: '비고', header: { text: '비고' } },
{ name: 'rmrk', fieldName: 'rmrk', header: { text: '비고' } },
// hidden
{ name: 'CHCKER_OPINION', fieldName: '검토자의견', header: { text: '검토자의견' } },
{ name: 'WRTER_OPINION', fieldName: '사용자의견', header: { text: '사용자의견' } },
// 참조 필드
{ name: 'SEWER_RNTFEE', fieldName: 'SEWER_RNTFEE', header: { text: 'SEWER_RNTFEE' } },
{ name: 'B_LEVY_AMOUNT', fieldName: 'B_LEVY_AMOUNT', header: { text: 'B_LEVY_AMOUNT' } },
{ name: 'admdstCd', fieldName: 'admdstCd', header: { text: '행정구역코드' }, visible: false, },
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, visible: false },
],
columnLayout: [
{
name: 'group_admin',
header: { text: '행정구역' },
items: ['SIDO', 'GUGUN']
items: [
{ column: 'ctpvNm', footerUserSpans: [{ colspan: 2 }] },
'sggNm',
],
},
{
name: 'group_total',
@@ -74,12 +115,12 @@ export const SewerageUsageFeeInpColumn = {
{
name: 'total_amount',
header: { text: '부과액' },
items: ['LEVY_AMOUNT']
items: ['levyAmt']
},
{
name: 'total_qty',
header: { text: '부과량' },
items: ['LEVY_QY']
items: ['levyQnt']
}
]
},
@@ -90,17 +131,17 @@ export const SewerageUsageFeeInpColumn = {
{
name: 'home_amount',
header: { text: '부과액' },
items: ['HOME_LEVY_AMOUNT']
items: ['hshusLevyAmt']
},
{
name: 'home_qty',
header: { text: '부과량' },
items: ['HOME_LEVY_QY']
items: ['hshusLevyQnt']
},
{
name: 'home_price',
header: { text: '단가' },
items: ['HOME_UNTPC']
items: ['hshusUntprcAmt']
}
]
},
@@ -111,17 +152,17 @@ export const SewerageUsageFeeInpColumn = {
{
name: 'job_amount',
header: { text: '부과액' },
items: ['JOB_LEVY_AMOUNT']
items: ['taskFrLevyAmt']
},
{
name: 'job_qty',
header: { text: '부과량' },
items: ['JOB_LEVY_QY']
items: ['taskFrLevyQnt']
},
{
name: 'job_price',
header: { text: '단가' },
items: ['JOB_UNTPC']
items: ['taskFrUntprcAmt']
}
]
},
@@ -132,17 +173,17 @@ export const SewerageUsageFeeInpColumn = {
{
name: 'bsn_amount',
header: { text: '부과액' },
items: ['BSN_LEVY_AMOUNT']
items: ['fbuLevyAmt']
},
{
name: 'bsn_qty',
header: { text: '부과량' },
items: ['BSN_LEVY_QY']
items: ['fbuLevyQnt']
},
{
name: 'bsn_price',
header: { text: '단가' },
items: ['BSN_UNTPC']
items: ['fbuUntprcAmt']
}
]
},
@@ -153,17 +194,17 @@ export const SewerageUsageFeeInpColumn = {
{
name: 'baths1_amount',
header: { text: '부과액' },
items: ['BATHS1_LEVY_AMOUNT']
items: ['bthhsFrSpcs1LevyAmt']
},
{
name: 'baths1_qty',
header: { text: '부과량' },
items: ['BATHS1_LEVY_QY']
items: ['bthhsFrSpcs1LevyQnt']
},
{
name: 'baths1_price',
header: { text: '단가' },
items: ['BATHS1_UNTPC']
items: ['bthhsFrSpcs1UntprcAmt']
}
]
},
@@ -174,17 +215,17 @@ export const SewerageUsageFeeInpColumn = {
{
name: 'pbbath_amount',
header: { text: '부과액' },
items: ['PBBATH_LEVY_AMOUNT']
items: ['bthhsFrSpcs2LevyAmt']
},
{
name: 'pbbath_qty',
header: { text: '부과량' },
items: ['PBBATH_LEVY_QY']
items: ['bthhsFrSpcs2LevyQnt']
},
{
name: 'pbbath_price',
header: { text: '단가' },
items: ['PBBATH_UNTPC']
items: ['bthhsFrSpcs2UntprcAmt']
}
]
},
@@ -195,17 +236,17 @@ export const SewerageUsageFeeInpColumn = {
{
name: 'indust_amount',
header: { text: '부과액' },
items: ['INDUST_LEVY_AMOUNT']
items: ['induLevyAmt']
},
{
name: 'indust_qty',
header: { text: '부과량' },
items: ['INDUST_LEVY_QY']
items: ['induLevyQnt']
},
{
name: 'indust_price',
header: { text: '단가' },
items: ['INDUST_UNTPC']
items: ['induUntprcAmt']
}
]
},
@@ -216,25 +257,27 @@ export const SewerageUsageFeeInpColumn = {
{
name: 'etc_amount',
header: { text: '부과액' },
items: ['ETC_LEVY_AMOUNT']
items: ['etcLevyAmt']
},
{
name: 'etc_qty',
header: { text: '부과량' },
items: ['ETC_LEVY_QY']
items: ['etcLevyQnt']
},
{
name: 'etc_price',
header: { text: '단가' },
items: ['ETC_UNTPC']
items: ['etcLevyUntprcAmt']
}
]
},
'RMK'
'rmrk',
'admdstCd',
'admdstNm'
],
rowStartNum: 3,
fixedColumns: 1,
tabKey: 'sewerageUsageFeeInp',
tabKey: 'ST00090003',
tabLabel: '하수도 사용료'
};
@@ -0,0 +1,91 @@
import { ValueType } from "realgrid";
import type { ColumnConfig, ColumnInfo } from "@/components/type/DataGrid.type";
import type { StatisticsLogDetailRow } from "@/entities/statistics/model/statistics-interface";
const COMMON_FIELD_ORDER = ["rmrk", "sggNm", "admdstCd", "admdstNm"] as const;
const FIELD_HEADER: Record<string, string> = {
rmrk: "비고",
sggNm: "시군구",
admdstCd: "행정구역코드",
admdstNm: "행정구역명",
};
function collectFieldNames(rows: StatisticsLogDetailRow[]): string[] {
const keys = new Set<string>();
for (const row of rows) {
for (const key of Object.keys(row)) {
keys.add(key);
}
}
const common = COMMON_FIELD_ORDER.filter((k) => keys.has(k));
const rest = [...keys]
.filter((k) => !COMMON_FIELD_ORDER.includes(k as (typeof COMMON_FIELD_ORDER)[number]))
.sort((a, b) => a.localeCompare(b, "ko"));
return [...common, ...rest];
}
function isNumericField(rows: StatisticsLogDetailRow[], fieldName: string): boolean {
return rows.some((row) => {
const v = row[fieldName];
return typeof v === "number" && !Number.isNaN(v);
});
}
function buildColumns(rows: StatisticsLogDetailRow[]): ColumnConfig[] {
const fieldNames = collectFieldNames(rows);
if (fieldNames.length === 0) {
return COMMON_FIELD_ORDER.map((fieldName) => ({
name: fieldName,
fieldName,
header: { text: FIELD_HEADER[fieldName] ?? fieldName },
editable: false,
width: Math.min(340, Math.max(90, fieldName.length * 9 + 28))
}));
}
return fieldNames.map((fieldName) => {
const numeric = isNumericField(rows, fieldName);
return {
name: fieldName,
fieldName,
header: { text: FIELD_HEADER[fieldName] ?? fieldName },
editable: false,
valueType: numeric ? ValueType.NUMBER : undefined,
dataFormat: numeric ? "#,##0.###" : undefined,
width: Math.min(340, Math.max(90, fieldName.length * 9 + 28)),
visible: fieldName !== "admdstCd",
};
});
}
export function buildLogHistoryDetailColumnInfo(
rows: StatisticsLogDetailRow[],
): ColumnInfo {
const columns = buildColumns(rows);
return {
columns,
columnLayout: columns.map((c) => c.fieldName),
};
}
/** 그리드 field 정의와 행 키를 맞춤 (누락 필드 → "") */
export function alignLogDetailRowsToColumns(
rows: Record<string, string | number>[],
columnInfo: ColumnInfo,
): Record<string, string | number>[] {
const fieldNames = columnInfo.columns.map((c) => c.fieldName);
return rows.map((row) => {
const aligned: Record<string, string | number> = {};
for (const fieldName of fieldNames) {
const value = row[fieldName];
aligned[fieldName] =
value === null || value === undefined ? "" : value;
}
return aligned;
});
}
export const emptyLogHistoryDetailColumnInfo =
buildLogHistoryDetailColumnInfo([]);
@@ -8,6 +8,12 @@ function toNum(v: unknown): number {
return isNaN(n) ? 0 : n;
}
/** 소수점 첫째 자리 이후 버림 (반올림 없음) */
function truncateToFirstDecimal(value: number): number {
if (!Number.isFinite(value)) return 0;
return Math.floor(value * 10) / 10;
}
/** 합계용 valueCallback 생성 */
export function createSumValueCallback(fieldNames: string[]): DataFieldValueCallback {
return (_prod, _dataRow, _fieldName, fieldNamesArr, values) => {
@@ -37,6 +43,65 @@ export function createAvgValueCallback(fieldNames: string[]): DataFieldValueCall
};
}
function sumFieldValues(
fields: string[],
fieldNamesArr: string[],
values: unknown[],
): number {
let sum = 0;
for (const f of fields) {
const idx = fieldNamesArr.indexOf(f);
if (idx >= 0) sum += toNum(values[idx]);
}
return sum;
}
/** halfSumOfSums 한 건 — (sum(first) + sum(second)) / 2, 소수 내림 */
function computeHalfSumOfSums(
firstSumFields: string[],
secondSumFields: string[],
fieldNamesArr: string[],
values: unknown[],
): number {
const firstSum = sumFieldValues(firstSumFields, fieldNamesArr, values);
const secondSum = sumFieldValues(secondSumFields, fieldNamesArr, values);
return Math.floor((firstSum + secondSum) / 2);
}
export type HalfSumOfSumsGroup = {
firstSumFields: string[];
secondSumFields: string[];
};
/** 두 그룹 합계의 평균 — (sum(first) + sum(second)) / 2 */
export function createHalfSumOfSumsValueCallback(
firstSumFields: string[],
secondSumFields: string[],
): DataFieldValueCallback {
return (_prod, _dataRow, _fieldName, fieldNamesArr, values) =>
computeHalfSumOfSums(firstSumFields, secondSumFields, fieldNamesArr, values);
}
/** halfSumOfSums 2건의 합 — (B+C)/2 + (E+F)/2 */
export function createSumOfTwoHalfSumOfSumsValueCallback(
firstGroup: HalfSumOfSumsGroup,
secondGroup: HalfSumOfSumsGroup,
): DataFieldValueCallback {
return (_prod, _dataRow, _fieldName, fieldNamesArr, values) =>
computeHalfSumOfSums(
firstGroup.firstSumFields,
firstGroup.secondSumFields,
fieldNamesArr,
values,
) +
computeHalfSumOfSums(
secondGroup.firstSumFields,
secondGroup.secondSumFields,
fieldNamesArr,
values,
);
}
/** 차이값: fields[0] − fields[1] (예: 매설연장 − 철거연장) */
export function createDifferenceValueCallback(fields: string[]): DataFieldValueCallback {
const a = fields[0] ?? "";
@@ -141,7 +206,7 @@ export function createCoverageRateValueCallback(
};
}
// 하수도 설치율(%) valueCallback
// 하수도 설치율(%) valueCallback — 항목·중간·결과 모두 소수 첫째 자리 이후 버림(반올림 없음)
export function createSwrgInstlrtRateValueCallback(
numeratorFields: string[],
denominatorFields: string[],
@@ -152,18 +217,100 @@ export function createSwrgInstlrtRateValueCallback(
let sum = 0;
for (const f of fields) {
const idx = fieldNamesArr.indexOf(f);
if (idx >= 0) sum += toNum(values[idx]);
if (idx >= 0) {
sum += truncateToFirstDecimal(toNum(values[idx]));
}
}
return sum;
return truncateToFirstDecimal(sum);
};
const sum1 = getSum(numeratorFields);
const sum2 = getSum(denominatorFields);
const piplSupprt = toNum(values[fieldNamesArr.indexOf(thirdFields[0] || 'piplSupprt')]);
const piplSupprt = truncateToFirstDecimal(
toNum(values[fieldNamesArr.indexOf(thirdFields[0] || "piplSupprt")]),
);
const total1 = (sum1 === 0 ? 0 : Math.round(sum2 / sum1 * 100));
const ratioPercent =
sum1 === 0 ? 0 : truncateToFirstDecimal((sum2 / sum1) * 100);
const result = truncateToFirstDecimal((ratioPercent * piplSupprt) / 100);
return total1 * piplSupprt / 100;
return result;
};
}
/** 처리효율: (유입BOD − 방류BOD) / 유입BOD */
export function createBodPrcsRtValueCallback(
inflwField: string,
dschgField: string,
): DataFieldValueCallback {
return (_prod, _dataRow, _fieldName, fieldNamesArr, values) => {
const inflwIdx = fieldNamesArr.indexOf(inflwField);
const dschgIdx = fieldNamesArr.indexOf(dschgField);
const inflw = inflwIdx >= 0 ? toNum(values[inflwIdx]) : 0;
const dschg = dschgIdx >= 0 ? toNum(values[dschgIdx]) : 0;
if (inflw === 0) return 0;
return (inflw - dschg) / inflw;
};
}
/** 총양수량: Σ(펌프대수 + 예비펌프대수) × 대당 양수량 */
export function createPumpGrossPpqtyValueCallback(
pumpGroups: Array<{
pumpCntField: string;
rsrvPumpCntField: string;
perPpqtyField: string;
}>,
): DataFieldValueCallback {
return (_prod, _dataRow, _fieldName, fieldNamesArr, values) => {
let total = 0;
for (const group of pumpGroups) {
const pumpIdx = fieldNamesArr.indexOf(group.pumpCntField);
const rsrvIdx = fieldNamesArr.indexOf(group.rsrvPumpCntField);
const perIdx = fieldNamesArr.indexOf(group.perPpqtyField);
const pumpCnt = pumpIdx >= 0 ? toNum(values[pumpIdx]) : 0;
const rsrvCnt = rsrvIdx >= 0 ? toNum(values[rsrvIdx]) : 0;
const perPpqty = perIdx >= 0 ? toNum(values[perIdx]) : 0;
total += (pumpCnt + rsrvCnt) * perPpqty;
}
return total;
};
}
/** (a/b) / (c/d) × 100 — 각 quotient 분모 0이면 0 */
export function createQuotientRatioPercentValueCallback(
numeratorQuotient: [string, string],
denominatorQuotient: [string, string],
): DataFieldValueCallback {
const [numField, numDenField] = numeratorQuotient;
const [denNumField, denDenField] = denominatorQuotient;
return (_prod, _dataRow, _fieldName, fieldNamesArr, values) => {
const getVal = (field: string) => {
const idx = fieldNamesArr.indexOf(field);
return idx >= 0 ? toNum(values[idx]) : 0;
};
const numDen = getVal(numDenField);
const denDen = getVal(denDenField);
const denNum = getVal(denNumField);
if (numDen === 0 || denDen === 0 || denNum === 0) return 0;
const numerator = getVal(numField) / numDen;
const denominator = denNum / denDen;
if (denominator === 0) return 0;
return (numerator / denominator) * 100;
};
}
/** 나눗셈: fields[0] / fields[1] (분모 0이면 0) */
export function createQuotientValueCallback(fields: string[]): DataFieldValueCallback {
const numeratorField = fields[0] ?? "";
const denominatorField = fields[1] ?? "";
return (_prod, _dataRow, _fieldName, fieldNamesArr, values) => {
if (!numeratorField || !denominatorField) return 0;
const numIdx = fieldNamesArr.indexOf(numeratorField);
const denIdx = fieldNamesArr.indexOf(denominatorField);
const numerator = numIdx >= 0 ? toNum(values[numIdx]) : 0;
const denominator = denIdx >= 0 ? toNum(values[denIdx]) : 0;
if (denominator === 0) return 0;
return numerator / denominator;
};
}
@@ -178,11 +325,28 @@ export function getComputedValueCallback(config: ComputedFieldConfig): DataField
return createMaxValueCallback(config.fields);
case 'difference':
return createDifferenceValueCallback(config.fields);
case 'quotient':
return createQuotientValueCallback(config.fields);
case 'quotientRatioPercent':
return createQuotientRatioPercentValueCallback(
config.numeratorQuotient,
config.denominatorQuotient,
);
case 'differenceOfSums':
return createDifferenceOfSumsValueCallback(
config.minuendFields,
config.subtrahendFields,
);
case 'halfSumOfSums':
return createHalfSumOfSumsValueCallback(
config.firstSumFields,
config.secondSumFields,
);
case 'sumOfTwoHalfSumOfSums':
return createSumOfTwoHalfSumOfSumsValueCallback(
config.firstHalfSum,
config.secondHalfSum,
);
case 'maxOfFieldAndSum':
return createMaxOfFieldAndSumValueCallback(
config.baseField,
@@ -197,5 +361,9 @@ export function getComputedValueCallback(config: ComputedFieldConfig): DataField
return createCoverageRateValueCallback(config.numeratorFields, config.denominatorFields);
case 'swrgInstlrtRate':
return createSwrgInstlrtRateValueCallback(config.numeratorFields, config.denominatorFields, config.thirdFields);
case 'pumpGrossPpqty':
return createPumpGrossPpqtyValueCallback(config.pumpGroups);
case 'bodPrcsRt':
return createBodPrcsRtValueCallback(config.inflwField, config.dschgField);
}
}
@@ -0,0 +1,72 @@
/** API·DB 8자리 일자(yyyyMMdd) → 그리드·date 편집기용 yyyy-MM-dd */
export function formatCompactYmdForGrid(ymd: string | number | null | undefined): string {
const s = String(ymd ?? "").replace(/\D/g, "");
if (s.length !== 8) return String(ymd ?? "").trim();
return `${s.slice(0, 4)}-${s.slice(4, 6)}-${s.slice(6, 8)}`;
}
function isValidCompactYmdDigits(ymd: string): boolean {
if (!/^\d{8}$/.test(ymd)) return false;
const y = Number(ymd.slice(0, 4));
const m = Number(ymd.slice(4, 6));
const d = Number(ymd.slice(6, 8));
if (y < 1000 || y > 9999 || m < 1 || m > 12 || d < 1 || d > 31) return false;
const dt = new Date(y, m - 1, d);
return dt.getFullYear() === y && dt.getMonth() === m - 1 && dt.getDate() === d;
}
function formatDateToCompactYmd(date: Date): string {
if (Number.isNaN(date.getTime())) return "";
const y = date.getFullYear();
const m = date.getMonth() + 1;
const d = date.getDate();
if (y < 1000 || y > 9999) return "";
return `${y}${String(m).padStart(2, "0")}${String(d).padStart(2, "0")}`;
}
/**
* 그리드·API 값 → 8자리 일자(yyyyMMdd).
* RealGrid datetime은 Date 객체로 올 수 있어, 숫자만 이어붙이는 방식은 사용하지 않습니다.
*/
export function toCompactYmd(
value: string | number | Date | null | undefined,
): string {
if (value == null || value === "") return "";
if (value instanceof Date) {
return formatDateToCompactYmd(value);
}
if (typeof value === "number" && Number.isFinite(value)) {
if (value >= 19000101 && value <= 21001231) {
const compact = String(Math.trunc(value)).padStart(8, "0").slice(-8);
return isValidCompactYmdDigits(compact) ? compact : "";
}
if (value > 1e11) {
return formatDateToCompactYmd(new Date(value));
}
}
const trimmed = String(value).trim();
const isoLike = trimmed.match(/^(\d{4})-(\d{2})-(\d{2})/);
if (isoLike) {
const compact = `${isoLike[1]}${isoLike[2]}${isoLike[3]}`;
return isValidCompactYmdDigits(compact) ? compact : "";
}
const digits = trimmed.replace(/\D/g, "");
if (digits.length === 8 && isValidCompactYmdDigits(digits)) {
return digits;
}
return "";
}
/** 설치목적 등 O/X 표기 → 대문자 O 또는 X (그 외는 원문 유지) */
export function normalizeOxYnValue(
value: string | number | null | undefined,
): string {
const v = String(value ?? "").trim().toUpperCase();
if (v === "O" || v === "X") return v;
return String(value ?? "").trim();
}
+59 -1
View File
@@ -1,6 +1,64 @@
import type { ColumnConfig } from "@/components/type/DataGrid.type";
import type {
ColumnConfig,
ColumnLayoutItem,
} from "@/components/type/DataGrid.type";
import type { GridView } from "realgrid";
function flattenColumnLayoutNames(layout: ColumnLayoutItem[]): string[] {
const result: string[] = [];
for (const item of layout) {
if (typeof item === "string") {
result.push(item);
continue;
}
if (item && typeof item === "object") {
if ("column" in item && typeof item.column === "string") {
result.push(item.column);
continue;
}
if ("items" in item && Array.isArray(item.items)) {
result.push(
...flattenColumnLayoutNames(
item.items as ColumnLayoutItem[],
),
);
}
}
}
return result;
}
/** 엑셀 가져오기 — N번째 열을 그리드 N번째 fieldName에 매핑 (보내기 컬럼 순서와 동일) */
export function getExcelImportColumnFieldNames(
columns: ColumnConfig[],
columnLayout?: ColumnLayoutItem[],
): string[] {
const excludedNames = new Set(
columns.filter((c) => c.excludeFromExcelExport).map((c) => c.name),
);
const fieldByName = new Map(
columns
.filter((c) => c.fieldName)
.map((c) => [c.name, c.fieldName as string]),
);
const layoutNames =
columnLayout && columnLayout.length > 0
? flattenColumnLayoutNames(columnLayout)
: columns.map((c) => c.name);
const seen = new Set<string>();
const fieldNames: string[] = [];
for (const name of layoutNames) {
if (excludedNames.has(name) || seen.has(name)) continue;
const fieldName = fieldByName.get(name);
if (!fieldName) continue;
seen.add(name);
fieldNames.push(fieldName);
}
return fieldNames;
}
export type ExcelExportVisibilitySnapshot = Map<string, boolean>;
/** 엑셀보내기 직전: 제외 컬럼 숨김, 그리드용 숨김(visible:false) 컬럼은 export에만 표시 */
@@ -0,0 +1,100 @@
import {
ACCESS_TOKEN,
AUTH_USER_ID,
CLAIM_NAME,
ENDPOINT,
} from "@/shared/config";
import { getCookie } from "@/shared/lib";
import { getRemainingMs } from "@common/auth";
import {
clearAuthToken,
setToken,
setupRefreshTimer,
} from "../lib/token-manager";
import type { AuthPayload, AuthService } from "../model/auth-interface";
import { clearTabStorePersist } from "@/store/tab-store";
async function login(payload: AuthPayload): Promise<void> {
const response = await fetch(`/api/proxy${ENDPOINT.USER_SERVICE.LOGIN}`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload),
});
const data = await response.json();
const accessToken = data[ACCESS_TOKEN];
const tokenId = data[AUTH_USER_ID];
if (!accessToken || !tokenId) {
throw new Error("인증 토큰을 받지 못했습니다.");
}
const prevTokenId = getCookie(AUTH_USER_ID);
if (prevTokenId !== undefined && prevTokenId !== tokenId) {
clearTabStorePersist();
}
setToken(CLAIM_NAME, accessToken);
setToken(AUTH_USER_ID, tokenId);
const remainingMs = getRemainingMs(accessToken);
if (remainingMs > 0) {
setupRefreshTimer(silentRefresh, remainingMs);
}
}
async function silentRefresh(): Promise<void> {
console.log(`[silentRefresh] Called at ${new Date().toISOString()}`);
try {
const response = await fetch(
`/api/proxy${ENDPOINT.USER_SERVICE.SILENT_REFRESH}`,
{ method: "PUT" },
);
const data = await response.json();
if (!response.ok) {
throw new Error(data?.message ?? "토큰 갱신에 실패했습니다.");
}
const accessToken = data[ACCESS_TOKEN];
const tokenId = data[AUTH_USER_ID];
if (!accessToken || !tokenId) {
throw new Error("갱신된 인증 토큰을 받지 못했습니다.");
}
setToken(CLAIM_NAME, accessToken);
setToken(AUTH_USER_ID, tokenId);
const remainingMs = getRemainingMs(accessToken);
if (remainingMs > 0) {
setupRefreshTimer(silentRefresh, remainingMs);
}
} catch (error) {
console.error(
`[silentRefresh] Failed at ${new Date().toISOString()}`,
error,
);
clearAuthToken();
if (typeof window !== "undefined") {
window.dispatchEvent(new CustomEvent("auth:logout"));
}
}
}
export async function logout(): Promise<void> {
clearAuthToken();
if (typeof window !== "undefined") {
window.dispatchEvent(new CustomEvent("auth:logout"));
}
}
export const authService: AuthService = {
login,
silentRefresh,
logout,
};
@@ -1,105 +0,0 @@
import { AxiosError } from "axios";
import {
ACCESS_TOKEN,
AUTH_USER_ID,
CLAIM_NAME,
ENDPOINT,
} from "@/shared/config";
import { getCookie } from "@/shared/lib";
import { getRemainingMs } from "@common/auth";
import { clearAuthToken, setToken, setupRefreshTimer } from "../lib/token-manager";
import type { ILogin,LoginService } from "../model/login-interface";
import { clearTabStorePersist } from "@/store/tab-store";
export class LoginApiService implements LoginService {
private static instance: LoginApiService;
private constructor() {}
public static getInstance(): LoginApiService {
if (!LoginApiService.instance) {
LoginApiService.instance = new LoginApiService();
}
return LoginApiService.instance;
}
public async login(payload: ILogin): Promise<void> {
try {
const response = await fetch(`/api/proxy${ENDPOINT.USER_SERVICE.LOGIN}`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload),
});
const data = await response.json();
const accessToken = data[ACCESS_TOKEN];
const tokenId = data[AUTH_USER_ID];
if (!accessToken || !tokenId) {
throw new Error("Missing required authentication tokens");
}
const prevTokenId = getCookie(AUTH_USER_ID);
if (prevTokenId !== undefined && prevTokenId !== tokenId) {
clearTabStorePersist();
}
setToken(CLAIM_NAME, accessToken);
setToken(AUTH_USER_ID, tokenId);
const remainingMs = getRemainingMs(accessToken);
if (remainingMs > 0) {
setupRefreshTimer(
() => this.silentRefresh(),
remainingMs,
);
}
} catch (error) {
if (error instanceof AxiosError) {
throw new Error(`Login failed: ${error.response?.data?.message}`);
}
throw new Error(`Login failed: ${error}`);
}
}
public async silentRefresh(): Promise<void> {
try {
const response = await fetch(
`/api/proxy${ENDPOINT.USER_SERVICE.SILENT_REFRESH}`,
{ method: "PUT" },
);
const data = await response.json();
const accessToken = data[ACCESS_TOKEN];
const tokenId = data[AUTH_USER_ID];
if (!accessToken || !tokenId) {
throw new Error("Missing required authentication tokens");
}
setToken(CLAIM_NAME, accessToken);
setToken(AUTH_USER_ID, tokenId);
const remainingMs = getRemainingMs(accessToken);
if (remainingMs > 0) {
setupRefreshTimer(
() => this.silentRefresh(),
remainingMs,
);
}
} catch (error) {
clearAuthToken();
if (error instanceof AxiosError) {
throw new Error(
`Silent refresh failed: ${error.response?.data?.message}`,
);
}
throw new Error(`Silent refresh failed: ${error}`);
}
}
}
export const LoginApi = LoginApiService.getInstance();
+2 -2
View File
@@ -1,3 +1,3 @@
export { LoginApi } from "./api/login-service";
export { authService } from "./api/auth-service";
export { AuthWrapper } from "./lib/auth-wrapper";
export { tokenManager } from "./lib/token-manager";
export { tokenManager } from "./lib/token-manager";
+70 -32
View File
@@ -1,47 +1,85 @@
"use client";
import { useEffect } from "react";
import { useRouter } from "next/navigation";
import { isAxiosError } from "axios";
import { client } from "@/shared/api";
import type { IUserInfo } from "@/shared/store";
import { getCookie, useUserStore } from "@/shared/lib";
import { isAtLoginRedirectUrl } from "@common/network";
import {
ENDPOINT,
AUTH_USER_ID,
AUTH_LOGIN_REDIRECT_URL,
AUTH_USER_ID,
CLAIM_NAME,
ENDPOINT,
} from "@/shared/config";
import { useUserStore } from "@/shared/lib";
import type { IUserInfo } from "@/shared/store";
import { getRemainingMs } from "@common/auth";
import { isAtLoginRedirectUrl } from "@common/network";
import { authService } from "../api/auth-service";
import { getToken, setupRefreshTimer } from "./token-manager";
const AuthWrapper = ({ children }: { children: React.ReactNode }) => {
const { userInfo, setUserInfo } = useUserStore((state) => state);
async function authCheck() {
if (isAtLoginRedirectUrl(AUTH_LOGIN_REDIRECT_URL)) {
return;
}
const userId = getCookie(AUTH_USER_ID);
if (!userId) {
throw new Error("Missing required authentication tokens");
}
const response = await client.get<IUserInfo>(
`${ENDPOINT.USER_SERVICE.USERS}/info/me`,
);
if (!userInfo) setUserInfo(response.data);
}
const router = useRouter();
const userInfo = useUserStore((state) => state.userInfo);
const setUserInfo = useUserStore((state) => state.setUserInfo);
useEffect(() => {
(async () => {
try {
await authCheck();
} catch (error) {
console.error(error);
setUserInfo(null);
if (!isAtLoginRedirectUrl(AUTH_LOGIN_REDIRECT_URL)) {
window.location.assign(AUTH_LOGIN_REDIRECT_URL);
}
// 페이지 새로고침 시 silentRefresh 타이머 복구
const token = getToken(CLAIM_NAME);
if (token) {
const remainingMs = getRemainingMs(token);
if (remainingMs > 0) {
console.log(
`[AuthWrapper] Refresh timer set: ${remainingMs}ms (${remainingMs / 1000}s)`,
);
setupRefreshTimer(authService.silentRefresh, remainingMs);
}
})();
}
if (isAtLoginRedirectUrl(AUTH_LOGIN_REDIRECT_URL)) return;
async function authCheck() {
const userId = getToken(AUTH_USER_ID);
if (!userId) {
router.replace(AUTH_LOGIN_REDIRECT_URL);
return;
}
if (userInfo) return;
const response = await client.get<IUserInfo>(
`${ENDPOINT.USER_SERVICE.USERS}/info/me`,
);
setUserInfo(response.data);
}
authCheck().catch((error) => {
// 401은 @common/network error-interceptor에서 이미 리다이렉트 처리됨
if (isAxiosError(error) && error.response?.status === 401) return;
console.error(error);
setUserInfo(null);
if (!isAtLoginRedirectUrl(AUTH_LOGIN_REDIRECT_URL)) {
router.replace(AUTH_LOGIN_REDIRECT_URL);
}
});
}, []);
// silentRefresh 실패 시 auth:logout 이벤트를 수신해 로그인으로 이동
useEffect(() => {
function handleAuthLogout() {
setUserInfo(null);
if (!isAtLoginRedirectUrl(AUTH_LOGIN_REDIRECT_URL)) {
router.replace(AUTH_LOGIN_REDIRECT_URL);
}
}
window.addEventListener("auth:logout", handleAuthLogout);
return () =>
window.removeEventListener("auth:logout", handleAuthLogout);
}, []);
return <>{children}</>;
@@ -0,0 +1,10 @@
export interface AuthPayload {
userId: string;
password: string;
}
export interface AuthService {
login(payload: AuthPayload): Promise<void>;
silentRefresh(): Promise<void>;
logout(): Promise<void>;
}
@@ -1,9 +0,0 @@
export interface ILogin {
userId: string;
password: string;
}
export interface LoginService {
login(payload: ILogin): Promise<void>;
silentRefresh(): Promise<void>;
}
+4 -20
View File
@@ -2,30 +2,14 @@ import { useQuery } from "@tanstack/react-query";
import { ENDPOINT } from "@/shared/config";
import type { RecentPostSearchParams } from "../model/post-interface";
import type { UserPostSearchParams } from "../model/post-interface";
import { postApi } from "./post-service";
export function useRecentPostList(params?: RecentPostSearchParams) {
export function useUserPostList(params?: UserPostSearchParams) {
return useQuery({
queryKey: createRecentPostListQueryKey(params),
queryFn: () => postApi.getRecentPostList(params),
queryKey: [ENDPOINT.BOARD_SERVICE.POSTS, params],
queryFn: () => postApi.getUserPostList(params),
refetchOnWindowFocus: false,
});
}
function createRecentPostListQueryKey(params?: RecentPostSearchParams) {
return [
ENDPOINT.BOARD_SERVICE.POSTS,
"recentPosts",
params?.page ?? "",
params?.size ?? "",
params?.sort ?? "",
params?.keywordType ?? "",
params?.keyword ?? "",
params?.bbsId ?? "",
params?.delYn ?? "",
params?.frDateYmd ?? "",
params?.toDateYmd ?? "",
];
}
@@ -1,22 +1,22 @@
import { client } from "@/shared/api";
import { ENDPOINT } from "@/shared/config";
import { ENDPOINT, ST_DASHBOARD_BBS_ID } from "@/shared/config";
import type {
PostService,
RecentPostListResponse,
RecentPostSearchParams,
UserPostListResponse,
UserPostSearchParams,
} from "../model/post-interface";
async function getRecentPostList(
params?: RecentPostSearchParams,
): Promise<RecentPostListResponse> {
const response = await client.get<RecentPostListResponse>(
`${ENDPOINT.BOARD_SERVICE.POSTS}/recentPosts`,
async function getUserPostList(
params?: UserPostSearchParams,
): Promise<UserPostListResponse> {
const response = await client.get<UserPostListResponse>(
`${ENDPOINT.BOARD_SERVICE.POSTS}/user/${ST_DASHBOARD_BBS_ID}`,
{ params },
);
return response.data;
}
export const postApi: PostService = {
getRecentPostList,
getUserPostList,
};
+2 -7
View File
@@ -1,8 +1,3 @@
export { useRecentPostList } from "./api/post-queries";
export { useUserPostList } from "./api/post-queries";
export { postApi } from "./api/post-service";
export {
type PostService,
type PstRecentListResponse,
type RecentPostListResponse,
type RecentPostSearchParams,
} from "./model/post-interface";
export { type PostService, type UserPost } from "./model/post-interface";
@@ -1,15 +1,17 @@
import type { PageableList, PageableParams } from "@/shared/model";
export interface RecentPostSearchParams extends PageableParams {
export interface UserPostSearchParams extends PageableParams {
keywordType?: string;
keyword?: string;
bbsId?: number;
delYn?: string;
frDateYmd?: string;
toDateYmd?: string;
popupYn?: string;
upndFixYn?: string;
prdPstgYn?: string;
siteId?: string;
bbsTypeCd?: string;
ansUseYn?: string;
}
export interface PstRecentListResponse {
export interface UserPost {
rowNo: number;
bbsId: number;
pstNo: number;
@@ -29,14 +31,12 @@ export interface PstRecentListResponse {
regDt: string;
rgtrNm: string;
cmntCnt: number;
bbsTypeCd: string;
bbsNm: string;
}
export type RecentPostListResponse = PageableList<PstRecentListResponse>;
export type UserPostListResponse = PageableList<UserPost>;
export interface PostService {
getRecentPostList(
params?: RecentPostSearchParams,
): Promise<RecentPostListResponse>;
getUserPostList(
params?: UserPostSearchParams,
): Promise<UserPostListResponse>;
}
@@ -0,0 +1,53 @@
import { stClient } from "@/shared/api/client";
import { withAuthHeader } from "@/shared/api/with-auth-header";
import { ENDPOINT } from "@/shared/config";
import {
type ExcretaTreatmentFacilityApiResponse,
type ExcretaTreatmentFacilityRequestParams,
type ExcretaTreatmentFacilitySaveRequest,
type ExcretaTreatmentFacilitySaveResponse,
type ExcretaTreatmentFacilitySubmitRequest,
type ExcretaTreatmentFacilitySubmitResponse,
type StatisticsInputExcretaTreatmentFacilityService,
} from "../../model/input/statistics-input-excreta-treatment-facility-interface";
export class StatisticsInputExcretaTreatmentFacilityApiService
implements StatisticsInputExcretaTreatmentFacilityService
{
/** 분뇨처리시설 조회 — ST00070001 */
public async getExcretaTreatmentFacilityList(
params: ExcretaTreatmentFacilityRequestParams,
): Promise<ExcretaTreatmentFacilityApiResponse> {
const response = await stClient.get<ExcretaTreatmentFacilityApiResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/excreta-treatment-facility`,
withAuthHeader({ params }),
);
return response.data;
}
/** 분뇨처리시설 저장 — ST00070001 */
public async saveExcretaTreatmentFacilityList(
request: ExcretaTreatmentFacilitySaveRequest,
): Promise<ExcretaTreatmentFacilitySaveResponse> {
const response = await stClient.put<ExcretaTreatmentFacilitySaveResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/excreta-treatment-facility/save`,
request,
);
return response.data;
}
/** 분뇨처리시설 제출 — ST00070001 */
public async submitExcretaTreatmentFacilityList(
request: ExcretaTreatmentFacilitySubmitRequest,
): Promise<ExcretaTreatmentFacilitySubmitResponse> {
const response = await stClient.put<ExcretaTreatmentFacilitySubmitResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/excreta-treatment-facility/submit`,
request,
);
return response.data;
}
}
export const statisticsInputExcretaTreatmentFacilityApi =
new StatisticsInputExcretaTreatmentFacilityApiService();
@@ -0,0 +1,133 @@
import { stClient } from "@/shared/api/client";
import { withAuthHeader } from "@/shared/api/with-auth-header";
import { ENDPOINT } from "@/shared/config";
import {
type PrivateSewageDesigStatusApiResponse,
type PrivateSewageDesigStatusRequestParams,
type PrivateSewageDesigStatusSaveRequest,
type PrivateSewageDesigStatusSaveResponse,
type PrivateSewageDesigStatusSubmitRequest,
type PrivateSewageDesigStatusSubmitResponse,
type SepticTankStatusApiResponse,
type SepticTankStatusRequestParams,
type SepticTankStatusSaveRequest,
type SepticTankStatusSaveResponse,
type SepticTankStatusSubmitRequest,
type SepticTankStatusSubmitResponse,
type SewageTreatFactStatusApiResponse,
type SewageTreatFactStatusRequestParams,
type SewageTreatFactStatusSaveRequest,
type SewageTreatFactStatusSaveResponse,
type SewageTreatFactStatusSubmitRequest,
type SewageTreatFactStatusSubmitResponse,
type StatisticsInputPrivateSewageFacilityService,
} from "../../model/input/statistics-input-private-sewage-facility-interface";
const BASE = `${ENDPOINT.ST_SERVICE.INPUT}/private-sewage-facility`;
export class StatisticsInputPrivateSewageFacilityApiService
implements StatisticsInputPrivateSewageFacilityService
{
/** 처리용량별 오수처리시설 현황 조회 — ST00080001 */
public async getSewageTreatFactStatusList(
params: SewageTreatFactStatusRequestParams,
): Promise<SewageTreatFactStatusApiResponse> {
const response = await stClient.get<SewageTreatFactStatusApiResponse>(
`${BASE}/sewage-treat-fact-status`,
withAuthHeader({ params }),
);
return response.data;
}
/** 처리용량별 오수처리시설 현황 저장 — ST00080001 */
public async saveSewageTreatFactStatus(
request: SewageTreatFactStatusSaveRequest,
): Promise<SewageTreatFactStatusSaveResponse> {
const response = await stClient.put<SewageTreatFactStatusSaveResponse>(
`${BASE}/sewage-treat-fact-status/save`,
request,
);
return response.data;
}
/** 처리용량별 오수처리시설 현황 제출 — ST00080001 */
public async submitSewageTreatFactStatus(
request: SewageTreatFactStatusSubmitRequest,
): Promise<SewageTreatFactStatusSubmitResponse> {
const response = await stClient.put<SewageTreatFactStatusSubmitResponse>(
`${BASE}/sewage-treat-fact-status/submit`,
request,
);
return response.data;
}
/** 정화조 현황 조회 — ST00080002 */
public async getSepticTankStatusList(
params: SepticTankStatusRequestParams,
): Promise<SepticTankStatusApiResponse> {
const response = await stClient.get<SepticTankStatusApiResponse>(
`${BASE}/septic-tank-status`,
withAuthHeader({ params }),
);
return response.data;
}
/** 정화조 현황 저장 — ST00080002 */
public async saveSepticTankStatus(
request: SepticTankStatusSaveRequest,
): Promise<SepticTankStatusSaveResponse> {
const response = await stClient.put<SepticTankStatusSaveResponse>(
`${BASE}/septic-tank-status/save`,
request,
);
return response.data;
}
/** 정화조 현황 제출 — ST00080002 */
public async submitSepticTankStatus(
request: SepticTankStatusSubmitRequest,
): Promise<SepticTankStatusSubmitResponse> {
const response = await stClient.put<SepticTankStatusSubmitResponse>(
`${BASE}/septic-tank-status/submit`,
request,
);
return response.data;
}
/** 개인하수도 관리지역 지정공고 현황 조회 — ST00080003 */
public async getPrivateSewageDesigStatusList(
params: PrivateSewageDesigStatusRequestParams,
): Promise<PrivateSewageDesigStatusApiResponse> {
const response = await stClient.get<PrivateSewageDesigStatusApiResponse>(
`${BASE}/desig-status`,
withAuthHeader({ params }),
);
return response.data;
}
/** 개인하수도 관리지역 지정공고 현황 저장 — ST00080003 */
public async savePrivateSewageDesigStatus(
request: PrivateSewageDesigStatusSaveRequest,
): Promise<PrivateSewageDesigStatusSaveResponse> {
const response = await stClient.put<PrivateSewageDesigStatusSaveResponse>(
`${BASE}/desig-status/save`,
request,
);
return response.data;
}
/** 개인하수도 관리지역 지정공고 현황 제출 — ST00080003 */
public async submitPrivateSewageDesigStatus(
request: PrivateSewageDesigStatusSubmitRequest,
): Promise<PrivateSewageDesigStatusSubmitResponse> {
const response = await stClient.put<PrivateSewageDesigStatusSubmitResponse>(
`${BASE}/desig-status/submit`,
request,
);
return response.data;
}
}
export const statisticsInputPrivateSewageFacilityApi =
new StatisticsInputPrivateSewageFacilityApiService();
@@ -0,0 +1,50 @@
import { stClient } from "@/shared/api/client";
import { withAuthHeader } from "@/shared/api/with-auth-header";
import { ENDPOINT } from "@/shared/config";
import {
type PumpingStationApiResponse,
type PumpingStationRequestParams,
type PumpingStationSaveRequest,
type PumpingStationSaveResponse,
type PumpingStationSubmitRequest,
type PumpingStationSubmitResponse,
type StatisticsInputPumpingStationService,
} from "../../model/input/statistics-input-pumping-station-interface";
export class StatisticsInputPumpingStationApiService implements StatisticsInputPumpingStationService {
/** 펌프장 조회 — ST00050001 */
public async getPumpingStationList(
params: PumpingStationRequestParams,
): Promise<PumpingStationApiResponse> {
const response = await stClient.get<PumpingStationApiResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/pumping-station`,
withAuthHeader({ params }),
);
return response.data;
}
/** 펌프장 저장 — ST00050001 */
public async savePumpingStationList(
request: PumpingStationSaveRequest,
): Promise<PumpingStationSaveResponse> {
const response = await stClient.put<PumpingStationSaveResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/pumping-station/save`,
request,
);
return response.data;
}
/** 펌프장 제출 — ST00050001 */
public async submitPumpingStationList(
request: PumpingStationSubmitRequest,
): Promise<PumpingStationSubmitResponse> {
const response = await stClient.put<PumpingStationSubmitResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/pumping-station/submit`,
request,
);
return response.data;
}
}
export const statisticsInputPumpingStationApi = new StatisticsInputPumpingStationApiService();
@@ -1,5 +1,6 @@
import { ENDPOINT } from "@/shared/config";
import { stClient } from "@/shared/api/client";
import { withAuthHeader } from "@/shared/api/with-auth-header";
import { ENDPOINT } from "@/shared/config";
import {
type StatisticsInputSewSupplyRateService,
@@ -15,7 +16,7 @@ export class StatisticsInputSewSupplyRateApiService implements StatisticsInputSe
public async getSewerageSupplyRateList(params: SewerageSupplyRateRequestParams): Promise<SewerageSupplyRateApiResponse> {
const response = await stClient.get<SewerageSupplyRateApiResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/sewerage-supply-rate`,
{ params }
withAuthHeader({ params }),
);
return response.data;
}
@@ -1,9 +1,18 @@
import { stClient } from "@/shared/api/client";
import { withAuthHeader } from "@/shared/api/with-auth-header";
import { ENDPOINT } from "@/shared/config";
import type {
SewagePipeMaintainDredgingResponse,
SewagePipeMaintainDredgingSaveRequest,
SewagePipeMaintainDredgingSaveResponse,
SewagePipeMaintainDredgingSubmitRequest,
SewagePipeMaintainDredgingSubmitResponse,
SewagePipeMaintainRepairResponse,
SewagePipeMaintainRepairSaveRequest,
SewagePipeMaintainRepairSaveResponse,
SewagePipeMaintainRepairSubmitRequest,
SewagePipeMaintainRepairSubmitResponse,
SewagePipeMaintainRequestParams,
SewagePipeMaintainService,
} from "../../model/input/statistics-input-sewage-pipe-maintain-interface";
@@ -12,7 +21,7 @@ export class SewagePipeMaintainApiService implements SewagePipeMaintainService {
public async getSewagePipeMaintainRepair(param: SewagePipeMaintainRequestParams): Promise<SewagePipeMaintainRepairResponse> {
const response = await stClient.get<SewagePipeMaintainRepairResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-pipe-maintain/repair`,
{ params: param }
withAuthHeader({ params: param })
);
return response.data;
};
@@ -20,10 +29,50 @@ export class SewagePipeMaintainApiService implements SewagePipeMaintainService {
public async getSewagePipeMaintainDredging(param: SewagePipeMaintainRequestParams): Promise<SewagePipeMaintainDredgingResponse> {
const response = await stClient.get<SewagePipeMaintainDredgingResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-pipe-maintain/dredging`,
{ params: param }
withAuthHeader({ params: param })
);
return response.data;
};
public async saveSewagePipeMaintainRepair(
param: SewagePipeMaintainRepairSaveRequest,
): Promise<SewagePipeMaintainRepairSaveResponse> {
const response = await stClient.put<SewagePipeMaintainRepairSaveResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-pipe-maintain/repair/save`,
param,
);
return response.data;
}
public async submitSewagePipeMaintainRepair(
param: SewagePipeMaintainRepairSubmitRequest,
): Promise<SewagePipeMaintainRepairSubmitResponse> {
const response = await stClient.put<SewagePipeMaintainRepairSubmitResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-pipe-maintain/repair/submit`,
param,
);
return response.data;
}
public async saveSewagePipeMaintainDredging(
param: SewagePipeMaintainDredgingSaveRequest,
): Promise<SewagePipeMaintainDredgingSaveResponse> {
const response = await stClient.put<SewagePipeMaintainDredgingSaveResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-pipe-maintain/dredging/save`,
param,
);
return response.data;
}
public async submitSewagePipeMaintainDredging(
param: SewagePipeMaintainDredgingSubmitRequest,
): Promise<SewagePipeMaintainDredgingSubmitResponse> {
const response = await stClient.put<SewagePipeMaintainDredgingSubmitResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-pipe-maintain/dredging/submit`,
param,
);
return response.data;
}
}
export const sewagePipeMaintainApiService = new SewagePipeMaintainApiService();
@@ -0,0 +1,86 @@
import { stClient } from "@/shared/api/client";
import { withAuthHeader } from "@/shared/api/with-auth-header";
import { ENDPOINT } from "@/shared/config";
import {
type StatisticsInputSewageReservoirPumpService,
type SewageReservoirApiResponse,
type SewageReservoirRequestParams,
type SewageReservoirSaveRequest,
type SewageReservoirSaveResponse,
type SewageReservoirSubmitRequest,
type SewageReservoirSubmitResponse,
type RainfallPumpStationApiResponse,
type RainfallPumpStationSaveRequest,
type RainfallPumpStationSaveResponse,
type RainfallPumpStationSubmitRequest,
type RainfallPumpStationSubmitResponse,
} from "../../model/input/statistics-input-sewage-reservoir-pump-interface";
export class StatisticsInputSewageReservoirPumpApiService implements StatisticsInputSewageReservoirPumpService {
/** 하수저류시설 조회 — ST00040001 */
public async getSewageReservoirList(params: SewageReservoirRequestParams): Promise<SewageReservoirApiResponse> {
const response = await stClient.get<SewageReservoirApiResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-reservoir-pump/sewage-reservoir`,
withAuthHeader({ params }),
);
return response.data;
}
/** 빗물펌프장 조회 — ST00040002 */
public async getRainfallPumpStationList(
params: SewageReservoirRequestParams,
): Promise<RainfallPumpStationApiResponse> {
const response = await stClient.get<RainfallPumpStationApiResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-reservoir-pump/rainfall-pump`,
withAuthHeader({ params }),
);
return response.data;
}
/** 하수저류시설 저장 — ST00040001 */
public async saveSewageReservoir(
request: SewageReservoirSaveRequest,
): Promise<SewageReservoirSaveResponse> {
const response = await stClient.put<SewageReservoirSaveResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-reservoir-pump/sewage-reservoir/save`,
request,
);
return response.data;
}
/** 하수저류시설 제출 — ST00040001 */
public async submitSewageReservoir(
request: SewageReservoirSubmitRequest,
): Promise<SewageReservoirSubmitResponse> {
const response = await stClient.put<SewageReservoirSubmitResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-reservoir-pump/sewage-reservoir/submit`,
request,
);
return response.data;
}
/** 빗물펌프장 저장 — ST00040002 */
public async saveRainfallPumpStation(
request: RainfallPumpStationSaveRequest,
): Promise<RainfallPumpStationSaveResponse> {
const response = await stClient.put<RainfallPumpStationSaveResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-reservoir-pump/rainfall-pump/save`,
request,
);
return response.data;
}
/** 빗물펌프장 제출 — ST00040002 */
public async submitRainfallPumpStation(
request: RainfallPumpStationSubmitRequest,
): Promise<RainfallPumpStationSubmitResponse> {
const response = await stClient.put<RainfallPumpStationSubmitResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-reservoir-pump/rainfall-pump/submit`,
request,
);
return response.data;
}
}
export const statisticsInputSewageReservoirPumpApi = new StatisticsInputSewageReservoirPumpApiService();
@@ -0,0 +1,68 @@
import { stClient } from "@/shared/api/client";
import { withAuthHeader } from "@/shared/api/with-auth-header";
import { ENDPOINT } from "@/shared/config";
import {
type CauserBurdenApiResponse,
type CauserBurdenRequestParams,
type SewerageChargeApiResponse,
type SewerageChargeRequestParams,
type SewerageFinanceSettleApiResponse,
type SewerageFinanceSettleRequestParams,
type SewerageUsageFeeApiResponse,
type SewerageUsageFeeRequestParams,
type StatisticsInputSewerageFinanceService,
} from "../../model/input/statistics-input-sewerage-finance-interface";
const BASE = `${ENDPOINT.ST_SERVICE.INPUT}/sewerage-finance`;
export class StatisticsInputSewerageFinanceApiService
implements StatisticsInputSewerageFinanceService
{
/** 하수도재정 결산 조회 — ST00090001 */
public async getSewerageFinanceSettleList(
params: SewerageFinanceSettleRequestParams,
): Promise<SewerageFinanceSettleApiResponse> {
const response = await stClient.get<SewerageFinanceSettleApiResponse>(
`${BASE}/settle`,
withAuthHeader({ params }),
);
return response.data;
}
/** 하수도 요금 조회 — ST00090002 */
public async getSewerageChargeList(
params: SewerageChargeRequestParams,
): Promise<SewerageChargeApiResponse> {
const response = await stClient.get<SewerageChargeApiResponse>(
`${BASE}/charge`,
withAuthHeader({ params }),
);
return response.data;
}
/** 하수도 사용료 조회 — ST00090003 */
public async getSewerageUsageFeeList(
params: SewerageUsageFeeRequestParams,
): Promise<SewerageUsageFeeApiResponse> {
const response = await stClient.get<SewerageUsageFeeApiResponse>(
`${BASE}/usage-fee`,
withAuthHeader({ params }),
);
return response.data;
}
/** 원인자 부담금 조회 — ST00090004 */
public async getCauserBurdenList(
params: CauserBurdenRequestParams,
): Promise<CauserBurdenApiResponse> {
const response = await stClient.get<CauserBurdenApiResponse>(
`${BASE}/causer-burden`,
withAuthHeader({ params }),
);
return response.data;
}
}
export const statisticsInputSewerageFinanceApi =
new StatisticsInputSewerageFinanceApiService();
@@ -1,4 +1,5 @@
import { stClient } from "@/shared/api/client";
import { withAuthHeader } from "@/shared/api/with-auth-header";
import { ENDPOINT } from "@/shared/config";
import type {
@@ -20,7 +21,7 @@ export class StatisticsInputPublicSewageFacilityApiService implements Statistics
public async getPublicSewageFacility(param: PublicSewageFacilityRequestParams): Promise<PublicSewageFacilityResponse> {
const response = await stClient.get<PublicSewageFacilityResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/public-sewage-facility/facility`,
{ params: param },
withAuthHeader({ params: param }),
);
return response.data;
}
@@ -28,7 +29,7 @@ export class StatisticsInputPublicSewageFacilityApiService implements Statistics
public async getPublicSewageMainFacility(param: PublicSewageFacilityRequestParams): Promise<PublicSewageMainFacilityResponse> {
const response = await stClient.get<PublicSewageMainFacilityResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/public-sewage-facility/main-facility`,
{ params: param },
withAuthHeader({ params: param }),
);
return response.data;
}
@@ -38,7 +39,7 @@ export class StatisticsInputPublicSewageFacilityApiService implements Statistics
): Promise<PublicSewageMappingTargetsResponse> {
const response = await stClient.get<PublicSewageMappingTargetsResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/public-sewage-facility/main-facility/mapping-targets`,
{ params: param },
withAuthHeader({ params: param }),
);
return response.data;
}
@@ -1,5 +1,6 @@
import { ENDPOINT } from "@/shared/config";
import { stClient } from "@/shared/api/client";
import { withAuthHeader } from "@/shared/api/with-auth-header";
import { ENDPOINT } from "@/shared/config";
import type {
SeweragePipeFacilityAdminAreaListRequest,
SeweragePipeFacilityAdminAreaListResponse,
@@ -39,7 +40,7 @@ export class StatisticsInputSewPipeApiService implements StatisticsInputSewPipeS
public async getRegionalFactStatus(param: SeweragePipeRequestParams): Promise<SeweragePipeInputRegionalResponse> {
const response = await stClient.get<SeweragePipeInputRegionalResponse> (
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-pipe/regional-facility-status`,
{ params: param },
withAuthHeader({ params: param }),
);
return response.data;
}
@@ -47,7 +48,7 @@ export class StatisticsInputSewPipeApiService implements StatisticsInputSewPipeS
public async getFactInstallStatus(param: SeweragePipeRequestParams): Promise<SeweragePipeInputFactInstallResponse> {
const response = await stClient.get<SeweragePipeInputFactInstallResponse> (
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-pipe/facility-install-status`,
{ params: param },
withAuthHeader({ params: param }),
);
return response.data;
}
@@ -55,7 +56,7 @@ export class StatisticsInputSewPipeApiService implements StatisticsInputSewPipeS
public async getPipeTypeStatus(param: SeweragePipeRequestParams): Promise<SeweragePipeInputPipeTypeResponse> {
const response = await stClient.get<SeweragePipeInputPipeTypeResponse> (
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-pipe/pipe-type-status`,
{ params: param },
withAuthHeader({ params: param }),
);
return response.data;
}
@@ -63,7 +64,7 @@ export class StatisticsInputSewPipeApiService implements StatisticsInputSewPipeS
public async getPipeDiameterStatus(param: SeweragePipeRequestParams): Promise<SeweragePipeInputPipeDiameterResponse> {
const response = await stClient.get<SeweragePipeInputPipeDiameterResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-pipe/pipe-diameter-status`,
{ params: param },
withAuthHeader({ params: param }),
);
return response.data;
}
@@ -71,7 +72,7 @@ export class StatisticsInputSewPipeApiService implements StatisticsInputSewPipeS
public async getManholeStatus(param: SeweragePipeRequestParams): Promise<SeweragePipeInputManholeResponse> {
const response = await stClient.get<SeweragePipeInputManholeResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-pipe/manhole-status`,
{ params: param },
withAuthHeader({ params: param }),
);
return response.data;
}
@@ -79,7 +80,7 @@ export class StatisticsInputSewPipeApiService implements StatisticsInputSewPipeS
public async getConnectionStatus(param: SeweragePipeRequestParams): Promise<SeweragePipeInputConnectionStatusResponse> {
const response = await stClient.get<SeweragePipeInputConnectionStatusResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-pipe/facility-connection-status`,
{ params: param },
withAuthHeader({ params: param }),
);
return response.data;
}
@@ -87,7 +88,7 @@ export class StatisticsInputSewPipeApiService implements StatisticsInputSewPipeS
public async getFacilitiesList(param: SeweragePipeFacilitiesListRequest): Promise<SeweragePipeFacilitiesListResponse> {
const response = await stClient.get<SeweragePipeFacilitiesListResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-pipe/facility-connection-status/popup/facilities`,
{ params: param },
withAuthHeader({ params: param }),
);
return response.data;
}
@@ -95,7 +96,7 @@ export class StatisticsInputSewPipeApiService implements StatisticsInputSewPipeS
public async getFacilityAdminAreaList(param: SeweragePipeFacilityAdminAreaListRequest): Promise<SeweragePipeFacilityAdminAreaListResponse> {
const response = await stClient.get<SeweragePipeFacilityAdminAreaListResponse>(
`${ENDPOINT.ST_SERVICE.INPUT}/sewage-pipe/facility-connection-status/popup/areas`,
{ params: param },
withAuthHeader({ params: param }),
);
return response.data;
}
@@ -287,9 +287,14 @@ export class StatisticsApiService implements StatisticsService {
}
public async getVerificationResultList(param: VerificationResultListRequest): Promise<VerificationResultListResponse> {
const { statsCd, ...rest } = param;
const params: VerificationResultListRequest = {
...rest,
...(statsCd && statsCd !== "ALL" ? { statsCd } : {}),
};
const response = await stClient.get<VerificationResultListResponse>(
`${ENDPOINT.ST_SERVICE.INPUTVERIFY}/results`,
{ params: param },
`${ENDPOINT.ST_SERVICE.INPUTVERIFY}/results/input`,
{ params },
);
return response.data;
}
@@ -0,0 +1,42 @@
import { getUserInfo } from "../../../../../../packages/common/components/src/api";
import { stClient } from "@/shared/api/client";
import { ENDPOINT } from "@/shared/config";
import type {
VerificationInputReportRequest,
VerificationInputReportResponse,
VerificationInputReportService,
} from "../model/verification-input-report-interface";
/** 이 API 전용 헤더 키 (백엔드 스펙: `token-id`) */
const TOKEN_ID_HEADER = "token-id";
export class VerificationInputReportApiService implements VerificationInputReportService {
public async getVerificationInputReport(
param: VerificationInputReportRequest,
): Promise<VerificationInputReportResponse> {
const userInfo = await getUserInfo();
const { statsCd, page, size, ...rest } = param;
const params: VerificationInputReportRequest = {
...rest,
...(statsCd && statsCd !== "ALL" ? { statsCd } : {}),
...(page != null ? { page } : {}),
...(size != null ? { size } : {}),
};
const response = await stClient.get<VerificationInputReportResponse>(
`${ENDPOINT.ST_SERVICE.INPUTVERIFY}/results/input/report`,
{
params,
headers: {
[TOKEN_ID_HEADER]: userInfo.userUnqId,
},
},
);
return response.data;
}
}
export const verificationInputReportApi = new VerificationInputReportApiService();
@@ -0,0 +1,166 @@
import type { ApiResponse, SewerageStatusInfo } from "../statistics-interface";
/** 분뇨처리시설(ST00070001) — `ExcretaTreatFactInpColumn` */
export const EXCRETA_TREATMENT_FACILITY_STATS_CD = "ST00070001" as const;
/** 검증 결과 한 건 */
export interface ExcretaTreatmentFacilityVerificationResultItem {
vrfcCd: string;
rsnExpln: string;
nowVlCn: string;
compVlCn: string;
}
/** 필드명 → 검증 결과 배열 */
export type ExcretaTreatmentFacilityVerificationResult = Record<
string,
ExcretaTreatmentFacilityVerificationResultItem[]
>;
/** 분뇨처리시설 조회 `data.commonInfo` */
export interface ExcretaTreatmentFacilityCommonInfo {
statsYr: string;
ctpvNm: string;
sewerBzmnCd: string;
statsCd: string;
verificationResult?: ExcretaTreatmentFacilityVerificationResult;
}
/**
* 분뇨처리시설 조회 `data.excretaTreatmentFacilityList[]` 한 행.
* `ExcretaTreatFactInpColumn` fieldName과 동일 (`ctpvNm` 그리드 값은 `commonInfo.ctpvNm` 시도명).
*/
export interface ExcretaTreatmentFacilityItem {
admdstCd: string;
sggNm: string;
admdstNm: string;
fcltSn: string;
fcltNm: string;
fcltPstnCn: string;
telNo: string;
cmptnStrtYmd: string;
oprtngStrtYmd: string;
wholPjtcoAmt: number;
prcsFcltCpct: number;
cpct: number;
oprtngDayCnt: number;
prcsMthdExpln: string;
linkTmplntCn: string;
linkPrcsQnt: number;
inflwBodWqVl: number;
inflwTocWqVl: number;
inflwSsWqVl: number;
inflwTnWqVl: number;
inflwTpWqVl: number;
inflwClfgCnt: number;
dschgBodWqVl: number;
dschgTocWqVl: number;
dschgSsWqVl: number;
dschgTnWqVl: number;
dschgTpWqVl: number;
dschgClfgCnt: number;
wtsysNm: string;
trbtrNm: string;
msirbCn: string;
ssirbCn: string;
operMthdCdCn: string;
wholNope: number;
sftyAcdntEvntcsCnt: number;
rmrk: string | null;
verificationResult?: ExcretaTreatmentFacilityVerificationResult;
}
export interface ExcretaTreatmentFacilityResponseData {
statusInfo: SewerageStatusInfo;
commonInfo: ExcretaTreatmentFacilityCommonInfo;
excretaTreatmentFacilityList: ExcretaTreatmentFacilityItem[];
}
export type ExcretaTreatmentFacilityApiResponse =
ApiResponse<ExcretaTreatmentFacilityResponseData> & {
message: string;
};
/** 분뇨처리시설(ST00070001) 조회 요청 파라미터 */
export interface ExcretaTreatmentFacilityRequestParams {
ctpvNm?: string;
sggNm?: string;
sewerBzmnCd?: string;
statsYr?: string;
mode?: string;
fcltNm?: string;
}
/**
* 분뇨처리시설(ST00070001) 저장 — `saveList` / `deleteList` 항목.
* `sggNm`·검증결과는 저장 요청에서 제외.
*/
export type ExcretaTreatmentFacilitySaveItem = Omit<
ExcretaTreatmentFacilityItem,
"sggNm" | "verificationResult"
>;
/** 분뇨처리시설(ST00070001) 저장 API 요청 */
export interface ExcretaTreatmentFacilitySaveRequest {
statsYr: string;
ctpvNm: string;
sggNm: string;
sewerBzmnCd: string;
userId: string;
superAdmin?: string;
noApplicable?: boolean;
saveList: ExcretaTreatmentFacilitySaveItem[];
deleteList: ExcretaTreatmentFacilitySaveItem[];
}
export interface ExcretaTreatmentFacilitySaveResponse {
status: string;
message?: string;
data?: string;
}
export type ExcretaTreatmentFacilitySubmitItem = ExcretaTreatmentFacilitySaveItem;
/** 분뇨처리시설(ST00070001) 제출 API 요청 */
export interface ExcretaTreatmentFacilitySubmitRequest {
statsYr: string;
ctpvNm: string;
sggNm: string;
sewerBzmnCd: string;
userId: string;
laePicNm: string;
laePicTelNo: string;
laeKbrdrDeptNm: string;
laeKbrdrJbgdNm: string;
laeIdfrNm: string;
laeIdfrTelNo: string;
laeIdfrDeptNm: string;
laeIdfrJbgdNm: string;
superAdmin?: string;
noApplicable?: boolean;
submitList: ExcretaTreatmentFacilitySubmitItem[];
deleteList: ExcretaTreatmentFacilitySubmitItem[];
}
export interface ExcretaTreatmentFacilitySubmitResponse {
status: string;
message?: string;
data?: {
finalStatus: string;
nvpassed: boolean;
};
}
export interface StatisticsInputExcretaTreatmentFacilityService {
getExcretaTreatmentFacilityList(
params: ExcretaTreatmentFacilityRequestParams,
): Promise<ExcretaTreatmentFacilityApiResponse>;
saveExcretaTreatmentFacilityList(
request: ExcretaTreatmentFacilitySaveRequest,
): Promise<ExcretaTreatmentFacilitySaveResponse>;
submitExcretaTreatmentFacilityList(
request: ExcretaTreatmentFacilitySubmitRequest,
): Promise<ExcretaTreatmentFacilitySubmitResponse>;
}
@@ -0,0 +1,453 @@
import type { ApiResponse, SewerageStatusInfo } from "../statistics-interface";
/** 처리용량별 오수처리시설 현황(ST00080001) — `SewageTreatFactStatusInpColumn.tabKey` */
export const SEWAGE_TREAT_FACT_STATUS_STATS_CD = "ST00080001" as const;
/** 검증 결과 한 건 */
export interface PrivateSewageFacilityVerificationResultItem {
vrfcCd: string;
rsnExpln: string;
nowVlCn: string;
compVlCn: string;
}
/** 필드명 → 검증 결과 배열 */
export type PrivateSewageFacilityVerificationResult = Record<
string,
PrivateSewageFacilityVerificationResultItem[]
>;
/** ST00080001 조회 `data.commonInfo` */
export interface SewageTreatFactStatusCommonInfo {
statsYr: string;
ctpvNm: string;
sewerBzmnCd: string;
statsCd: string;
verificationResult?: PrivateSewageFacilityVerificationResult;
}
/**
* ST00080001 조회 `data.sewageTreatFactStatusList[]` 한 행.
* `SewageTreatFactStatusInpColumn` fieldName과 동일 (`ctpvNm` 그리드 값은 `commonInfo.ctpvNm` 시도명).
*/
export interface SewageTreatFactStatusItem {
admdstCd: string;
sggNm: string;
admdstNm: string;
wholDrtwPrcsFcltCnt: number;
wholStaaCnt: number;
step1StaaPrcsQnt: number;
step2StaaPrcsQnt: number;
step3StaaPrcsQnt: number;
step4StaaPrcsQnt: number;
step5StaaPrcsQnt: number;
step6StaaPrcsQnt: number;
step7StaaPrcsQnt: number;
staaExcpWhol: number;
step1StaaExcpPrcsQnt: number;
step2StaaExcpPrcsQnt: number;
step3StaaExcpPrcsQnt: number;
step4StaaExcpPrcsQnt: number;
step5StaaExcpPrcsQnt: number;
step6StaaExcpPrcsQnt: number;
step7StaaExcpPrcsQnt: number;
rmrk: string | null;
verificationResult?: PrivateSewageFacilityVerificationResult;
}
export interface SewageTreatFactStatusResponseData {
statusInfo: SewerageStatusInfo;
commonInfo: SewageTreatFactStatusCommonInfo;
sewageTreatFactStatusList: SewageTreatFactStatusItem[];
}
export type SewageTreatFactStatusApiResponse = ApiResponse<SewageTreatFactStatusResponseData> & {
message: string;
};
/** ST00080001 조회 요청 파라미터 */
export interface SewageTreatFactStatusRequestParams {
ctpvNm?: string;
sggNm?: string;
sewerBzmnCd?: string;
statsYr?: string;
mode?: string;
}
/** 정화조 현황(ST00080002) — `SepticTankStatusInpColumn.tabKey` */
export const SEPTIC_TANK_STATUS_STATS_CD = "ST00080002" as const;
/** ST00080002 조회 `data.commonInfo` */
export interface SepticTankStatusCommonInfo {
statsYr: string;
ctpvNm: string;
sewerBzmnCd: string;
statsCd: string;
verificationResult?: PrivateSewageFacilityVerificationResult;
}
/**
* ST00080002 조회 `data.septicTankStatusList[]` 한 행.
* `SepticTankStatusInpColumn` fieldName과 동일 (`ctpvNm` 그리드 값은 `commonInfo.ctpvNm` 시도명).
*/
export interface SepticTankStatusItem {
admdstCd: string;
sggNm: string;
admdstNm: string;
grssFcltCnt: number;
staaInsdWhol: number;
staaInsdPrcsMthByWhol: number;
staaInsdSttkNprsflCnt: number;
step1StaaInsdSttkFrcCnt: number;
staaInsdSprktpFltrtbCnt: number;
staaInsdAertMthdCnt: number;
staaInsdCntcAertCnt: number;
staaInsdEtcCnt: number;
staaInsdPrcsCpctByWhol: number;
step1StaaInsdNope: number;
step2StaaInsdNope: number;
step3StaaInsdNope: number;
step4StaaInsdNope: number;
step5StaaInsdNope: number;
step6StaaInsdNope: number;
step7StaaInsdNope: number;
step8StaaInsdNope: number;
staaExcpWhol: number;
staaExcpPrcsMthByWhol: number;
staaExcpSttkNprsflCnt: number;
step1StaaExcpSttkFrcCnt: number;
staaExcpSprktpFltrtbCnt: number;
staaExcpAertMthdCnt: number;
staaExcpCntcAertCnt: number;
staaExcpEtcCnt: number;
staaExcpPrcsCpctByWhol: number;
step1StaaExcpNope: number;
step2StaaExcpNope: number;
step3StaaExcpNope: number;
step4StaaExcpNope: number;
step5StaaExcpNope: number;
step6StaaExcpNope: number;
step7StaaExcpNope: number;
step8StaaExcpNope: number;
rmrk: string | null;
verificationResult?: PrivateSewageFacilityVerificationResult;
}
export interface SepticTankStatusResponseData {
statusInfo: SewerageStatusInfo;
commonInfo: SepticTankStatusCommonInfo;
septicTankStatusList: SepticTankStatusItem[];
}
export type SepticTankStatusApiResponse = ApiResponse<SepticTankStatusResponseData> & {
message: string;
};
/** ST00080002 조회 요청 파라미터 */
export interface SepticTankStatusRequestParams {
ctpvNm?: string;
sggNm?: string;
sewerBzmnCd?: string;
statsYr?: string;
mode?: string;
}
/** 개인하수도 관리지역 지정공고 현황(ST00080003) — `PrivateSewageDesigStatusInpColumn` */
export const PRIVATE_SEWAGE_DESIG_STATUS_STATS_CD = "ST00080003" as const;
/** ST00080003 조회 `data.commonInfo` */
export interface PrivateSewageDesigStatusCommonInfo {
statsYr: string;
ctpvNm: string;
sewerBzmnCd: string;
statsCd: string;
verificationResult?: PrivateSewageFacilityVerificationResult;
}
/**
* ST00080003 조회 `data.privateSewageDesigStatusList[]` 한 행.
* `PrivateSewageDesigStatusInpColumn` fieldName과 동일 (`ctpvNm` 그리드 값은 `commonInfo.ctpvNm` 시도명).
*/
export interface PrivateSewageDesigStatusItem {
admdstCd: string;
sggNm: string;
admdstNm: string;
indvSwagePbancRgnCnt: number;
indvSwageDsgnScpLen: number;
spctnkGrssFcltCnt: number;
spctnkQnt: number;
drtwPrcsFcltGrssFcltCnt: number;
drtwPrcsFcltQnt: number;
rmrk: string | null;
verificationResult?: PrivateSewageFacilityVerificationResult;
}
export interface PrivateSewageDesigStatusResponseData {
statusInfo: SewerageStatusInfo;
commonInfo: PrivateSewageDesigStatusCommonInfo;
privateSewageDesigStatusList: PrivateSewageDesigStatusItem[];
}
export type PrivateSewageDesigStatusApiResponse =
ApiResponse<PrivateSewageDesigStatusResponseData> & {
message: string;
};
/** ST00080003 조회 요청 파라미터 */
export interface PrivateSewageDesigStatusRequestParams {
ctpvNm?: string;
sggNm?: string;
sewerBzmnCd?: string;
statsYr?: string;
mode?: string;
}
/**
* ST00080001 저장·제출 API `saveList` / `submitList` 한 행.
* `sggNm`·계산필드(`wholDrtwPrcsFcltCnt`, `wholStaaCnt`, `staaExcpWhol`)·검증결과는 제외.
*/
export interface SewageTreatFactStatusSaveItem {
admdstCd: string;
admdstNm: string;
step1StaaPrcsQnt: number;
step2StaaPrcsQnt: number;
step3StaaPrcsQnt: number;
step4StaaPrcsQnt: number;
step5StaaPrcsQnt: number;
step6StaaPrcsQnt: number;
step7StaaPrcsQnt: number;
step1StaaExcpPrcsQnt: number;
step2StaaExcpPrcsQnt: number;
step3StaaExcpPrcsQnt: number;
step4StaaExcpPrcsQnt: number;
step5StaaExcpPrcsQnt: number;
step6StaaExcpPrcsQnt: number;
step7StaaExcpPrcsQnt: number;
rmrk: string | null;
}
/** ST00080001 저장 API 요청 */
export interface SewageTreatFactStatusSaveRequest {
statsYr: string;
ctpvNm: string;
sggNm: string;
sewerBzmnCd: string;
userId: string;
superAdmin?: string;
noApplicable?: boolean;
saveList: SewageTreatFactStatusSaveItem[];
}
export interface SewageTreatFactStatusSaveResponse {
status: string;
message?: string;
data?: string;
}
/** ST00080001 제출 API 요청 */
export interface SewageTreatFactStatusSubmitRequest {
statsYr: string;
ctpvNm: string;
sggNm: string;
sewerBzmnCd: string;
userId: string;
laePicNm: string;
laePicTelNo: string;
laeKbrdrDeptNm: string;
laeKbrdrJbgdNm: string;
laeIdfrNm: string;
laeIdfrTelNo: string;
laeIdfrDeptNm: string;
laeIdfrJbgdNm: string;
superAdmin?: string;
noApplicable?: boolean;
submitList: SewageTreatFactStatusSaveItem[];
}
export interface SewageTreatFactStatusSubmitResponse {
status: string;
message?: string;
data?: {
finalStatus: string;
nvpassed: boolean;
};
}
/**
* ST00080002 저장·제출 API `saveList` / `submitList` 한 행.
* `sggNm`·계산필드(`grssFcltCnt`, `staaInsdWhol`, `staaInsdPrcsMthByWhol`, `staaInsdPrcsCpctByWhol`,
* `staaExcpWhol`, `staaExcpPrcsMthByWhol`, `staaExcpPrcsCpctByWhol`)·검증결과는 제외.
*/
export interface SepticTankStatusSaveItem {
admdstCd: string;
admdstNm: string;
staaInsdSttkNprsflCnt: number;
step1StaaInsdSttkFrcCnt: number;
staaInsdSprktpFltrtbCnt: number;
staaInsdAertMthdCnt: number;
staaInsdCntcAertCnt: number;
staaInsdEtcCnt: number;
step1StaaInsdNope: number;
step2StaaInsdNope: number;
step3StaaInsdNope: number;
step4StaaInsdNope: number;
step5StaaInsdNope: number;
step6StaaInsdNope: number;
step7StaaInsdNope: number;
step8StaaInsdNope: number;
staaExcpSttkNprsflCnt: number;
step1StaaExcpSttkFrcCnt: number;
staaExcpSprktpFltrtbCnt: number;
staaExcpAertMthdCnt: number;
staaExcpCntcAertCnt: number;
staaExcpEtcCnt: number;
step1StaaExcpNope: number;
step2StaaExcpNope: number;
step3StaaExcpNope: number;
step4StaaExcpNope: number;
step5StaaExcpNope: number;
step6StaaExcpNope: number;
step7StaaExcpNope: number;
step8StaaExcpNope: number;
rmrk: string | null;
}
/** ST00080002 저장 API 요청 */
export interface SepticTankStatusSaveRequest {
statsYr: string;
ctpvNm: string;
sggNm: string;
sewerBzmnCd: string;
userId: string;
superAdmin?: string;
noApplicable?: boolean;
saveList: SepticTankStatusSaveItem[];
}
export interface SepticTankStatusSaveResponse {
status: string;
message?: string;
data?: string;
}
/** ST00080002 제출 API 요청 */
export interface SepticTankStatusSubmitRequest {
statsYr: string;
ctpvNm: string;
sggNm: string;
sewerBzmnCd: string;
userId: string;
laePicNm: string;
laePicTelNo: string;
laeKbrdrDeptNm: string;
laeKbrdrJbgdNm: string;
laeIdfrNm: string;
laeIdfrTelNo: string;
laeIdfrDeptNm: string;
laeIdfrJbgdNm: string;
superAdmin?: string;
noApplicable?: boolean;
submitList: SepticTankStatusSaveItem[];
}
export interface SepticTankStatusSubmitResponse {
status: string;
message?: string;
data?: {
finalStatus: string;
nvpassed: boolean;
};
}
/**
* ST00080003 저장·제출 API `saveList` / `submitList` 한 행.
* `sggNm`·검증결과는 제외.
*/
export interface PrivateSewageDesigStatusSaveItem {
admdstCd: string;
admdstNm: string;
indvSwagePbancRgnCnt: number;
indvSwageDsgnScpLen: number;
spctnkGrssFcltCnt: number;
spctnkQnt: number;
drtwPrcsFcltGrssFcltCnt: number;
drtwPrcsFcltQnt: number;
rmrk: string | null;
}
/** ST00080003 저장 API 요청 */
export interface PrivateSewageDesigStatusSaveRequest {
statsYr: string;
ctpvNm: string;
sggNm: string;
sewerBzmnCd: string;
userId: string;
superAdmin?: string;
noApplicable?: boolean;
saveList: PrivateSewageDesigStatusSaveItem[];
}
export interface PrivateSewageDesigStatusSaveResponse {
status: string;
message?: string;
data?: string;
}
/** ST00080003 제출 API 요청 */
export interface PrivateSewageDesigStatusSubmitRequest {
statsYr: string;
ctpvNm: string;
sggNm: string;
sewerBzmnCd: string;
userId: string;
laePicNm: string;
laePicTelNo: string;
laeKbrdrDeptNm: string;
laeKbrdrJbgdNm: string;
laeIdfrNm: string;
laeIdfrTelNo: string;
laeIdfrDeptNm: string;
laeIdfrJbgdNm: string;
superAdmin?: string;
noApplicable?: boolean;
submitList: PrivateSewageDesigStatusSaveItem[];
}
export interface PrivateSewageDesigStatusSubmitResponse {
status: string;
message?: string;
data?: {
finalStatus: string;
nvpassed: boolean;
};
}
export interface StatisticsInputPrivateSewageFacilityService {
getSewageTreatFactStatusList(
params: SewageTreatFactStatusRequestParams,
): Promise<SewageTreatFactStatusApiResponse>;
saveSewageTreatFactStatus(
request: SewageTreatFactStatusSaveRequest,
): Promise<SewageTreatFactStatusSaveResponse>;
submitSewageTreatFactStatus(
request: SewageTreatFactStatusSubmitRequest,
): Promise<SewageTreatFactStatusSubmitResponse>;
getSepticTankStatusList(
params: SepticTankStatusRequestParams,
): Promise<SepticTankStatusApiResponse>;
saveSepticTankStatus(
request: SepticTankStatusSaveRequest,
): Promise<SepticTankStatusSaveResponse>;
submitSepticTankStatus(
request: SepticTankStatusSubmitRequest,
): Promise<SepticTankStatusSubmitResponse>;
getPrivateSewageDesigStatusList(
params: PrivateSewageDesigStatusRequestParams,
): Promise<PrivateSewageDesigStatusApiResponse>;
savePrivateSewageDesigStatus(
request: PrivateSewageDesigStatusSaveRequest,
): Promise<PrivateSewageDesigStatusSaveResponse>;
submitPrivateSewageDesigStatus(
request: PrivateSewageDesigStatusSubmitRequest,
): Promise<PrivateSewageDesigStatusSubmitResponse>;
}
@@ -0,0 +1,174 @@
import type { ApiResponse, SewerageStatusInfo } from "../statistics-interface";
/** 펌프장(ST00050001) — `PumpingStationInpColumn` tabKey */
export const PUMPING_STATION_STATS_CD = "ST00050001" as const;
/** 검증 결과 한 건 */
export interface PumpingStationVerificationResultItem {
vrfcCd: string;
rsnExpln: string;
nowVlCn: string;
compVlCn: string;
}
/** 필드명 → 검증 결과 배열 */
export type PumpingStationVerificationResult = Record<
string,
PumpingStationVerificationResultItem[]
>;
/** 펌프장 조회 `data.commonInfo` */
export interface PumpingStationCommonInfo {
statsYr: string;
ctpvNm: string;
sewerBzmnCd: string;
statsCd: string;
verificationResult?: PumpingStationVerificationResult;
}
/**
* 펌프장 조회 `data.pumpingStationList[]` 한 행.
* `PumpingStationInpColumn` fieldName과 동일 (`ctpvNm` 그리드 값은 `commonInfo.ctpvNm` 시도명).
*/
export interface PumpingStationItem {
admdstCd: string;
sggNm: string;
admdstNm: string;
fcltSn: string;
swtrmtFcltNm: string;
fcltNm: string;
pumpSeNm: string;
fcltPstnCn: string;
oprtngStrtYmd: string;
planMltvArea: number;
sndyArea: number;
rainArea: number;
exlnQnt: number;
drtwPumpGrssPpqty: number;
drtwPumpN1DmtrArea: number;
drtwPumpN1Ppqty: number;
drtwPumpN1Cnt: number;
drtwPumpN1RsrvCnt: number;
drtwPumpN2DmtrArea: number;
drtwPumpN2Ppqty: number;
drtwPumpN2Cnt: number;
drtwPumpN2RsrvCnt: number;
drtwPumpN3DmtrArea: number;
drtwPumpN3Ppqty: number;
drtwPumpN3Cnt: number;
drtwPumpN3RsrvCnt: number;
exlnPumpGrssPpqty: number;
exlnPumpN1DmtrArea: number;
exlnPumpN1Ppqty: number;
exlnPumpN1Cnt: number;
exlnPumpN1RsrvCnt: number;
exlnPumpN2DmtrArea: number;
exlnPumpN2Ppqty: number;
exlnPumpN2Cnt: number;
exlnPumpN2RsrvCnt: number;
exlnPumpN3DmtrArea: number;
exlnPumpN3Ppqty: number;
exlnPumpN3Cnt: number;
exlnPumpN3RsrvCnt: number;
anlElpwrUseQnt: number;
rmrk: string | null;
verificationResult?: PumpingStationVerificationResult;
}
export interface PumpingStationResponseData {
statusInfo: SewerageStatusInfo;
commonInfo: PumpingStationCommonInfo;
pumpingStationList: PumpingStationItem[];
}
export type PumpingStationApiResponse = ApiResponse<PumpingStationResponseData> & {
message: string;
};
/** 펌프장(ST00050001) 조회 요청 파라미터 */
export interface PumpingStationRequestParams {
ctpvNm?: string;
sggNm?: string;
sewerBzmnCd?: string;
statsYr?: string;
mode?: string;
fcltNm?: string;
}
/**
* 펌프장(ST00050001) 저장 — `saveList` / `deleteList` 항목.
* `sggNm`·계산필드·검증결과는 저장 요청에서 제외.
*/
export type PumpingStationSaveItem = Omit<
PumpingStationItem,
| "sggNm"
| "verificationResult"
| "exlnQnt"
| "drtwPumpGrssPpqty"
| "exlnPumpGrssPpqty"
>;
/** 펌프장(ST00050001) 저장 API 요청 */
export interface PumpingStationSaveRequest {
statsYr: string;
ctpvNm: string;
sggNm: string;
sewerBzmnCd: string;
userId: string;
superAdmin?: string;
noApplicable?: boolean;
saveList: PumpingStationSaveItem[];
deleteList: PumpingStationSaveItem[];
}
export interface PumpingStationSaveResponse {
status: string;
message?: string;
data?: string;
}
export type PumpingStationSubmitItem = PumpingStationSaveItem;
/** 펌프장(ST00050001) 제출 API 요청 */
export interface PumpingStationSubmitRequest {
statsYr: string;
ctpvNm: string;
sggNm: string;
sewerBzmnCd: string;
userId: string;
laePicNm: string;
laePicTelNo: string;
laeKbrdrDeptNm: string;
laeKbrdrJbgdNm: string;
laeIdfrNm: string;
laeIdfrTelNo: string;
laeIdfrDeptNm: string;
laeIdfrJbgdNm: string;
superAdmin?: string;
noApplicable?: boolean;
submitList: PumpingStationSubmitItem[];
deleteList: PumpingStationSubmitItem[];
}
export interface PumpingStationSubmitResponse {
status: string;
message?: string;
data?: {
finalStatus: string;
nvpassed: boolean;
};
}
export interface StatisticsInputPumpingStationService {
getPumpingStationList(
params: PumpingStationRequestParams,
): Promise<PumpingStationApiResponse>;
savePumpingStationList(
request: PumpingStationSaveRequest,
): Promise<PumpingStationSaveResponse>;
submitPumpingStationList(
request: PumpingStationSubmitRequest,
): Promise<PumpingStationSubmitResponse>;
}
@@ -3,6 +3,8 @@ import type { ApiResponse, SewerageStatusInfo } from "../statistics-interface";
export interface SewagePipeMaintainRepairVerificationResultItem {
vrfcCd: string;
rsnExpln: string;
nowVlCn?: string;
compVlCn?: string;
}
/** 필드명 -> 검증 결과 배열 */
@@ -93,7 +95,157 @@ export interface SewagePipeMaintainRequestParams {
export type SewagePipeMaintainRepairResponse = ApiResponse<SewagePipeMaintainRepairData>;
export type SewagePipeMaintainDredgingResponse = ApiResponse<SewagePipeMaintainDredgingData>;
/** ST00030001 하수관로 유지관리 > 개보수 저장·제출 API 행 */
export interface SewagePipeMaintainRepairSaveItem {
admdstCd: string;
sggNm: string;
admdstNm: string;
mendngWhol: number;
cbsysMendngPrlg: number;
sprsysExlnPrlg: number;
sprsysDrtwPrlg: number;
cbsysPartMendngPrlg: number;
sprsysExlnMendngPrlg: number;
sprsysDrtwMendngPrlg: number;
cbsysMnhlCnt: number;
sprsysDrtwMnhlCnt: number;
sprsysExlnMnhlCnt: number;
drtwRcvprpCnt: number;
exlnRcvprpCnt: number;
stofcbrCnt: number;
otflCnt: number;
cctvExmnPrlg: number;
rmrk: string | null;
}
/** ST00030001 하수관로 유지관리 > 개보수 저장 API 요청 */
export interface SewagePipeMaintainRepairSaveRequest {
statsYr: string;
ctpvNm: string;
sggNm: string;
sewerBzmnCd: string;
userId: string;
superAdmin?: string;
saveList: SewagePipeMaintainRepairSaveItem[];
}
export interface SewagePipeMaintainRepairSaveResponse {
data?: string;
message?: string;
status: string;
}
/** ST00030001 하수관로 유지관리 > 개보수 제출 API 요청 */
export interface SewagePipeMaintainRepairSubmitRequest {
statsYr: string;
ctpvNm: string;
sggNm: string;
sewerBzmnCd: string;
userId: string;
laePicNm: string;
laePicTelNo: string;
laeKbrdrDeptNm: string;
laeKbrdrJbgdNm: string;
laeIdfrNm: string;
laeIdfrTelNo: string;
laeIdfrDeptNm: string;
laeIdfrJbgdNm: string;
submitList: SewagePipeMaintainRepairSaveItem[];
}
export interface SewagePipeMaintainRepairSubmitResponse {
data: {
finalStatus: string;
nvpassed: boolean;
};
message?: string;
status: string;
}
/** ST00030002 하수관로 유지관리 > 관로준설 저장·제출 API 행 */
export interface SewagePipeMaintainDredgingSaveItem {
admdstCd: string;
sggNm: string;
admdstNm: string;
wholFcltPrlg: number;
wholSwagePpl: number;
cbsysPplPrlg: number;
sprsysExlnPrlg: number;
sprsysDrtwPrlg: number;
mnhlCnt: number;
exlnDrtwRcvprpCnt: number;
stofcbrOtflCnt: number;
drdgnPlanPrlg: number;
drdgnTrgtCtrsDrdgnRt: number;
wholPrlgCtrsDrdgnRt: number;
drdgnAmt: number;
drdgnQnt: number;
drdgnUntprcAmt: number;
wholDrdgnPrcsQnt: number;
rclmQnt: number;
oceanEmsnQnt: number;
rcycQnt: number;
etcQnt: number;
rmrk: string | null;
}
/** ST00030002 하수관로 유지관리 > 관로준설 저장 API 요청 */
export interface SewagePipeMaintainDredgingSaveRequest {
statsYr: string;
ctpvNm: string;
sggNm: string;
sewerBzmnCd: string;
userId: string;
superAdmin?: string;
saveList: SewagePipeMaintainDredgingSaveItem[];
}
export interface SewagePipeMaintainDredgingSaveResponse {
data?: string;
message?: string;
status: string;
}
/** ST00030002 하수관로 유지관리 > 관로준설 제출 API 요청 */
export interface SewagePipeMaintainDredgingSubmitRequest {
statsYr: string;
ctpvNm: string;
sggNm: string;
sewerBzmnCd: string;
userId: string;
laePicNm: string;
laePicTelNo: string;
laeKbrdrDeptNm: string;
laeKbrdrJbgdNm: string;
laeIdfrNm: string;
laeIdfrTelNo: string;
laeIdfrDeptNm: string;
laeIdfrJbgdNm: string;
submitList: SewagePipeMaintainDredgingSaveItem[];
}
export interface SewagePipeMaintainDredgingSubmitResponse {
data: {
finalStatus: string;
nvpassed: boolean;
};
message?: string;
status: string;
}
export interface SewagePipeMaintainService {
getSewagePipeMaintainRepair(param: SewagePipeMaintainRequestParams): Promise<SewagePipeMaintainRepairResponse>;
getSewagePipeMaintainDredging(param: SewagePipeMaintainRequestParams): Promise<SewagePipeMaintainDredgingResponse>;
saveSewagePipeMaintainRepair(
param: SewagePipeMaintainRepairSaveRequest,
): Promise<SewagePipeMaintainRepairSaveResponse>;
submitSewagePipeMaintainRepair(
param: SewagePipeMaintainRepairSubmitRequest,
): Promise<SewagePipeMaintainRepairSubmitResponse>;
saveSewagePipeMaintainDredging(
param: SewagePipeMaintainDredgingSaveRequest,
): Promise<SewagePipeMaintainDredgingSaveResponse>;
submitSewagePipeMaintainDredging(
param: SewagePipeMaintainDredgingSubmitRequest,
): Promise<SewagePipeMaintainDredgingSubmitResponse>;
}
@@ -0,0 +1,294 @@
import type { ApiResponse, SewerageStatusInfo } from "../statistics-interface";
/** 하수저류시설 Tab1 — `SewageReservoirInpColumn.tabKey` */
export const SEWAGE_RESERVOIR_STATS_CD = "ST00040001" as const;
/** 검증 결과 한 건 */
export interface SewageReservoirVerificationResultItem {
vrfcCd: string;
rsnExpln: string;
nowVlCn: string;
compVlCn: string;
}
/** 필드명 → 검증 결과 배열 */
export type SewageReservoirVerificationResult = Record<
string,
SewageReservoirVerificationResultItem[]
>;
/** 하수저류시설 조회 `data.commonInfo` */
export interface SewageReservoirCommonInfo {
statsYr: string;
ctpvNm: string;
sewerBzmnCd: string;
statsCd: string;
verificationResult?: SewageReservoirVerificationResult;
}
/**
* 하수저류시설 조회 `data.sewageReservoirList[]` 한 행.
* `SewageReservoirInpColumn` fieldName과 동일 (`ctpvNm` 그리드 값은 `commonInfo.ctpvNm` 시도명).
*/
export interface SewageReservoirItem {
admdstCd: string;
sggNm: string;
admdstNm: string;
fcltSn: string;
fcltNm: string;
fcltPstnCn: string;
oprtngStrtYmd: string;
planDesignFreqCnt: number;
fldngPrvtnYn: string;
wqPlltnMtgtYn: string;
rtlztnUsgYn: string;
fcltStrctCn: string | null;
wtrStrgZoneArea: number;
impdFcltCpct: number;
grssPpqty: number;
pumpFcltN1DmtrExpln: string;
pumpFcltN1PerPpqty: number;
pumpFcltN1PumpCnt: number;
pumpFcltN1RsrvPumpCnt: number;
pumpFcltN2DmtrExpln: string;
pumpFcltN2PerPpqty: number;
pumpFcltN2PumpCnt: number;
pumpFcltN2RsrvPumpCnt: number;
pumpFcltN3DmtrExpln: string;
pumpFcltN3PerPpqty: number;
pumpFcltN3PumpCnt: number;
pumpFcltN3RsrvPumpCnt: number;
prcsgFcltYn: string;
ddrztnEqpmYn: string;
oslfEtgtYn: string;
mltvMthCn: string | null;
impdMthCn: string | null;
impdPrcsMthdCn: string | null;
dschgWtrsExpln: string;
prcptnLastDspsQnt: number;
ctmnLastDspsQnt: number;
prcptnLastDspsMthdExpln: string;
ctmnLastDspsMthdExpln: string;
oprtngDayCnt: number;
grssMltvQnt: number;
rmrk: string | null;
verificationResult?: SewageReservoirVerificationResult;
}
export interface SewageReservoirResponseData {
statusInfo: SewerageStatusInfo;
commonInfo: SewageReservoirCommonInfo;
sewageReservoirList: SewageReservoirItem[];
}
export type SewageReservoirApiResponse = ApiResponse<SewageReservoirResponseData> & {
message: string;
};
/** 빗물펌프장 Tab2 `data.commonInfo` */
export interface RainfallPumpStationCommonInfo {
statsYr: string;
ctpvNm: string;
sewerBzmnCd: string;
statsCd: string;
verificationResult?: SewageReservoirVerificationResult;
}
/**
* 빗물펌프장 조회 `data.rainfallPumpStationList[]` 한 행.
* `RainfallPumpStationInpColumn` fieldName과 동일 (ctpvNm은 commonInfo에서 그리드에 합침).
*/
export interface RainfallPumpStationItem {
admdstCd: string;
sggNm: string;
admdstNm: string;
fcltSn: string;
fcltNm: string;
fcltPstnCn: string;
fcltyKndCn: string;
oprtngStrtYmd: string;
planDesignFreqCnt: number;
wtrStrgZoneArea: number;
rsvrYn: string;
rsvrImpndQnt: number;
abstnRgnImpdQnt: number;
grssPpqty: number;
pumpFcltN1DmtrExpln: string;
pumpFcltN1PerPpqty: number;
pumpFcltN1PumpCnt: number;
pumpFcltN1RsrvPumpCnt: number;
pumpFcltN2DmtrExpln: string;
pumpFcltN2PerPpqty: number;
pumpFcltN2PumpCnt: number;
pumpFcltN2RsrvPumpCnt: number;
pumpFcltN3DmtrExpln: string;
pumpFcltN3PerPpqty: number;
pumpFcltN3PumpCnt: number;
pumpFcltN3RsrvPumpCnt: number;
prcsgFcltYn: string;
ddrztnEqpmYn: string;
oslfEtgtYn: string;
dschgWtrsExpln: string;
prcptnLastDspsQnt: number;
ctmnLastDspsQnt: number;
prcptnLastDspsMthdExpln: string;
ctmnLastDspsMthdExpln: string;
oprtngDayCnt: number;
grssMltvQnt: number;
rmrk: string | null;
verificationResult?: SewageReservoirVerificationResult;
}
export interface RainfallPumpStationResponseData {
statusInfo: SewerageStatusInfo;
commonInfo: RainfallPumpStationCommonInfo;
rainfallPumpStationList: RainfallPumpStationItem[];
}
export type RainfallPumpStationApiResponse = ApiResponse<RainfallPumpStationResponseData> & {
message: string;
};
/** 하수저류시설(ST00040001) 조회 요청 파라미터 */
export interface SewageReservoirRequestParams {
ctpvNm?: string;
sggNm?: string;
sewerBzmnCd?: string;
statsYr?: string;
mode?: string;
fcltNm?: string;
}
/**
* 하수저류시설(ST00040001) 저장 — `saveList` / `deleteList` 항목.
* `sggNm`·검증결과는 저장 요청에서 제외.
*/
export type SewageReservoirSaveItem = Omit<
SewageReservoirItem,
"sggNm" | "verificationResult"
>;
/** 하수저류시설(ST00040001) 저장 API 요청 */
export interface SewageReservoirSaveRequest {
statsYr: string;
ctpvNm: string;
sggNm: string;
sewerBzmnCd: string;
userId: string;
superAdmin?: string;
noApplicable?: boolean;
saveList: SewageReservoirSaveItem[];
deleteList: SewageReservoirSaveItem[];
}
export interface SewageReservoirSaveResponse {
status: string;
message?: string;
data?: string;
}
/** 하수저류시설(ST00040001) 제출 API 요청 */
export interface SewageReservoirSubmitRequest {
statsYr: string;
ctpvNm: string;
sggNm: string;
sewerBzmnCd: string;
userId: string;
laePicNm: string;
laePicTelNo: string;
laeKbrdrDeptNm: string;
laeKbrdrJbgdNm: string;
laeIdfrNm: string;
laeIdfrTelNo: string;
laeIdfrDeptNm: string;
laeIdfrJbgdNm: string;
noApplicable?: boolean;
submitList: SewageReservoirSaveItem[];
deleteList: SewageReservoirSaveItem[];
}
export interface SewageReservoirSubmitResponse {
status: string;
message?: string;
data?: {
finalStatus: string;
nvpassed: boolean;
};
}
/**
* 빗물펌프장(ST00040002) 저장 — `saveList` / `deleteList` 항목.
* `sggNm`·검증결과는 저장 요청에서 제외.
*/
export type RainfallPumpStationSaveItem = Omit<
RainfallPumpStationItem,
"sggNm" | "verificationResult"
>;
/**
* 빗물펌프장(ST00040002) 저장 API 요청
* (요청 shape은 예시 JSON과 동일)
*/
export interface RainfallPumpStationSaveRequest {
statsYr: string;
ctpvNm: string;
sggNm: string;
sewerBzmnCd: string;
userId: string;
superAdmin?: string;
noApplicable?: boolean;
saveList: RainfallPumpStationSaveItem[];
deleteList: RainfallPumpStationSaveItem[];
}
/** 빗물펌프장(ST00040002) 저장 응답 */
export type RainfallPumpStationSaveResponse = SewageReservoirSaveResponse;
/** 빗물펌프장(ST00040002) 제출 API 요청 */
export interface RainfallPumpStationSubmitRequest {
statsYr: string;
ctpvNm: string;
sggNm: string;
sewerBzmnCd: string;
userId: string;
laePicNm: string;
laePicTelNo: string;
laeKbrdrDeptNm: string;
laeKbrdrJbgdNm: string;
laeIdfrNm: string;
laeIdfrTelNo: string;
laeIdfrDeptNm: string;
laeIdfrJbgdNm: string;
noApplicable?: boolean;
submitList: RainfallPumpStationSaveItem[];
deleteList: RainfallPumpStationSaveItem[];
}
/** 빗물펌프장(ST00040002) 제출 응답 */
export type RainfallPumpStationSubmitResponse = SewageReservoirSubmitResponse;
export interface StatisticsInputSewageReservoirPumpService {
getSewageReservoirList(params: SewageReservoirRequestParams): Promise<SewageReservoirApiResponse>;
getRainfallPumpStationList(
params: SewageReservoirRequestParams,
): Promise<RainfallPumpStationApiResponse>;
saveSewageReservoir(request: SewageReservoirSaveRequest): Promise<SewageReservoirSaveResponse>;
submitSewageReservoir(
request: SewageReservoirSubmitRequest,
): Promise<SewageReservoirSubmitResponse>;
/** 빗물펌프장 저장 — ST00040002 */
saveRainfallPumpStation(
request: RainfallPumpStationSaveRequest,
): Promise<RainfallPumpStationSaveResponse>;
/** 빗물펌프장 제출 — ST00040002 */
submitRainfallPumpStation(
request: RainfallPumpStationSubmitRequest,
): Promise<RainfallPumpStationSubmitResponse>;
}
@@ -0,0 +1,277 @@
import type { ApiResponse, SewerageStatusInfo } from "../statistics-interface";
/** 하수도재정 결산(ST00090001) — `SewerageFinanceSettleInpColumn.tabKey` */
export const SEWERAGE_FINANCE_SETTLE_STATS_CD = "ST00090001" as const;
/** 검증 결과 한 건 */
export interface SewerageFinanceVerificationResultItem {
vrfcCd: string;
rsnExpln: string;
nowVlCn: string;
compVlCn: string;
}
/** 필드명 → 검증 결과 배열 */
export type SewerageFinanceVerificationResult = Record<
string,
SewerageFinanceVerificationResultItem[]
>;
/** ST00090001 조회 `data.commonInfo` */
export interface SewerageFinanceSettleCommonInfo {
statsYr: string;
ctpvNm: string;
sewerBzmnCd: string;
statsCd: string;
verificationResult?: SewerageFinanceVerificationResult;
}
/**
* ST00090001 조회 `data.sewerageFinanceSettleList[]` 한 행.
* `SewerageFinanceSettleInpColumn` fieldName과 동일 (`ctpvNm` 그리드 값은 `commonInfo.ctpvNm` 시도명).
*/
export interface SewerageFinanceSettleItem {
admdstCd: string;
sggNm: string;
admdstNm: string;
fnnByWholPjtcoAmt: number;
cnterGovSprtAmt: number;
mctpvLcexpAmt: number;
wareaSggLclAmt: number;
sewerUseAmt: number;
orgprBrdnAmt: number;
etcIncmAmt: number;
crfwAmt: number;
lbltAmt: number;
usgByWholPjtcoAmt: number;
tmplntWholAmt: number;
tmplntFcltAmt: number;
tmplntMendngAmt: number;
tmplntOperKeepAmt: number;
tmplntEtcAmt: number;
wholSwagePplAmt: number;
swagePplFcltAmt: number;
swagePplMendngAmt: number;
swagePplOperKeepAmt: number;
swagePplEtcAmt: number;
wholSwageImpdFcltAmt: number;
swageImpdFcltAmt: number;
swageImpdMendngAmt: number;
swageImpdOperKeepAmt: number;
swageImpdFcltEtcAmt: number;
etcWholAmt: number;
etcAcdntCrfwAmt: number;
etcNrcpAmt: number;
etcAmt: number;
rmrk: string | null;
verificationResult?: SewerageFinanceVerificationResult;
}
export interface SewerageFinanceSettleResponseData {
statusInfo: SewerageStatusInfo;
commonInfo: SewerageFinanceSettleCommonInfo;
sewerageFinanceSettleList: SewerageFinanceSettleItem[];
}
export type SewerageFinanceSettleApiResponse = ApiResponse<SewerageFinanceSettleResponseData> & {
message: string;
};
/** ST00090001 조회 요청 파라미터 */
export interface SewerageFinanceSettleRequestParams {
ctpvNm?: string;
sggNm?: string;
sewerBzmnCd?: string;
statsYr?: string;
mode?: string;
}
/** 하수도 요금(ST00090002) — `SewerageChargeInpColumn.tabKey` */
export const SEWERAGE_CHARGE_STATS_CD = "ST00090002" as const;
/** ST00090002 조회 `data.commonInfo` */
export interface SewerageChargeCommonInfo {
statsYr: string;
ctpvNm: string;
sewerBzmnCd: string;
statsCd: string;
verificationResult?: SewerageFinanceVerificationResult;
}
/**
* ST00090002 조회 `data.sewerageChargeList[]` 한 행.
* `SewerageChargeInpColumn` fieldName과 동일 (`ctpvNm` 그리드 값은 `commonInfo.ctpvNm` 시도명).
*/
export interface SewerageChargeItem {
admdstCd: string;
sggNm: string;
admdstNm: string;
anlLevyQnt: number;
levyAmt: number;
avgUntprcAmt: number;
grssPrmcoAmt: number;
grssUnitPrmcoAmt: number;
rlztnRt: number;
rmrk: string | null;
verificationResult?: SewerageFinanceVerificationResult;
}
export interface SewerageChargeResponseData {
statusInfo: SewerageStatusInfo;
commonInfo: SewerageChargeCommonInfo;
sewerageChargeList: SewerageChargeItem[];
}
export type SewerageChargeApiResponse = ApiResponse<SewerageChargeResponseData> & {
message: string;
};
/** ST00090002 조회 요청 파라미터 */
export interface SewerageChargeRequestParams {
ctpvNm?: string;
sggNm?: string;
sewerBzmnCd?: string;
statsYr?: string;
mode?: string;
}
/** 하수도 사용료(ST00090003) — `SewerageUsageFeeInpColumn.tabKey` */
export const SEWERAGE_USAGE_FEE_STATS_CD = "ST00090003" as const;
/** ST00090003 조회 `data.commonInfo` */
export interface SewerageUsageFeeCommonInfo {
statsYr: string;
ctpvNm: string;
sewerBzmnCd: string;
statsCd: string;
verificationResult?: SewerageFinanceVerificationResult;
}
/**
* ST00090003 조회 `data.sewerageUsageFeeList[]` 한 행.
* `SewerageUsageFeeInpColumn` fieldName과 동일 (`ctpvNm` 그리드 값은 `commonInfo.ctpvNm` 시도명).
*/
export interface SewerageUsageFeeItem {
admdstCd: string;
sggNm: string;
admdstNm: string;
levyAmt: number;
levyQnt: number;
hshusLevyAmt: number;
hshusLevyQnt: number;
hshusUntprcAmt: number;
taskFrLevyAmt: number;
taskFrLevyQnt: number;
taskFrUntprcAmt: number;
fbuLevyAmt: number;
fbuLevyQnt: number;
fbuUntprcAmt: number;
bthhsFrSpcs1LevyAmt: number;
bthhsFrSpcs1LevyQnt: number;
bthhsFrSpcs1UntprcAmt: number;
bthhsFrSpcs2LevyAmt: number;
bthhsFrSpcs2LevyQnt: number;
bthhsFrSpcs2UntprcAmt: number;
induLevyAmt: number;
induLevyQnt: number;
induUntprcAmt: number;
etcLevyAmt: number;
etcLevyQnt: number;
etcLevyUntprcAmt: number;
rmrk: string | null;
verificationResult?: SewerageFinanceVerificationResult;
}
export interface SewerageUsageFeeResponseData {
statusInfo: SewerageStatusInfo;
commonInfo: SewerageUsageFeeCommonInfo;
sewerageUsageFeeList: SewerageUsageFeeItem[];
}
export type SewerageUsageFeeApiResponse = ApiResponse<SewerageUsageFeeResponseData> & {
message: string;
};
/** ST00090003 조회 요청 파라미터 */
export interface SewerageUsageFeeRequestParams {
ctpvNm?: string;
sggNm?: string;
sewerBzmnCd?: string;
statsYr?: string;
mode?: string;
}
/** 원인자 부담금(ST00090004) — `CauserBurdenInpColumn.tabKey` */
export const CAUSER_BURDEN_STATS_CD = "ST00090004" as const;
/** ST00090004 조회 `data.commonInfo` */
export interface CauserBurdenCommonInfo {
statsYr: string;
ctpvNm: string;
sewerBzmnCd: string;
statsCd: string;
verificationResult?: SewerageFinanceVerificationResult;
}
/**
* ST00090004 조회 `data.causerBurdenList[]` 한 행.
* `CauserBurdenInpColumn` fieldName과 동일 (`ctpvNm` 그리드 값은 `commonInfo.ctpvNm` 시도명).
*/
export interface CauserBurdenItem {
admdstCd: string;
sggNm: string;
admdstNm: string;
levyEvntcsCnt: number;
levyAmt: number;
trgtByWholClctnEvntcsCnt: number;
trgtByWholClctnAmt: number;
mltvEqpmEvntcsCnt: number;
mltvEqpmAmt: number;
othrCstrnOthrActrCnt: number;
othrCstrnOthrActrAmt: number;
rmrk: string | null;
verificationResult?: SewerageFinanceVerificationResult;
}
export interface CauserBurdenResponseData {
statusInfo: SewerageStatusInfo;
commonInfo: CauserBurdenCommonInfo;
causerBurdenList: CauserBurdenItem[];
}
export type CauserBurdenApiResponse = ApiResponse<CauserBurdenResponseData> & {
message: string;
};
/** ST00090004 조회 요청 파라미터 */
export interface CauserBurdenRequestParams {
ctpvNm?: string;
sggNm?: string;
sewerBzmnCd?: string;
statsYr?: string;
mode?: string;
}
/** 하수도재정 조회 공통 요청 파라미터 */
export interface SewerageFinanceRequestParams {
ctpvNm?: string;
sggNm?: string;
sewerBzmnCd?: string;
statsYr?: string;
mode?: string;
}
export interface StatisticsInputSewerageFinanceService {
getSewerageFinanceSettleList(
params: SewerageFinanceSettleRequestParams,
): Promise<SewerageFinanceSettleApiResponse>;
getSewerageChargeList(
params: SewerageChargeRequestParams,
): Promise<SewerageChargeApiResponse>;
getSewerageUsageFeeList(
params: SewerageUsageFeeRequestParams,
): Promise<SewerageUsageFeeApiResponse>;
getCauserBurdenList(
params: CauserBurdenRequestParams,
): Promise<CauserBurdenApiResponse>;
}
@@ -9,7 +9,6 @@ export interface SewerageSupplyRateCommonInfo {
sewerBzmnWholPpltnCnt: number;
piplFcltyExtn: number;
piplPlanExtn: number;
swagePplPsplyRt: number;
ctpvNm: string;
statsYr: string;
statsCd: string;
@@ -62,6 +61,7 @@ export interface SewerageSupplyRateItem {
staaPsplyRt: number;
altdPrcsPsplyRt: number;
sewerInstlRt: number;
swagePplPsplyRt: number;
rmrk: string | null;
verificationResult?: SewerageSupplyRateVerificationResult | null;
}
@@ -159,10 +159,13 @@ export interface VerificationResultListRequest {
ctpvNm?: string;
sggNm?: string;
statsCd?: string;
/** 검증 방법 코드 (예: IMR) */
/** 검증 방법 코드 (예: NV, IMR, HB) */
vrfcMthdCd?: string;
/** 처리여부 코드 목록, 콤마 구분 */
/** 처리여부 코드 목록, 콤마 구분 (예: 0,2) */
prcsYnList?: string;
/** 반려상태 코드 목록, 콤마 구분 (예: 0,1,2) */
rejectCodeList?: string;
/** @deprecated 신규 API에서는 미사용 */
pbcpAprvYn?: string;
page?: number;
size?: number;
@@ -172,7 +175,6 @@ export interface VerificationResultListRequest {
export interface VerificationResultReportItem {
statsYr: string;
statsCd: string;
statsNm: string;
sewerBzmnCd: string;
ctpvNm: string;
sggNm: string;
@@ -181,18 +183,22 @@ export interface VerificationResultReportItem {
vrfcMthdCd: string;
vrfcMthdNm: string;
vrfcTrgtNm: string;
regDt: string;
rsnExpln: string;
nowVlCn: string;
compVlCn: string | null;
prcsYn: string;
prcsYnNm: string;
prcsOpnnExpln: string | null;
prcrId: string | null;
stVrfRjtComCd: string;
stVrfRjtComNm: string;
rjctOpnnCn: string | null;
pbcpAprvYn: string;
mdfrId: string | null;
regDt: string;
mdfcnDt: string;
/** 하위 호환: 일부 API/화면에서만 내려올 수 있음 */
statsNm?: string;
prcrId?: string | null;
pbcpAprvYn?: string;
mdfrId?: string | null;
}
export interface VerificationResultListPageInfo {
@@ -158,7 +158,7 @@ export const statisticsVerificationResultColumnInfo: ColumnInfo = {
name: "vrfcMthdNm",
fieldName: "vrfcMthdNm",
header: { text: "검증유형" },
width: 150,
width: 100,
styleName: READ_ONLY_STYLE,
editable: false,
},
@@ -241,4 +241,4 @@ export const statisticsVerificationResultColumnInfo: ColumnInfo = {
"pbcpAprvYn",
"vrfcSn",
],
};
};
@@ -67,6 +67,13 @@ export const hbArticleColumnInfo: ColumnInfo = {
valueType: ValueType.NUMBER,
dataFormat: "#,##0.###",
},
{
name: "useYn",
fieldName: "useYn",
header: { text: "사용 여부" },
editable: false,
sortdisable: false,
},
{
name: "rgtrNm",
fieldName: "rgtrNm",
@@ -91,6 +98,7 @@ export const hbArticleColumnInfo: ColumnInfo = {
"pctlCrtrVl",
"scopCntCntVl",
"thrsCntVl",
"useYn",
"rgtrNm",
"regDt",
],
@@ -126,6 +134,13 @@ export const imrArticleColumnInfo: ColumnInfo = {
editable: false,
sortdisable: false,
},
{
name: "useYn",
fieldName: "useYn",
header: { text: "사용 여부" },
editable: false,
sortdisable: false,
},
{
name: "rgtrNm",
fieldName: "rgtrNm",
@@ -146,6 +161,7 @@ export const imrArticleColumnInfo: ColumnInfo = {
"vrfcTrgtNm",
"tblNm",
"colNm",
"useYn",
"rgtrNm",
"regDt",
],
@@ -181,6 +197,13 @@ export const validationArticleColumnInfo: ColumnInfo = {
editable: false,
sortdisable: false,
},
{
name: "useYn",
fieldName: "useYn",
header: { text: "사용 여부" },
editable: false,
sortdisable: false,
},
{
name: "rgtrNm",
fieldName: "rgtrNm",
@@ -201,6 +224,7 @@ export const validationArticleColumnInfo: ColumnInfo = {
"vrfcTrgtNm",
"tblNm",
"colNm",
"useYn",
"rgtrNm",
"regDt",
],
@@ -0,0 +1,58 @@
/** 이상치 선별 보고서 조회 요청 (`GET .../results/input/report`) */
export interface VerificationInputReportRequest {
statsYr: string;
vrfcMthdCd: string;
statsCd?: string;
page?: number;
size?: number;
}
export interface VerificationInputReportTypeCountingInfo {
nvCount: number;
imrCount: number;
hbCount: number;
}
/** 이상치 선별 보고서 목록 한 행 */
export interface VerificationInputReportItem {
statsYr: string;
statsCd: string;
/** 통계코드명 (타이틀 표시용) */
statsNm?: string;
sewerBzmnCd: string;
ctpvNm: string;
sggNm: string | null;
vrfcSn: number;
vrfcMthdCd: string;
vrfcMthdNm: string;
vrfcTrgtNm: string;
rsnExpln: string;
nowVlCn: string;
compVlCn: string | null;
vrfcStatusNm: string;
}
export interface VerificationInputReportPageInfo {
totalElements: number;
totalPages: number;
currentPage: number;
size: number;
}
export interface VerificationInputReportData {
verifyTypeCountingInfo: VerificationInputReportTypeCountingInfo;
verifyResultList: VerificationInputReportItem[];
pageInfo: VerificationInputReportPageInfo;
}
export interface VerificationInputReportResponse {
status: string;
message?: string;
data?: VerificationInputReportData;
}
export interface VerificationInputReportService {
getVerificationInputReport(
param: VerificationInputReportRequest,
): Promise<VerificationInputReportResponse>;
}
+22 -3
View File
@@ -1,20 +1,34 @@
"use client";
import { useState } from "react";
import Image from "next/image";
import { authService } from "@/entities/auth";
import { images } from "@common/assets";
import { LoginApi } from "@/entities/auth";
import "./login.css";
function LoginPage() {
const [errorMessage, setErrorMessage] = useState<string>("");
const handleSubmit = async (e: React.SubmitEvent<HTMLFormElement>) => {
e.preventDefault();
setErrorMessage("");
const formData = new FormData(e.target as HTMLFormElement);
const userId = formData.get("id") as string;
const password = formData.get("password") as string;
await LoginApi.login({ userId, password });
window.location.href = "/statistics";
try {
await authService.login({ userId, password });
window.location.href = "/statistics";
} catch (error) {
const message =
error instanceof Error
? error.message
: "로그인에 실패했습니다.";
setErrorMessage(message);
}
};
return (
@@ -89,6 +103,11 @@ function LoginPage() {
</div>
{/* <a href="javascript:fnUserSearch();" className=" pw_message fx"><i className="xi-external-link"></i>비밀번호 또는 아이디를 잃어버리셨나요?</a> */}
</div>
{errorMessage && (
<div className="error_message">
<span>{errorMessage}</span>
</div>
)}
<button type="submit" className="login_btn fx">
<span>LOGIN</span>
</button>
@@ -5,8 +5,9 @@ import { useRouter } from "next/navigation";
import { createColumnHelper, getCoreRowModel } from "@tanstack/react-table";
import dayjs from "dayjs";
import { ST_DASHBOARD_BBS_ID } from "@/shared/config";
import { useDataTable } from "@/shared/lib";
import { type PstRecentListResponse, useRecentPostList } from "@/entities/post";
import { type UserPost, useUserPostList } from "@/entities/post";
import { Button } from "@common/components";
import { useDragHandle } from "../sortable-panel";
@@ -15,25 +16,23 @@ export function NoticePanel() {
const { dragHandleProps, isDragging } = useDragHandle();
const router = useRouter();
const recentPostListQuery = useRecentPostList({
const userPostListQuery = useUserPostList({
page: 0,
size: 4,
keywordType: "bbsTypeCd",
keyword: "BBSNOTICE",
});
const handleRowClick = (post: PstRecentListResponse) => {
router.push(
`/cms/${post.bbsTypeCd.toLowerCase()}/${post.bbsId}/${post.pstNo}`,
);
const handleRowClick = (post: UserPost) => {
router.push(`/cms/bbsnotice/${ST_DASHBOARD_BBS_ID}/${post.pstNo}`);
};
const handleMoreClick = () => {
router.push("/cms/bbsnotice/7");
router.push(`/cms/bbsnotice/${ST_DASHBOARD_BBS_ID}`);
};
const { tableComponent } = useDataTable({
query: recentPostListQuery,
query: userPostListQuery,
tableOptions: {
columns: noticeColumns,
getCoreRowModel: getCoreRowModel(),
@@ -52,8 +51,11 @@ export function NoticePanel() {
title="헤더를 드래그하여 패널 순서 변경"
>
<h3 className="text-2xl font-semibold">공지사항</h3>
</div>
<div className="py-2 text-right">
<Button
size="sm"
color="white"
className="!text-xl"
onClick={handleMoreClick}
>
@@ -65,7 +67,7 @@ export function NoticePanel() {
);
}
const columnHelper = createColumnHelper<PstRecentListResponse>();
const columnHelper = createColumnHelper<UserPost>();
const noticeColumns = [
columnHelper.accessor("pstTtl", {
+6 -5
View File
@@ -1,4 +1,5 @@
import { Client } from "@common/network";
import { BASE_URL, ST_SERVICE_BASE_URL } from "../config/api";
import { SITE_ID } from "../config/env";
import { setCookie } from "../lib";
@@ -6,11 +7,11 @@ import { setCookie } from "../lib";
setCookie("site-id-key", SITE_ID);
export const client = Client.getInstance({
baseURL: BASE_URL,
siteId: SITE_ID,
baseURL: BASE_URL,
siteId: SITE_ID,
});
export const stClient = Client.getInstance({
baseURL: ST_SERVICE_BASE_URL,
siteId: SITE_ID,
});
baseURL: ST_SERVICE_BASE_URL,
siteId: SITE_ID,
});
+1
View File
@@ -1 +1,2 @@
export { client } from "./client";
export { withAuthHeader } from "./with-auth-header";
@@ -0,0 +1,16 @@
import type { AxiosRequestConfig } from "axios";
import { getToken } from "@/entities/auth/lib/token-manager";
import { CLAIM_NAME } from "@/shared/config";
export function withAuthHeader<T extends AxiosRequestConfig>(config: T = {} as T): T {
const authorization = getToken(CLAIM_NAME);
if (!authorization) return config;
return {
...config,
headers: {
...config.headers,
[CLAIM_NAME]: authorization,
},
};
}
+1
View File
@@ -14,3 +14,4 @@ export const AUTH_USER_ID = process.env.NEXT_PUBLIC_AUTH_USER_ID || "token-id";
export const ST_SERVICE_URL =
process.env.NEXT_PUBLIC_ST_SERVICE_URL || "http://localhost:8080";
export const COOKIE_DOMAIN = process.env.NEXT_PUBLIC_COOKIE_DOMAIN;
export const ST_DASHBOARD_BBS_ID = process.env.NEXT_PUBLIC_ST_DASHBOARD_BBS_ID;
@@ -0,0 +1,12 @@
export const STATISTICS_ROUTE = "/statistics";
export const STATISTICS_TAB_QUERY_KEY = "tab";
export function buildStatisticsTabUrl(tabId: string): string {
return `${STATISTICS_ROUTE}?${STATISTICS_TAB_QUERY_KEY}=${encodeURIComponent(tabId)}`;
}
export function isStatisticsPathname(
pathname: string | null,
): pathname is typeof STATISTICS_ROUTE {
return pathname === STATISTICS_ROUTE;
}
@@ -0,0 +1,99 @@
"use client";
import { useEffect, useRef } from "react";
import { useRouter, useSearchParams } from "next/navigation";
import type { MenuItem } from "@/entities/menu";
import { findMenuItemByUrlPath } from "@/shared/lib/stats-cd-input-navigation";
import { getTabStoreState } from "@/store/tab-store";
import {
STATISTICS_ROUTE,
STATISTICS_TAB_QUERY_KEY,
buildStatisticsTabUrl,
isStatisticsPathname,
} from "./statistics-tab-url";
type UseStatisticsTabUrlSyncParams = {
pathname: string | null;
menuList: MenuItem[] | null;
activeTabId: string | null;
addTab: (menuItem: MenuItem) => boolean;
addTabForGrid: (menuItem: MenuItem) => void;
setCurrentMenuInfo: (item: MenuItem) => void;
};
/** `/statistics?tab=` ↔ Zustand 활성 탭 동기화 */
export function useStatisticsTabUrlSync({
pathname,
menuList,
activeTabId,
addTab,
addTabForGrid,
setCurrentMenuInfo,
}: UseStatisticsTabUrlSyncParams): {
syncTabToUrl: (tabId: string) => void;
} {
const router = useRouter();
const searchParams = useSearchParams();
const tabParam = searchParams?.get(STATISTICS_TAB_QUERY_KEY) ?? null;
const skipUrlToStoreRef = useRef(false);
const syncTabToUrl = (tabId: string) => {
if (!isStatisticsPathname(pathname)) {
router.push(buildStatisticsTabUrl(tabId));
return;
}
if (tabParam === tabId) return;
skipUrlToStoreRef.current = true;
router.replace(buildStatisticsTabUrl(tabId), { scroll: false });
};
// URL ?tab → 탭 스토어
useEffect(() => {
if (!isStatisticsPathname(pathname) || !menuList) return;
if (skipUrlToStoreRef.current) {
skipUrlToStoreRef.current = false;
return;
}
if (!tabParam) return;
if (getTabStoreState().activeTabId === tabParam) return;
const menu = findMenuItemByUrlPath(menuList, tabParam);
if (!menu) return;
setCurrentMenuInfo(menu);
const ok = addTab(menu);
if (ok) {
addTabForGrid(menu);
}
}, [
pathname,
menuList,
tabParam,
addTab,
addTabForGrid,
setCurrentMenuInfo,
]);
// 활성 탭 → URL (탭 바 전환·persist 복원 포함)
useEffect(() => {
if (!isStatisticsPathname(pathname)) return;
if (!activeTabId) {
if (tabParam) {
skipUrlToStoreRef.current = true;
router.replace(STATISTICS_ROUTE, { scroll: false });
}
return;
}
if (tabParam === activeTabId) return;
skipUrlToStoreRef.current = true;
router.replace(buildStatisticsTabUrl(activeTabId), { scroll: false });
}, [pathname, activeTabId, tabParam, router]);
return { syncTabToUrl };
}