Compare commits

...
Author SHA1 Message Date
yangsein 428b199dd3 feat:12하수및분뇨관리사업 2026-06-15 01:02:13 +09:00
yangsein 3c4a6efeea feat:10.물재이용 2026-06-15 01:01:51 +09:00
yangsein dae7024043 feat:[집계표]13.하수도 서비스수준 2026-06-15 01:00:31 +09:00
yangsein 64e5c26e8c feat: [집계표] 12.하수및 분뇨관리사업 2026-06-15 00:59:03 +09:00
yangsein 84ae60edd6 feat:[집계표] 11하수및 분뇨찌꺼기 2026-06-15 00:57:39 +09:00
yangsein d4c9989069 feat: [집계표] 물재이용 2026-06-15 00:56:20 +09:00
yangsein 6cda413913 feat:[집계표]09.하수도 재정 2026-06-15 00:55:06 +09:00
yangsein a11eaf031d feat:[집계표]08.개인하수처리시설 2026-06-15 00:52:54 +09:00
yangsein 3c701359fd feat:[집계표]분뇨처리시설 2026-06-15 00:50:54 +09:00
yangsein 85ba9fe0ab feat:[집계표]05 펌프장 2026-06-15 00:48:45 +09:00
yangsein 71077f4c8e feat:[집계표]04.하수저류시설 및 빗물 펌프장 2026-06-15 00:47:11 +09:00
yangsein 4c7ff53d78 feat:[집계표]03.하수관로 유지관리 2026-06-15 00:43:03 +09:00
chanii8 99fe41b41d [st] feat: H-B 통계검증, I-MR 검증이력 페이지 수정 2026-05-26 13:18:57 +09:00
rsone001 90834f3493 [st] - feat: 미입력현황 조회 2026-05-18 19:36:13 +09:00
rsone001 ac75188980 [st] - fix: DataGrid height 변경 2026-05-18 17:02:12 +09:00
rsone001 404624a583 [st] - fix: 통계이력조회 메뉴 구조 변경 2026-05-18 16:57:18 +09:00
rsone001 91e505f37f [st] - fix: 권한 및 데이터 상태에 따른 버튼 표출 조건식 오류 수정, 2-6 & 6-2 저장 가능 여부 기능 추가 2026-05-18 16:26:10 +09:00
jcchoi 7a0a8f23b7 컬럼추가 2026-05-18 16:15:08 +09:00
jcchoi 246f6472a3 검증리포트 항목추가 2026-05-18 16:08:56 +09:00
rsone001 50ed22b4bc [st] - fix: 메뉴 권한체크 로직 수정 2026-05-18 12:06:56 +09:00
rsone001 b508568e86 [st] - fix: 오류 수정 및 누락 기능 추가 2026-05-18 11:03:43 +09:00
rsone001 8384743a30 Merge branch 'iipbs/st/dev' of https://www.onasys.co.kr:3000/ONAANDALL/frontend into iipbs/st/dev 2026-05-18 11:01:20 +09:00
yangsein 4e8f492006 feat:01.하수도보급률 농어촌 보급률 컬럼 추가
02.하수관로 관종별현황 노후하수관로율 컬럼추가
2026-05-15 16:01:20 +09:00
jcchoi 91116ccdf7 Merge branch 'main' of https://www.onasys.co.kr:3000/ONAANDALL/frontend
Deploy Frontend / deploy (push) Successful in 4m12s
2026-05-15 11:41:30 +09:00
jcchoi 2bcc49e090 검증결과 리포트 수정정 2026-05-15 11:41:23 +09:00
jcchoi c013759869 그리드 색상 수수정(머지시 , 롤오버시) 2026-05-15 11:41:05 +09:00
mind-one005 bdbba42616 Merge branch 'main' of https://www.onasys.co.kr:3000/ONAANDALL/frontend 2026-05-14 17:50:11 +09:00
mind-one005 a84b233435 Merge branch 'iipbs/dm/dev' of https://www.onasys.co.kr:3000/ONAANDALL/frontend into iipbs/dm/dev 2026-05-14 17:04:27 +09:00
mind-one005 4340a57180 dm: 컨텐츠 조회 2026-05-14 17:04:19 +09:00
LGS 1cc6b4b565 메인 컨텐츠 layout 內 세로스크롤 overflow-x-auto 제거 및 헤더 중복 제거 2026-05-13 15:39:27 +09:00
mind-one005 4a6cfed9bb dm: 스크롤 이상 수정 2026-05-13 15:24:56 +09:00
123 changed files with 6443 additions and 1123 deletions
@@ -0,0 +1,9 @@
export const dynamic = "force-dynamic";
import { ContentsPage } from "@/components/ui/contents";
export default async function Contents() {
const contsSn = 28;
const menuCd = "24";
return <ContentsPage contsSn={contsSn} menuCd={menuCd} />;
}
@@ -1,3 +1,6 @@
/**
* 물 재이용 사례
*/
import SubPageHeader from "@/components/SubPageHeader"; import SubPageHeader from "@/components/SubPageHeader";
import BusinessSubNav, { type BusinessSubNavMenu } from "@/components/BusinessSubNav"; import BusinessSubNav, { type BusinessSubNavMenu } from "@/components/BusinessSubNav";
@@ -287,7 +287,7 @@ export default function SewageStatusSection() {
const isSubItem = type === "red-item" || type === "blue-item"; const isSubItem = type === "red-item" || type === "blue-item";
if (index === 0) { if (index === 0) {
console.log(header.id, value); // console.log(header.id, value);
return ( return (
<td key={`${rowIdx}-${header.id}`} className={`${tableStyles.td} relative`}> <td key={`${rowIdx}-${header.id}`} className={`${tableStyles.td} relative`}>
{isSubItem ? ( {isSubItem ? (
+1 -1
View File
@@ -58,7 +58,7 @@ const menus: BusinessSubNavMenu[] = [
}, },
{ {
id: "status-treated-usage", id: "status-treated-usage",
label: "연도별 하수처리수 재이용 현황", label: "용도별 하수처리수 재이용 현황",
}, },
{ {
id: "status-treated-facility", id: "status-treated-facility",
+1 -1
View File
@@ -16,7 +16,7 @@ export default function RootLayout({
<title>물재이용 대민</title> <title>물재이용 대민</title>
</head> </head>
<body> <body>
<div className="min-w-[1400px] overflow-x-auto"> <div className="min-w-[1400px]">
{children} {children}
</div> </div>
</body> </body>
-2
View File
@@ -1,12 +1,10 @@
// app/main/layout.tsx // app/main/layout.tsx
import "../reuse.module.css"; import "../reuse.module.css";
import TopNav from "@/components/TopNav";
import { StoreProvider } from "../store"; import { StoreProvider } from "../store";
export default function ReuseLandingLayout({ children }: { children: React.ReactNode }) { export default function ReuseLandingLayout({ children }: { children: React.ReactNode }) {
return ( return (
<StoreProvider> <StoreProvider>
<TopNav />
<div className="pt-[83px]">{children}</div> {/* TopNav 높이만큼 */} <div className="pt-[83px]">{children}</div> {/* TopNav 높이만큼 */}
</StoreProvider> </StoreProvider>
); );
+1 -1
View File
@@ -33,7 +33,7 @@ export const StoreZus = (
return createStore<DmStore>()((set) => { return createStore<DmStore>()((set) => {
if (typeof window !== "undefined") { if (typeof window !== "undefined") {
tokenManager.setToken("site-id-key", process.env.NEXT_PUBLIC_SITE_ID||"DM"); tokenManager.setToken("site-id-key", process.env.NEXT_PUBLIC_SITE_ID||"DM");
tokenManager.setToken("site-theme-key", "green"); tokenManager.setToken("site-theme-key", "white");
} }
return { return {
+59 -33
View File
@@ -1,3 +1,6 @@
/**
* 우측 메뉴
*/
"use client"; "use client";
import Link from "next/link"; import Link from "next/link";
@@ -47,44 +50,67 @@ export default function BusinessSubNav({
setOpenMenus(initialOpenState); setOpenMenus(initialOpenState);
}, [menus]); }, [menus]);
useEffect(() => { useEffect(() => {
if (!allSections.length) return; if (!allSections.length) return;
const observer = new IntersectionObserver( const targets = allSections
(entries) => { .map((section) => document.getElementById(section.id))
const visible = entries .filter(Boolean) as HTMLElement[];
.filter((entry) => entry.isIntersecting)
.sort((a, b) => b.intersectionRatio - a.intersectionRatio);
if (visible[0]) { if (!targets.length) return;
setActiveId(visible[0].target.id);
} let rafId = 0;
},
{ const updateActiveSection = () => {
rootMargin: `-${offsetTop}px 0px -55% 0px`, const baseLine = offsetTop + 500;
threshold: [0.2, 0.35, 0.5, 0.7], let nextActiveId = targets[0]?.id ?? "";
for (const el of targets) {
const { top } = el.getBoundingClientRect();
if (top <= baseLine) {
nextActiveId = el.id;
continue;
} }
);
const targets = allSections break;
.map((section) => document.getElementById(section.id)) }
.filter(Boolean) as HTMLElement[];
targets.forEach((el) => observer.observe(el)); setActiveId((prev) => (prev === nextActiveId ? prev : nextActiveId));
};
const hash = window.location.hash.replace("#", ""); const requestUpdate = () => {
const initialActive = if (rafId) return;
allSections.find((section) => section.id === hash)?.id ??
allSections[0]?.id ??
"";
setActiveId(initialActive); rafId = window.requestAnimationFrame(() => { // 예약번호 반환
updateActiveSection();
rafId = 0;
});
};
return () => observer.disconnect(); const hash = window.location.hash.replace("#", "");
}, [allSections, offsetTop]); const initialActive =
allSections.find((section) => section.id === hash)?.id ??
allSections[0]?.id ??
"";
useEffect(() => { setActiveId(initialActive);
if (!activeId) return; updateActiveSection();
window.addEventListener("scroll", requestUpdate, { passive: true });
window.addEventListener("resize", requestUpdate);
return () => {
window.removeEventListener("scroll", requestUpdate);
window.removeEventListener("resize", requestUpdate);
if (rafId) {
window.cancelAnimationFrame(rafId);
}
};
}, [allSections, offsetTop]);
useEffect(() => {
if (!activeId) return;
const parentMenu = menus.find((menu) => const parentMenu = menus.find((menu) =>
(menu.sections ?? []).some((section) => section.id === activeId) (menu.sections ?? []).some((section) => section.id === activeId)
@@ -93,13 +119,13 @@ export default function BusinessSubNav({
if (!parentMenu) return; if (!parentMenu) return;
setOpenMenus(() => { setOpenMenus(() => {
const nextOpenState: Record<string, boolean> = {}; const nextOpenState: Record<string, boolean> = {};
menus.forEach((menu) => { menus.forEach((menu) => {
nextOpenState[menu.key] = menu.key === parentMenu.key; nextOpenState[menu.key] = menu.key === parentMenu.key;
}); });
return nextOpenState; return nextOpenState;
}); });
}, [activeId, menus]); }, [activeId, menus]);
@@ -0,0 +1,26 @@
// apps/dm/src/entities/content/
// contents-api.ts
import { unstable_cache } from "next/cache";
import { ENDPOINT } from "@/src/shared/config";
export const getCachedContentDetail = unstable_cache(
async (contsSn: number, menuCd: string) => {
const baseUrl = process.env.NEXT_PUBLIC_PROXY_HOST || "http://localhost:3015";
const res = await fetch(
`${baseUrl}${ENDPOINT.CMS_SERVICE.CONTENTS}/${contsSn}?menuCd=${menuCd}`,
{
next: { revalidate: 3600, tags: [`content:${contsSn}`] },
}
);
if (!res.ok) {
console.log(res);
throw new Error("Failed to fetch content");
}
return res.json();
},
["dm-content-detail"],
);
@@ -0,0 +1,18 @@
/**
* 컨텐츠 서버 페이지
*/
import { getCachedContentDetail } from "./contents-api";
import { ContentsPageClient } from "./contentsPageClient";
type ContentsPageProps = {
contsSn: number;
menuCd: string;
};
async function ContentsPage({ contsSn, menuCd }: ContentsPageProps) {
const initialContent = await getCachedContentDetail(contsSn, menuCd);
return <ContentsPageClient initialContent={initialContent} />;
}
export { ContentsPage };
@@ -0,0 +1,37 @@
"use client";
import { useEffect, useRef } from "react";
import type { ContentsDetail } from "@/src/entities/content/model/contents-interface";
type ContentsPageClientProps = {
initialContent: ContentsDetail;
};
function ContentsPageClient({ initialContent }: ContentsPageClientProps) {
const shadowRootRef = useRef<HTMLDivElement>(null);
useEffect(() => {
if (!shadowRootRef.current || !initialContent?.contsCn) return;
const shadowRoot =
shadowRootRef.current.shadowRoot ??
shadowRootRef.current.attachShadow({ mode: "open" });
shadowRoot.innerHTML = "";
const styleElement = document.createElement("style");
styleElement.textContent = `div { font-size: 16px; line-height: 1.5; }`;
shadowRoot.appendChild(styleElement);
const contentElement = document.createElement("div");
contentElement.innerHTML = initialContent.contsCn;
shadowRoot.appendChild(contentElement);
}, [initialContent]);
return (
<div className="card card-border !mt-6 !p-6">
<div ref={shadowRootRef} />
</div>
);
}
export { ContentsPageClient };
+1
View File
@@ -0,0 +1 @@
export { ContentsPage } from "./contentsPage";
+1 -1
View File
@@ -60,7 +60,7 @@ export function middleware(req: NextRequest) {
if (pathname.startsWith("/user-service") if (pathname.startsWith("/user-service")
|| pathname.startsWith("/cms-service")) { || pathname.startsWith("/cms-service")) {
let queryParams = searchParams.toString(); const queryParams = searchParams.toString();
const requestHeaders = new Headers(req.headers); const requestHeaders = new Headers(req.headers);
const newUrl = `${serverApiUrl}${pathname}${queryParams ? `?${queryParams}` : ""}`; const newUrl = `${serverApiUrl}${pathname}${queryParams ? `?${queryParams}` : ""}`;
+4
View File
@@ -48,6 +48,10 @@ const nextConfig: NextConfig = {
source: "/operation-service/:path*", source: "/operation-service/:path*",
destination: `${subDomain}/operation-service/:path*`, destination: `${subDomain}/operation-service/:path*`,
}, },
{
source: "/cms-service/:path*",
destination: `${subDomain}/cms-service/:path*`,
},
], ],
fallback: [], fallback: [],
}; };
@@ -0,0 +1,101 @@
import { client } from "@/src/shared/api";
import { ENDPOINT } from "@/src/shared/config";
import type {
ContentsService,
ContentsParams,
ContentsList,
ContentsFormData,
ContentsVersionParams,
ContentsVersionList,
ContentsDetail,
} from "../model/contents-interface";
export class ContentsApiService implements ContentsService {
public async getContentsList(params: ContentsParams): Promise<ContentsList> {
const response = await client.get<ContentsList>(
`${ENDPOINT.CMS_SERVICE.CONTENTS}`,
{ params },
);
return response.data;
}
public async getLatestApprovedContentsInfo(
contsSn: number,
menuCd: string,
): Promise<ContentsDetail> {
const response = await client.get<ContentsDetail>(
`${ENDPOINT.CMS_SERVICE.CONTENTS}/${contsSn}`,
{ params: { menuCd } },
);
return response.data;
}
public async getContentsVersionList(
params: ContentsVersionParams,
): Promise<ContentsVersionList> {
const response = await client.get<ContentsVersionList>(
`${ENDPOINT.CMS_SERVICE.CONTENTS_DETAILS}`,
{ params },
);
return response.data;
}
public async getLatestContentsInfo(
contsSn: number,
contsVer: number,
): Promise<ContentsDetail> {
const response = await client.get<ContentsDetail>(
`${ENDPOINT.CMS_SERVICE.CONTENTS_DETAILS}/${contsSn}/${contsVer}`,
);
return response.data;
}
public async createContents(data: ContentsFormData): Promise<void> {
const response = await client.post<void>(
`${ENDPOINT.CMS_SERVICE.CONTENTS_DETAILS}`,
data,
);
return response.data;
}
public async updateContents(
contsSn: number,
contsVer: number,
data: ContentsFormData,
): Promise<void> {
const response = await client.put<void>(
`${ENDPOINT.CMS_SERVICE.CONTENTS_DETAILS}/${contsSn}/${contsVer}`,
data,
);
return response.data;
}
public async deleteContents(
contsSn: number,
contsVer: number,
): Promise<void> {
await client.delete(
`${ENDPOINT.CMS_SERVICE.CONTENTS_DETAILS}/${contsSn}/${contsVer}`,
);
}
public async requestApprove(
contsSn: number,
contsVer: number,
): Promise<void> {
await client.put(
`${ENDPOINT.CMS_SERVICE.CONTENTS_DETAILS}/${contsSn}/${contsVer}/approveRequest`,
);
}
public async approveContents(
contsSn: number,
contsVer: number,
): Promise<void> {
await client.put(
`${ENDPOINT.CMS_SERVICE.CONTENTS_DETAILS}/${contsSn}/${contsVer}/approve`,
);
}
}
export const ContentsApi = new ContentsApiService();
+8
View File
@@ -0,0 +1,8 @@
export { ContentsApi } from "./api/contents-service";
export {
CONTENTS_APPROVE_STATUS,
contentsFormSchema,
type Contents,
type ContentsParams,
type ContentsFormData,
} from "./model/contents-interface";
@@ -0,0 +1,34 @@
interface SortConfig {
empty: boolean;
sorted: boolean;
unsorted: boolean;
}
interface PageableConfig {
sort: SortConfig;
offset: number;
pageNumber: number;
pageSize: number;
paged: boolean;
unpaged: boolean;
}
export interface PageableList<T> {
content: T[];
pageable: PageableConfig;
sort: SortConfig;
totalPages: number;
totalElements: number;
number: number;
numberOfElements: number;
size: number;
first: boolean;
last: boolean;
empty: boolean;
}
export interface PageableParams {
page?: number;
size?: number;
sort?: string;
}
@@ -0,0 +1,105 @@
import { z } from "zod";
import type { PageableList, PageableParams } from "./api-interface";
export const CONTENTS_APPROVE_STATUS = {
DRAFT: "01",
REQUESTED: "02",
APPROVED: "99",
} as const;
export type ContentsApproveStatus =
(typeof CONTENTS_APPROVE_STATUS)[keyof typeof CONTENTS_APPROVE_STATUS];
export interface ContentsParams extends PageableParams {
contsTtl?: string;
aprvContsVer?: number;
useYn?: string;
}
export interface ContentsVersionParams extends PageableParams {
contsSn?: number;
contsCn?: string;
aprvCd?: ContentsApproveStatus;
cclCd?: string;
koglCd?: string;
tag?: string;
useYn?: string;
}
export interface ContentsVersion {
contsSn: number;
contsVer: number;
contsCn: string;
useYn: string;
}
export const contentsSchema = z.object({
contsSn: z.number(),
contsTtl: z.string(),
aprvContsVer: z.number(),
useYn: z.string(),
mdfcnDt: z.string(),
mdfr: z.string(),
mdfrNm: z.string(),
aprvDt: z.string(),
autzrNm: z.string(),
workAprvCd: z.string(),
workAprvNm: z.string(),
workContsVer: z.number(),
});
export const contentsDetailSchema = z.object({
contsSn: z.number(),
contsVer: z.number(),
contsTtl: z.string(),
contsCn: z.string(),
contsRmrk: z.string().nullish(),
aprvCd: z.enum([
CONTENTS_APPROVE_STATUS.DRAFT,
CONTENTS_APPROVE_STATUS.REQUESTED,
CONTENTS_APPROVE_STATUS.APPROVED,
]),
cclCd: z.string().nullish(),
koglCd: z.string().nullish(),
tag: z.string().nullish(),
aprvDt: z.string(),
autzr: z.string(),
useYn: z.string(),
menuPicUserUnqIdNm: z.string().nullish(),
});
export const contentsFormSchema = contentsDetailSchema.omit({
contsVer: true,
aprvDt: true,
autzr: true,
});
export type Contents = z.infer<typeof contentsSchema>;
export type ContentsDetail = z.infer<typeof contentsDetailSchema>;
export type ContentsFormData = z.infer<typeof contentsFormSchema>;
export type ContentsList = PageableList<Contents>;
export type ContentsVersionList = PageableList<ContentsVersion>;
export interface ContentsService {
getContentsList(params: ContentsParams): Promise<ContentsList>;
getLatestApprovedContentsInfo(
contsSn: number,
menuCd: string,
): Promise<ContentsDetail>;
getContentsVersionList(
params: ContentsVersionParams,
): Promise<ContentsVersionList>;
getLatestContentsInfo(
contsSn: number,
contsVer: number,
): Promise<ContentsDetail>;
createContents(data: ContentsFormData): Promise<void>;
updateContents(
contsSn: number,
contsVer: number,
data: ContentsFormData,
): Promise<void>;
deleteContents(contsSn: number, contsVer: number): Promise<void>;
requestApprove(contsSn: number, contsVer: number): Promise<void>;
approveContents(contsSn: number, contsVer: number): Promise<void>;
}
+3 -3
View File
@@ -1,7 +1,7 @@
# apps/cs/src/shared/config/env.ts 참고 # apps/cs/src/shared/config/env.ts 참고
NEXT_PUBLIC_PORT=3000 NEXT_PUBLIC_PORT=3001
NEXT_PUBLIC_PROXY_HOST=http://localhost:3000 NEXT_PUBLIC_PROXY_HOST=http://localhost:3001
SERVER_API_URL=http://192.168.0.102:8000 SERVER_API_URL=http://192.168.0.102:8000
NEXT_PUBLIC_SITE_ID=CS NEXT_PUBLIC_SITE_ID=ST
NEXT_PUBLIC_SUB_DOMAIN=http://localhost:3000 NEXT_PUBLIC_SUB_DOMAIN=http://localhost:3000
NEXT_PUBLIC_TINY_API_KEY=t9nc4z6inquvvd5pq1vea8wcp7lb01qmqseh6egms9vpaju2 NEXT_PUBLIC_TINY_API_KEY=t9nc4z6inquvvd5pq1vea8wcp7lb01qmqseh6egms9vpaju2
@@ -82,13 +82,14 @@ export default function WithBaseLayout({
const activeId = getTabStoreState().activeTabId; const activeId = getTabStoreState().activeTabId;
if (activeId) { if (activeId) {
setActiveTab(activeId);
const activeTab = appTabs.find((t) => t.id === activeId); const activeTab = appTabs.find((t) => t.id === activeId);
const gridActiveId = activeTab?.menuItem.menuEngNm; const gridActiveId = activeTab?.menuItem.menuEngNm;
if (gridActiveId) { if (gridActiveId) {
getGridTabStoreState().setActiveTab(gridActiveId); getGridTabStoreState().setActiveTab(gridActiveId);
} }
} }
}, [menuList, tabs]); }, [menuList, tabs, setActiveTab]);
useEffect(() => { useEffect(() => {
if (!pathname) return; if (!pathname) return;
@@ -103,7 +104,7 @@ export default function WithBaseLayout({
setActiveTabForGrid(gridActiveId); setActiveTabForGrid(gridActiveId);
} }
} }
}, [pathname, setActiveTab, setActiveTabForGrid]); }, [pathname, setActiveTab, setActiveTabForGrid, tabs.length, activeTabId]);
// 활성 탭의 메뉴를 찾아서 urlPath를 가져옴. 탭이 전부 닫히면 ''를 넘겨 LNB에서 메뉴 강조 제거 // 활성 탭의 메뉴를 찾아서 urlPath를 가져옴. 탭이 전부 닫히면 ''를 넘겨 LNB에서 메뉴 강조 제거
const currentPath = useMemo(() => { const currentPath = useMemo(() => {
+1 -1
View File
@@ -10,7 +10,7 @@ import {
ST_SERVICE_URL, ST_SERVICE_URL,
} from "./src/shared/config"; } from "./src/shared/config";
const serverApiUrl = process.env.SERVER_API_URL ?? "http://localhost:3000"; const serverApiUrl = process.env.SERVER_API_URL;
const stServiceUrl = ST_SERVICE_URL; const stServiceUrl = ST_SERVICE_URL;
+1 -1
View File
@@ -3,7 +3,7 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev -p 3001",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "next lint" "lint": "next lint"
+30 -1
View File
@@ -21,6 +21,16 @@
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-vrf-prcs-ok { .rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-vrf-prcs-ok {
@apply !font-semibold !text-[#3372cf]; @apply !font-semibold !text-[#3372cf];
} }
/* 검증결과 다이얼로그: 구분(NV·IMR·HB) */
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-vrf-mthd-nv {
@apply !bg-[#f3f4f6] !font-semibold !text-[#4b5563];
}
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-vrf-mthd-imr {
@apply !bg-[#fef2f2] !font-semibold !text-[#dc2626];
}
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-vrf-mthd-hb {
@apply !bg-[#eff6ff] !font-semibold !text-[#2563eb];
}
/* 개별 반려: 높이/레이아웃은 RealGrid 행에 그대로 두고, 색·테두리·정렬만 버튼 느낌 */ /* 개별 반려: 높이/레이아웃은 RealGrid 행에 그대로 두고, 색·테두리·정렬만 버튼 느낌 */
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-reject-mini-btn { .rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-reject-mini-btn {
text-align: center !important; text-align: center !important;
@@ -195,7 +205,7 @@
* .rg-grid … 특이도로 덮어씀. * .rg-grid … 특이도로 덮어씀.
*/ */
.rg-grid .rg-header .rg-table .rg-header-group-cell { .rg-grid .rg-header .rg-table .rg-header-group-cell {
background-color: #466995 !important; background-color: #5987bf !important;
color: #ffffff !important; color: #ffffff !important;
} }
.rg-grid .rg-header .rg-table { .rg-grid .rg-header .rg-table {
@@ -215,6 +225,8 @@
color: #ffffff !important; color: #ffffff !important;
} }
.rg-header .rg-table tr td:hover { background: #5987bf; }
[data-theme="black"] .rg-grid .rg-header .rg-table .rg-header-group-cell { [data-theme="black"] .rg-grid .rg-header .rg-table .rg-header-group-cell {
background-color: #3c4043 !important; background-color: #3c4043 !important;
color: #ffffff !important; color: #ffffff !important;
@@ -235,6 +247,11 @@
background-color: #62686d !important; background-color: #62686d !important;
color: #ffffff !important; color: #ffffff !important;
} }
[data-theme="black"] .rg-header .rg-table tr td:hover {
background-color: #62686d !important;
color: #ffffff !important;
}
[data-theme="black"] .rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell { [data-theme="black"] .rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell {
background-color: #545556 !important; background-color: #545556 !important;
color: #ffffff !important; color: #ffffff !important;
@@ -245,6 +262,18 @@
[data-theme="black"] .rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-vrf-prcs-ok { [data-theme="black"] .rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-vrf-prcs-ok {
color: #3372cf !important; color: #3372cf !important;
} }
[data-theme="black"] .rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-vrf-mthd-nv {
background-color: #4b5563 !important;
color: #f9fafb !important;
}
[data-theme="black"] .rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-vrf-mthd-imr {
background-color: rgb(127 29 29 / 0.55) !important;
color: #fecaca !important;
}
[data-theme="black"] .rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-vrf-mthd-hb {
background-color: rgb(30 58 138 / 0.55) !important;
color: #bfdbfe !important;
}
[data-theme="black"] .rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-reject-mini-btn { [data-theme="black"] .rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-reject-mini-btn {
background-color: rgb(127 29 29 / 0.42) !important; background-color: rgb(127 29 29 / 0.42) !important;
border-color: rgb(248 113 113 / 0.5) !important; border-color: rgb(248 113 113 / 0.5) !important;
@@ -116,7 +116,8 @@ const CompactDataGrid = ({
onItemChecked, onItemChecked,
onItemAllChecked, onItemAllChecked,
compactFullWidth = false, compactFullWidth = false,
compactGridHeightClass = "h-[65vh]", compactGridHeightClass = "h-[55vh]",
headerHeight = 60,
}: DataGridProps) => { }: DataGridProps) => {
const { columns, columnLayout } = columnInfo; const { columns, columnLayout } = columnInfo;
const gridRef = useRef<RealGridReact>(null); const gridRef = useRef<RealGridReact>(null);
@@ -188,7 +189,7 @@ const CompactDataGrid = ({
fitStyle: GridFitStyle.EVEN fitStyle: GridFitStyle.EVEN
}); });
gridView.header.height = 60; gridView.header.height = headerHeight;
if (columns.some((c) => Boolean(resolveColumnTooltip(c)))) { if (columns.some((c) => Boolean(resolveColumnTooltip(c)))) {
(gridView.header as { showTooltip?: boolean }).showTooltip = true; (gridView.header as { showTooltip?: boolean }).showTooltip = true;
} }
@@ -449,7 +450,17 @@ const CompactDataGrid = ({
return () => { return () => {
if (getGridDataRef) getGridDataRef.current = null; if (getGridDataRef) getGridDataRef.current = null;
}; };
}, [columns, columnLayout, fixedColumns, rowData, showHeaderCheckbox, getGridDataRef, compactFullWidth, compactGridHeightClass]); }, [
columns,
columnLayout,
fixedColumns,
rowData,
showHeaderCheckbox,
getGridDataRef,
compactFullWidth,
compactGridHeightClass,
headerHeight,
]);
// 행 클릭 이벤트 // 행 클릭 이벤트
useEffect(() => { useEffect(() => {
+85 -5
View File
@@ -20,6 +20,11 @@ import type {
} from "../type/DataGrid.type"; } from "../type/DataGrid.type";
import { getComputedValueCallback } from "@/components/util/grid/computedFieldCallbacks"; import { getComputedValueCallback } from "@/components/util/grid/computedFieldCallbacks";
import {
prepareGridColumnsForExcelExport,
restoreGridColumnsAfterExcelExport,
shouldPrepareColumnsForExcelExport,
} from "@/components/util/gridExcelExport";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
// RealGrid 타입 확장 // RealGrid 타입 확장
@@ -47,6 +52,23 @@ if (typeof window !== "undefined") {
RealGrid.setLicenseKey(process.env.NEXT_PUBLIC_ST_REALGRID_KEY || ""); RealGrid.setLicenseKey(process.env.NEXT_PUBLIC_ST_REALGRID_KEY || "");
type GridViewWithCheckApi = {
checkItem?: (itemIndex: number, checked: boolean, exclusive?: boolean) => void;
checkRow?: (dataRow: number, checked: boolean, exclusive?: boolean) => void;
checkAll?: (checked: boolean) => void;
};
function isRowCheckedFlag(value: unknown): boolean {
return (
value === true ||
value === 1 ||
value === "1" ||
value === "Y" ||
value === "y" ||
value === "true"
);
}
/** setDataComparer(field, comparer) - setFields 없이 숫자 정렬용. comparer(field, row1, row2) => -1|0|1 */ /** setDataComparer(field, comparer) - setFields 없이 숫자 정렬용. comparer(field, row1, row2) => -1|0|1 */
interface RealGridDataProviderComparer { interface RealGridDataProviderComparer {
setDataComparer?( setDataComparer?(
@@ -386,7 +408,9 @@ const DataGrid = ({
highlightedRowId, highlightedRowId,
idFieldName = "id", idFieldName = "id",
enableSort = false, enableSort = false,
gridHeight = 65, // vh 단위 gridHeight = 55, // vh 단위
headerHeight = 60,
fitStyle = GridFitStyle.EVEN,
}: DataGridProps) => { }: DataGridProps) => {
const { columns, columnLayout } = columnInfo; const { columns, columnLayout } = columnInfo;
const gridRef = useRef<RealGridReact>(null); const gridRef = useRef<RealGridReact>(null);
@@ -411,6 +435,7 @@ const DataGrid = ({
const onItemCheckedRef = useRef<typeof onItemChecked>(onItemChecked); const onItemCheckedRef = useRef<typeof onItemChecked>(onItemChecked);
const onItemAllCheckedRef = const onItemAllCheckedRef =
useRef<typeof onItemAllChecked>(onItemAllChecked); useRef<typeof onItemAllChecked>(onItemAllChecked);
const isSyncingChecksFromRowDataRef = useRef(false);
columnsRef.current = columns; columnsRef.current = columns;
rowDataRef.current = rowData; rowDataRef.current = rowData;
cellStyleCallbackRef.current = cellStyleCallback; cellStyleCallbackRef.current = cellStyleCallback;
@@ -547,6 +572,12 @@ const DataGrid = ({
gridView.setColumnLayout?.(normalizedLayout); gridView.setColumnLayout?.(normalizedLayout);
} }
const useExcelColumnVisibilityPrep =
shouldPrepareColumnsForExcelExport(columns);
const excelExportVisibilitySnapshot = useExcelColumnVisibilityPrep
? prepareGridColumnsForExcelExport(gridView, columns)
: undefined;
const exportBaseName = excelExportFileSuffix const exportBaseName = excelExportFileSuffix
? `${menuName}_${excelExportFileSuffix}` ? `${menuName}_${excelExportFileSuffix}`
: menuName; : menuName;
@@ -556,8 +587,14 @@ const DataGrid = ({
target: "local", target: "local",
fileName: `${exportBaseName}.xlsx`, fileName: `${exportBaseName}.xlsx`,
footer: "hidden", footer: "hidden",
allColumns: true, // 숨김(visible: false) 컬럼도 엑셀에 포함 allColumns: !useExcelColumnVisibilityPrep,
done: () => { done: () => {
if (excelExportVisibilitySnapshot) {
restoreGridColumnsAfterExcelExport(
gridView,
excelExportVisibilitySnapshot,
);
}
// 헤더 원복 // 헤더 원복
columns.forEach((col) => { columns.forEach((col) => {
if (col.fieldName && gridView.columnByName) { if (col.fieldName && gridView.columnByName) {
@@ -850,10 +887,9 @@ const DataGrid = ({
) )
: () => false; : () => false;
(gridView.displayOptions as DisplayOptions).fitStyle = (gridView.displayOptions as DisplayOptions).fitStyle = fitStyle;
GridFitStyle.EVEN;
gridView.displayOptions.rowHeight = 30; gridView.displayOptions.rowHeight = 30;
gridView.header.height = 60; gridView.header.height = headerHeight;
if (columns.some((c) => Boolean(resolveColumnTooltip(c)))) { if (columns.some((c) => Boolean(resolveColumnTooltip(c)))) {
(gridView.header as { showTooltip?: boolean }).showTooltip = true; (gridView.header as { showTooltip?: boolean }).showTooltip = true;
} }
@@ -1178,6 +1214,9 @@ const DataGrid = ({
rowData, rowData,
showHeaderCheckbox, showHeaderCheckbox,
getGridDataRef, getGridDataRef,
headerHeight,
fitStyle,
enableSort,
]); ]);
// 행 클릭 이벤트 + 검증 오류 셀 클릭 시 showMessage (공식 문서 방식) // 행 클릭 이벤트 + 검증 오류 셀 클릭 시 showMessage (공식 문서 방식)
@@ -1278,6 +1317,7 @@ const DataGrid = ({
if (onItemChecked) { if (onItemChecked) {
gridView.onItemChecked = (_grid, itemIndex, checked) => { gridView.onItemChecked = (_grid, itemIndex, checked) => {
if (isSyncingChecksFromRowDataRef.current) return;
onItemCheckedRef.current?.(itemIndex, checked); onItemCheckedRef.current?.(itemIndex, checked);
}; };
} else { } else {
@@ -1286,6 +1326,7 @@ const DataGrid = ({
if (onItemAllChecked) { if (onItemAllChecked) {
gridView.onItemAllChecked = (_grid, checked) => { gridView.onItemAllChecked = (_grid, checked) => {
if (isSyncingChecksFromRowDataRef.current) return;
onItemAllCheckedRef.current?.(checked); onItemAllCheckedRef.current?.(checked);
}; };
} else { } else {
@@ -1299,6 +1340,45 @@ const DataGrid = ({
}; };
}, [onItemChecked, onItemAllChecked]); }, [onItemChecked, onItemAllChecked]);
useEffect(() => {
if (!gridRef.current?.gridView || !showHeaderCheckbox) return;
const gridView = gridRef.current.gridView as GridViewWithCheckApi;
const dataProvider = gridRef.current.dataProvider as
| { setRows?: (rows: Record<string, string | number>[]) => void }
| undefined;
if (dataProvider?.setRows) {
dataProvider.setRows(rowData);
}
const hasCheckedColumn = rowData.some((row) =>
Object.prototype.hasOwnProperty.call(row, "__checked"),
);
if (!hasCheckedColumn) return;
const timer = window.setTimeout(() => {
isSyncingChecksFromRowDataRef.current = true;
try {
gridView.checkAll?.(false);
rowData.forEach((row, itemIndex) => {
if (!isRowCheckedFlag((row as Record<string, unknown>).__checked)) return;
if (gridView.checkItem) {
gridView.checkItem(itemIndex, true, false);
return;
}
gridView.checkRow?.(itemIndex, true, false);
});
} catch (e) {
console.warn("check sync:", e);
} finally {
isSyncingChecksFromRowDataRef.current = false;
}
}, 0);
return () => window.clearTimeout(timer);
}, [rowData, showHeaderCheckbox]);
useEffect(() => { useEffect(() => {
const gridView = gridRef.current?.gridView; const gridView = gridRef.current?.gridView;
if (!gridView) return; if (!gridView) return;
@@ -466,7 +466,7 @@ export function ExceptionProcessingHistoryDialog({
gridRef: MutableRefObject<RealGridReact | null>, gridRef: MutableRefObject<RealGridReact | null>,
) => { ) => {
if (!loading && rows.length === 0) { if (!loading && rows.length === 0) {
return <p className="p-6 text-center text-[1.3rem] text-muted-foreground">{emptyMessage}</p>; return <p className="p-6 text-center text-[1.3rem] text-muted-foreground h-[65vh] flex justify-center items-center">{emptyMessage}</p>;
} }
return ( return (
@@ -334,7 +334,23 @@ const SidoSggFacilityNameSearchForm = ({
} }
}; };
const handleSaveAdminRegions = () => { const handleSaveAdminRegions = async () => {
const statusCodeResponse = await statisticsApi.CheckStatusCode({
sewerBzmnCd: initialSearchValues?.bsnmCd?.trim() ?? "",
statsCd: 'ST00020002',
statsYr: statsYr?.trim() ?? ''
});
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관리자에게 문의하세요')
}
if (!statsYr?.trim()) { if (!statsYr?.trim()) {
alert("상단에서 통계연도로 조회한 뒤 이용해 주세요."); alert("상단에서 통계연도로 조회한 뒤 이용해 주세요.");
return; return;
+14 -1
View File
@@ -16,6 +16,11 @@ import GridTopActionButton from "./GridTopActionButton";
import SplitDataGrid from "./SplitDataGrid"; import SplitDataGrid from "./SplitDataGrid";
import { getComputedValueCallback } from "@/components/util/grid/computedFieldCallbacks" import { getComputedValueCallback } from "@/components/util/grid/computedFieldCallbacks"
import {
prepareGridColumnsForExcelExport,
restoreGridColumnsAfterExcelExport,
shouldPrepareColumnsForExcelExport,
} from "@/components/util/gridExcelExport"
import { useTabStore } from "@/store/tab-store" import { useTabStore } from "@/store/tab-store"
// RealGrid 타입 확장 // RealGrid 타입 확장
@@ -432,13 +437,21 @@ const TabDataGrid = ({
gridView.setColumnLayout?.(normalizedLayout); gridView.setColumnLayout?.(normalizedLayout);
} }
const useExcelColumnVisibilityPrep = shouldPrepareColumnsForExcelExport(columns);
const excelExportVisibilitySnapshot = useExcelColumnVisibilityPrep
? prepareGridColumnsForExcelExport(gridView, columns)
: undefined;
gridView.exportGrid({ gridView.exportGrid({
type: 'excel', type: 'excel',
target: 'local', target: 'local',
fileName: `${menuName}_${tabLabel}.xlsx`, fileName: `${menuName}_${tabLabel}.xlsx`,
footer: 'hidden', footer: 'hidden',
allColumns: true, // 숨김(visible: false) 컬럼도 엑셀에 포함 allColumns: !useExcelColumnVisibilityPrep,
done: () => { done: () => {
if (excelExportVisibilitySnapshot) {
restoreGridColumnsAfterExcelExport(gridView, excelExportVisibilitySnapshot);
}
// 헤더 원복 // 헤더 원복
columns.forEach((col) => { columns.forEach((col) => {
if (col.fieldName && gridView.columnByName) { if (col.fieldName && gridView.columnByName) {
@@ -23,7 +23,11 @@ import {
} from "@common/components"; } from "@common/components";
import DataGrid from "@/components/module/DataGrid"; import DataGrid from "@/components/module/DataGrid";
import { VerificationResultHistoryPagination } from "@/components/module/VerificationResultHistoryPagination"; import { VerificationResultHistoryPagination } from "@/components/module/VerificationResultHistoryPagination";
import type { CellEditedCallbackParams, ColumnInfo } from "@/components/type/DataGrid.type"; import type {
CellEditedCallbackParams,
CellStyleCallbackParams,
ColumnInfo,
} from "@/components/type/DataGrid.type";
import { getUserInfo } from "../../../../../packages/common/components/src/api"; import { getUserInfo } from "../../../../../packages/common/components/src/api";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import type { VerificationResultListRequest, VerificationResultReportItem } from "@/entities/statistics/model/statistics-interface"; import type { VerificationResultListRequest, VerificationResultReportItem } from "@/entities/statistics/model/statistics-interface";
@@ -31,6 +35,16 @@ import { useAlertStore } from "@/shared/lib";
type VerificationResultGridRow = Record<string, string | number>; type VerificationResultGridRow = Record<string, string | number>;
type VerificationMethodCd = "NV" | "IMR" | "HB";
const VERIFICATION_METHOD_CODES: VerificationMethodCd[] = ["NV", "IMR", "HB"];
const VRFC_MTHD_NAME_MAP: Record<VerificationMethodCd, string> = {
NV: "일반",
IMR: "I-MR",
HB: "HB",
};
export type VerificationExceptionSubmitItem = { export type VerificationExceptionSubmitItem = {
vrfcSn: number; vrfcSn: number;
prcsOpnnExpln: string; prcsOpnnExpln: string;
@@ -60,9 +74,23 @@ const PRCS_YN_LABEL: Record<string, string> = {
"3": "반려", "3": "반려",
}; };
/** History와 동일 + 편집 가능한 처리의견(예외사유, API 필드명 `prcsOpnnExpln`과 동일) */ function verificationMthdCellStyle({
fieldName,
row,
}: CellStyleCallbackParams): string | undefined {
if (fieldName !== "vrfcMthdNm") return undefined;
const code = String(row.vrfcMthdCd ?? "");
if (code === "IMR") return "rg-cell-vrf-mthd-imr";
if (code === "HB") return "rg-cell-vrf-mthd-hb";
if (code === "NV") return "rg-cell-vrf-mthd-nv";
return undefined;
}
/** History와 동일 + 구분(검증유형) + 편집 가능한 처리의견(예외사유) */
const verificationSubmitResultColumnInfo: ColumnInfo = { const verificationSubmitResultColumnInfo: ColumnInfo = {
columns: [ columns: [
{ 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: "ctpvNm", fieldName: "ctpvNm", header: { text: "시도" }, editable: false },
{ name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false }, { name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false },
{ name: "vrfcTrgtNm", fieldName: "vrfcTrgtNm", header: { text: "검증대상" }, editable: false }, { name: "vrfcTrgtNm", fieldName: "vrfcTrgtNm", header: { text: "검증대상" }, editable: false },
@@ -81,6 +109,7 @@ const verificationSubmitResultColumnInfo: ColumnInfo = {
}, },
], ],
columnLayout: [ columnLayout: [
"vrfcMthdNm",
"ctpvNm", "ctpvNm",
"sggNm", "sggNm",
"vrfcTrgtNm", "vrfcTrgtNm",
@@ -121,7 +150,6 @@ export function VerificationResultDialog({
emptyMessage = "표시할 검증 결과가 없습니다.", emptyMessage = "표시할 검증 결과가 없습니다.",
onExceptionSubmitted, onExceptionSubmitted,
}: VerificationResultDialogProps) { }: VerificationResultDialogProps) {
/** 부모가 매 렌더마다 새 객체를 넘기면 queryContext 참조만 바뀌어 loadInitial이 재실행되므로 필드 값 기준으로 안정화 */
const stableQueryContext = useMemo((): VerificationResultDialogQueryContext | null => { const stableQueryContext = useMemo((): VerificationResultDialogQueryContext | null => {
if (!queryContext) return null; if (!queryContext) return null;
return queryContext; return queryContext;
@@ -133,47 +161,24 @@ export function VerificationResultDialog({
queryContext?.statsCd, queryContext?.statsCd,
]); ]);
const [normalPageIndex, setNormalPageIndex] = useState(0); const [pageIndex, setPageIndex] = useState(0);
const [imrPageIndex, setImrPageIndex] = useState(0); const [pageCount, setPageCount] = useState(1);
const [normalPageCount, setNormalPageCount] = useState(1); const [loading, setLoading] = useState(false);
const [imrPageCount, setImrPageCount] = useState(1);
const [normalLoading, setNormalLoading] = useState(false);
const [imrLoading, setImrLoading] = useState(false);
const [errorMessage, setErrorMessage] = useState<string | null>(null); const [errorMessage, setErrorMessage] = useState<string | null>(null);
const [normalRows, setNormalRows] = useState<VerificationResultGridRow[]>([]); const [rows, setRows] = useState<VerificationResultGridRow[]>([]);
const [imrRows, setImrRows] = useState<VerificationResultGridRow[]>([]); const [checkedIndices, setCheckedIndices] = useState<Set<number>>(() => new Set());
const [normalCheckedIndices, setNormalCheckedIndices] = useState<Set<number>>(
() => new Set(),
);
const [imrCheckedIndices, setImrCheckedIndices] = useState<Set<number>>(() => new Set());
const normalGridRef = useRef<RealGridReact | null>(null); const gridRef = useRef<RealGridReact | null>(null);
const imrGridRef = useRef<RealGridReact | null>(null); const getGridDataRef = useRef<(() => VerificationResultGridRow[]) | null>(null);
/** 메인 입력 화면처럼 편집 값은 그리드에 두고, 제출 시에만 스냅샷 조회 → Enter 시 rows 재주입 충돌 방지 */
const getNormalGridDataRef = useRef<(() => VerificationResultGridRow[]) | null>(null);
const getImrGridDataRef = useRef<(() => VerificationResultGridRow[]) | null>(null);
const alert = useAlertStore((state) => state.setMessage); const alert = useAlertStore((state) => state.setMessage);
const onNormalPrcsOpnnExplnEdited = useCallback((params: CellEditedCallbackParams) => { const onPrcsOpnnExplnEdited = useCallback((params: CellEditedCallbackParams) => {
if (params.fieldName !== "prcsOpnnExpln") return; if (params.fieldName !== "prcsOpnnExpln") return;
const text = String(params.newValue ?? ""); const text = String(params.newValue ?? "");
const hasValue = text.trim().length > 0; const hasValue = text.trim().length > 0;
setRowCheckByItemIndex(normalGridRef, params.itemIndex, hasValue); setRowCheckByItemIndex(gridRef, params.itemIndex, hasValue);
setNormalCheckedIndices((prev) => { setCheckedIndices((prev) => {
const next = new Set(prev);
if (hasValue) next.add(params.itemIndex);
else next.delete(params.itemIndex);
return next;
});
}, []);
const onImrPrcsOpnnExplnEdited = useCallback((params: CellEditedCallbackParams) => {
if (params.fieldName !== "prcsOpnnExpln") return;
const text = String(params.newValue ?? "");
const hasValue = text.trim().length > 0;
setRowCheckByItemIndex(imrGridRef, params.itemIndex, hasValue);
setImrCheckedIndices((prev) => {
const next = new Set(prev); const next = new Set(prev);
if (hasValue) next.add(params.itemIndex); if (hasValue) next.add(params.itemIndex);
else next.delete(params.itemIndex); else next.delete(params.itemIndex);
@@ -182,38 +187,38 @@ export function VerificationResultDialog({
}, []); }, []);
const resetState = useCallback(() => { const resetState = useCallback(() => {
setNormalPageIndex(0); setPageIndex(0);
setImrPageIndex(0); setPageCount(1);
setNormalPageCount(1); setLoading(false);
setImrPageCount(1);
setNormalLoading(false);
setImrLoading(false);
setErrorMessage(null); setErrorMessage(null);
setNormalRows([]); setRows([]);
setImrRows([]); setCheckedIndices(new Set());
setNormalCheckedIndices(new Set());
setImrCheckedIndices(new Set());
}, []); }, []);
const mapItemToRow = useCallback((item: VerificationResultReportItem): VerificationResultGridRow => { const mapItemToRow = useCallback(
return { (item: VerificationResultReportItem, vrfcMthdCd: VerificationMethodCd): VerificationResultGridRow => {
vrfcSn: item.vrfcSn, return {
ctpvNm: item.ctpvNm, vrfcSn: item.vrfcSn,
sggNm: item.sggNm, vrfcMthdCd,
vrfcTrgtNm: item.vrfcTrgtNm, vrfcMthdNm: VRFC_MTHD_NAME_MAP[vrfcMthdCd] ?? item.vrfcMthdNm,
rsnExpln: item.rsnExpln, ctpvNm: item.ctpvNm,
nowVlCn: item.nowVlCn ?? "-", sggNm: item.sggNm,
compVlCn: item.compVlCn ?? "-", vrfcTrgtNm: item.vrfcTrgtNm,
prcsYn: PRCS_YN_LABEL[item.prcsYn] ?? item.prcsYn, rsnExpln: item.rsnExpln,
pbcpAprvYn: item.pbcpAprvYn, nowVlCn: item.nowVlCn ?? "-",
regDt: (item.regDt ?? "").slice(0, 16), compVlCn: item.compVlCn ?? "-",
mdfcnDt: (item.mdfcnDt ?? "").slice(0, 16), prcsYn: PRCS_YN_LABEL[item.prcsYn] ?? item.prcsYn,
prcsOpnnExpln: item.prcsOpnnExpln ?? "", pbcpAprvYn: item.pbcpAprvYn,
}; regDt: (item.regDt ?? "").slice(0, 16),
}, []); mdfcnDt: (item.mdfcnDt ?? "").slice(0, 16),
prcsOpnnExpln: item.prcsOpnnExpln ?? "",
};
},
[],
);
const fetchVerificationResultPage = useCallback( const fetchVerificationResultPage = useCallback(
async (vrfcMthdCd: "NV" | "IMR", pageIndex: number) => { async (vrfcMthdCd: VerificationMethodCd, page: number) => {
if (!stableQueryContext) return null; if (!stableQueryContext) return null;
const param: VerificationResultListRequest = { const param: VerificationResultListRequest = {
sewerBzmnCd: stableQueryContext.sewerBzmnCd, sewerBzmnCd: stableQueryContext.sewerBzmnCd,
@@ -224,7 +229,7 @@ export function VerificationResultDialog({
pbcpAprvYn: "N", pbcpAprvYn: "N",
vrfcMthdCd, vrfcMthdCd,
prcsYnList: "0", prcsYnList: "0",
page: pageIndex + 1, page: page + 1,
size: 10000, size: 10000,
}; };
return statisticsApi.getVerificationResultList(param); return statisticsApi.getVerificationResultList(param);
@@ -232,81 +237,56 @@ export function VerificationResultDialog({
[stableQueryContext], [stableQueryContext],
); );
const loadInitial = useCallback(async () => { const loadPage = useCallback(
if (!stableQueryContext) { async (nextPageIndex: number) => {
setErrorMessage("조회 조건이 없어 검증 결과를 불러올 수 없습니다."); if (!stableQueryContext) {
return; setErrorMessage("조회 조건이 없어 검증 결과를 불러올 수 없습니다.");
} return;
setErrorMessage(null); }
setNormalLoading(true);
setImrLoading(true);
setNormalPageIndex(0);
setImrPageIndex(0);
try {
const [nvRes, imrRes] = await Promise.all([
fetchVerificationResultPage("NV", 0),
fetchVerificationResultPage("IMR", 0),
]);
const nvList = nvRes?.data?.verifyResultList ?? [];
const imrList = imrRes?.data?.verifyResultList ?? [];
setNormalRows(nvList.map(mapItemToRow));
setImrRows(imrList.map(mapItemToRow));
setNormalPageCount(nvRes?.data?.pageInfo?.totalPages ?? 1);
setImrPageCount(imrRes?.data?.pageInfo?.totalPages ?? 1);
} catch {
setNormalRows([]);
setImrRows([]);
setNormalPageCount(1);
setImrPageCount(1);
setErrorMessage("검증 결과 조회 중 오류가 발생했습니다.");
} finally {
setNormalLoading(false);
setImrLoading(false);
setNormalCheckedIndices(new Set());
setImrCheckedIndices(new Set());
}
}, [fetchVerificationResultPage, mapItemToRow, stableQueryContext]);
const handleNormalPageChange = useCallback(
async (pageIndex: number) => {
if (pageIndex === normalPageIndex || !stableQueryContext) return;
setErrorMessage(null); setErrorMessage(null);
setNormalLoading(true); setLoading(true);
try { try {
const response = await fetchVerificationResultPage("NV", pageIndex); const responses = await Promise.all(
const list = response?.data?.verifyResultList ?? []; VERIFICATION_METHOD_CODES.map((code) =>
setNormalRows(list.map(mapItemToRow)); fetchVerificationResultPage(code, nextPageIndex),
setNormalPageCount(response?.data?.pageInfo?.totalPages ?? 1); ),
setNormalPageIndex(pageIndex); );
const merged: VerificationResultGridRow[] = [];
let maxPageCount = 1;
VERIFICATION_METHOD_CODES.forEach((code, index) => {
const response = responses[index];
const list = response?.data?.verifyResultList ?? [];
merged.push(...list.map((item) => mapItemToRow(item, code)));
maxPageCount = Math.max(
maxPageCount,
response?.data?.pageInfo?.totalPages ?? 1,
);
});
setRows(merged);
setPageCount(maxPageCount);
setPageIndex(nextPageIndex);
} catch { } catch {
setErrorMessage("일반검증 내역 조회 중 오류가 발생했습니다."); setRows([]);
setPageCount(1);
setErrorMessage("검증 결과 조회 중 오류가 발생했습니다.");
} finally { } finally {
setNormalLoading(false); setLoading(false);
setNormalCheckedIndices(new Set()); setCheckedIndices(new Set());
} }
}, },
[fetchVerificationResultPage, mapItemToRow, normalPageIndex, stableQueryContext], [fetchVerificationResultPage, mapItemToRow, stableQueryContext],
); );
const handleImrPageChange = useCallback( const loadInitial = useCallback(async () => {
async (pageIndex: number) => { await loadPage(0);
if (pageIndex === imrPageIndex || !stableQueryContext) return; }, [loadPage]);
setErrorMessage(null);
setImrLoading(true); const handlePageChange = useCallback(
try { async (nextPageIndex: number) => {
const response = await fetchVerificationResultPage("IMR", pageIndex); if (nextPageIndex === pageIndex || !stableQueryContext) return;
const list = response?.data?.verifyResultList ?? []; await loadPage(nextPageIndex);
setImrRows(list.map(mapItemToRow));
setImrPageCount(response?.data?.pageInfo?.totalPages ?? 1);
setImrPageIndex(pageIndex);
} catch {
setErrorMessage("I-MR 검증내역 조회 중 오류가 발생했습니다.");
} finally {
setImrLoading(false);
setImrCheckedIndices(new Set());
}
}, },
[fetchVerificationResultPage, mapItemToRow, imrPageIndex, stableQueryContext], [loadPage, pageIndex, stableQueryContext],
); );
useEffect(() => { useEffect(() => {
@@ -317,58 +297,32 @@ export function VerificationResultDialog({
void loadInitial(); void loadInitial();
}, [loadInitial, open, resetState]); }, [loadInitial, open, resetState]);
/** 조회된 행에 예외사유 텍스트가 있으면 체크바·체크 인덱스와 맞춤 */
useEffect(() => { useEffect(() => {
if (normalLoading) return; if (loading) return;
const id = requestAnimationFrame(() => { const id = requestAnimationFrame(() => {
setNormalCheckedIndices((prev) => { setCheckedIndices((prev) => {
const next = new Set(prev); const next = new Set(prev);
normalRows.forEach((row, itemIndex) => { rows.forEach((row, itemIndex) => {
const has = String(row.prcsOpnnExpln ?? "").trim().length > 0; const has = String(row.prcsOpnnExpln ?? "").trim().length > 0;
setRowCheckByItemIndex(normalGridRef, itemIndex, has); setRowCheckByItemIndex(gridRef, itemIndex, has);
if (has) next.add(itemIndex); if (has) next.add(itemIndex);
}); });
return next; return next;
}); });
}); });
return () => cancelAnimationFrame(id); return () => cancelAnimationFrame(id);
}, [normalRows, normalLoading]); }, [rows, loading]);
useEffect(() => {
if (imrLoading) return;
const id = requestAnimationFrame(() => {
setImrCheckedIndices((prev) => {
const next = new Set(prev);
imrRows.forEach((row, itemIndex) => {
const has = String(row.prcsOpnnExpln ?? "").trim().length > 0;
setRowCheckByItemIndex(imrGridRef, itemIndex, has);
if (has) next.add(itemIndex);
});
return next;
});
});
return () => cancelAnimationFrame(id);
}, [imrRows, imrLoading]);
const handleExceptionSubmitClick = useCallback(async () => { const handleExceptionSubmitClick = useCallback(async () => {
const nvGrid = getNormalGridDataRef.current?.() ?? []; const gridRows = getGridDataRef.current?.() ?? [];
const imGrid = getImrGridDataRef.current?.() ?? [];
const payload: VerificationExceptionSubmitItem[] = []; const payload: VerificationExceptionSubmitItem[] = [];
const pushChecked = ( checkedIndices.forEach((idx) => {
indices: Set<number>, const prcsOpnnExpln = String(gridRows[idx]?.prcsOpnnExpln ?? "").trim();
gridRows: VerificationResultGridRow[], if (!prcsOpnnExpln) return;
idRows: VerificationResultGridRow[], const vrfcSn = Number(rows[idx]?.vrfcSn);
) => { if (!Number.isFinite(vrfcSn)) return;
indices.forEach((idx) => { payload.push({ vrfcSn, prcsOpnnExpln });
const prcsOpnnExpln = String(gridRows[idx]?.prcsOpnnExpln ?? "").trim(); });
if (!prcsOpnnExpln) return;
const vrfcSn = Number(idRows[idx]?.vrfcSn);
if (!Number.isFinite(vrfcSn)) return;
payload.push({ vrfcSn, prcsOpnnExpln });
});
};
pushChecked(normalCheckedIndices, nvGrid, normalRows);
pushChecked(imrCheckedIndices, imGrid, imrRows);
if (payload.length === 0) { if (payload.length === 0) {
alert("작성된 예외 제출 항목이 없습니다."); alert("작성된 예외 제출 항목이 없습니다.");
return; return;
@@ -402,75 +356,13 @@ export function VerificationResultDialog({
} }
}, [ }, [
alert, alert,
imrCheckedIndices, checkedIndices,
imrRows, rows,
normalCheckedIndices,
normalRows,
onExceptionSubmitted, onExceptionSubmitted,
onOpenChange, onOpenChange,
stableQueryContext, stableQueryContext,
]); ]);
const renderGrid = (
rows: VerificationResultGridRow[],
setRows: Dispatch<SetStateAction<VerificationResultGridRow[]>>,
pageIndex: number,
pageCount: number,
onPageIndexChange: (page: number) => void,
loading: boolean,
gridRef: MutableRefObject<RealGridReact | null>,
getGridDataRef: MutableRefObject<(() => VerificationResultGridRow[]) | null>,
onPrcsOpnnExplnCellEdited: (params: CellEditedCallbackParams) => void,
setCheckedIndices: Dispatch<SetStateAction<Set<number>>>,
) => {
if (!loading && rows.length === 0) {
return <p className="p-6 text-center text-[1.3rem] text-muted-foreground">{emptyMessage}</p>;
}
return (
<div className="relative space-y-2">
<DataGrid
columnInfo={verificationSubmitResultColumnInfo}
rowData={rows}
setRowData={setRows as Dispatch<SetStateAction<Record<string, string | number>[]>>}
isExcelImport={false}
isExcelExport={false}
showHeaderCheckbox
enableSort={false}
getGridRef={gridRef}
getGridDataRef={getGridDataRef}
onCellEdited={onPrcsOpnnExplnCellEdited}
onItemChecked={(itemIndex, checked) => {
setCheckedIndices((prev) => {
const next = new Set(prev);
if (checked) next.add(itemIndex);
else next.delete(itemIndex);
return next;
});
}}
onItemAllChecked={(checked) => {
setCheckedIndices(
checked ? new Set(rows.map((_, i) => i)) : new Set(),
);
}}
/>
<VerificationResultHistoryPagination
pageCount={Math.max(pageCount, 1)}
pageIndex={Math.max(pageIndex, 0)}
onPageIndexChange={onPageIndexChange}
className="mx-2 mb-2"
/>
{loading && (
<div className="absolute inset-0 z-10 rounded-md [data-theme='black']:bg-transparent bg-white/40 flex items-center justify-center">
<div className="relative size-[5rem]">
<LoadingWithAnimation color="primary" />
</div>
</div>
)}
</div>
);
};
const titleSuffix = useMemo(() => { const titleSuffix = useMemo(() => {
if (!stableQueryContext) return ""; if (!stableQueryContext) return "";
const sgg = stableQueryContext.sggNm?.trim() ? ` ${stableQueryContext.sggNm}` : ""; const sgg = stableQueryContext.sggNm?.trim() ? ` ${stableQueryContext.sggNm}` : "";
@@ -488,38 +380,61 @@ export function VerificationResultDialog({
</DialogHeader> </DialogHeader>
<div className="max-h-[85vh] space-y-5 overflow-auto"> <div className="max-h-[85vh] space-y-5 overflow-auto">
{errorMessage && ( {errorMessage && (
<p className="rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[1.2rem] text-destructive"> <p className="rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[1.2rem] text-destructive h-[65vh] flex justify-center items-center">
{errorMessage} {errorMessage}
</p> </p>
)} )}
<section className="rounded-md border border-border"> <section className="rounded-md border border-border">
<h3 className="border-b border-border px-4 py-2 text-[1.35rem] font-semibold">일반검증 내역</h3> {!loading && rows.length === 0 ? (
{renderGrid( <p className="p-6 text-center text-[1.3rem] text-muted-foreground">
normalRows, {emptyMessage}
setNormalRows, </p>
normalPageIndex, ) : (
normalPageCount, <div className="relative space-y-2">
handleNormalPageChange, <DataGrid
normalLoading, columnInfo={verificationSubmitResultColumnInfo}
normalGridRef, rowData={rows}
getNormalGridDataRef, setRowData={
onNormalPrcsOpnnExplnEdited, setRows as Dispatch<
setNormalCheckedIndices, SetStateAction<Record<string, string | number>[]>
)} >
</section> }
<section className="rounded-md border border-border"> isExcelImport={false}
<h3 className="border-b border-border px-4 py-2 text-[1.35rem] font-semibold">I-MR 검증내역</h3> isExcelExport={false}
{renderGrid( showHeaderCheckbox
imrRows, enableSort={false}
setImrRows, getGridRef={gridRef}
imrPageIndex, getGridDataRef={getGridDataRef}
imrPageCount, onCellEdited={onPrcsOpnnExplnEdited}
handleImrPageChange, cellStyleCallback={verificationMthdCellStyle}
imrLoading, onItemChecked={(itemIndex, checked) => {
imrGridRef, setCheckedIndices((prev) => {
getImrGridDataRef, const next = new Set(prev);
onImrPrcsOpnnExplnEdited, if (checked) next.add(itemIndex);
setImrCheckedIndices, else next.delete(itemIndex);
return next;
});
}}
onItemAllChecked={(checked) => {
setCheckedIndices(
checked ? new Set(rows.map((_, i) => i)) : new Set(),
);
}}
/>
<VerificationResultHistoryPagination
pageCount={Math.max(pageCount, 1)}
pageIndex={Math.max(pageIndex, 0)}
onPageIndexChange={handlePageChange}
className="mx-2 mb-2"
/>
{loading && (
<div className="absolute inset-0 z-10 flex items-center justify-center rounded-md bg-white/40 [data-theme='black']:bg-transparent">
<div className="relative size-[5rem]">
<LoadingWithAnimation color="primary" />
</div>
</div>
)}
</div>
)} )}
</section> </section>
</div> </div>
@@ -1,7 +1,18 @@
"use client"; "use client";
import { type Dispatch, type SetStateAction, useCallback, useEffect, useMemo, useState } from "react"; import {
type Dispatch,
type MutableRefObject,
type SetStateAction,
useCallback,
useEffect,
useMemo,
useRef,
useState,
} from "react";
import type { RealGridReact } from "realgrid-react";
import { getUserInfo } from "../../../../../packages/common/components/src/api";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import type { VerificationResultListRequest, VerificationResultReportItem } from "@/entities/statistics/model/statistics-interface"; import type { VerificationResultListRequest, VerificationResultReportItem } from "@/entities/statistics/model/statistics-interface";
import { import {
@@ -22,6 +33,7 @@ import {
import DataGrid from "@/components/module/DataGrid"; import DataGrid from "@/components/module/DataGrid";
import { VerificationResultHistoryPagination } from "@/components/module/VerificationResultHistoryPagination"; import { VerificationResultHistoryPagination } from "@/components/module/VerificationResultHistoryPagination";
import type { CellStyleCallbackParams, ColumnInfo } from "@/components/type/DataGrid.type"; import type { CellStyleCallbackParams, ColumnInfo } from "@/components/type/DataGrid.type";
import { useAlertStore } from "@/shared/lib";
type VerificationResultGridRow = Record<string, string | number>; type VerificationResultGridRow = Record<string, string | number>;
type VerificationHistoryTabKey = "NV" | "IMR" | "HB"; type VerificationHistoryTabKey = "NV" | "IMR" | "HB";
@@ -32,6 +44,24 @@ const verificationHistoryTabs: { value: VerificationHistoryTabKey; label: string
{ value: "HB", label: "HB 검증내역" }, { value: "HB", label: "HB 검증내역" },
]; ];
const PAGE_SIZE = 30;
/** vrfcSn → prcsYn (페이지 이동 후에도 취소 가능 여부 검증용) */
const createEmptyCheckedVrfcByTab = (): Record<VerificationHistoryTabKey, Map<number, string>> => ({
NV: new Map(),
IMR: new Map(),
HB: new Map(),
});
const initialTabPageState = (): Record<
VerificationHistoryTabKey,
{ pageIndex: number; pageCount: number }
> => ({
NV: { pageIndex: 0, pageCount: 1 },
IMR: { pageIndex: 0, pageCount: 1 },
HB: { pageIndex: 0, pageCount: 1 },
});
function prcsYnCodeToNumber(raw: string | number | undefined): number | undefined { function prcsYnCodeToNumber(raw: string | number | undefined): number | undefined {
if (raw === undefined || raw === null) return undefined; if (raw === undefined || raw === null) return undefined;
if (typeof raw === "number" && Number.isFinite(raw)) return raw; if (typeof raw === "number" && Number.isFinite(raw)) return raw;
@@ -41,7 +71,62 @@ function prcsYnCodeToNumber(raw: string | number | undefined): number | undefine
return Number.isFinite(n) ? n : undefined; return Number.isFinite(n) ? n : undefined;
} }
/** prcsYn 0·4 → 빨간색, 그 외 → 초록색 (처리여부 컬럼) */ /** 예외 제출 취소 가능: prcsYn = 2 (예외처리) */
function canExceptionReset(prcsYn: string | number | undefined): boolean {
return prcsYnCodeToNumber(prcsYn) === 2;
}
const EXCEPTION_RESET_ONLY_PRCS_YN_2_MESSAGE =
"예외 제출 취소는 처리여부가 사용자예외처리인 항목만 선택할 수 있습니다.";
type GridViewWithCheckApi = {
getCheckedRows?: (allItems?: boolean, visibleOnly?: boolean, exclusive?: boolean) => number[];
checkItem?: (itemIndex: number, checked: boolean, exclusive?: boolean) => void;
};
function uncheckGridRow(gridRef: MutableRefObject<RealGridReact | null>, itemIndex: number) {
try {
(gridRef.current?.gridView as GridViewWithCheckApi | undefined)?.checkItem?.(itemIndex, false, false);
} catch {
/* ignore */
}
}
function syncCheckedMapFromGrid(
entries: VerificationResultReportItem[],
gridRef: MutableRefObject<RealGridReact | null>,
prevMap: Map<number, string>,
): Map<number, string> {
const next = new Map(prevMap);
for (const entry of entries) {
const sn = Number(entry.vrfcSn);
if (Number.isFinite(sn)) next.delete(sn);
}
const indices =
(gridRef.current?.gridView as GridViewWithCheckApi | undefined)?.getCheckedRows?.(true, false, true) ??
[];
for (const itemIndex of indices) {
const entry = entries[itemIndex];
if (!entry) continue;
const sn = Number(entry.vrfcSn);
if (!Number.isFinite(sn)) continue;
next.set(sn, String(entry.prcsYn ?? ""));
}
return next;
}
function selectionHasNonExceptionResetAllowed(
map: Map<number, string>,
currentEntries: VerificationResultReportItem[],
): boolean {
for (const [vrfcSn, storedPrcsYn] of map) {
const onPage = currentEntries.find((e) => Number(e.vrfcSn) === vrfcSn);
const prcsYn = onPage ? onPage.prcsYn : storedPrcsYn;
if (!canExceptionReset(prcsYn)) return true;
}
return false;
}
function verificationPrcsYnNmCellStyle({ fieldName, row }: CellStyleCallbackParams): string | undefined { function verificationPrcsYnNmCellStyle({ fieldName, row }: CellStyleCallbackParams): string | undefined {
if (fieldName !== "prcsYnNm") return undefined; if (fieldName !== "prcsYnNm") return undefined;
const code = prcsYnCodeToNumber(row.prcsYn); const code = prcsYnCodeToNumber(row.prcsYn);
@@ -62,8 +147,22 @@ const verificationResultColumnInfo: ColumnInfo = {
{ name: "regDt", fieldName: "regDt", header: { text: "등록일시" }, editable: false }, { name: "regDt", fieldName: "regDt", header: { text: "등록일시" }, editable: false },
{ name: "mdfcnDt", fieldName: "mdfcnDt", header: { text: "갱신일시" }, editable: false }, { name: "mdfcnDt", fieldName: "mdfcnDt", header: { text: "갱신일시" }, editable: false },
{ name: "prcsYn", fieldName: "prcsYn", header: { text: "검증결과상태코드" }, editable: false, visible: false }, { name: "prcsYn", fieldName: "prcsYn", header: { text: "검증결과상태코드" }, editable: false, visible: false },
{ name: "vrfcSn", fieldName: "vrfcSn", header: { text: "검증일련번호" }, editable: false, visible: false },
],
columnLayout: [
"ctpvNm",
"sggNm",
"vrfcTrgtNm",
"rsnExpln",
"nowVlCn",
"compVlCn",
"prcsYnNm",
"pbcpAprvYn",
"regDt",
"mdfcnDt",
"prcsYn",
"vrfcSn",
], ],
columnLayout: ["ctpvNm", "sggNm", "vrfcTrgtNm", "rsnExpln", "nowVlCn", "compVlCn", "prcsYnNm", "pbcpAprvYn", "regDt", "mdfcnDt", "prcsYn"],
}; };
export interface VerificationResultHistoryDialogProps { export interface VerificationResultHistoryDialogProps {
@@ -87,152 +186,168 @@ export function VerificationResultHistoryDialog({
title = "검증 결과 내역", title = "검증 결과 내역",
emptyMessage = "표시할 검증 결과가 없습니다.", emptyMessage = "표시할 검증 결과가 없습니다.",
}: VerificationResultHistoryDialogProps) { }: VerificationResultHistoryDialogProps) {
const stableQueryContext = useMemo(() => {
if (!queryContext) return null;
return queryContext;
}, [
queryContext?.sewerBzmnCd,
queryContext?.ctpvNm,
queryContext?.sggNm,
queryContext?.statsYr,
queryContext?.statsCd,
]);
const [activeTab, setActiveTab] = useState<VerificationHistoryTabKey>("NV"); const [activeTab, setActiveTab] = useState<VerificationHistoryTabKey>("NV");
const [normalEntries, setNormalEntries] = useState<VerificationResultReportItem[]>([]); const [entriesByTab, setEntriesByTab] = useState<
const [imrEntries, setImrEntries] = useState<VerificationResultReportItem[]>([]); Record<VerificationHistoryTabKey, VerificationResultReportItem[]>
const [hbEntries, setHbEntries] = useState<VerificationResultReportItem[]>([]); >({
const [normalPageIndex, setNormalPageIndex] = useState(0); NV: [],
const [imrPageIndex, setImrPageIndex] = useState(0); IMR: [],
const [hbPageIndex, setHbPageIndex] = useState(0); HB: [],
const [normalPageCount, setNormalPageCount] = useState(1); });
const [imrPageCount, setImrPageCount] = useState(1); const [tabPages, setTabPages] = useState(initialTabPageState);
const [hbPageCount, setHbPageCount] = useState(1); const [loadingByTab, setLoadingByTab] = useState<Record<VerificationHistoryTabKey, boolean>>({
const [normalLoading, setNormalLoading] = useState(false); NV: false,
const [imrLoading, setImrLoading] = useState(false); IMR: false,
const [hbLoading, setHbLoading] = useState(false); HB: false,
});
const [errorMessage, setErrorMessage] = useState<string | null>(null); const [errorMessage, setErrorMessage] = useState<string | null>(null);
const [resetSubmitting, setResetSubmitting] = useState(false);
const [checkedVrfcByTab, setCheckedVrfcByTab] = useState(createEmptyCheckedVrfcByTab);
const nvGridRef = useRef<RealGridReact | null>(null);
const imrGridRef = useRef<RealGridReact | null>(null);
const hbGridRef = useRef<RealGridReact | null>(null);
const alert = useAlertStore((state) => state.setMessage);
const gridRefByTab: Record<VerificationHistoryTabKey, MutableRefObject<RealGridReact | null>> = {
NV: nvGridRef,
IMR: imrGridRef,
HB: hbGridRef,
};
const checkedVrfcByTabRef = useRef(checkedVrfcByTab);
checkedVrfcByTabRef.current = checkedVrfcByTab;
const resetState = useCallback(() => { const resetState = useCallback(() => {
setActiveTab("NV"); setActiveTab("NV");
setNormalEntries([]); setEntriesByTab({ NV: [], IMR: [], HB: [] });
setImrEntries([]); setTabPages(initialTabPageState());
setHbEntries([]); setLoadingByTab({ NV: false, IMR: false, HB: false });
setNormalPageIndex(0);
setImrPageIndex(0);
setHbPageIndex(0);
setNormalPageCount(1);
setImrPageCount(1);
setHbPageCount(1);
setNormalLoading(false);
setImrLoading(false);
setHbLoading(false);
setErrorMessage(null); setErrorMessage(null);
setResetSubmitting(false);
setCheckedVrfcByTab(createEmptyCheckedVrfcByTab());
}, []); }, []);
const fetchVerificationResultPage = useCallback( const fetchVerificationResultPage = useCallback(
async (vrfcMthdCd: VerificationHistoryTabKey, pageIndex: number) => { async (vrfcMthdCd: VerificationHistoryTabKey, pageIndex: number) => {
if (!queryContext) return null; if (!stableQueryContext) return null;
const param: VerificationResultListRequest = { const param: VerificationResultListRequest = {
sewerBzmnCd: queryContext.sewerBzmnCd, sewerBzmnCd: stableQueryContext.sewerBzmnCd,
ctpvNm: queryContext.ctpvNm, ctpvNm: stableQueryContext.ctpvNm,
sggNm: queryContext.sggNm, sggNm: stableQueryContext.sggNm,
statsYr: queryContext.statsYr, statsYr: stableQueryContext.statsYr,
statsCd: queryContext.statsCd, statsCd: stableQueryContext.statsCd,
pbcpAprvYn: 'N', pbcpAprvYn: "N",
vrfcMthdCd, vrfcMthdCd,
prcsYnList: "0,2,3", prcsYnList: "0,2,3",
page: pageIndex + 1, page: pageIndex + 1,
size: 30, size: PAGE_SIZE,
}; };
return statisticsApi.getVerificationResultList(param); return statisticsApi.getVerificationResultList(param);
}, },
[queryContext], [stableQueryContext],
);
const applyPageResponse = useCallback(
(tab: VerificationHistoryTabKey, pageIndex: number, list: VerificationResultReportItem[], totalPages: number) => {
const pageCount = Math.max(totalPages, 1);
const clampedIndex = Math.min(Math.max(pageIndex, 0), pageCount - 1);
setEntriesByTab((prev) => ({ ...prev, [tab]: list }));
setTabPages((prev) => ({
...prev,
[tab]: { pageIndex: clampedIndex, pageCount },
}));
},
[],
);
const loadTabPage = useCallback(
async (tab: VerificationHistoryTabKey, pageIndex: number) => {
if (!stableQueryContext) {
setErrorMessage("조회 조건이 없어 검증 결과를 불러올 수 없습니다.");
return;
}
setErrorMessage(null);
setLoadingByTab((prev) => ({ ...prev, [tab]: true }));
try {
const response = await fetchVerificationResultPage(tab, pageIndex);
const list = response?.data?.verifyResultList ?? [];
const totalPages = response?.data?.pageInfo?.totalPages ?? 1;
const apiCurrentPage = response?.data?.pageInfo?.currentPage;
const resolvedPageIndex =
apiCurrentPage != null && Number.isFinite(apiCurrentPage)
? Math.max(0, Number(apiCurrentPage) - 1)
: pageIndex;
applyPageResponse(tab, resolvedPageIndex, list, totalPages);
} catch {
const tabLabel =
verificationHistoryTabs.find((t) => t.value === tab)?.label ?? tab;
setErrorMessage(`${tabLabel} 조회 중 오류가 발생했습니다.`);
} finally {
setLoadingByTab((prev) => ({ ...prev, [tab]: false }));
}
},
[applyPageResponse, fetchVerificationResultPage, stableQueryContext],
); );
const loadInitial = useCallback(async () => { const loadInitial = useCallback(async () => {
if (!queryContext) { if (!stableQueryContext) {
setErrorMessage("조회 조건이 없어 검증 결과를 불러올 수 없습니다."); setErrorMessage("조회 조건이 없어 검증 결과를 불러올 수 없습니다.");
return; return;
} }
setErrorMessage(null); setErrorMessage(null);
setNormalLoading(true); setTabPages(initialTabPageState());
setImrLoading(true); setLoadingByTab({ NV: true, IMR: true, HB: true });
setHbLoading(true);
setNormalPageIndex(0);
setImrPageIndex(0);
setHbPageIndex(0);
try { try {
const [nvRes, imrRes, hbRes] = await Promise.all([ const results = await Promise.all(
fetchVerificationResultPage("NV", 0), verificationHistoryTabs.map((tab) =>
fetchVerificationResultPage("IMR", 0), fetchVerificationResultPage(tab.value, 0),
fetchVerificationResultPage("HB", 0), ),
]); );
setNormalEntries(nvRes?.data?.verifyResultList ?? []); setEntriesByTab({
setImrEntries(imrRes?.data?.verifyResultList ?? []); NV: results[0]?.data?.verifyResultList ?? [],
setHbEntries(hbRes?.data?.verifyResultList ?? []); IMR: results[1]?.data?.verifyResultList ?? [],
setNormalPageCount(nvRes?.data?.pageInfo?.totalPages ?? 1); HB: results[2]?.data?.verifyResultList ?? [],
setImrPageCount(imrRes?.data?.pageInfo?.totalPages ?? 1); });
setHbPageCount(hbRes?.data?.pageInfo?.totalPages ?? 1); setTabPages({
NV: {
pageIndex: 0,
pageCount: Math.max(results[0]?.data?.pageInfo?.totalPages ?? 1, 1),
},
IMR: {
pageIndex: 0,
pageCount: Math.max(results[1]?.data?.pageInfo?.totalPages ?? 1, 1),
},
HB: {
pageIndex: 0,
pageCount: Math.max(results[2]?.data?.pageInfo?.totalPages ?? 1, 1),
},
});
} catch { } catch {
setNormalEntries([]); setEntriesByTab({ NV: [], IMR: [], HB: [] });
setImrEntries([]); setTabPages(initialTabPageState());
setHbEntries([]);
setNormalPageCount(1);
setImrPageCount(1);
setHbPageCount(1);
setErrorMessage("검증 결과 내역 조회 중 오류가 발생했습니다."); setErrorMessage("검증 결과 내역 조회 중 오류가 발생했습니다.");
} finally { } finally {
setNormalLoading(false); setLoadingByTab({ NV: false, IMR: false, HB: false });
setImrLoading(false);
setHbLoading(false);
} }
}, [fetchVerificationResultPage, queryContext]); }, [fetchVerificationResultPage, stableQueryContext]);
const handleNormalPageChange = useCallback( const handleTabPageChange = useCallback(
async (pageIndex: number) => { (tab: VerificationHistoryTabKey, pageIndex: number) => {
if (pageIndex === normalPageIndex || !queryContext) return; if (pageIndex === tabPages[tab].pageIndex) return;
setErrorMessage(null); void loadTabPage(tab, pageIndex);
setNormalLoading(true);
try {
const response = await fetchVerificationResultPage("NV", pageIndex);
setNormalEntries(response?.data?.verifyResultList ?? []);
setNormalPageCount(response?.data?.pageInfo?.totalPages ?? 1);
setNormalPageIndex(pageIndex);
} catch {
setErrorMessage("일반검증 내역 조회 중 오류가 발생했습니다.");
} finally {
setNormalLoading(false);
}
}, },
[fetchVerificationResultPage, normalPageIndex, queryContext], [loadTabPage, tabPages],
);
const handleImrPageChange = useCallback(
async (pageIndex: number) => {
if (pageIndex === imrPageIndex || !queryContext) return;
setErrorMessage(null);
setImrLoading(true);
try {
const response = await fetchVerificationResultPage("IMR", pageIndex);
setImrEntries(response?.data?.verifyResultList ?? []);
setImrPageCount(response?.data?.pageInfo?.totalPages ?? 1);
setImrPageIndex(pageIndex);
} catch {
setErrorMessage("I-MR 검증내역 조회 중 오류가 발생했습니다.");
} finally {
setImrLoading(false);
}
},
[fetchVerificationResultPage, imrPageIndex, queryContext],
);
const handleHbPageChange = useCallback(
async (pageIndex: number) => {
if (pageIndex === hbPageIndex || !queryContext) return;
setErrorMessage(null);
setHbLoading(true);
try {
const response = await fetchVerificationResultPage("HB", pageIndex);
setHbEntries(response?.data?.verifyResultList ?? []);
setHbPageCount(response?.data?.pageInfo?.totalPages ?? 1);
setHbPageIndex(pageIndex);
} catch {
setErrorMessage("HB 검증내역 조회 중 오류가 발생했습니다.");
} finally {
setHbLoading(false);
}
},
[fetchVerificationResultPage, hbPageIndex, queryContext],
); );
useEffect(() => { useEffect(() => {
@@ -243,56 +358,173 @@ export function VerificationResultHistoryDialog({
void loadInitial(); void loadInitial();
}, [loadInitial, open, resetState]); }, [loadInitial, open, resetState]);
const mapRows = (entries: VerificationResultReportItem[]): VerificationResultGridRow[] => const updateCheckedVrfcForTab = useCallback(
entries.map((item) => ({ (tab: VerificationHistoryTabKey, updater: (map: Map<number, string>) => void) => {
ctpvNm: item.ctpvNm, setCheckedVrfcByTab((prev) => {
sggNm: item.sggNm, const nextMap = new Map(prev[tab]);
vrfcTrgtNm: item.vrfcTrgtNm, updater(nextMap);
rsnExpln: item.rsnExpln, return { ...prev, [tab]: nextMap };
nowVlCn: item.nowVlCn ?? "-", });
compVlCn: item.compVlCn ?? "-", },
prcsYnNm: item.prcsYnNm ?? "-", [],
prcsYn: item.prcsYn ?? "", );
pbcpAprvYn: item.pbcpAprvYn,
regDt: (item.regDt ?? "").slice(0, 16),
mdfcnDt: (item.mdfcnDt ?? "").slice(0, 16),
}));
const normalRows = useMemo(() => mapRows(normalEntries), [normalEntries]); const mapRows = useCallback(
const imrRows = useMemo(() => mapRows(imrEntries), [imrEntries]); (entries: VerificationResultReportItem[], checkedMap: Map<number, string>): VerificationResultGridRow[] =>
const hbRows = useMemo(() => mapRows(hbEntries), [hbEntries]); entries.map((item) => {
const vrfcSn = Number(item.vrfcSn);
const isChecked = Number.isFinite(vrfcSn) && checkedMap.has(vrfcSn);
return {
vrfcSn: item.vrfcSn,
__checked: isChecked ? 1 : 0,
ctpvNm: item.ctpvNm,
sggNm: item.sggNm,
vrfcTrgtNm: item.vrfcTrgtNm,
rsnExpln: item.rsnExpln,
nowVlCn: item.nowVlCn ?? "-",
compVlCn: item.compVlCn ?? "-",
prcsYnNm: item.prcsYnNm ?? "-",
prcsYn: item.prcsYn ?? "",
pbcpAprvYn: item.pbcpAprvYn,
regDt: (item.regDt ?? "").slice(0, 16),
mdfcnDt: (item.mdfcnDt ?? "").slice(0, 16),
};
}),
[],
);
/** 페이지(entries) 변경 시에만 __checked 반영 — 클릭마다 rowData를 바꾸지 않아 체크 UI가 안정적 */
const rowsByTab = useMemo(
() => {
const checked = checkedVrfcByTabRef.current;
return {
NV: mapRows(entriesByTab.NV, checked.NV),
IMR: mapRows(entriesByTab.IMR, checked.IMR),
HB: mapRows(entriesByTab.HB, checked.HB),
};
},
[entriesByTab, mapRows],
);
const noopSetRows = ((_: SetStateAction<Record<string, string | number>[]>) => {}) as Dispatch< const noopSetRows = ((_: SetStateAction<Record<string, string | number>[]>) => {}) as Dispatch<
SetStateAction<Record<string, string | number>[]> SetStateAction<Record<string, string | number>[]>
>; >;
const renderGrid = ( const handleExceptionResetClick = useCallback(async () => {
rows: VerificationResultGridRow[], if (!stableQueryContext) {
pageIndex: number, alert("조회 조건이 없습니다.");
pageCount: number, return;
onPageIndexChange: (page: number) => void, }
loading: boolean, const tab = activeTab;
) => { const currentEntries = entriesByTab[tab];
const syncedMap = syncCheckedMapFromGrid(currentEntries, gridRefByTab[tab], checkedVrfcByTab[tab]);
if (syncedMap.size === 0) {
alert("예외 제출 취소할 항목을 체크해주세요.");
return;
}
if (selectionHasNonExceptionResetAllowed(syncedMap, currentEntries)) {
alert(EXCEPTION_RESET_ONLY_PRCS_YN_2_MESSAGE);
return;
}
setCheckedVrfcByTab((prev) => ({ ...prev, [tab]: syncedMap }));
const vrfcSnList = Array.from(syncedMap.keys());
let mdfrId: string;
try {
const userInfo = await getUserInfo();
mdfrId = userInfo.userUnqId;
} catch {
alert("사용자 정보를 불러오지 못했습니다.");
return;
}
setResetSubmitting(true);
setErrorMessage(null);
try {
const response = await statisticsApi.StatiscicsExceptionReset({
statsYr: stableQueryContext.statsYr,
sewerBzmnCd: stableQueryContext.sewerBzmnCd,
statsCd: stableQueryContext.statsCd,
mdfrId,
vrfcSnList,
});
if (response.status !== "success") {
alert(response.message ?? "예외 제출 취소 처리 중 오류가 발생했습니다.");
return;
}
alert("예외 제출 취소 처리되었습니다.");
setCheckedVrfcByTab((prev) => ({ ...prev, [tab]: new Map() }));
await loadTabPage(tab, tabPages[tab].pageIndex);
} catch {
alert("예외 제출 취소 처리 중 오류가 발생했습니다.");
} finally {
setResetSubmitting(false);
}
}, [activeTab, alert, checkedVrfcByTab, entriesByTab, loadTabPage, stableQueryContext, tabPages]);
const renderActiveTabPanel = (tab: VerificationHistoryTabKey) => {
const entries = entriesByTab[tab];
const rows = rowsByTab[tab];
const { pageIndex, pageCount } = tabPages[tab];
const loading = loadingByTab[tab];
const gridRef = gridRefByTab[tab];
if (!loading && rows.length === 0) { if (!loading && rows.length === 0) {
return <p className="p-6 text-center text-[1.3rem] text-muted-foreground">{emptyMessage}</p>; return <p className="p-6 text-center text-[1.3rem] text-muted-foreground h-[65vh] flex justify-center items-center">{emptyMessage}</p>;
} }
return ( return (
<div className="relative space-y-2"> <div className="relative space-y-2">
<DataGrid <DataGrid
key={`verification-history-grid-${tab}`}
columnInfo={verificationResultColumnInfo} columnInfo={verificationResultColumnInfo}
rowData={rows} rowData={rows}
setRowData={noopSetRows} setRowData={noopSetRows}
isExcelImport={false} isExcelImport={false}
isExcelExport={false} isExcelExport={false}
showHeaderCheckbox={false} showHeaderCheckbox
enableSort={false} enableSort={false}
getGridRef={gridRef}
cellStyleCallback={verificationPrcsYnNmCellStyle} cellStyleCallback={verificationPrcsYnNmCellStyle}
onItemChecked={(itemIndex, checked) => {
const entry = entries[itemIndex];
if (!entry) return;
const vrfcSn = Number(entry.vrfcSn);
if (!Number.isFinite(vrfcSn)) return;
if (checked && !canExceptionReset(entry.prcsYn)) {
alert(EXCEPTION_RESET_ONLY_PRCS_YN_2_MESSAGE);
uncheckGridRow(gridRef, itemIndex);
return;
}
updateCheckedVrfcForTab(tab, (map) => {
if (checked) map.set(vrfcSn, String(entry.prcsYn ?? ""));
else map.delete(vrfcSn);
});
}}
onItemAllChecked={(checked) => {
updateCheckedVrfcForTab(tab, (map) => {
entries.forEach((entry, itemIndex) => {
const vrfcSn = Number(entry.vrfcSn);
if (!Number.isFinite(vrfcSn)) return;
if (!checked) {
map.delete(vrfcSn);
return;
}
if (canExceptionReset(entry.prcsYn)) {
map.set(vrfcSn, String(entry.prcsYn ?? ""));
} else {
uncheckGridRow(gridRef, itemIndex);
}
});
});
if (checked && entries.some((e) => !canExceptionReset(e.prcsYn))) {
alert(EXCEPTION_RESET_ONLY_PRCS_YN_2_MESSAGE);
}
}}
/> />
<VerificationResultHistoryPagination <VerificationResultHistoryPagination
pageCount={Math.max(pageCount, 1)} key={`verification-history-pagination-${tab}`}
pageIndex={Math.max(pageIndex, 0)} pageCount={pageCount}
onPageIndexChange={onPageIndexChange} pageIndex={pageIndex}
onPageIndexChange={(nextPage) => handleTabPageChange(tab, nextPage)}
className="mx-2 mb-2" className="mx-2 mb-2"
/> />
{loading && ( {loading && (
@@ -318,7 +550,12 @@ export function VerificationResultHistoryDialog({
{errorMessage} {errorMessage}
</p> </p>
)} )}
<Tabs value={activeTab} onValueChange={(value) => setActiveTab(value as VerificationHistoryTabKey)} className="w-full" variant="default"> <Tabs
value={activeTab}
onValueChange={(value) => setActiveTab(value as VerificationHistoryTabKey)}
className="w-full"
variant="default"
>
<TabsList> <TabsList>
{verificationHistoryTabs.map((tab) => ( {verificationHistoryTabs.map((tab) => (
<TabsTrigger key={tab.value} value={tab.value}> <TabsTrigger key={tab.value} value={tab.value}>
@@ -326,20 +563,28 @@ export function VerificationResultHistoryDialog({
</TabsTrigger> </TabsTrigger>
))} ))}
</TabsList> </TabsList>
<TabsContent value="NV" className="rounded-md border border-border"> {verificationHistoryTabs.map((tab) => (
{renderGrid(normalRows, normalPageIndex, normalPageCount, handleNormalPageChange, normalLoading)} <TabsContent
</TabsContent> key={tab.value}
<TabsContent value="IMR" className="rounded-md border border-border"> value={tab.value}
{renderGrid(imrRows, imrPageIndex, imrPageCount, handleImrPageChange, imrLoading)} className="rounded-md border border-border"
</TabsContent> >
<TabsContent value="HB" className="rounded-md border border-border"> {activeTab === tab.value ? renderActiveTabPanel(tab.value) : null}
{renderGrid(hbRows, hbPageIndex, hbPageCount, handleHbPageChange, hbLoading)} </TabsContent>
</TabsContent> ))}
</Tabs> </Tabs>
</div> </div>
<DialogFooter> <DialogFooter>
<Button
type="button"
color="primary"
disabled={resetSubmitting || loadingByTab[activeTab]}
onClick={() => void handleExceptionResetClick()}
>
예외 제출 취소
</Button>
<DialogClose asChild> <DialogClose asChild>
<Button type="button" color="gray"> <Button type="button" color="gray" disabled={resetSubmitting}>
닫기 닫기
</Button> </Button>
</DialogClose> </DialogClose>
@@ -0,0 +1,85 @@
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import type { VerificationResultListResponse } from "@/entities/statistics/model/statistics-interface";
import type { VerificationResultDialogQueryContext } from "./VerificationResultDialog";
const POST_SUBMIT_VRFC_MTHD_CODES = ["NV", "IMR", "HB"] as const;
export const POST_SUBMIT_COMPLETE_MESSAGE = "제출 완료되었습니다.";
export type OpenVerificationResultDialogOptions = {
notify?: (message: string) => void;
/** 미통과 검증 결과가 없을 때 제출 완료 알림 (기본 true, IMR 오류 catch 등에서는 false) */
notifySubmitComplete?: boolean;
submitCompleteMessage?: string;
};
function responseHasVerificationResults(response: VerificationResultListResponse | null): boolean {
const total = response?.data?.pageInfo?.totalElements;
if (typeof total === "number" && total > 0) return true;
const list = response?.data?.verifyResultList;
return Array.isArray(list) && list.length > 0;
}
/**
* 제출 직후 `VerificationResultDialog`에 표시할 미통과(prcsYn=0) 검증 결과가
* 일반검증(NV)·I-MR(IMR)·HB 중 하나라도 있는지 조회합니다.
*/
export async function hasAnyPostSubmitVerificationResult(
ctx: VerificationResultDialogQueryContext,
): Promise<boolean> {
const base = {
sewerBzmnCd: ctx.sewerBzmnCd,
ctpvNm: ctx.ctpvNm,
sggNm: ctx.sggNm,
statsYr: ctx.statsYr,
statsCd: ctx.statsCd,
pbcpAprvYn: "N" as const,
prcsYnList: "0",
page: 1,
size: 1,
};
const responses = await Promise.all(
POST_SUBMIT_VRFC_MTHD_CODES.map((vrfcMthdCd) =>
statisticsApi.getVerificationResultList({ ...base, vrfcMthdCd }),
),
);
return responses.some(responseHasVerificationResults);
}
/**
* 미통과 검증 결과가 있으면 다이얼로그를 열고, 없으면 제출 완료 알림을 표시합니다.
* @returns 다이얼로그를 열었으면 true
*/
export async function openVerificationResultDialogIfNeeded(
ctx: VerificationResultDialogQueryContext | null | undefined,
setOpen: (open: boolean) => void,
options?: OpenVerificationResultDialogOptions,
): Promise<boolean> {
const {
notify,
notifySubmitComplete = true,
submitCompleteMessage = POST_SUBMIT_COMPLETE_MESSAGE,
} = options ?? {};
const notifyComplete = () => {
if (notifySubmitComplete && notify) {
notify(submitCompleteMessage);
}
};
if (!ctx) {
notifyComplete();
return false;
}
if (await hasAnyPostSubmitVerificationResult(ctx)) {
setOpen(true);
return true;
}
notifyComplete();
return false;
}
@@ -1,6 +1,6 @@
"use client"; "use client";
import { useCallback } from "react"; import { useCallback, useState } from "react";
import { useQueries } from "@tanstack/react-query"; import { useQueries } from "@tanstack/react-query";
import { useTabStore as useGridTabStore } from "@rsone/components"; import { useTabStore as useGridTabStore } from "@rsone/components";
@@ -19,16 +19,30 @@ import {
Badge, Badge,
type BadgeProps, type BadgeProps,
LoadingWithAnimation, LoadingWithAnimation,
Tabs,
TabsContent,
TabsList,
TabsTrigger,
} from "@common/components"; } from "@common/components";
type VerificationReportTabKey = "NV" | "IMR" | "HB";
const VERIFICATION_REPORT_TABS: { value: VerificationReportTabKey; label: string }[] = [
{ value: "NV", label: "일반" },
{ value: "IMR", label: "I-MR" },
{ value: "HB", label: "HB" },
];
const TYPE_CODE_COLOR_MAP: Record<string, BadgeProps["color"]> = { const TYPE_CODE_COLOR_MAP: Record<string, BadgeProps["color"]> = {
NV: "gray", NV: "gray",
IMR: "red", IMR: "red",
HB: "blue",
}; };
const TYPE_CODE_NAME_MAP: Record<string, string> = { const TYPE_CODE_NAME_MAP: Record<string, string> = {
NV: "일반", NV: "일반",
IMR: "I-MR", IMR: "I-MR",
HB: "HB",
}; };
type VerificationSelectionReportProps = { type VerificationSelectionReportProps = {
@@ -46,6 +60,7 @@ const VerificationSelectionReport = ({
(s) => s.setPendingInputTab, (s) => s.setPendingInputTab,
); );
const alert = useAlertStore((s) => s.setMessage); const alert = useAlertStore((s) => s.setMessage);
const [activeTab, setActiveTab] = useState<VerificationReportTabKey>("NV");
const statsYr = String(dayjs().year() - 1); const statsYr = String(dayjs().year() - 1);
@@ -57,7 +72,7 @@ const VerificationSelectionReport = ({
prcsYnList: "0", prcsYnList: "0",
}; };
const [nvQuery, imrQuery] = useQueries({ const [nvQuery, imrQuery, hbQuery] = useQueries({
queries: [ queries: [
{ {
queryKey: [ queryKey: [
@@ -91,14 +106,34 @@ const VerificationSelectionReport = ({
vrfcMthdCd: "IMR", vrfcMthdCd: "IMR",
}), }),
}, },
{
queryKey: [
"verificationResultList",
statsYr,
"HB",
baseRequest.pbcpAprvYn,
baseRequest.page,
baseRequest.size,
baseRequest.prcsYnList,
],
queryFn: () =>
statisticsApi.getVerificationResultList({
...baseRequest,
vrfcMthdCd: "HB",
}),
},
], ],
}); });
const isLoading = nvQuery.isLoading || imrQuery.isLoading; const isLoading =
const error = nvQuery.error ?? imrQuery.error; nvQuery.isLoading || imrQuery.isLoading || hbQuery.isLoading;
const error = nvQuery.error ?? imrQuery.error ?? hbQuery.error;
const nvList = nvQuery.data?.data?.verifyResultList ?? []; const listsByTab: Record<VerificationReportTabKey, VerificationResultReportItem[]> = {
const imrList = imrQuery.data?.data?.verifyResultList ?? []; NV: nvQuery.data?.data?.verifyResultList ?? [],
IMR: imrQuery.data?.data?.verifyResultList ?? [],
HB: hbQuery.data?.data?.verifyResultList ?? [],
};
const openInputFromStatsCd = useCallback( const openInputFromStatsCd = useCallback(
(item: VerificationResultReportItem) => { (item: VerificationResultReportItem) => {
@@ -147,68 +182,61 @@ const VerificationSelectionReport = ({
], ],
); );
const renderSection = ( const renderResultList = (
typeCode: "IMR" | "NV", typeCode: VerificationReportTabKey,
items: VerificationResultReportItem[], items: VerificationResultReportItem[],
) => ( ) => (
<section className="flex min-h-0 flex-1 flex-col rounded-sm border border-border h-[50rem]"> <div className="min-h-0 flex-1 overflow-y-auto p-2">
<div className="flex items-center justify-between border-b border-border px-3 py-2"> {items.length === 0 ? (
<Badge color={TYPE_CODE_COLOR_MAP[typeCode]} className="rounded-full px-2 py-1 text-lg"> <div className="flex h-full min-h-[8rem] items-center justify-center text-lg text-muted-foreground">
{TYPE_CODE_NAME_MAP[typeCode]} {items.length} 항목이 없습니다.
</Badge> </div>
</div> ) : (
<div className="min-h-0 flex-1 overflow-y-auto p-2"> <div className="space-y-2 tracking-tight">
{items.length === 0 ? ( {items.map((item) => (
<div className="flex h-full min-h-[8rem] items-center justify-center text-lg text-muted-foreground"> <div
항목이 없습니다. key={`${typeCode}-${item.vrfcSn}`}
</div> role="button"
) : ( tabIndex={0}
<div className="space-y-2 tracking-tight"> className="flex flex-col rounded-sm border border-border p-3 cursor-pointer hover:bg-gray-100"
{items.map((item) => ( onClick={() => openInputFromStatsCd(item)}
<div onKeyDown={(e) => {
key={`${typeCode}-${item.vrfcSn}`} if (e.key === "Enter" || e.key === " ") {
role="button" e.preventDefault();
tabIndex={0} openInputFromStatsCd(item);
className="flex flex-col rounded-sm border border-border p-3 cursor-pointer hover:bg-gray-100" }
onClick={() => openInputFromStatsCd(item)} }}
onKeyDown={(e) => { >
if (e.key === "Enter" || e.key === " ") { <div className="mb-2 flex items-center justify-between">
e.preventDefault(); <span className="font-medium">
openInputFromStatsCd(item); {item.statsNm}
</span>
<Badge
color={
TYPE_CODE_COLOR_MAP[item.vrfcMthdCd] ??
"gray"
} }
}} className="text-sm"
> >
<div className="mb-2 flex items-center justify-between"> {TYPE_CODE_NAME_MAP[item.vrfcMthdCd] ??
<span className="font-medium"> item.vrfcMthdNm}
{item.statsNm} </Badge>
</span>
<Badge
color={
TYPE_CODE_COLOR_MAP[item.vrfcMthdCd] ??
"gray"
}
className="text-sm"
>
{TYPE_CODE_NAME_MAP[item.vrfcMthdCd] ??
item.vrfcMthdNm}
</Badge>
</div>
<p className="text-lg text-muted-foreground">
{item.rsnExpln}
</p>
<div className="flex justify-between text-lg text-muted-foreground">
<span>{item.admdstNm}</span>
<span>
현재: {item.nowVlCn ?? "-"} / 비교:{" "}
{item.compVlCn ?? "-"}
</span>
</div>
</div> </div>
))} <p className="text-lg text-muted-foreground">
</div> {item.rsnExpln}
)} </p>
</div> <div className="flex justify-between text-lg text-muted-foreground">
</section> <span>{item.admdstNm}</span>
<span>
현재: {item.nowVlCn ?? "-"} / 비교:{" "}
{item.compVlCn ?? "-"}
</span>
</div>
</div>
))}
</div>
)}
</div>
); );
return ( return (
@@ -246,10 +274,42 @@ const VerificationSelectionReport = ({
</div> </div>
)} )}
{!isLoading && !error && ( {!isLoading && !error && (
<div className="grid grid-rows-2 gap-6"> <section className="flex min-h-0 flex-1 flex-col h-[85rem]">
{renderSection("IMR", imrList)} <Tabs
{renderSection("NV", nvList)} value={activeTab}
</div> onValueChange={(value) =>
setActiveTab(value as VerificationReportTabKey)
}
className="flex min-h-0 flex-1 flex-col h-full"
variant="default"
>
<TabsList className="grid w-full grid-cols-3 p-1">
{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})
</TabsTrigger>
))}
</TabsList>
{VERIFICATION_REPORT_TABS.map((tab) => (
<TabsContent
key={tab.value}
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}
</TabsContent>
))}
</Tabs>
</section>
)} )}
</div> </div>
</div> </div>
@@ -1,7 +1,7 @@
import { useState } from "react"; import { useState } from "react";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import { DataGrid } from "@rsone/components"; import DataGrid from "@/components/module/DataGrid";
import SubmitButton from "@/components/button/SumitButton"; import SubmitButton from "@/components/button/SumitButton";
import SaveButton from "@/components/button/SaveButton"; import SaveButton from "@/components/button/SaveButton";
import LastYearDataButton from "@/components/button/LastYearDataButton"; import LastYearDataButton from "@/components/button/LastYearDataButton";
@@ -240,11 +240,6 @@ export function MainFacilityMappingSaveDialog({
</div> </div>
</div> </div>
<DialogFooter> <DialogFooter>
<DialogClose asChild>
<Button type="button" color="gray" disabled={isSubmitting}>
취소
</Button>
</DialogClose>
<Button <Button
type="button" type="button"
color="primary" color="primary"
@@ -253,6 +248,11 @@ export function MainFacilityMappingSaveDialog({
> >
저장 저장
</Button> </Button>
<DialogClose asChild>
<Button type="button" color="gray" disabled={isSubmitting}>
취소
</Button>
</DialogClose>
</DialogFooter> </DialogFooter>
</DialogContent> </DialogContent>
</Dialog> </Dialog>
@@ -1,7 +1,7 @@
import { useState } from "react"; import { useState } from "react";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import { TabDataGrid } from "@rsone/components"; import TabDataGrid from "@/components/module/TabDataGrid";
import SubmitButton from "@/components/button/SumitButton"; import SubmitButton from "@/components/button/SumitButton";
import SaveButton from "@/components/button/SaveButton"; import SaveButton from "@/components/button/SaveButton";
import SubmitExceptionButton from "@/components/button/SubmitExceptionButton"; import SubmitExceptionButton from "@/components/button/SubmitExceptionButton";
@@ -38,6 +38,7 @@ import VerificationResultButton from '@/components/button/VerificationResultButt
import DataGrid from '@/components/module/DataGrid'; import DataGrid from '@/components/module/DataGrid';
import SearchForm from '@/components/module/SearchForm'; import SearchForm from '@/components/module/SearchForm';
import SplitDataGrid from '@/components/module/SplitDataGrid'; import SplitDataGrid from '@/components/module/SplitDataGrid';
import { openVerificationResultDialogIfNeeded } from '@/components/module/post-submit-verification-results';
import { VerificationResultDialog } from '@/components/module/VerificationResultDialog'; import { VerificationResultDialog } from '@/components/module/VerificationResultDialog';
import { VerificationResultHistoryDialog } from '@/components/module/VerificationResultHistoryDialog'; import { VerificationResultHistoryDialog } from '@/components/module/VerificationResultHistoryDialog';
import type { CellStyleCallbackParams, ColumnInfo, ColumnInfoList } from '@/components/type/DataGrid.type'; import type { CellStyleCallbackParams, ColumnInfo, ColumnInfoList } from '@/components/type/DataGrid.type';
@@ -86,13 +87,16 @@ function computeTabToolbarSnapshot(
): TabToolbarSnapshot { ): TabToolbarSnapshot {
const gugunOk = buildGugunOkForToolbar(searchContext); const gugunOk = buildGugunOkForToolbar(searchContext);
const enterable = computeTabEnterable(statusInfo, periodEnterable); const enterable = computeTabEnterable(statusInfo, periodEnterable);
const isSubmitted = statusInfo?.laeSbmsnSttsCd === '2';
const showSaveInToolbar = (enterable || isAdminInfo) && gugunOk; const showSaveInToolbar = (enterable || isAdminInfo) && gugunOk;
const showEnterableToolbarButtons = enterable && gugunOk; const showEnterableToolbarButtons = enterable && gugunOk;
const showSubmittedInInputPeriodToolbar = isSubmitted && periodEnterable && gugunOk;
const showActionToolbarCard = const showActionToolbarCard =
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
(statusInfo?.laeSbmsnSttsCd === '2' && showEnterableToolbarButtons ||
(isAdminInfo || (enterable && gugunOk)))); showSubmittedInInputPeriodToolbar ||
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -342,14 +346,34 @@ const PublicSewageFacilityInp = () => {
searchParamRef.current, searchParamRef.current,
lastSearchedValues, lastSearchedValues,
); );
setVerificationResultDialogOpen(true); await openVerificationResultDialogIfNeeded(
{
sewerBzmnCd: lastSearchedValues.bsnmCd ?? '',
ctpvNm: lastSearchedValues.sido ?? '',
sggNm: lastSearchedValues.gugun === 'ALL' ? '' : (lastSearchedValues.gugun ?? ''),
statsYr: lastSearchedValues.year ?? '',
statsCd: statsCdForTab,
},
setVerificationResultDialogOpen,
{ notify: alert },
);
} catch (e) { } catch (e) {
await loadPublicSewageFacilityActiveTabData( await loadPublicSewageFacilityActiveTabData(
'ST00060001', 'ST00060001',
searchParamRef.current, searchParamRef.current,
lastSearchedValues, lastSearchedValues,
); );
setVerificationResultDialogOpen(true); await openVerificationResultDialogIfNeeded(
{
sewerBzmnCd: lastSearchedValues.bsnmCd ?? '',
ctpvNm: lastSearchedValues.sido ?? '',
sggNm: lastSearchedValues.gugun === 'ALL' ? '' : (lastSearchedValues.gugun ?? ''),
statsYr: lastSearchedValues.year ?? '',
statsCd: statsCdForTab,
},
setVerificationResultDialogOpen,
{ notify: alert, notifySubmitComplete: false },
);
const msg = const msg =
e instanceof Error && e.message e instanceof Error && e.message
? e.message ? e.message
@@ -363,7 +387,17 @@ const PublicSewageFacilityInp = () => {
searchParamRef.current, searchParamRef.current,
lastSearchedValues, lastSearchedValues,
); );
setVerificationResultDialogOpen(true); await openVerificationResultDialogIfNeeded(
{
sewerBzmnCd: lastSearchedValues.bsnmCd ?? '',
ctpvNm: lastSearchedValues.sido ?? '',
sggNm: lastSearchedValues.gugun === 'ALL' ? '' : (lastSearchedValues.gugun ?? ''),
statsYr: lastSearchedValues.year ?? '',
statsCd: statsCdForTab,
},
setVerificationResultDialogOpen,
{ notify: alert },
);
} }
} catch { } catch {
alert('데이터 제출 중 오류가 발생했습니다.'); alert('데이터 제출 중 오류가 발생했습니다.');
@@ -380,6 +414,22 @@ const PublicSewageFacilityInp = () => {
} }
if (activeTab === 'ST00060002') { if (activeTab === 'ST00060002') {
const statusCodeResponse = await statisticsApi.CheckStatusCode({
sewerBzmnCd: lastSearchedValues.bsnmCd ?? '',
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관리자에게 문의하세요')
}
if (!(await confirm('저장 하시겠습니까?'))) return; if (!(await confirm('저장 하시겠습니까?'))) return;
const leftRows = rowDataMap.get('MainFacility') ?? []; const leftRows = rowDataMap.get('MainFacility') ?? [];
@@ -472,7 +522,7 @@ const PublicSewageFacilityInp = () => {
sggNm: lastSearchedValues.gugun === 'ALL' ? '' : lastSearchedValues.gugun ?? '', sggNm: lastSearchedValues.gugun === 'ALL' ? '' : lastSearchedValues.gugun ?? '',
sewerBzmnCd: lastSearchedValues.bsnmCd ?? '', sewerBzmnCd: lastSearchedValues.bsnmCd ?? '',
userId: userInfo.userUnqId, userId: userInfo.userUnqId,
superAdmin: isAdminInfo ? 'superAdmin' : '', // superAdmin: isAdminInfo ? 'superAdmin' : '',
noApplicable: getNoApplicableForRequest(), noApplicable: getNoApplicableForRequest(),
saveList, saveList,
}; };
@@ -949,26 +999,34 @@ const PublicSewageFacilityInp = () => {
}; };
const searchContextForToolbar = lastSearchedValues ?? searchValues; const searchContextForToolbar = lastSearchedValues ?? searchValues;
const gugunOkOrNotDoList = buildGugunOkForToolbar(searchContextForToolbar);
const activeTabStatus = tabStatusInfoMap.get(activeTab) ?? null; const activeTabStatus = tabStatusInfoMap.get(activeTab) ?? null;
const activeTabToolbar = const activeTabToolbar = computeTabToolbarSnapshot(
toolbarSnapshotByTab.get(activeTab) ?? activeTabStatus,
computeTabToolbarSnapshot( tabRowDataExists(activeTab),
activeTabStatus, hasSearched,
tabRowDataExists(activeTab), searchContextForToolbar,
hasSearched, inputPeriodEnterable,
searchContextForToolbar, isAdminInfo,
inputPeriodEnterable, );
isAdminInfo,
);
const { const {
showSaveInToolbar: baseShowSaveInToolbar, showSaveInToolbar: baseShowSaveInToolbar,
showEnterableToolbarButtons: baseShowEnterableToolbarButtons, showEnterableToolbarButtons: baseShowEnterableToolbarButtons,
showActionToolbarCard: baseShowActionToolbarCard, showActionToolbarCard: baseShowActionToolbarCard,
} = activeTabToolbar; } = activeTabToolbar;
const showSaveInToolbar = baseShowSaveInToolbar && toolbarGroupAllowed;
const showEnterableToolbarButtons = baseShowEnterableToolbarButtons && toolbarGroupAllowed;
const showActionToolbarCard = baseShowActionToolbarCard && toolbarGroupAllowed;
const isMainFacilityTab = activeTab === 'ST00060002'; const isMainFacilityTab = activeTab === 'ST00060002';
const showMainFacilitySaveInToolbar =
isMainFacilityTab &&
tabRowDataExists('ST00060002') &&
gugunOkOrNotDoList &&
(isAdminInfo || inputPeriodEnterable);
const showSaveInToolbar =
toolbarGroupAllowed && (baseShowSaveInToolbar || showMainFacilitySaveInToolbar);
const showEnterableToolbarButtons =
baseShowEnterableToolbarButtons && toolbarGroupAllowed;
const showActionToolbarCard =
toolbarGroupAllowed &&
(baseShowActionToolbarCard || showMainFacilitySaveInToolbar);
const openVerificationHistoryDialog = () => { const openVerificationHistoryDialog = () => {
const ctx = lastSearchedValues ?? searchValues; const ctx = lastSearchedValues ?? searchValues;
@@ -1006,9 +1064,11 @@ const PublicSewageFacilityInp = () => {
{showActionToolbarCard && ( {showActionToolbarCard && (
<div className="card !py-0"> <div className="card !py-0">
<div className="flex justify-end items-center gap-[0.6rem] mx-[0.6rem]"> <div className="flex justify-end items-center gap-[0.6rem] mx-[0.6rem]">
<VerificationResultButton {!isMainFacilityTab && (
VerificationResultButtonFunc={openVerificationHistoryDialog} <VerificationResultButton
/> VerificationResultButtonFunc={openVerificationHistoryDialog}
/>
)}
{showEnterableToolbarButtons && !isMainFacilityTab && ( {showEnterableToolbarButtons && !isMainFacilityTab && (
<> <>
{showIsNotApplicable && <NotApplicableCheckButton isCheck={isNotApplicable} setIsCheck={setIsNotApplicable} />} {showIsNotApplicable && <NotApplicableCheckButton isCheck={isNotApplicable} setIsCheck={setIsNotApplicable} />}
@@ -1128,13 +1188,25 @@ const PublicSewageFacilityInp = () => {
} }
const gridColumnInfo = getGridColumnInfo(tab); const gridColumnInfo = getGridColumnInfo(tab);
const tabStatus = tabStatusInfoMap.get(tab.tabKey) ?? null;
const tabEnterableForGrid = computeTabEnterable(
tabStatus,
inputPeriodEnterable,
);
const excelToolbarEnabledForTab =
tabRowDataExists(tab.tabKey) &&
tabEnterableForGrid &&
gugunOkOrNotDoList;
return ( return (
<TabsContent key={tab.tabKey} value={tab.tabKey}> <TabsContent key={tab.tabKey} value={tab.tabKey}>
<DataGrid <DataGrid
key={(tabEnterableForGrid || isAdminInfo) ? 'enterable' : 'readonly'}
columnInfo={gridColumnInfo} columnInfo={gridColumnInfo}
rowStartNum={tab.rowStartNum} rowStartNum={tab.rowStartNum}
excelExportFileSuffix={tab.tabLabel || tab.tabKey}
fixedColumns={tab.fixedColumns} fixedColumns={tab.fixedColumns}
statusInfo={activeTabStatus} statusInfo={tabStatus}
rowData={rowDataMap.get(tab.tabKey) ?? []} rowData={rowDataMap.get(tab.tabKey) ?? []}
setRowData={(updater) => { setRowData={(updater) => {
setRowDataMap((prev) => { setRowDataMap((prev) => {
@@ -1151,6 +1223,8 @@ const PublicSewageFacilityInp = () => {
getGridDataRef={ getGridDataRef={
tab.tabKey === 'ST00060001' ? st60001GridGetRowsRef : undefined tab.tabKey === 'ST00060001' ? st60001GridGetRowsRef : undefined
} }
isExcelImport={excelToolbarEnabledForTab}
isExcelExport
showHeaderCheckbox={false} showHeaderCheckbox={false}
enableSort={false} enableSort={false}
cellStyleCallback={({ row, fieldName }) => { cellStyleCallback={({ row, fieldName }) => {
@@ -1,7 +1,7 @@
import { useState } from "react"; import { useState } from "react";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import { DataGrid } from '@rsone/components'; import DataGrid from "@/components/module/DataGrid";
import SubmitButton from "@/components/button/SumitButton"; import SubmitButton from "@/components/button/SumitButton";
import SaveButton from "@/components/button/SaveButton"; import SaveButton from "@/components/button/SaveButton";
import LastYearDataButton from "@/components/button/LastYearDataButton"; import LastYearDataButton from "@/components/button/LastYearDataButton";
@@ -1,7 +1,7 @@
import { useState } from "react"; import { useState } from "react";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import { TabDataGrid } from "@rsone/components"; import TabDataGrid from "@/components/module/TabDataGrid";
import SubmitButton from "@/components/button/SumitButton"; import SubmitButton from "@/components/button/SumitButton";
import SaveButton from "@/components/button/SaveButton"; import SaveButton from "@/components/button/SaveButton";
import SubmitExceptionButton from "@/components/button/SubmitExceptionButton"; import SubmitExceptionButton from "@/components/button/SubmitExceptionButton";
@@ -1,7 +1,7 @@
import { useState } from "react"; import { useState } from "react";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import { TabDataGrid } from "@rsone/components"; import TabDataGrid from "@/components/module/TabDataGrid";
import SubmitButton from "@/components/button/SumitButton"; import SubmitButton from "@/components/button/SumitButton";
import SaveButton from "@/components/button/SaveButton"; import SaveButton from "@/components/button/SaveButton";
import SubmitExceptionButton from "@/components/button/SubmitExceptionButton"; import SubmitExceptionButton from "@/components/button/SubmitExceptionButton";
@@ -56,6 +56,7 @@ import DataGrid from "@/components/module/DataGrid";
import GridTopActionButton from "@/components/module/GridTopActionButton"; import GridTopActionButton from "@/components/module/GridTopActionButton";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import SplitDataGrid from "@/components/module/SplitDataGrid"; import SplitDataGrid from "@/components/module/SplitDataGrid";
import { openVerificationResultDialogIfNeeded } from "@/components/module/post-submit-verification-results";
import { VerificationResultDialog } from "@/components/module/VerificationResultDialog"; import { VerificationResultDialog } from "@/components/module/VerificationResultDialog";
import { VerificationResultHistoryDialog } from "@/components/module/VerificationResultHistoryDialog"; import { VerificationResultHistoryDialog } from "@/components/module/VerificationResultHistoryDialog";
import type { ColumnConfig,ColumnInfo, ColumnInfoList } from "@/components/type/DataGrid.type"; import type { ColumnConfig,ColumnInfo, ColumnInfoList } from "@/components/type/DataGrid.type";
@@ -331,13 +332,16 @@ function computeTabToolbarSnapshot(
): TabToolbarSnapshot { ): TabToolbarSnapshot {
const gugunOk = buildGugunOkForToolbar(searchContext); const gugunOk = buildGugunOkForToolbar(searchContext);
const enterable = computeTabEnterable(statusInfo, periodEnterable); const enterable = computeTabEnterable(statusInfo, periodEnterable);
const isSubmitted = statusInfo?.laeSbmsnSttsCd === "2";
const showSaveInToolbar = (enterable || isAdminInfo) && gugunOk; const showSaveInToolbar = (enterable || isAdminInfo) && gugunOk;
const showEnterableToolbarButtons = enterable && gugunOk; const showEnterableToolbarButtons = enterable && gugunOk;
const showSubmittedInInputPeriodToolbar = isSubmitted && periodEnterable && gugunOk;
const showActionToolbarCard = const showActionToolbarCard =
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
(statusInfo?.laeSbmsnSttsCd === "2" && showEnterableToolbarButtons ||
(isAdminInfo || (enterable && gugunOk)))); showSubmittedInInputPeriodToolbar ||
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -1248,7 +1252,17 @@ const SewagePipeInp = () => {
true, true,
false, false,
); );
setVerificationResultDialogOpen(true); await openVerificationResultDialogIfNeeded(
{
sewerBzmnCd: values.bsnmCd ?? "",
ctpvNm: values.sido ?? "",
sggNm: values.gugun === "ALL" ? "" : (values.gugun ?? ""),
statsYr: values.year ?? "",
statsCd: statsCdForTab,
},
setVerificationResultDialogOpen,
{ notify: alert },
);
} catch (e) { } catch (e) {
await loadSewagePipeActiveTabData( await loadSewagePipeActiveTabData(
tabKey, tabKey,
@@ -1257,7 +1271,17 @@ const SewagePipeInp = () => {
true, true,
false, false,
); );
setVerificationResultDialogOpen(true); await openVerificationResultDialogIfNeeded(
{
sewerBzmnCd: values.bsnmCd ?? "",
ctpvNm: values.sido ?? "",
sggNm: values.gugun === "ALL" ? "" : (values.gugun ?? ""),
statsYr: values.year ?? "",
statsCd: statsCdForTab,
},
setVerificationResultDialogOpen,
{ notify: alert, notifySubmitComplete: false },
);
const msg = const msg =
e instanceof Error && e.message e instanceof Error && e.message
? e.message ? e.message
@@ -1273,7 +1297,17 @@ const SewagePipeInp = () => {
true, true,
false, false,
); );
setVerificationResultDialogOpen(true); await openVerificationResultDialogIfNeeded(
{
sewerBzmnCd: values.bsnmCd ?? "",
ctpvNm: values.sido ?? "",
sggNm: values.gugun === "ALL" ? "" : (values.gugun ?? ""),
statsYr: values.year ?? "",
statsCd: statsCdForTab,
},
setVerificationResultDialogOpen,
{ notify: alert },
);
} }
} catch { } catch {
alert("데이터 제출 중 오류가 발생했습니다."); alert("데이터 제출 중 오류가 발생했습니다.");
@@ -1429,7 +1463,7 @@ const SewagePipeInp = () => {
sggNm: values.gugun === "ALL" ? "" : (values.gugun ?? ""), sggNm: values.gugun === "ALL" ? "" : (values.gugun ?? ""),
sewerBzmnCd: values.bsnmCd ?? "", sewerBzmnCd: values.bsnmCd ?? "",
userId: userInfo.userUnqId, userId: userInfo.userUnqId,
superAdmin: isAdminInfo ? "superAdmin" : "", // superAdmin: isAdminInfo ? "superAdmin" : "",
saveList, saveList,
}; };
@@ -1509,7 +1543,7 @@ const SewagePipeInp = () => {
sggNm: values.gugun === "ALL" ? "" : (values.gugun ?? ""), sggNm: values.gugun === "ALL" ? "" : (values.gugun ?? ""),
sewerBzmnCd: values.bsnmCd ?? "", sewerBzmnCd: values.bsnmCd ?? "",
userId: userInfo.userUnqId, userId: userInfo.userUnqId,
superAdmin: isAdminInfo ? "superAdmin" : "", // superAdmin: isAdminInfo ? "superAdmin" : "",
saveList, saveList,
}; };
@@ -1594,7 +1628,7 @@ const SewagePipeInp = () => {
sggNm: values.gugun === "ALL" ? "" : (values.gugun ?? ""), sggNm: values.gugun === "ALL" ? "" : (values.gugun ?? ""),
sewerBzmnCd: values.bsnmCd ?? "", sewerBzmnCd: values.bsnmCd ?? "",
userId: userInfo.userUnqId, userId: userInfo.userUnqId,
superAdmin: isAdminInfo ? "superAdmin" : "", // superAdmin: isAdminInfo ? "superAdmin" : "",
saveList, saveList,
}; };
@@ -1657,7 +1691,7 @@ const SewagePipeInp = () => {
sggNm: values.gugun === "ALL" ? "" : (values.gugun ?? ""), sggNm: values.gugun === "ALL" ? "" : (values.gugun ?? ""),
sewerBzmnCd: values.bsnmCd ?? "", sewerBzmnCd: values.bsnmCd ?? "",
userId: userInfo.userUnqId, userId: userInfo.userUnqId,
superAdmin: isAdminInfo ? "superAdmin" : "", // superAdmin: isAdminInfo ? "superAdmin" : "",
saveList, saveList,
}; };
@@ -1736,7 +1770,7 @@ const SewagePipeInp = () => {
sggNm: values.gugun === "ALL" ? "" : (values.gugun ?? ""), sggNm: values.gugun === "ALL" ? "" : (values.gugun ?? ""),
sewerBzmnCd: values.bsnmCd ?? "", sewerBzmnCd: values.bsnmCd ?? "",
userId: userInfo.userUnqId, userId: userInfo.userUnqId,
superAdmin: isAdminInfo ? "superAdmin" : "", // superAdmin: isAdminInfo ? "superAdmin" : "",
saveList, saveList,
}; };
@@ -1856,9 +1890,11 @@ const SewagePipeInp = () => {
const rightRowData = rowDataMap.get(rightKey) ?? []; const rightRowData = rowDataMap.get(rightKey) ?? [];
const splitTopButton = info.right.topButton; const splitTopButton = info.right.topButton;
const showSplitTopButton = const showSplitTopButton =
activeTab === tabKey &&
Boolean(splitTopButton?.text) && Boolean(splitTopButton?.text) &&
(splitTopButton?.visible ?? true) && (splitTopButton?.visible ?? true) &&
excelToolbarEnabledForTab; tabRowDataExists(rowDataMap, tabKey) &&
gugunOkOrNotDoList;
const leftColumnInfo: ColumnInfo = { const leftColumnInfo: ColumnInfo = {
columns: info.left.columns ?? [], columns: info.left.columns ?? [],
columnLayout: info.left.columnLayout ?? [], columnLayout: info.left.columnLayout ?? [],
@@ -1,85 +1,125 @@
import { useState } from "react"; import { useState } from "react";
import SearchForm from "@/components/module/SearchForm"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components";
import { TabDataGrid } from '@rsone/components';
import SubmitButton from "@/components/button/SumitButton";
import SaveButton from "@/components/button/SaveButton";
import LastYearDataButton from "@/components/button/LastYearDataButton";
import SubmitExceptionButton from "@/components/button/SubmitExceptionButton";
import AddArticleButton from "@/components/button/AddArticleButton"; import AddArticleButton from "@/components/button/AddArticleButton";
import DeleteArticleButton from "@/components/button/DeleteArticleButton"; import DeleteArticleButton from "@/components/button/DeleteArticleButton";
import LastYearDataButton from "@/components/button/LastYearDataButton";
import NotApplicableCheckButton from "@/components/button/NotApplicableCheckButton"; import NotApplicableCheckButton from "@/components/button/NotApplicableCheckButton";
import SaveButton from "@/components/button/SaveButton";
import { SewageReservoirInpColumn } from "@/components/util/column/input/sewageReservoirPump/SewageReservoirInpColumn"; import SubmitButton from "@/components/button/SumitButton";
import SubmitExceptionButton from "@/components/button/SubmitExceptionButton";
import DataGrid from "@/components/module/DataGrid";
import SearchForm from "@/components/module/SearchForm";
import type { ColumnInfo, ColumnInfoList } from "@/components/type/DataGrid.type";
import { RainfallPumpStationInpColumn } from "@/components/util/column/input/sewageReservoirPump/RainfallPumpStationInpColumn"; import { RainfallPumpStationInpColumn } from "@/components/util/column/input/sewageReservoirPump/RainfallPumpStationInpColumn";
import { SewageReservoirInpColumn } from "@/components/util/column/input/sewageReservoirPump/SewageReservoirInpColumn";
const SewageReservoirPumpInpTabList = [
SewageReservoirInpColumn,
RainfallPumpStationInpColumn,
] as ColumnInfoList[];
const toGridColumnInfo = (tab: ColumnInfoList): ColumnInfo => ({
columns: tab.columns ?? [],
columnLayout: tab.columnLayout ?? [],
});
const firstTabKey = SewageReservoirPumpInpTabList[0]?.tabKey ?? "sewageReservoirInp";
// 하수도 통계 관리 > 04. 하수저류 시설 및 빗물 펌프장 // 하수도 통계 관리 > 04. 하수저류 시설 및 빗물 펌프장
const SewageReservoirPumpInp = () => { const SewageReservoirPumpInp = () => {
// tab List
const SewageReservoirPumpInpTabList = [
SewageReservoirInpColumn,
RainfallPumpStationInpColumn
];
const submitExceptionFunc = () => { const submitExceptionFunc = () => {
console.log('submit exception'); console.log("submit exception");
// 예외 제출 로직 // 예외 제출 로직
}; };
const getLastYearDataFunc = () => { const getLastYearDataFunc = () => {
console.log('get last year data'); console.log("get last year data");
// 지난연도 데이터 가져오기 로직 // 지난연도 데이터 가져오기 로직
}; };
const submitFunc = () => { const submitFunc = () => {
console.log('submit'); console.log("submit");
// 제출 로직 // 제출 로직
}; };
const saveFunc = () => { const saveFunc = () => {
console.log('save'); console.log("save");
// 저장 로직 // 저장 로직
}; };
const addArticleFunc = () => { const addArticleFunc = () => {
console.log('save'); console.log("save");
// 항목 추가 로직 // 항목 추가 로직
}; };
const deleteArticleFunc = () => { const deleteArticleFunc = () => {
console.log('save'); console.log("save");
// 항목 제외 로직 // 항목 제외 로직
}; };
const [activeTab, setActiveTab] = useState(firstTabKey);
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map()); const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map());
const [isNotApplicable, setIsNotApplicable] = useState(false); const [isNotApplicable, setIsNotApplicable] = useState(false);
return ( return (
<> <>
<SearchForm fctName={true} /> <div className="relative">
<div className="card !py-0"> <SearchForm fctName={true} />
<div className="flex justify-end items-center gap-[0.6rem] m-[0.6rem]"> <div className="card !py-0">
<SubmitExceptionButton SubmitExceptionFunc={submitExceptionFunc} /> <div className="m-[0.6rem] flex items-center justify-end gap-[0.6rem]">
<LastYearDataButton getLastYearDataFunc={getLastYearDataFunc} /> <SubmitExceptionButton SubmitExceptionFunc={submitExceptionFunc} />
<SubmitButton submitFunc={submitFunc} /> <LastYearDataButton getLastYearDataFunc={getLastYearDataFunc} />
<SaveButton saveFunc={saveFunc} /> <SubmitButton submitFunc={submitFunc} />
<SaveButton saveFunc={saveFunc} />
</div>
</div> </div>
</div> <div className="card !py-0">
<div className="card !py-0"> <div className="m-[0.6rem] flex items-center justify-end gap-[0.6rem]">
<div className="flex justify-end items-center gap-[0.6rem] m-[0.6rem]"> <NotApplicableCheckButton isCheck={isNotApplicable} setIsCheck={setIsNotApplicable} />
<NotApplicableCheckButton isCheck={isNotApplicable} setIsCheck={setIsNotApplicable} /> <AddArticleButton addArticleFunc={addArticleFunc} />
<AddArticleButton addArticleFunc={addArticleFunc} /> <DeleteArticleButton deleteArticleFunc={deleteArticleFunc} />
<DeleteArticleButton deleteArticleFunc={deleteArticleFunc} /> </div>
</div> </div>
<Tabs value={activeTab} onValueChange={setActiveTab}>
<TabsList>
{SewageReservoirPumpInpTabList.map((tab) => (
<TabsTrigger key={tab.tabKey} value={tab.tabKey ?? ""}>
{tab.tabLabel || tab.tabKey}
</TabsTrigger>
))}
</TabsList>
{SewageReservoirPumpInpTabList.map((tab) => {
const tabKey = tab.tabKey ?? "";
return (
<TabsContent key={tabKey} value={tabKey}>
<DataGrid
columnInfo={toGridColumnInfo(tab)}
rowStartNum={tab.rowStartNum}
fixedColumns={tab.fixedColumns}
rowData={rowDataMap.get(tabKey) ?? []}
setRowData={(updater) => {
setRowDataMap((prev) => {
const next = new Map(prev);
const cur = next.get(tabKey) ?? [];
const n =
typeof updater === "function"
? (updater as (p: Record<string, string | number>[]) => Record<string, string | number>[])(cur)
: updater;
next.set(tabKey, n);
return next;
});
}}
showHeaderCheckbox={false}
/>
</TabsContent>
);
})}
</Tabs>
</div> </div>
<TabDataGrid
columnInfo={SewageReservoirPumpInpTabList}
rowDataMap={rowDataMap}
setRowDataMap={setRowDataMap}
/>
</> </>
); );
}; };
export default SewageReservoirPumpInp; export default SewageReservoirPumpInp;
@@ -1,7 +1,7 @@
import { useState } from "react"; import { useState } from "react";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import { TabDataGrid } from '@rsone/components'; import TabDataGrid from "@/components/module/TabDataGrid";
import SubmitButton from "@/components/button/SumitButton"; import SubmitButton from "@/components/button/SumitButton";
import SaveButton from "@/components/button/SaveButton"; import SaveButton from "@/components/button/SaveButton";
import SubmitExceptionButton from "@/components/button/SubmitExceptionButton"; import SubmitExceptionButton from "@/components/button/SubmitExceptionButton";
@@ -41,6 +41,7 @@ import VerificationResultButton from "@/components/button/VerificationResultButt
// import { DataGrid } from "@rsone/components"; // import { DataGrid } from "@rsone/components";
import DataGrid from "@/components/module/DataGrid"; import DataGrid from "@/components/module/DataGrid";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import { openVerificationResultDialogIfNeeded } from "@/components/module/post-submit-verification-results";
import { VerificationResultDialog } from "@/components/module/VerificationResultDialog"; import { VerificationResultDialog } from "@/components/module/VerificationResultDialog";
import { VerificationResultHistoryDialog } from "@/components/module/VerificationResultHistoryDialog"; import { VerificationResultHistoryDialog } from "@/components/module/VerificationResultHistoryDialog";
import type { SearchFormValues } from "@/components/type/SearchForm.type"; import type { SearchFormValues } from "@/components/type/SearchForm.type";
@@ -348,9 +349,9 @@ const SeweragePenetrationRateInp = () => {
statsCd: statsCd, statsCd: statsCd,
}; };
if (isAdminInfo) { // if (isAdminInfo) {
params.superAdmin = 'superAdmin'; // params.superAdmin = 'superAdmin';
} // }
try { try {
setIsLoading(true); setIsLoading(true);
@@ -525,11 +526,35 @@ const SeweragePenetrationRateInp = () => {
} }
setGlobalProgress(100); setGlobalProgress(100);
await fetchSewerageSupplyRate(getSewerageSupplyRateParams(searchValues ?? {}), true); await fetchSewerageSupplyRate(getSewerageSupplyRateParams(searchValues ?? {}), true);
setVerificationResultDialogOpen(true); await openVerificationResultDialogIfNeeded(
searchValues?.year && searchValues?.sido && searchValues?.bsnmCd && statsCd
? {
sewerBzmnCd: searchValues.bsnmCd,
ctpvNm: searchValues.sido,
sggNm: searchValues.gugun === "ALL" ? "" : (searchValues.gugun ?? ""),
statsYr: searchValues.year,
statsCd,
}
: null,
setVerificationResultDialogOpen,
{ notify: alert },
);
} catch (e) { } catch (e) {
await fetchSewerageSupplyRate(getSewerageSupplyRateParams(searchValues ?? {}), true); await fetchSewerageSupplyRate(getSewerageSupplyRateParams(searchValues ?? {}), true);
setIsLoading(false); setIsLoading(false);
setVerificationResultDialogOpen(true); await openVerificationResultDialogIfNeeded(
searchValues?.year && searchValues?.sido && searchValues?.bsnmCd && statsCd
? {
sewerBzmnCd: searchValues.bsnmCd,
ctpvNm: searchValues.sido,
sggNm: searchValues.gugun === "ALL" ? "" : (searchValues.gugun ?? ""),
statsYr: searchValues.year,
statsCd,
}
: null,
setVerificationResultDialogOpen,
{ notify: alert, notifySubmitComplete: false },
);
const msg = const msg =
e instanceof Error && e.message e instanceof Error && e.message
? e.message ? e.message
@@ -540,7 +565,19 @@ const SeweragePenetrationRateInp = () => {
} else { } else {
setGlobalProgress(100); setGlobalProgress(100);
await fetchSewerageSupplyRate(getSewerageSupplyRateParams(searchValues ?? {}), false); await fetchSewerageSupplyRate(getSewerageSupplyRateParams(searchValues ?? {}), false);
setVerificationResultDialogOpen(true); await openVerificationResultDialogIfNeeded(
searchValues?.year && searchValues?.sido && searchValues?.bsnmCd && statsCd
? {
sewerBzmnCd: searchValues.bsnmCd,
ctpvNm: searchValues.sido,
sggNm: searchValues.gugun === "ALL" ? "" : (searchValues.gugun ?? ""),
statsYr: searchValues.year,
statsCd,
}
: null,
setVerificationResultDialogOpen,
{ notify: alert },
);
} }
} else { } else {
alert(response.message || '데이터 제출 중 오류가 발생했습니다.'); alert(response.message || '데이터 제출 중 오류가 발생했습니다.');
@@ -641,9 +678,9 @@ const SeweragePenetrationRateInp = () => {
sewerBzmnFrgnrWholPpltnCnt: footerFromApi?.sewerBzmnFrgnrWholPpltnCnt // 행정참고자료 외국인 합계 sewerBzmnFrgnrWholPpltnCnt: footerFromApi?.sewerBzmnFrgnrWholPpltnCnt // 행정참고자료 외국인 합계
}; };
if (isAdminInfo) { // if (isAdminInfo) {
requestData.superAdmin = 'superAdmin'; // requestData.superAdmin = 'superAdmin';
} // }
const response = await statisticsInputSewSupplyRateApi.saveSewerageSupplyRate(requestData); const response = await statisticsInputSewSupplyRateApi.saveSewerageSupplyRate(requestData);
@@ -711,16 +748,21 @@ const SeweragePenetrationRateInp = () => {
? Boolean(lastSearchedValues?.gugun && lastSearchedValues.gugun !== 'ALL') ? Boolean(lastSearchedValues?.gugun && lastSearchedValues.gugun !== 'ALL')
: true; : true;
const inputPeriodCurrent = isInputPeriodCurrent(periodCheckList);
const isSubmitted = statusInfo?.laeSbmsnSttsCd === '2';
const baseShowSaveInToolbar = (isEnterable || isAdminInfo) && gugunOkOrNotDoList; const baseShowSaveInToolbar = (isEnterable || isAdminInfo) && gugunOkOrNotDoList;
const baseShowEnterableToolbarButtons = isEnterable && gugunOkOrNotDoList; const baseShowEnterableToolbarButtons = isEnterable && gugunOkOrNotDoList;
const showSubmittedInInputPeriodToolbar =
isSubmitted && inputPeriodCurrent && gugunOkOrNotDoList;
const showSaveInToolbar = baseShowSaveInToolbar && toolbarGroupAllowed; const showSaveInToolbar = baseShowSaveInToolbar && toolbarGroupAllowed;
const showEnterableToolbarButtons = baseShowEnterableToolbarButtons && toolbarGroupAllowed; const showEnterableToolbarButtons = baseShowEnterableToolbarButtons && toolbarGroupAllowed;
/** 카드는 저장/제출줄/제출취소 중 하나라도 보일 때만 (관리자만으로 빈 카드 방지) */
const showActionToolbarCard = const showActionToolbarCard =
rowData.length > 0 && rowData.length > 0 &&
toolbarGroupAllowed && toolbarGroupAllowed &&
(baseShowSaveInToolbar || (baseShowSaveInToolbar ||
(statusInfo?.laeSbmsnSttsCd === '2' && (isAdminInfo || (isEnterable && gugunOkOrNotDoList)))); baseShowEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar ||
(isSubmitted && isAdminInfo));
return ( return (
<> <>
@@ -1,7 +1,7 @@
import { useState } from "react"; import { useState } from "react";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import { TabDataGrid } from '@rsone/components'; import TabDataGrid from "@/components/module/TabDataGrid";
import SubmitButton from "@/components/button/SumitButton"; import SubmitButton from "@/components/button/SumitButton";
import SaveButton from "@/components/button/SaveButton"; import SaveButton from "@/components/button/SaveButton";
import LastYearDataButton from "@/components/button/LastYearDataButton"; import LastYearDataButton from "@/components/button/LastYearDataButton";
@@ -4,7 +4,7 @@ import { useConfirm } from "@frontend-opensource/use-react-hooks";
import { RealGridReact } from "realgrid-react"; import { RealGridReact } from "realgrid-react";
import useSWR, { useSWRConfig } from "swr"; import useSWR, { useSWRConfig } from "swr";
import { useAlertStore, useStatisticsInputStatusConfirmGroupGate } from "@/shared/lib"; import { useActiveTabRegAuthorityAllowed, useAlertStore } from "@/shared/lib";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { StatisticsInputStatusApi } from "@/entities/statistics/api/input/statistics-input-status-service"; import { StatisticsInputStatusApi } from "@/entities/statistics/api/input/statistics-input-status-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
@@ -62,7 +62,7 @@ const StatsInputStatusInp = () => {
ExceptionProcessingHistoryQueryContext | null ExceptionProcessingHistoryQueryContext | null
>(null); >(null);
const [isApproveLoading, setIsApproveLoading] = useState(false); const [isApproveLoading, setIsApproveLoading] = useState(false);
const confirmGroupToolbarAllowed = useStatisticsInputStatusConfirmGroupGate(); const regAuthorityToolbarAllowed = useActiveTabRegAuthorityAllowed();
const swrKey = searchParams const swrKey = searchParams
? (["stats-input-status", searchParams] as const) ? (["stats-input-status", searchParams] as const)
@@ -214,6 +214,10 @@ const StatsInputStatusInp = () => {
const openExceptionHistoryForRow = useCallback( const openExceptionHistoryForRow = useCallback(
(row: Record<string, string | number>) => { (row: Record<string, string | number>) => {
if (!regAuthorityToolbarAllowed) {
alert("권한이 없습니다.");
return;
}
const ctx = lastSearchedValues; const ctx = lastSearchedValues;
if (!ctx?.year || !ctx?.sido || !ctx?.bsnmCd) { if (!ctx?.year || !ctx?.sido || !ctx?.bsnmCd) {
alert("먼저 조회를 진행해주세요."); alert("먼저 조회를 진행해주세요.");
@@ -233,7 +237,7 @@ const StatsInputStatusInp = () => {
}); });
setExceptionHistoryOpen(true); setExceptionHistoryOpen(true);
}, },
[alert, lastSearchedValues], [alert, lastSearchedValues, regAuthorityToolbarAllowed],
); );
const handleExceptionSubmitHistoryCellClick = useCallback( const handleExceptionSubmitHistoryCellClick = useCallback(
@@ -266,7 +270,7 @@ const StatsInputStatusInp = () => {
gugunOkOrNotDoList && gugunOkOrNotDoList &&
inputPeriodCurrentRef.current && inputPeriodCurrentRef.current &&
!allRowsLaeSbmsnApproved && !allRowsLaeSbmsnApproved &&
confirmGroupToolbarAllowed; regAuthorityToolbarAllowed;
return ( return (
<> <>
@@ -1,7 +1,7 @@
import { useState } from "react"; import { useState } from "react";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import { TabDataGrid } from '@rsone/components'; import TabDataGrid from "@/components/module/TabDataGrid";
import SubmitButton from "@/components/button/SumitButton"; import SubmitButton from "@/components/button/SumitButton";
import SaveButton from "@/components/button/SaveButton"; import SaveButton from "@/components/button/SaveButton";
import LastYearDataButton from "@/components/button/LastYearDataButton"; import LastYearDataButton from "@/components/button/LastYearDataButton";
@@ -1,41 +1,342 @@
import { useState } from "react"; import { useMemo, useState } from "react";
import { GridFitStyle } from "realgrid";
import { useAlertStore, useUserStore } from "@/shared/lib";
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import type {
UnSubmitDataStatusItem,
unSubmitDataRequest,
} from "@/entities/statistics/model/statistics-interface";
import { LoadingWithAnimation } from "@common/components";
import DataGrid from "@/components/module/DataGrid"; import DataGrid from "@/components/module/DataGrid";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import type { ColumnConfig } from "@/components/type/DataGrid.type"; import type { ColumnConfig, ColumnLayoutItem } from "@/components/type/DataGrid.type";
import type { SearchFormValues } from "@/components/type/SearchForm.type";
import { toGridRows } from "@/components/util/grid/gridFunction";
const NotEnteredStatus = () => { const SIDO_FIELD = "\uc2dc\ub3c4";
const [rowData, setRowData] = useState<Record<string, string | number>[]>([]); const SGG_FIELD = "\uc2dc\uad70\uad6c";
const columns: ColumnConfig[] = [ function sbmsnYnToOx(sbmsnYn: string): string {
{ name: 'sido', fieldName: '시도', header: { text: '시도' }, mergeCells: true, editable: false, sortdisable: true }, const v = sbmsnYn.trim().toUpperCase();
{ name: 'sgg', fieldName: '시군구', header: { text: '시군구' }, mergeCells: true, editable: false, sortdisable: true }, if (v === "Y") return "O";
{ name: '1', fieldName: '1', header: { text: '시군구' }, mergeCells: true, editable: false, sortdisable: true }, if (v === "N") return "X";
{ name: '2-1', fieldName: '2-1', header: { text: '2-1' }, mergeCells: true, editable: false, sortdisable: true }, return sbmsnYn;
{ name: '2-2', fieldName: '2-2', header: { text: '2-2' }, mergeCells: true, editable: false, sortdisable: true }, }
{ name: '2-3', fieldName: '2-3', header: { text: '2-3' }, mergeCells: true, editable: false, sortdisable: true },
{ name: '2-4', fieldName: '2-4', header: { text: '2-4' }, mergeCells: true, editable: false, sortdisable: true },
{ name: '3-1', fieldName: '3-1', header: { text: '3-1' }, mergeCells: true, editable: false, sortdisable: true },
{ name: '3-2', fieldName: '3-2', header: { text: '3-2' }, mergeCells: true, editable: false, sortdisable: true },
];
const columnLayout = [ function splitSidoSggNm(sidoSggNm: string): { sido: string; sgg: string } {
'sido', const trimmed = sidoSggNm.trim();
'sgg', if (!trimmed) return { sido: "", sgg: "" };
const spaceIdx = trimmed.indexOf(" ");
if (spaceIdx < 0) return { sido: trimmed, sgg: "" };
return {
sido: trimmed.slice(0, spaceIdx),
sgg: trimmed.slice(spaceIdx + 1).trim(),
};
}
function statColumnKey(statsNm: string, statsCd: string): string {
const trimmed = statsNm.trim();
const dotIdx = trimmed.indexOf(".");
if (dotIdx > 0) return trimmed.slice(0, dotIdx).trim();
return statsCd;
}
type StatDefinition = { statsCd: string; statsNm: string; columnKey: string };
/** submission-status statusList 기준 고정 컬럼(번호) */
const FIXED_STAT_DEFINITIONS: StatDefinition[] = [
{ columnKey: "1", statsCd: "ST00010001", statsNm: "1.하수도보급률" },
{ columnKey: "2-1", statsCd: "ST00020001", statsNm: "2-1.하수관로-지역별 시설현황" },
{ columnKey: "2-2", statsCd: "ST00020002", statsNm: "2-2.하수관로-시설별 설치현황" },
{ columnKey: "2-3", statsCd: "ST00020003", statsNm: "2-3.하수관로-관종별 현황" },
{ columnKey: "2-4", statsCd: "ST00020004", statsNm: "2-4.하수관로-관경별 현황" },
{ columnKey: "2-5", statsCd: "ST00020005", statsNm: "2-5.하수관로-맨홀 현황" },
{ columnKey: "3-1", statsCd: "ST00030001", statsNm: "3-1.하수관로유지관리-개․보수" },
{ columnKey: "3-2", statsCd: "ST00030002", statsNm: "3-2.하수관로유지관리-하수관로준설" },
{
columnKey: "4-1",
statsCd: "ST00040001",
statsNm: "4-1.하수저류시설및빗물펌프장-하수저류시설",
},
{
columnKey: "4-2",
statsCd: "ST00040002",
statsNm: "4-2.하수저류시설및빗물펌프장-빗물펌프장",
},
{ columnKey: "5", statsCd: "ST00050001", statsNm: "5.펌프장" },
{ columnKey: "6", statsCd: "ST00060001", statsNm: "6.공공하수처리시설" },
{ columnKey: "7", statsCd: "ST00070001", statsNm: "7.분뇨처리시설" },
{
columnKey: "8-1",
statsCd: "ST00080001",
statsNm: "8-1.개인하수처리시설-처리용량별 오수처리시설 현황",
},
{
columnKey: "8-2",
statsCd: "ST00080002",
statsNm: "8-2.개인하수처리시설-정화조 현황(처리방식별, 처리용량별)",
},
{
columnKey: "8-3",
statsCd: "ST00080003",
statsNm: "8-3.개인하수처리시설-개인하수도관리지역 지정공고 현황",
},
{ columnKey: "9-1", statsCd: "ST00090001", statsNm: "9-1.하수도재정-하수도 재정 결산" },
{ columnKey: "9-2", statsCd: "ST00090002", statsNm: "9-2.하수도재정-하수도 요금" },
{ columnKey: "9-3", statsCd: "ST00090003", statsNm: "9-3.하수도재정-업종별 하수도 사용료" },
{ columnKey: "9-4", statsCd: "ST00090004", statsNm: "9-4.하수도재정-하수도 원인자부담금" },
{ columnKey: "10-1", statsCd: "ST00100001", statsNm: "10-1.물재이용-공공하수처리수 재이용" },
{ columnKey: "10-2", statsCd: "ST00100002", statsNm: "10-2.물재이용-중수도 현황" },
{ columnKey: "10-3", statsCd: "ST00100003", statsNm: "10-3.물재이용-빗물이용시설현황" },
{
columnKey: "10-4",
statsCd: "ST00100004",
statsNm: "10-4.물재이용-하․폐수처리수 재이용시설 설계시공업 등록현황",
},
{
columnKey: "10-5",
statsCd: "ST00100005",
statsNm: "10-5.물재이용-하․폐수처리수 재이용사업 인가현황",
},
{
columnKey: "11-1",
statsCd: "ST00110001",
statsNm: "11-1.하수및분뇨찌꺼기(슬러지)처리-하수찌꺼기 발생 및 처리현황",
},
{
columnKey: "11-2",
statsCd: "ST00110002",
statsNm: "11-2.하수및분뇨찌꺼기(슬러지)처리-소화조 운영 현황",
},
{
columnKey: "11-3",
statsCd: "ST00110003",
statsNm: "11-3.하수및분뇨찌꺼기(슬러지)처리-하수찌꺼기 처리시설 운영 현황",
},
{
columnKey: "11-4",
statsCd: "ST00110004",
statsNm: "11-4.하수및분뇨찌꺼기(슬러지)처리-분뇨찌꺼기 처리현황",
},
{
columnKey: "12-1",
statsCd: "ST00120001",
statsNm: "12-1.하수및분뇨관련산업-공공기관 하수분야",
},
{
columnKey: "12-2",
statsCd: "ST00120002",
statsNm: "12-2.하수및분뇨관련산업-공공기관 분뇨분야",
},
{
columnKey: "12-3",
statsCd: "ST00120003",
statsNm: "12-3.하수및분뇨관련산업-분뇨수집 · 운반업 현황",
},
{
columnKey: "12-4",
statsCd: "ST00120004",
statsNm: "12-4.하수및분뇨관련산업-개인하수처리 관련업 현황",
},
{ columnKey: "13-1", statsCd: "ST00130001", statsNm: "13-1.하수도서비스수준-민원" },
{ columnKey: "13-2", statsCd: "ST00130002", statsNm: "13-2.하수도서비스수준-주민친화시설" },
];
const STAT_COLUMN_KEYS = FIXED_STAT_DEFINITIONS.map((d) => d.columnKey);
const STATS_CD_TO_COLUMN_KEY = Object.fromEntries(
FIXED_STAT_DEFINITIONS.map((d) => [d.statsCd, d.columnKey]),
) as Record<string, string>;
function resolveColumnKey(item: UnSubmitDataStatusItem): string {
return STATS_CD_TO_COLUMN_KEY[item.statsCd] ?? statColumnKey(item.statsNm, item.statsCd);
}
/** 헤더(statsNm) 텍스트 길이에 맞춘 컬럼 너비(px) */
function columnWidthForHeaderText(text: string, min = 88, max = 340): number {
return Math.min(max, Math.max(min, text.length * 9 + 28));
}
function buildColumnInfo(statDefinitions: StatDefinition[]) {
const fixedColumns: ColumnConfig[] = [
{ {
name: 'groupA', name: "sido",
hideChildHeaders: false, fieldName: SIDO_FIELD,
header: { text: '미입력 하수도 통계 세부항목(번호)' }, header: { text: "시도" },
items: ['1', '2-1', '2-2', '2-3', '2-4', '3-1', '3-2'], mergeCells: true,
editable: false,
sortdisable: true,
width: 100,
},
{
name: "sgg",
fieldName: SGG_FIELD,
header: { text: "시군구" },
mergeGroupField: SIDO_FIELD,
editable: false,
sortdisable: true,
width: 120,
}, },
]; ];
const statColumns: ColumnConfig[] = statDefinitions.map(({ columnKey, statsNm }) => ({
name: columnKey,
fieldName: columnKey,
header: { text: statsNm },
editable: false,
sortdisable: true,
width: columnWidthForHeaderText(statsNm),
}));
const columns = [...fixedColumns, ...statColumns];
const statKeys = statDefinitions.map((s) => s.columnKey);
const columnLayout: ColumnLayoutItem[] = [
"sido",
"sgg",
{
name: "statsGroup",
hideChildHeaders: false,
header: { text: "미입력 하수도 통계 세부항목(번호)" },
items: statKeys,
},
];
return { columns, columnLayout, statKeys };
}
function buildRowsFromStatusList(
statusList: UnSubmitDataStatusItem[],
statKeys: string[],
): Record<string, string | number>[] {
const rowMap = new Map<string, Record<string, string | number>>();
for (const item of statusList) {
const { sido, sgg } = splitSidoSggNm(item.sidoSggNm);
const rowKey = `${sido}\u0001${sgg}`;
const columnKey = resolveColumnKey(item);
if (!rowMap.has(rowKey)) {
const row: Record<string, string | number> = {
[SIDO_FIELD]: sido,
[SGG_FIELD]: sgg,
};
for (const key of statKeys) {
row[key] = "";
}
rowMap.set(rowKey, row);
}
const row = rowMap.get(rowKey)!;
if (statKeys.includes(columnKey)) {
row[columnKey] = sbmsnYnToOx(item.sbmsnYn);
}
}
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");
});
}
function buildUnSubmitDataRequest(
values: SearchFormValues,
userInfo: { dtlInstCd?: string; enoCd?: string; laeSeCd?: string } | null,
): unSubmitDataRequest {
const sewerBzmnCd = values.bsnmCd?.trim();
return {
statsYr: values.year ?? "",
dtlInstCd: userInfo?.dtlInstCd ?? "",
enoCd: userInfo?.enoCd ?? "",
laeSeCd: userInfo?.laeSeCd ?? "",
...(sewerBzmnCd ? { sewerBzmnCd } : {}),
sido: !values.sido || values.sido === "ALL" ? "" : values.sido,
sggNm: !values.gugun || values.gugun === "ALL" ? "" : values.gugun,
unSubmitOnly: false,
};
}
const COLUMN_INFO = buildColumnInfo(FIXED_STAT_DEFINITIONS);
const NotEnteredStatus = () => {
const { setMessage: alert } = useAlertStore((state) => state);
const userInfo = useUserStore((state) => state.userInfo);
const [isLoading, setIsLoading] = useState(false);
const [rowData, setRowData] = useState<Record<string, string | number>[]>([]);
const gridColumnInfo = useMemo(
() => ({
columns: COLUMN_INFO.columns,
columnLayout: COLUMN_INFO.columnLayout,
}),
[],
);
const handleSearch = async (values: SearchFormValues) => {
if (!values.year) {
alert("년도를 선택해주세요.");
return;
}
const params = buildUnSubmitDataRequest(values, userInfo);
console.log(params);
if (!params.dtlInstCd) {
alert("기관 정보를 확인할 수 없습니다.");
return;
}
try {
setIsLoading(true);
const response = await statisticsApi.getUnSubmitData(params);
if (response.status !== "success" || !response.data) {
alert(response.message ?? "조회에 실패했습니다.");
setRowData([]);
return;
}
const statusList = response.data.statusList ?? [];
setRowData(toGridRows(buildRowsFromStatusList(statusList, STAT_COLUMN_KEYS)));
} catch {
alert("데이터 조회 중 오류가 발생했습니다.");
setRowData([]);
} finally {
setIsLoading(false);
}
};
const handleReset = () => {
setRowData([]);
};
return ( return (
<> <div className="relative">
<SearchForm /> <SearchForm
<DataGrid columnInfo={{ columns, columnLayout }} rowData={rowData} setRowData={setRowData} isExcelImport={false} fixedColumns={2} rowStartNum={2} /> onSubmit={handleSearch}
</> onReset={handleReset}
sidoSelectText="전체"
/>
{isLoading && (
<div className="absolute inset-0 z-50 flex items-center justify-center rounded-lg p-10 [data-theme='black']:bg-transparent">
<div className="relative size-[5rem]">
<LoadingWithAnimation color="primary" />
</div>
</div>
)}
<DataGrid
columnInfo={gridColumnInfo}
rowData={rowData}
setRowData={setRowData}
isExcelImport={false}
fixedColumns={2}
rowStartNum={2}
fitStyle={GridFitStyle.NONE}
enableSort={false}
/>
</div>
); );
}; };
export default NotEnteredStatus; export default NotEnteredStatus;
@@ -120,7 +120,7 @@ const PublicSewageFacilityRvw = () => {
const rawList = response.data.publicSewageList; const rawList = response.data.publicSewageList;
const convertedData: PublicSewageFacilityReviewItem[] = rawList.map((item) => ({ const convertedData: PublicSewageFacilityReviewItem[] = rawList.map((item) => ({
...item, ...item,
impdFcltPstnCn: item.fcltPstnCn ?? "", fcltPstnCn: item.fcltPstnCn ?? "",
prxyBzentyNmCn: item.prxyBzentyNmCn ?? "", prxyBzentyNmCn: item.prxyBzentyNmCn ?? "",
prxyCtrtCn: item.prxyCtrtCn ?? "", prxyCtrtCn: item.prxyCtrtCn ?? "",
intgPrcsFcltCn: item.intgPrcsFcltCn ?? "", intgPrcsFcltCn: item.intgPrcsFcltCn ?? "",
@@ -1,10 +1,123 @@
import { useRef, useState } from "react";
import { useAlertStore } from "@/shared/lib";
import { LoadingWithAnimation } from "@common/components";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import DataGrid from "@/components/module/DataGrid";
import type { ColumnInfo } from "@/components/type/DataGrid.type";
import type { SearchFormValues } from "@/components/type/SearchForm.type";
import { toGridRows } from "@/components/util/grid/gridFunction";
// 분리된 분뇨처리시설용 컬럼 구성 임포트
import { ExcretaTreatmentStatusColumnConfig } from "@/components/util/column/total/SewerExcretaTreatmentStatusColumn";
// 집계표(TOTAL) API 및 인터페이스 명세 호출
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
import type {
ExcretaTreatmentMaintainTotalRequest
} from "@/entities/statistics/model/statistics-total/statistics-excreta-treatment-total-interface";
import CellColorInfo from "./CellColorInfo";
const ExcretaTreatmentFacilityTot = () => { const ExcretaTreatmentFacilityTot = () => {
const { setMessage: alert } = useAlertStore((state) => state);
// null 타입 컴파일 에러를 방지하기 위해 엄격하게 정의한 데이터 상태
const [rowData, setRowData] = useState<Record<string, string | number>[]>([]);
const [isLoading, setIsLoading] = useState(false);
const lastSearchedValuesRef = useRef<SearchFormValues | null>(null);
const config = ExcretaTreatmentStatusColumnConfig;
const handleReset = () => {
setRowData([]);
lastSearchedValuesRef.current = null;
};
const loadGridData = async (values: SearchFormValues): Promise<boolean> => {
const param: ExcretaTreatmentMaintainTotalRequest = {
ctpvNm: values.sido === "ALL" ? "" : values.sido,
sggNm: values.gugun === "ALL" ? "" : values.gugun,
sewerBzmnCd: values.bsnmCd,
statsYr: values.year,
rowDataYn: values.isDetail,
summaryYn: values.isSummary !== 'ALL',
summaryYearCnt: values.isSummary !== 'ALL' ? Number(values.isSummary) : undefined
};
try {
const response = await statisticsTotalStatusApi.getExcretaTreatmentStatusTotalList(param);
if (response && response.status === "success" && response.data) {
// object[]로 변환하여 주입함으로써 상위 컴포넌트 간 null 에러 완벽 차단
setRowData(toGridRows(response.data as object[]));
return true;
}
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
return false;
} catch {
alert("서버 연결 중 오류가 발생했습니다.");
return false;
}
};
const handleSearch = async (values: SearchFormValues) => {
try {
setIsLoading(true);
const ok = await loadGridData(values);
if (ok) {
lastSearchedValuesRef.current = values;
} else {
lastSearchedValuesRef.current = null;
}
} catch {
alert("데이터 조회 중 오류가 발생했습니다.");
lastSearchedValuesRef.current = null;
} finally {
setIsLoading(false);
}
};
const gridColumnInfo: ColumnInfo = {
columns: config.columns,
columnLayout: config.columnLayout,
};
return ( return (
<> <div className="relative">
<SearchForm /> <SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
</>
{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>
)}
<CellColorInfo />
<div className="flex flex-col gap-[0.6rem] mx-[0.6rem] mt-[0.6rem]">
<DataGrid
columnInfo={gridColumnInfo}
rowStartNum={config.rowStartNum}
excelExportFileSuffix={config.tabLabel}
rowData={rowData}
setRowData={setRowData} // 필수 프로퍼티 에러 해결
isExcelImport={false}
isExcelExport={true}
showHeaderCheckbox={false}
fixedColumns={config.fixedColumns}
enableSort={false}
cellStyleCallback={({ row }) => {
const rowType = String(row.rowType ?? '');
if (rowType === 'DETAIL') return undefined;
if (rowType === 'BIZ_SUM') return 'rg-cell-rowtype-biz-sum';
if (rowType === 'SUMMARY') return 'rg-cell-rowtype-summary';
return 'rg-cell-rowtype-other';
}}
/>
</div>
</div>
); );
}; };
@@ -1,10 +1,206 @@
import { useRef, useState } from "react";
import { useAlertStore } from "@/shared/lib";
import { LoadingWithAnimation, Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import DataGrid from "@/components/module/DataGrid";
import type { ColumnInfo } from "@/components/type/DataGrid.type";
import type { SearchFormValues } from "@/components/type/SearchForm.type";
import { toGridRows } from "@/components/util/grid/gridFunction";
// 분리된 개별 3개 컬럼 스펙 파일 로드
import { PrivateSewageTab1ColumnConfig } from "@/components/util/column/total/sewerPrivateSewageColumn/SewerPrivateSewageTab1Column";
import { PrivateSewageTab2ColumnConfig } from "@/components/util/column/total/sewerPrivateSewageColumn/SewerPrivateSewageTab2Column";
import { PrivateSewageTab3ColumnConfig } from "@/components/util/column/total/sewerPrivateSewageColumn/SewerPrivateSewageTab3Column";
// 통계 API 서비스 및 통합 DTO 명세 임포트
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
import type {
PrivateSewageFacilitySummaryRequest
} from "@/entities/statistics/model/statistics-total/statistics-private-sewage-total-interface";
import CellColorInfo from "./CellColorInfo";
const PrivateSewageColumnListTot = [
PrivateSewageTab1ColumnConfig,
PrivateSewageTab2ColumnConfig,
PrivateSewageTab3ColumnConfig
];
const firstTabKey = PrivateSewageColumnListTot[0]?.tabKey ?? "ST00040005_1";
const PrivateSewageFacilityTot = () => { const PrivateSewageFacilityTot = () => {
const { setMessage: alert } = useAlertStore((state) => state);
// null 컴파일 예러를 사전에 원천 차단한 안전 상태 맵 선언
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map());
const [isLoading, setIsLoading] = useState(false);
const [activeTab, setActiveTab] = useState(firstTabKey);
const lastSearchedValuesRef = useRef<SearchFormValues | null>(null);
const columnInfo = PrivateSewageColumnListTot;
const handleReset = () => {
setRowDataMap(new Map());
setActiveTab(firstTabKey);
lastSearchedValuesRef.current = null;
};
/** 각 탭별 엔드포인트 비동기 디스패치 및 연동 */
const loadGridData = async (tabKey: string, values: SearchFormValues): Promise<boolean> => {
const param: PrivateSewageFacilitySummaryRequest = {
ctpvNm: values.sido === "ALL" ? "" : values.sido,
sggNm: values.gugun === "ALL" ? "" : values.gugun,
sewerBzmnCd: values.bsnmCd,
statsYr: values.year,
rowDataYn: values.isDetail,
summaryYn: values.isSummary !== 'ALL',
summaryYearCnt: values.isSummary !== 'ALL' ? Number(values.isSummary) : undefined
};
try {
// [Tab1] 처리용량별 오수처리시설
if (tabKey === "ST00080001") {
const response = await statisticsTotalStatusApi.getPrivateSewageTab1List(param);
if (response && response.status === "success" && response.data) {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
}
// [Tab2] 정화조현황
if (tabKey === "ST00080002") {
const response = await statisticsTotalStatusApi.getPrivateSewageTab2List(param);
if (response && response.status === "success" && response.data) {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
}
// [Tab3] 개인하수도 관리지역 지정공고 현황
if (tabKey === "ST00080003") {
const response = await statisticsTotalStatusApi.getPrivatePrivateMgmtAreaList(param);
if (response && response.status === "success" && response.data) {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
}
return false;
} catch {
alert("서버 연결 중 오류가 발생했습니다.");
return false;
}
};
const handleSearch = async (values: SearchFormValues) => {
try {
setIsLoading(true);
const ok = await loadGridData(activeTab, values);
if (ok) {
lastSearchedValuesRef.current = values;
} else {
lastSearchedValuesRef.current = null;
}
} catch {
alert("데이터 조회 중 오류가 발생했습니다.");
lastSearchedValuesRef.current = null;
} finally {
setIsLoading(false);
}
};
const handleActiveTabChange = async (tabKey: string) => {
setActiveTab(tabKey);
const values = lastSearchedValuesRef.current;
if (!values) return;
const existing = rowDataMap.get(tabKey);
if (existing && existing.length > 0) return; // 캐싱 검증 스킵
try {
setIsLoading(true);
await loadGridData(tabKey, values);
} catch {
alert("데이터 조회 중 오류가 발생했습니다.");
} finally {
setIsLoading(false);
}
};
return ( return (
<> <div className="relative">
<SearchForm /> <SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
</>
{/* 하수관로 규칙과 100% 싱크 맞춘 중앙 정렬 소형 팝업 로딩 바 고정 */}
{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>
)}
<CellColorInfo />
<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>
{columnInfo.map((info) => (
<TabsTrigger key={info.tabKey} value={info.tabKey}>
{info.tabLabel}
</TabsTrigger>
))}
</TabsList>
{columnInfo.map((info) => {
const tabKey = info.tabKey;
// 단언 연산자(as) 배제 형태 완벽 적용
const rowData = rowDataMap.get(tabKey) ?? [];
const gridColumnInfo: ColumnInfo = {
columns: info.columns,
columnLayout: info.columnLayout,
};
return (
<TabsContent key={tabKey} value={tabKey}>
<DataGrid
columnInfo={gridColumnInfo}
rowStartNum={info.rowStartNum}
excelExportFileSuffix={info.tabLabel}
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;
});
}}
isExcelImport={false}
isExcelExport={true}
showHeaderCheckbox={false}
fixedColumns={info.fixedColumns}
enableSort={false}
cellStyleCallback={({ row }) => {
const rowType = String(row.rowType ?? '');
if (rowType === 'DETAIL') return undefined;
if (rowType === 'BIZ_SUM') return 'rg-cell-rowtype-biz-sum';
if (rowType === 'SUMMARY') return 'rg-cell-rowtype-summary';
return 'rg-cell-rowtype-other';
}}
/>
</TabsContent>
);
})}
</Tabs>
</div>
</div>
); );
}; };
@@ -1,10 +1,123 @@
import { useRef, useState } from "react";
import { useAlertStore } from "@/shared/lib";
import { LoadingWithAnimation } from "@common/components";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import DataGrid from "@/components/module/DataGrid";
import type { ColumnInfo } from "@/components/type/DataGrid.type";
import type { SearchFormValues } from "@/components/type/SearchForm.type";
import { toGridRows } from "@/components/util/grid/gridFunction";
// 분리된 중계펌프장용 컬럼 구성 임포트
import { MediationPumpStatusColumnConfig } from "@/components/util/column/total/SewerMediationPumpStatusColumn";
// 집계표(TOTAL) API 및 인터페이스 명세 호출
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
import type {
MediationPumpMaintainTotalRequest
} from "@/entities/statistics/model/statistics-total/statistics-mediation-pump-total-interface";
import CellColorInfo from "./CellColorInfo";
const PumpingStationTot = () => { const PumpingStationTot = () => {
const { setMessage: alert } = useAlertStore((state) => state);
// null 타입 컴파일 에러가 발생하지 않도록 엄격하게 정의한 데이터 상태
const [rowData, setRowData] = useState<Record<string, string | number>[]>([]);
const [isLoading, setIsLoading] = useState(false);
const lastSearchedValuesRef = useRef<SearchFormValues | null>(null);
const config = MediationPumpStatusColumnConfig;
const handleReset = () => {
setRowData([]);
lastSearchedValuesRef.current = null;
};
const loadGridData = async (values: SearchFormValues): Promise<boolean> => {
const param: MediationPumpMaintainTotalRequest = {
ctpvNm: values.sido === "ALL" ? "" : values.sido,
sggNm: values.gugun === "ALL" ? "" : values.gugun,
sewerBzmnCd: values.bsnmCd,
statsYr: values.year,
rowDataYn: values.isDetail,
summaryYn: values.isSummary !== 'ALL',
summaryYearCnt: values.isSummary !== 'ALL' ? Number(values.isSummary) : undefined
};
try {
const response = await statisticsTotalStatusApi.getMediationPumpStationStatusTotalList(param);
if (response && response.status === "success" && response.data) {
// object[]로 변환하여 주입함으로써 null 에러 전면 방지
setRowData(toGridRows(response.data as object[]));
return true;
}
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
return false;
} catch {
alert("서버 연결 중 오류가 발생했습니다.");
return false;
}
};
const handleSearch = async (values: SearchFormValues) => {
try {
setIsLoading(true);
const ok = await loadGridData(values);
if (ok) {
lastSearchedValuesRef.current = values;
} else {
lastSearchedValuesRef.current = null;
}
} catch {
alert("데이터 조회 중 오류가 발생했습니다.");
lastSearchedValuesRef.current = null;
} finally {
setIsLoading(false);
}
};
const gridColumnInfo: ColumnInfo = {
columns: config.columns,
columnLayout: config.columnLayout,
};
return ( return (
<> <div className="relative">
<SearchForm /> <SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
</>
{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>
)}
<CellColorInfo />
<div className="flex flex-col gap-[0.6rem] mx-[0.6rem] mt-[0.6rem]">
<DataGrid
columnInfo={gridColumnInfo}
rowStartNum={config.rowStartNum}
excelExportFileSuffix={config.tabLabel}
rowData={rowData}
setRowData={setRowData}
isExcelImport={false}
isExcelExport={true}
showHeaderCheckbox={false}
fixedColumns={config.fixedColumns}
enableSort={false}
cellStyleCallback={({ row }) => {
const rowType = String(row.rowType ?? '');
if (rowType === 'DETAIL') return undefined;
if (rowType === 'BIZ_SUM') return 'rg-cell-rowtype-biz-sum';
if (rowType === 'SUMMARY') return 'rg-cell-rowtype-summary';
return 'rg-cell-rowtype-other';
}}
/>
</div>
</div>
); );
}; };
@@ -1,10 +1,162 @@
import { useRef, useState } from "react";
import { useAlertStore } from "@/shared/lib";
import { LoadingWithAnimation, Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import DataGrid from "@/components/module/DataGrid";
import type { ColumnInfo } from "@/components/type/DataGrid.type";
import type { SearchFormValues } from "@/components/type/SearchForm.type";
import { toGridRows } from "@/components/util/grid/gridFunction";
import CellColorInfo from "./CellColorInfo";
// 12. 하수 및 분뇨 관리 산업 탭 설정 (경로 확인 필수)
import { PublicSewageStaffTab1ColumnConfig } from "@/components/util/column/total/sewageExcretaIndustry/PublicSewageStaffTab1Column";
import { PublicHumanWasteStaffTab2ColumnConfig } from "@/components/util/column/total/sewageExcretaIndustry/PublicHumanWasteStaffTab2Column";
import { HumanWasteCollectionTab3ColumnConfig } from "@/components/util/column/total/sewageExcretaIndustry/HumanWasteCollectionTab3Column";
import { IndividualSewageTab4ColumnConfig } from "@/components/util/column/total/sewageExcretaIndustry/IndividualSewageTab4Column";
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
import type {
SewerageIndustry,
PublicSewageStaffTab1Response,
PublicHumanWasteStaffTab2Response,
HumanWasteCollectionTab3Response,
IndividualSewageTab4Response
} from "@/entities/statistics/model/statistics-total/statistics-sewerage-industry-interface";
const SewageExcretaIndustryColumnListTot = [PublicSewageStaffTab1ColumnConfig,PublicHumanWasteStaffTab2ColumnConfig,HumanWasteCollectionTab3ColumnConfig,IndividualSewageTab4ColumnConfig].filter(Boolean);
const firstTabKey = SewageExcretaIndustryColumnListTot[0]?.tabKey ?? "ST00120001";
const SewageExcretaRelatedTot = () => { const SewageExcretaRelatedTot = () => {
const { setMessage: alert } = useAlertStore((state) => state);
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map());
const [isLoading, setIsLoading] = useState(false);
const [activeTab, setActiveTab] = useState(firstTabKey);
const lastSearchedValuesRef = useRef<SearchFormValues | null>(null);
const handleReset = () => {
setRowDataMap(new Map());
setActiveTab(firstTabKey);
lastSearchedValuesRef.current = null;
};
const loadGridData = async (tabKey: string, values: SearchFormValues): Promise<boolean> => {
setIsLoading(true);
const param: SewerageIndustry = {
ctpvNm: values.sido === "ALL" ? "" : values.sido,
sggNm: values.gugun === "ALL" ? "" : values.gugun,
sewerBzmnCd: values.bsnmCd,
statsYr: values.year,
rowDataYn: values.isDetail,
summaryYn: values.isSummary !== 'ALL',
summaryYearCnt: values.isSummary !== 'ALL' ? Number(values.isSummary) : undefined
};
try {
if (tabKey === "ST00120001") {
const response: PublicSewageStaffTab1Response = await statisticsTotalStatusApi.getPublicSewageStaffTab1List(param);
if (response?.status === "success") {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
}
else if (tabKey === "ST00120002") {
const response: PublicHumanWasteStaffTab2Response = await statisticsTotalStatusApi.getPublicHumanWasteStaffTab2List(param);
if (response?.status === "success") {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
}
else if (tabKey === "ST00120003") {
const response: HumanWasteCollectionTab3Response = await statisticsTotalStatusApi.getHumanWasteCollectionTab3List(param);
if (response?.status === "success") {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
}
// [TAB4] 개인하수처리관련업
else if (tabKey === "ST00120004") {
const response: IndividualSewageTab4Response = await statisticsTotalStatusApi.getIndividualSewageTab4List(param);
if (response?.status === "success") {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
}
return false;
} catch {
alert("서버 연결 중 오류가 발생했습니다.");
return false;
} finally {
setIsLoading(false);
}
};
const handleSearch = async (values: SearchFormValues) => {
lastSearchedValuesRef.current = values;
await loadGridData(activeTab, values);
};
const handleActiveTabChange = async (tabKey: string) => {
setActiveTab(tabKey);
const values = lastSearchedValuesRef.current;
if (!values || rowDataMap.has(tabKey)) return;
await loadGridData(tabKey, values);
};
return ( return (
<> <div className="relative">
<SearchForm /> <SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
</>
{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>
)}
<CellColorInfo />
<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>
{SewageExcretaIndustryColumnListTot.map((info) => (
<TabsTrigger key={info.tabKey} value={info.tabKey}>{info.tabLabel}</TabsTrigger>
))}
</TabsList>
{SewageExcretaIndustryColumnListTot.map((info) => (
<TabsContent key={info.tabKey} value={info.tabKey}>
<DataGrid
columnInfo={{ columns: info.columns, columnLayout: info.columnLayout }}
rowStartNum={info.rowStartNum}
rowData={rowDataMap.get(info.tabKey) ?? []}
excelExportFileSuffix={info.tabLabel}
setRowData={(updater) => {
setRowDataMap((prev) => {
const next = new Map(prev);
const cur = next.get(info.tabKey) ?? [];
const n = typeof updater === "function" ? updater(cur) : updater;
next.set(info.tabKey, n);
return next;
});
}}
isExcelImport={false}
isExcelExport={true}
showHeaderCheckbox={false}
fixedColumns={info.fixedColumns}
enableSort={false}
cellStyleCallback={({ row }) => {
const rowType = String(row.rowType ?? '');
if (rowType === 'DETAIL') return undefined;
if (rowType === 'BIZ_SUM') return 'rg-cell-rowtype-biz-sum';
if (rowType === 'SUMMARY') return 'rg-cell-rowtype-summary';
return 'rg-cell-rowtype-other';
}}
/>
</TabsContent>
))}
</Tabs>
</div>
</div>
); );
}; };
@@ -1,10 +1,210 @@
import { useRef, useState } from "react";
import { useAlertStore } from "@/shared/lib";
import { LoadingWithAnimation, Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import DataGrid from "@/components/module/DataGrid";
import type { SearchFormValues } from "@/components/type/SearchForm.type";
import { toGridRows } from "@/components/util/grid/gridFunction";
// 4개 탭 컬럼 설정 임포트
import { SludgeProcessingTab1ColumnConfig } from "@/components/util/column/total/sludgeProcessing/SludgeProcessingTab1Column";
import { DigestionTankTab2ColumnConfig } from "@/components/util/column/total/sludgeProcessing/DigestionTankTab2Column";
import { SewageSludgeOperTab3ColumnConfig } from "@/components/util/column/total/sludgeProcessing/SewageSludgeOperTab3Column";
import { HumanWasteSludgeTab4ColumnConfig } from "@/components/util/column/total/sludgeProcessing/HumanWasteSludgeTab4Column";
// API 인스턴스 및 인터페이스 임포트 (타입 안전성 확보)
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
import type {
SludgeSummaryRequest,
SludgeProcessingTab1Response,
DigestionTankOperTab2Response,
SewageSludgeOperTab3Response,
HumanWasteSludgeTab4Response
} from "@/entities/statistics/model/statistics-total/statistics-sludge-total-interface";
import CellColorInfo from "./CellColorInfo";
// 탭 순회 설정
const SludgeColumnListTot = [
SludgeProcessingTab1ColumnConfig,
DigestionTankTab2ColumnConfig,
SewageSludgeOperTab3ColumnConfig,
HumanWasteSludgeTab4ColumnConfig
].filter(Boolean);
const firstTabKey = SludgeColumnListTot[0]?.tabKey ?? "ST00110001";
const SewageExcretaSlurgeTot = () => { const SewageExcretaSlurgeTot = () => {
const { setMessage: alert } = useAlertStore((state) => state);
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map());
const [isLoading, setIsLoading] = useState(false);
const [activeTab, setActiveTab] = useState(firstTabKey);
const lastSearchedValuesRef = useRef<SearchFormValues | null>(null);
const columnInfo = SludgeColumnListTot;
const handleReset = () => {
setRowDataMap(new Map());
setActiveTab(firstTabKey);
lastSearchedValuesRef.current = null;
};
const loadGridData = async (tabKey: string, values: SearchFormValues): Promise<boolean> => {
setIsLoading(true);
const param: SludgeSummaryRequest = {
ctpvNm: values.sido === "ALL" ? "" : values.sido,
sggNm: values.gugun === "ALL" ? "" : values.gugun,
sewerBzmnCd: values.bsnmCd,
statsYr: values.year,
rowDataYn: values.isDetail,
summaryYn: values.isSummary !== 'ALL',
summaryYearCnt: values.isSummary !== 'ALL' ? Number(values.isSummary) : undefined
};
try {
// [TAB1] 하수및분뇨찌꺼기 > 찌꺼기처리시설현황
if (tabKey === "ST00110001") {
const response: SludgeProcessingTab1Response = await statisticsTotalStatusApi.getSludgeProcessingTab1List(param);
if (response?.status === "success") {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
}
// [TAB2] 소화조 운영현황
else if (tabKey === "ST00110002") {
const response: DigestionTankOperTab2Response = await statisticsTotalStatusApi.getSludgeTab2List(param);
if (response?.status === "success") {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
}
// [TAB3] 하수찌꺼기 처리시설 운영현황
else if (tabKey === "ST00110003") {
const response: SewageSludgeOperTab3Response = await statisticsTotalStatusApi.getSludgeTab3List(param);
if (response?.status === "success") {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
}
// [TAB4] 분뇨찌꺼기 처리현황
else if (tabKey === "ST00110004") {
const response: HumanWasteSludgeTab4Response = await statisticsTotalStatusApi.getSludgeTab4List(param);
if (response?.status === "success") {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
}
alert("데이터 조회 중 오류가 발생했습니다.");
return false;
} catch {
alert("서버 연결 중 오류가 발생했습니다.");
return false;
} finally {
setIsLoading(false);
}
};
/** 검색 버튼 이벤트: SearchForm의 Values 타입을 기반으로 호출 */
const handleSearch = async (values: SearchFormValues) => {
try {
setIsLoading(true);
// 탭 변경 없이 현재 탭(activeTab)에 대해서만 명시적 타입 호출
const ok = await loadGridData(activeTab, values);
if (ok) {
lastSearchedValuesRef.current = values;
} else {
lastSearchedValuesRef.current = null;
}
} catch (error) {
alert("데이터 조회 중 오류가 발생했습니다.");
lastSearchedValuesRef.current = null;
} finally {
setIsLoading(false);
}
};
/** 탭 변경 이벤트: 현재 탭 상태와 SearchForm의 마지막 값을 동기화 */
const handleActiveTabChange = async (tabKey: string) => {
setActiveTab(tabKey);
// 마지막 검색 값이 있으면 해당 탭만 새로 로드
const values = lastSearchedValuesRef.current;
if (!values || rowDataMap.has(tabKey)) return;
try {
setIsLoading(true);
await loadGridData(tabKey, values);
} catch (error) {
alert("데이터 조회 중 오류가 발생했습니다.");
} finally {
setIsLoading(false);
}
};
return ( return (
<> <div className="relative">
<SearchForm /> <SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
</>
{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>
)}
<CellColorInfo />
<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>
{columnInfo.map((info) => (
<TabsTrigger key={info.tabKey} value={info.tabKey}>{info.tabLabel}</TabsTrigger>
))}
</TabsList>
{columnInfo.map((info) => {
const tabKey = info.tabKey;
const rowData = rowDataMap.get(tabKey) ?? [];
return (
<TabsContent key={tabKey} value={tabKey}>
<DataGrid
columnInfo={{ columns: info.columns, columnLayout: info.columnLayout }}
rowStartNum={info.rowStartNum}
rowData={rowData}
excelExportFileSuffix={info.tabLabel}
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;
});
}}
isExcelImport={false}
isExcelExport={true}
showHeaderCheckbox={false}
fixedColumns={info.fixedColumns}
enableSort={false}
cellStyleCallback={({ row }) => {
const rowType = String(row.rowType ?? '');
if (rowType === 'DETAIL') return undefined;
if (rowType === 'BIZ_SUM') return 'rg-cell-rowtype-biz-sum';
if (rowType === 'SUMMARY') return 'rg-cell-rowtype-summary';
return 'rg-cell-rowtype-other';
}}
/>
</TabsContent>
);
})}
</Tabs>
</div>
</div>
); );
}; };
@@ -15,12 +15,17 @@ import type { SewagePipeMaintainTotalRequest } from "@/entities/statistics/model
const firstTabKey = SewagePipeMaintainColumnListTot[0]?.tabKey ?? "ST00030001"; const firstTabKey = SewagePipeMaintainColumnListTot[0]?.tabKey ?? "ST00030001";
function buildSewagePipeMaintainTotSearchParam(values: SearchFormValues): SewagePipeMaintainTotalRequest { function buildSewagePipeMaintainTotSearchParam(values: SearchFormValues): SewagePipeMaintainTotalRequest {
const isSummaryEnabled = values.isSummary !== 'ALL';
const summaryYearCnt = isSummaryEnabled ? Number(values.isSummary) : undefined;
return { return {
ctpvNm: values.sido === "ALL" ? "" : values.sido, ctpvNm: values.sido === "ALL" ? "" : values.sido,
sggNm: values.gugun === "ALL" ? "" : values.gugun, sggNm: values.gugun === "ALL" ? "" : values.gugun,
sewerBzmnCd: values.bsnmCd, sewerBzmnCd: values.bsnmCd,
statsYr: values.year, statsYr: values.year,
rowDataYn: values.isDetail, rowDataYn: values.isDetail,
summaryYn: isSummaryEnabled,
...(isSummaryEnabled ? { summaryYearCnt } : {}),
}; };
} }
@@ -128,7 +133,7 @@ const SewagePipeMaintainTot = () => {
return ( return (
<div className="relative"> <div className="relative">
<SearchForm isDetail={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" /> <SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
{isLoading && ( {isLoading && (
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center"> <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]"> <div className="relative size-[5rem]">
@@ -1,10 +1,190 @@
import { useRef, useState } from "react";
import { useAlertStore } from "@/shared/lib";
import { LoadingWithAnimation, Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import DataGrid from "@/components/module/DataGrid";
import type { ColumnInfo } from "@/components/type/DataGrid.type";
import type { SearchFormValues } from "@/components/type/SearchForm.type";
import { toGridRows } from "@/components/util/grid/gridFunction";
// 분리된 개별 컬럼 구성 임포트 경로 유지
import { ReservoirStatusColumnConfig } from "@/components/util/column/total/sewerReservoir/SewerReservoirStatusColumn";
import { PumpStationStatusColumnConfig } from "@/components/util/column/total/sewerReservoir/SewerPumpStationStatusColumn";
// 수정 적용한 API 및 인터페이스 명세 호출 유지
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
import type {
SewerReservoirMaintainTotalRequest
} from "@/entities/statistics/model/statistics-total/statistics-sewage-reservoir-total-interface";
import CellColorInfo from "./CellColorInfo";
const SewerReservoirColumnListTot = [
ReservoirStatusColumnConfig,
PumpStationStatusColumnConfig
];
const firstTabKey = SewerReservoirColumnListTot[0]?.tabKey ?? "ST00040001";
const SewageReservoirPumpTot = () => { const SewageReservoirPumpTot = () => {
const { setMessage: alert } = useAlertStore((state) => state);
// 상태 정의에서 null을 제외하여 DataGrid와 타입을 일치시킵니다.
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map());
const [isLoading, setIsLoading] = useState(false);
const [activeTab, setActiveTab] = useState(firstTabKey);
const lastSearchedValuesRef = useRef<SearchFormValues | null>(null);
const columnInfo = SewerReservoirColumnListTot;
const handleReset = () => {
setRowDataMap(new Map());
setActiveTab(firstTabKey);
lastSearchedValuesRef.current = null;
};
const loadGridData = async (tabKey: string, values: SearchFormValues): Promise<boolean> => {
const param: SewerReservoirMaintainTotalRequest = {
ctpvNm: values.sido === "ALL" ? "" : values.sido,
sggNm: values.gugun === "ALL" ? "" : values.gugun,
sewerBzmnCd: values.bsnmCd,
statsYr: values.year,
rowDataYn: values.isDetail,
summaryYn: values.isSummary !== 'ALL',
summaryYearCnt: values.isSummary !== 'ALL' ? Number(values.isSummary) : undefined
};
try {
if (tabKey === "ST00040001") {
const response = await statisticsTotalStatusApi.getSewerReservoirStatusTotalList(param);
if (response && response.status === "success" && response.data) {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
}
if (tabKey === "ST00040002") {
const response = await statisticsTotalStatusApi.getSewerPumpStationStatusTotalList(param);
if (response && response.status === "success" && response.data) {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
}
return false;
} catch {
alert("서버 연결 중 오류가 발생했습니다.");
return false;
}
};
const handleSearch = async (values: SearchFormValues) => {
try {
setIsLoading(true);
const ok = await loadGridData(activeTab, values);
if (ok) {
lastSearchedValuesRef.current = values;
} else {
lastSearchedValuesRef.current = null;
}
} catch {
alert("데이터 조회 중 오류가 발생했습니다.");
lastSearchedValuesRef.current = null;
} finally {
setIsLoading(false);
}
};
const handleActiveTabChange = async (tabKey: string) => {
setActiveTab(tabKey);
const values = lastSearchedValuesRef.current;
if (!values) return;
const existing = rowDataMap.get(tabKey);
if (existing && existing.length > 0) return;
try {
setIsLoading(true);
await loadGridData(tabKey, values);
} catch {
alert("데이터 조회 중 오류가 발생했습니다.");
} finally {
setIsLoading(false);
}
};
return ( return (
<> <div className="relative">
<SearchForm /> <SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
</>
{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>
)}
<CellColorInfo />
<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>
{columnInfo.map((info) => (
<TabsTrigger key={info.tabKey} value={info.tabKey}>
{info.tabLabel}
</TabsTrigger>
))}
</TabsList>
{columnInfo.map((info) => {
const tabKey = info.tabKey;
const rowData = rowDataMap.get(tabKey) ?? [];
const gridColumnInfo: ColumnInfo = {
columns: info.columns,
columnLayout: info.columnLayout,
};
return (
<TabsContent key={tabKey} value={tabKey}>
<DataGrid
columnInfo={gridColumnInfo}
rowStartNum={info.rowStartNum}
excelExportFileSuffix={info.tabLabel}
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;
});
}}
isExcelImport={false}
isExcelExport={true}
showHeaderCheckbox={false}
fixedColumns={info.fixedColumns}
enableSort={false}
cellStyleCallback={({ row }) => {
const rowType = String(row.rowType ?? '');
if (rowType === 'DETAIL') return undefined;
if (rowType === 'BIZ_SUM') return 'rg-cell-rowtype-biz-sum';
if (rowType === 'SUMMARY') return 'rg-cell-rowtype-summary';
return 'rg-cell-rowtype-other';
}}
/>
</TabsContent>
);
})}
</Tabs>
</div>
</div>
); );
}; };
@@ -1,10 +1,217 @@
import { useRef, useState } from "react";
import { useAlertStore } from "@/shared/lib";
import { LoadingWithAnimation, Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import DataGrid from "@/components/module/DataGrid";
import type { ColumnInfo } from "@/components/type/DataGrid.type";
import type { SearchFormValues } from "@/components/type/SearchForm.type";
import { toGridRows } from "@/components/util/grid/gridFunction";
// 분리된 4개 개별 탭 컬럼 파일 바인딩
import { SewerageFinancialTab1ColumnConfig } from "@/components/util/column/total/sewerageFinancial/SewerageFinancialTab1Column";
import { SewerageFeeTab2ColumnConfig } from "@/components/util/column/total/sewerageFinancial/SewerageFeeTab2Column";
import { SewerageUsageFeeTab3ColumnConfig } from "@/components/util/column/total/sewerageFinancial/SewerageUsageFeeTab3Column";
import { SewerageOrgCauseTab4ColumnConfig } from "@/components/util/column/total/sewerageFinancial/SewerageOrgCauseTab4Column";
// API 인스턴스 및 인터페이스 호출
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
import type {
SewerageFinanceSummaryRequest
} from "@/entities/statistics/model/statistics-total/statistics-sewerage-finance-total-interface";
import CellColorInfo from "./CellColorInfo";
const SewerageFinanceColumnListTot = [
SewerageFinancialTab1ColumnConfig,
SewerageFeeTab2ColumnConfig,
SewerageUsageFeeTab3ColumnConfig,
SewerageOrgCauseTab4ColumnConfig
];
const firstTabKey = SewerageFinanceColumnListTot[0]?.tabKey ?? "ST00040006_1";
const SewerageFinanceTot = () => { const SewerageFinanceTot = () => {
const { setMessage: alert } = useAlertStore((state) => state);
// 컴파일 에러가 발생하지 않도록 원천 가공 처리형 맵 적용
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map());
const [isLoading, setIsLoading] = useState(false);
const [activeTab, setActiveTab] = useState(firstTabKey);
const lastSearchedValuesRef = useRef<SearchFormValues | null>(null);
const columnInfo = SewerageFinanceColumnListTot;
const handleReset = () => {
setRowDataMap(new Map());
setActiveTab(firstTabKey);
lastSearchedValuesRef.current = null;
};
/** 개별 조건별 데이터 동적 라우팅 디스패치 */
const loadGridData = async (tabKey: string, values: SearchFormValues): Promise<boolean> => {
const param: SewerageFinanceSummaryRequest = {
ctpvNm: values.sido === "ALL" ? "" : values.sido,
sggNm: values.gugun === "ALL" ? "" : values.gugun,
sewerBzmnCd: values.bsnmCd,
statsYr: values.year,
rowDataYn: values.isDetail,
summaryYn: values.isSummary !== 'ALL',
summaryYearCnt: values.isSummary !== 'ALL' ? Number(values.isSummary) : undefined
};
try {
// [Tab1] 하수도재정 결산
if (tabKey === "ST00090001") {
const response = await statisticsTotalStatusApi.getSewerageFinancialList(param); // 엔드포인트 바인딩
if (response && response.status === "success" && response.data) {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
}
// [Tab2] 하수도 요금
if (tabKey === "ST00090002") {
const response = await statisticsTotalStatusApi.getSewerageFeeList(param);
if (response && response.status === "success" && response.data) {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
}
// [Tab3] 하수도 사용료
if (tabKey === "ST00090003") {
const response = await statisticsTotalStatusApi.getSewerageUsageList(param);
if (response && response.status === "success" && response.data) {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
}
// [Tab4] 원인자 부담금
if (tabKey === "ST00090004") {
const response = await statisticsTotalStatusApi.getSewerageOrgCauseList(param);
if (response && response.status === "success" && response.data) {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
}
return false;
} catch {
alert("서버 연결 중 오류가 발생했습니다.");
return false;
}
};
const handleSearch = async (values: SearchFormValues) => {
try {
setIsLoading(true);
const ok = await loadGridData(activeTab, values);
if (ok) {
lastSearchedValuesRef.current = values;
} else {
lastSearchedValuesRef.current = null;
}
} catch {
alert("데이터 조회 중 오류가 발생했습니다.");
lastSearchedValuesRef.current = null;
} finally {
setIsLoading(false);
}
};
const handleActiveTabChange = async (tabKey: string) => {
setActiveTab(tabKey);
const values = lastSearchedValuesRef.current;
if (!values) return;
const existing = rowDataMap.get(tabKey);
if (existing && existing.length > 0) return;
try {
setIsLoading(true);
await loadGridData(tabKey, values);
} catch {
alert("데이터 조회 중 오류가 발생했습니다.");
} finally {
setIsLoading(false);
}
};
return ( return (
<> <div className="relative">
<SearchForm /> <SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
</>
{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>
)}
<CellColorInfo />
<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>
{columnInfo.map((info) => (
<TabsTrigger key={info.tabKey} value={info.tabKey}>
{info.tabLabel}
</TabsTrigger>
))}
</TabsList>
{columnInfo.map((info) => {
const tabKey = info.tabKey;
// 요청하신 타입 단언 제거 형태 유지
const rowData = rowDataMap.get(tabKey) ?? [];
const gridColumnInfo: ColumnInfo = {
columns: info.columns,
columnLayout: info.columnLayout,
};
return (
<TabsContent key={tabKey} value={tabKey}>
<DataGrid
columnInfo={gridColumnInfo}
rowStartNum={info.rowStartNum}
excelExportFileSuffix={info.tabLabel}
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;
});
}}
isExcelImport={false}
isExcelExport={true}
showHeaderCheckbox={false}
fixedColumns={info.fixedColumns}
enableSort={false}
cellStyleCallback={({ row }) => {
const rowType = String(row.rowType ?? '');
if (rowType === 'DETAIL') return undefined;
if (rowType === 'BIZ_SUM') return 'rg-cell-rowtype-biz-sum';
if (rowType === 'SUMMARY') return 'rg-cell-rowtype-summary';
return 'rg-cell-rowtype-other';
}}
/>
</TabsContent>
);
})}
</Tabs>
</div>
</div>
); );
}; };
@@ -1,131 +1,99 @@
import { useRef, useState } from "react"; import { useRef, useState } from "react";
import { useAlertStore } from "@/shared/lib"; import { useAlertStore } from "@/shared/lib";
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service"; import { LoadingWithAnimation, Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components";
import { toGridRows } from "@/components/util/grid/gridFunction";
import SearchForm from "@/components/module/SearchForm"; import SearchForm from "@/components/module/SearchForm";
import DataGrid from "@/components/module/DataGrid"; import DataGrid from "@/components/module/DataGrid";
import { LoadingWithAnimation, Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components";
import type { ColumnInfo } from "@/components/type/DataGrid.type"; import type { ColumnInfo } from "@/components/type/DataGrid.type";
import type { SearchFormValues } from "@/components/type/SearchForm.type"; import type { SearchFormValues } from "@/components/type/SearchForm.type";
import { ComplaintInpColumn } from "@/components/util/column/total/sewerageServiceLevel/ComplaintTotColumn"; import { toGridRows } from "@/components/util/grid/gridFunction";
import { ResidentFriendlyFactTotColumn } from "@/components/util/column/total/sewerageServiceLevel/ResidentFriendlyFactTotColumn"; import CellColorInfo from "./CellColorInfo";
const SewerageServiceLevelInpTabList = [ // 13. 하수도서비스수준 컬럼 설정
ComplaintInpColumn, import { SewageComplaintTab1ColumnConfig } from "@/components/util/column/total/sewerageServiceLevel/ComplaintTotColumn";
ResidentFriendlyFactTotColumn, import { ResidentFriendlyFacilityTab2ColumnConfig } from "@/components/util/column/total/sewerageServiceLevel/ResidentFriendlyFactTotColumn";
];
const SUPPORTED_TAB_KEYS = [ComplaintInpColumn.tabKey, ResidentFriendlyFactTotColumn.tabKey] as const; import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
import type {
SewerageServiceLevelRequest,
SewerageServiceLevelComplaintResponse,
SewerageServiceLevelResidentFriendlyFactResponse
} from "@/entities/statistics/model/statistics-total/statistics-service-level-total-interface";
const SewageServiceLevelColumnListTot = [
SewageComplaintTab1ColumnConfig,
ResidentFriendlyFacilityTab2ColumnConfig
].filter(Boolean);
const firstTabKey = SewageServiceLevelColumnListTot[0]?.tabKey ?? "ST00130001";
const SewerageServiceLevelTot = () => { const SewerageServiceLevelTot = () => {
const { setMessage: alert } = useAlertStore((state) => state); const { setMessage: alert } = useAlertStore((state) => state);
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map()); const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map());
const [isLoading, setIsLoading] = useState<boolean>(false); const [isLoading, setIsLoading] = useState(false);
const [activeTab, setActiveTab] = useState(ComplaintInpColumn.tabKey); const [activeTab, setActiveTab] = useState(firstTabKey);
const lastSearchValuesRef = useRef<SearchFormValues | null>(null); const lastSearchedValuesRef = useRef<SearchFormValues | null>(null);
const columnInfo = SewerageServiceLevelInpTabList;
const handleReset = () => { const handleReset = () => {
setRowDataMap(new Map()); setRowDataMap(new Map());
setActiveTab(ComplaintInpColumn.tabKey); setActiveTab(firstTabKey);
lastSearchValuesRef.current = null; lastSearchedValuesRef.current = null;
}; };
const loadSewerageServiceLevelTotTabData = async ( const loadGridData = async (tabKey: string, values: SearchFormValues): Promise<boolean> => {
tabKey: string, setIsLoading(true);
values: SearchFormValues, const param: SewerageServiceLevelRequest = {
mergeIntoExistingMap: boolean,
) => {
const param = {
ctpvNm: values.sido === "ALL" ? "" : values.sido, ctpvNm: values.sido === "ALL" ? "" : values.sido,
sggNm: values.gugun === "ALL" ? "" : values.gugun, sggNm: values.gugun === "ALL" ? "" : values.gugun,
sewerBzmnCd: values.bsnmCd, sewerBzmnCd: values.bsnmCd,
statsYr: values.year, statsYr: values.year,
rowDataYn: values.isDetail, rowDataYn: values.isDetail,
summaryYn: values.isSummary !== 'ALL',
summaryYearCnt: values.isSummary !== 'ALL' ? Number(values.isSummary) : undefined
}; };
const fetcherMap = {
[ComplaintInpColumn.tabKey]: statisticsTotalStatusApi.getSewerageServiceLevelComplaint.bind(
statisticsTotalStatusApi,
),
[ResidentFriendlyFactTotColumn.tabKey]:
statisticsTotalStatusApi.getSewerageServiceLevelResidentFriendlyFact.bind(
statisticsTotalStatusApi,
),
};
const fetcher = fetcherMap[tabKey];
if (!fetcher) {
return false;
}
const response = await fetcher(param);
if (response.status === "success" && response.data) {
const rows = toGridRows(response.data as object[]);
if (mergeIntoExistingMap) {
setRowDataMap((prev) => {
const next = new Map(prev);
next.set(tabKey, rows);
return next;
});
} else {
const next = new Map<string, Record<string, string | number>[]>();
next.set(tabKey, rows);
setRowDataMap(next);
}
return true;
}
alert(response.message || "데이터 조회 중 오류가 발생했습니다.");
return false;
};
const handleSearch = async (values: SearchFormValues) => {
try { try {
setIsLoading(true); // [TAB1] 민원
let ok = false; if (tabKey === "ST00130001") {
if (SUPPORTED_TAB_KEYS.includes(activeTab)) { const response: SewerageServiceLevelComplaintResponse = await statisticsTotalStatusApi.getSewerageServiceLevelComplaint(param);
ok = await loadSewerageServiceLevelTotTabData(activeTab, values, true); if (response?.status === "success") {
} setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
if (ok) { return true;
lastSearchValuesRef.current = values; }
} else { }
lastSearchValuesRef.current = null; // [TAB2] 주민친화시설
else if (tabKey === "ST00130002") {
const response: SewerageServiceLevelResidentFriendlyFactResponse = await statisticsTotalStatusApi.getSewerageServiceLevelResidentFriendlyFact(param);
if (response?.status === "success") {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
} }
return false;
} catch { } catch {
alert("데이터 조회 중 오류가 발생했습니다."); alert("서버 연결 중 오류가 발생했습니다.");
lastSearchValuesRef.current = null; return false;
} finally { } finally {
setIsLoading(false); setIsLoading(false);
} }
}; };
const handleSearch = async (values: SearchFormValues) => {
lastSearchedValuesRef.current = values;
await loadGridData(activeTab, values);
};
const handleActiveTabChange = async (tabKey: string) => { const handleActiveTabChange = async (tabKey: string) => {
setActiveTab(tabKey); setActiveTab(tabKey);
const values = lastSearchedValuesRef.current;
const values = lastSearchValuesRef.current; if (!values || rowDataMap.has(tabKey)) return;
if (!values) return; await loadGridData(tabKey, values);
const existing = rowDataMap.get(tabKey);
const hasData = Array.isArray(existing) && existing.length > 0;
if (hasData) return;
if (SUPPORTED_TAB_KEYS.includes(tabKey)) {
try {
setIsLoading(true);
await loadSewerageServiceLevelTotTabData(tabKey, values, true);
} catch {
alert("데이터 조회 중 오류가 발생했습니다.");
} finally {
setIsLoading(false);
}
}
}; };
return ( return (
<div className="relative"> <div className="relative">
<SearchForm isDetail={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" /> <SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
{isLoading && ( {isLoading && (
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center"> <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]"> <div className="relative size-[5rem]">
@@ -133,58 +101,48 @@ const SewerageServiceLevelTot = () => {
</div> </div>
</div> </div>
)} )}
<CellColorInfo />
<div className="flex flex-col gap-[0.6rem] mx-[0.6rem]"> <div className="flex flex-col gap-[0.6rem] mx-[0.6rem]">
<Tabs value={activeTab} onValueChange={(v) => void handleActiveTabChange(v)} className="w-full" variant="default"> <Tabs value={activeTab} onValueChange={(v) => void handleActiveTabChange(v)} className="w-full" variant="default">
<TabsList> <TabsList>
{columnInfo.map((info) => ( {SewageServiceLevelColumnListTot.map((info) => (
<TabsTrigger key={info.tabKey} value={info.tabKey}> <TabsTrigger key={info.tabKey} value={info.tabKey}>{info.tabLabel}</TabsTrigger>
{info.tabLabel || info.tabKey}
</TabsTrigger>
))} ))}
</TabsList> </TabsList>
{columnInfo.map((info) => {
const tabKey = info.tabKey; {SewageServiceLevelColumnListTot.map((info) => (
if (!info.columns || !info.columnLayout) { <TabsContent key={info.tabKey} value={info.tabKey}>
return null; <DataGrid
} columnInfo={{ columns: info.columns, columnLayout: info.columnLayout }}
rowStartNum={info.rowStartNum}
const rowData = rowDataMap.get(tabKey) ?? []; rowData={rowDataMap.get(info.tabKey) ?? []}
const gridColumnInfo: ColumnInfo = { excelExportFileSuffix={info.tabLabel}
columns: info.columns, setRowData={(updater) => {
columnLayout: info.columnLayout, setRowDataMap((prev) => {
}; const next = new Map(prev);
const cur = next.get(info.tabKey) ?? [];
return ( const n = typeof updater === "function" ? updater(cur) : updater;
<TabsContent key={tabKey} value={tabKey}> next.set(info.tabKey, n);
<DataGrid return next;
columnInfo={gridColumnInfo} });
rowStartNum={info.rowStartNum} }}
excelExportFileSuffix={info.tabLabel || tabKey} isExcelImport={false}
rowData={rowData} isExcelExport={true}
setRowData={(updater) => { showHeaderCheckbox={false}
setRowDataMap((prev) => { fixedColumns={info.fixedColumns}
const next = new Map(prev); enableSort={false}
const cur = next.get(tabKey) ?? []; cellStyleCallback={({ row }) => {
const n = typeof updater === "function" ? updater(cur) : updater; const rowType = String(row.rowType ?? '');
next.set(tabKey, n); if (rowType === 'DETAIL') return undefined;
return next; if (rowType === 'BIZ_SUM') return 'rg-cell-rowtype-biz-sum';
}); if (rowType === 'SUMMARY') return 'rg-cell-rowtype-summary';
}} return 'rg-cell-rowtype-other';
isExcelImport={false} }}
isExcelExport />
showHeaderCheckbox={false} </TabsContent>
fixedColumns={info.fixedColumns} ))}
enableSort={false}
cellStyleCallback={({ row }) => {
const rowType = String(row.rowType ?? "");
if (rowType === "DETAIL") return undefined;
if (rowType === "BIZ_SUM") return "rg-cell-rowtype-biz-sum";
return "rg-cell-rowtype-other";
}}
/>
</TabsContent>
);
})}
</Tabs> </Tabs>
</div> </div>
</div> </div>
@@ -1,10 +1,229 @@
import { useRef, useState } from "react";
import { useAlertStore } from "@/shared/lib";
import { LoadingWithAnimation, Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components";
import SearchForm from "../../module/SearchForm"; import SearchForm from "../../module/SearchForm";
import DataGrid from "@/components/module/DataGrid";
import type { ColumnInfo } from "@/components/type/DataGrid.type";
import type { SearchFormValues } from "@/components/type/SearchForm.type";
import { toGridRows } from "@/components/util/grid/gridFunction";
// [폴더 정밀 정비 완료] 프로젝트 트리 구조 5개 컬럼 스펙 패키지 호출
import { SewerageReuseTab1ColumnConfig } from "@/components/util/column/total/sewerageReuse/SewerageReuseTab1Column";
import { SewerageGrayWaterTab2ColumnConfig } from "@/components/util/column/total/sewerageReuse/SewerageGrayWaterTab2Column";
import { SewerageRainwaterTab3ColumnConfig } from "@/components/util/column/total/sewerageReuse/SewerageRainwaterTab3Column";
import { SewerageWwtRtlztnRegTab4ColumnConfig } from "@/components/util/column/total/sewerageReuse/SewerageWwtRtlztnRegTab4Column";
import { SewerageWwtRtlztnSncnTab5ColumnConfig } from "@/components/util/column/total/sewerageReuse/SewerageWwtRtlztnSncnTab5Column";
// 집계표(TOTAL) API 서비스 및 인터페이스 명세 임포트
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
import type {
WaterReuseSummaryRequest
} from "@/entities/statistics/model/statistics-total/statistics-sewerage-reuse-total-interface";
import CellColorInfo from "./CellColorInfo";
// 5개 멀티 탭 매핑을 위한 설정 취합 배열
const WaterReuseColumnListTot = [
SewerageReuseTab1ColumnConfig,
SewerageGrayWaterTab2ColumnConfig,
SewerageRainwaterTab3ColumnConfig,
SewerageWwtRtlztnRegTab4ColumnConfig,
SewerageWwtRtlztnSncnTab5ColumnConfig // 👈 5번째 탭 풀장착 완료
];
const firstTabKey = WaterReuseColumnListTot[0]?.tabKey ?? "ST00040007_1";
const WaterReuseTot = () => { const WaterReuseTot = () => {
const { setMessage: alert } = useAlertStore((state) => state);
// Map 데이터 구조를 사용하여 완벽하게 안전한 멀티 탭 데이터 상태 유지
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map());
const [isLoading, setIsLoading] = useState(false);
const [activeTab, setActiveTab] = useState(firstTabKey);
const lastSearchedValuesRef = useRef<SearchFormValues | null>(null);
const columnInfo = WaterReuseColumnListTot;
const handleReset = () => {
setRowDataMap(new Map());
setActiveTab(firstTabKey);
lastSearchedValuesRef.current = null;
};
const loadGridData = async (tabKey: string, values: SearchFormValues): Promise<boolean> => {
const param: WaterReuseSummaryRequest = {
ctpvNm: values.sido === "ALL" ? "" : values.sido,
sggNm: values.gugun === "ALL" ? "" : values.gugun,
sewerBzmnCd: values.bsnmCd,
statsYr: values.year,
rowDataYn: values.isDetail,
summaryYn: values.isSummary !== 'ALL',
summaryYearCnt: values.isSummary !== 'ALL' ? Number(values.isSummary) : undefined
};
try {
// [TAB1] 공공하수처리수 재이용 현황 조회
if (tabKey === "ST00100001") {
const response = await statisticsTotalStatusApi.getSewerageReuseTab1List(param);
if (response && response.status === "success" && response.data) {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
}
// [TAB2] 중수도 현황 조회
if (tabKey === "ST00100002") {
const response = await statisticsTotalStatusApi.getGrayWaterStatusTab2List(param);
if (response && response.status === "success" && response.data) {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
}
// [TAB3] 빗물이용시설현황 조회
if (tabKey === "ST00100003") {
const response = await statisticsTotalStatusApi.getRainwaterStatusTab3List(param);
if (response && response.status === "success" && response.data) {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
}
// [TAB4] 하·폐수처리수 재이용시설 시공업 등록현황 조회
if (tabKey === "ST00100004") {
const response = await statisticsTotalStatusApi.getWwtRtlztnRegStatusTab4List(param);
if (response && response.status === "success" && response.data) {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
}
// [TAB5] 하·폐수처리수 재이용시설 시공업 인가현황 조회
if (tabKey === "ST00100005") {
const response = await statisticsTotalStatusApi.getWwtRtlztnSncnStatusTab5List(param);
if (response && response.status === "success" && response.data) {
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
return true;
}
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
}
return false;
} catch {
alert("서버 연결 중 오류가 발생했습니다.");
return false;
}
};
const handleSearch = async (values: SearchFormValues) => {
try {
setIsLoading(true);
const ok = await loadGridData(activeTab, values);
if (ok) {
lastSearchedValuesRef.current = values;
} else {
lastSearchedValuesRef.current = null;
}
} catch {
alert("데이터 조회 중 오류가 발생했습니다.");
lastSearchedValuesRef.current = null;
} finally {
setIsLoading(false);
}
};
const handleActiveTabChange = async (tabKey: string) => {
setActiveTab(tabKey);
const values = lastSearchedValuesRef.current;
if (!values) return;
// 중복 API 통신 방지 필터 캐싱 디스패치
const existing = rowDataMap.get(tabKey);
if (existing && existing.length > 0) return;
try {
setIsLoading(true);
await loadGridData(tabKey, values);
} catch {
alert("데이터 조회 중 오류가 발생했습니다.");
} finally {
setIsLoading(false);
}
};
return ( return (
<> <div className="relative">
<SearchForm /> <SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
</>
{/* 정중앙 5rem 크기 고정 격리형 로딩 애니메이션 */}
{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>
)}
<CellColorInfo />
<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>
{columnInfo.map((info) => (
<TabsTrigger key={info.tabKey} value={info.tabKey}>
{info.tabLabel}
</TabsTrigger>
))}
</TabsList>
{columnInfo.map((info) => {
const tabKey = info.tabKey;
const rowData = rowDataMap.get(tabKey) ?? [];
const gridColumnInfo: ColumnInfo = {
columns: info.columns,
columnLayout: info.columnLayout,
};
return (
<TabsContent key={tabKey} value={tabKey}>
<DataGrid
columnInfo={gridColumnInfo}
rowStartNum={info.rowStartNum}
excelExportFileSuffix={info.tabLabel}
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;
});
}}
isExcelImport={false}
isExcelExport={true}
showHeaderCheckbox={false}
fixedColumns={info.fixedColumns}
enableSort={false}
cellStyleCallback={({ row }) => {
const rowType = String(row.rowType ?? '');
if (rowType === 'DETAIL') return undefined;
if (rowType === 'BIZ_SUM') return 'rg-cell-rowtype-biz-sum';
if (rowType === 'SUMMARY') return 'rg-cell-rowtype-summary';
return 'rg-cell-rowtype-other';
}}
/>
</TabsContent>
);
})}
</Tabs>
</div>
</div>
); );
}; };
@@ -73,7 +73,7 @@ interface VerificationFormState {
percentile: string; percentile: string;
a: string; a: string;
c: string; c: string;
verificationYear: string; statisticsYear: string;
} }
interface OutlierDialogState { interface OutlierDialogState {
@@ -118,7 +118,7 @@ export default function HbStatisticsVerification() {
percentile: "", percentile: "",
a: "", a: "",
c: "", c: "",
verificationYear: defaultYear, statisticsYear: defaultYear,
}); });
const [selectedTargets, setSelectedTargets] = useState<string[]>([]); const [selectedTargets, setSelectedTargets] = useState<string[]>([]);
const [outlierDialog, setOutlierDialog] = useState<OutlierDialogState>({ const [outlierDialog, setOutlierDialog] = useState<OutlierDialogState>({
@@ -298,8 +298,8 @@ export default function HbStatisticsVerification() {
} }
async function handleSubmit() { async function handleSubmit() {
if (!formState.verificationYear) { if (!formState.statisticsYear) {
alert("검증년도를 선택해 주세요."); alert("통계년도를 선택해 주세요.");
return; return;
} }
@@ -308,7 +308,7 @@ export default function HbStatisticsVerification() {
return; return;
} }
const yearNew = toNumber(formState.verificationYear); const yearNew = toNumber(formState.statisticsYear);
const payload: AnalysisRequestPayload = { const payload: AnalysisRequestPayload = {
dataset: dataset:
verifyType === "ALL" verifyType === "ALL"
@@ -337,7 +337,7 @@ export default function HbStatisticsVerification() {
percentile: "0", percentile: "0",
a: "0", a: "0",
c: "0", c: "0",
verificationYear: defaultYear, statisticsYear: defaultYear,
}); });
setSelectedTargets([]); setSelectedTargets([]);
} }
@@ -385,13 +385,13 @@ export default function HbStatisticsVerification() {
<div className="flex items-center gap-6"> <div className="flex items-center gap-6">
<div className="flex items-center gap-4 pl-2"> <div className="flex items-center gap-4 pl-2">
<Label className="text-[1.3rem] font-medium text-label"> <Label className="text-[1.3rem] font-medium text-label">
검증 년도 통계년도
</Label> </Label>
<Select <Select
value={formState.verificationYear} value={formState.statisticsYear}
onValueChange={(value) => onValueChange={(value) =>
handleFormChange( handleFormChange(
"verificationYear", "statisticsYear",
value, value,
) )
} }
@@ -86,10 +86,27 @@ function getImrDetailGridColumnInfo(statsCd: string): ColumnInfo {
}; };
} }
function getVerificationYearOptions(): string[] {
const currentYear = dayjs().year();
const startYear = 2017;
const endYear = currentYear - 1;
if (endYear < startYear) return [];
return Array.from({ length: endYear - startYear + 1 }, (_, index) =>
String(startYear + index),
);
}
const ImrVerificationHistory = () => { const ImrVerificationHistory = () => {
const yearOptions = useMemo(() => getVerificationYearOptions(), []);
const defaultYear: string =
yearOptions.length > 0
? (yearOptions[yearOptions.length - 1] ?? "")
: "";
// Area A Search States // Area A Search States
const [searchSido, setSearchSido] = useState<string>(""); const [searchSido, setSearchSido] = useState<string>("");
const [searchSigungu, setSearchSigungu] = useState<string>(""); const [searchSigungu, setSearchSigungu] = useState<string>("");
const [searchStatsYr, setSearchStatsYr] = useState<string>(defaultYear);
const [searchStatsCd, setSearchStatsCd] = useState<string>(""); const [searchStatsCd, setSearchStatsCd] = useState<string>("");
const [dateRange, setDateRange] = useState<DateRangeValue | undefined>({ const [dateRange, setDateRange] = useState<DateRangeValue | undefined>({
from: dayjs().subtract(1, "month").toDate(), from: dayjs().subtract(1, "month").toDate(),
@@ -101,6 +118,7 @@ const ImrVerificationHistory = () => {
size: 10, size: 10,
vrfcMthdCd: "IMR", vrfcMthdCd: "IMR",
sort: "anlsSn,desc", sort: "anlsSn,desc",
statsYr: defaultYear,
}); });
// Selected States // Selected States
@@ -226,6 +244,7 @@ const ImrVerificationHistory = () => {
if (searchSido !== "") if (searchSido !== "")
params.sewerBzmnCd = params.sewerBzmnCd =
searchSigungu !== "" ? searchSigungu : searchSido; searchSigungu !== "" ? searchSigungu : searchSido;
if (searchStatsYr) params.statsYr = searchStatsYr;
if (searchStatsCd) params.statsCd = searchStatsCd; if (searchStatsCd) params.statsCd = searchStatsCd;
if (dateRange?.from) if (dateRange?.from)
params.verifyDtStart = dayjs(dateRange.from).format("YYYY-MM-DD"); params.verifyDtStart = dayjs(dateRange.from).format("YYYY-MM-DD");
@@ -368,7 +387,7 @@ const ImrVerificationHistory = () => {
return ( return (
<div className="flex flex-col gap-4"> <div className="flex flex-col gap-4">
{/* 영역 A: 검증 이력 그리드 + 검색 필터 */} {/* 영역 A: 검증 이력 그리드 + 검색 필터 */}
<div className="card card-border bg-white p-6"> <div className="card card-border bg-white px-4">
<div className="flex flex-wrap items-end gap-6 p-2"> <div className="flex flex-wrap items-end gap-6 p-2">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<Label className="text-[1.3rem] font-medium text-label"> <Label className="text-[1.3rem] font-medium text-label">
@@ -422,6 +441,27 @@ const ImrVerificationHistory = () => {
</Select> </Select>
</div> </div>
<div className="flex items-center gap-2">
<Label className="text-[1.3rem] font-medium text-label">
통계년도
</Label>
<Select
value={searchStatsYr}
onValueChange={setSearchStatsYr}
>
<SelectTrigger className="w-[10rem] flex-1">
<SelectValue />
</SelectTrigger>
<SelectContent>
{yearOptions.map((year) => (
<SelectItem key={year} value={year}>
{year}년
</SelectItem>
))}
</SelectContent>
</Select>
</div>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<Label className="text-[1.3rem] font-medium text-label"> <Label className="text-[1.3rem] font-medium text-label">
검증일시 검증일시
@@ -131,12 +131,12 @@ const DEFAULT_FILTERS: StatisticsVerificationFilterState = {
statsYr: String(dayjs().year() - 1), statsYr: String(dayjs().year() - 1),
sewerBzmnCd: null, sewerBzmnCd: null,
statsCd: null, statsCd: null,
laeSbmsnSttsCd: "2", laeSbmsnSttsCd: "3",
}; };
const DEFAULT_SUB_FILTERS: StatisticsVerificationSubFilterState = { const DEFAULT_SUB_FILTERS: StatisticsVerificationSubFilterState = {
...DEFAULT_FILTERS, ...DEFAULT_FILTERS,
prcsYnList: "1,2,3", prcsYnList: "1,2",
pbcpAprvYn: "N", pbcpAprvYn: "N",
}; };
@@ -468,8 +468,6 @@ function StatisticsVerificationReport() {
async function handleReject() { async function handleReject() {
const commonParam = { const commonParam = {
statsYr: filters.statsYr, statsYr: filters.statsYr,
sewerBzmnCd: filters.sewerBzmnCd ?? "",
statsCd: filters.statsCd ?? "",
mdfrId: userInfo?.userUnqId ?? "", mdfrId: userInfo?.userUnqId ?? "",
}; };
@@ -496,6 +494,8 @@ function StatisticsVerificationReport() {
...commonParam, ...commonParam,
vrfcSn: Number.isNaN(vrfcSn) ? 0 : vrfcSn, vrfcSn: Number.isNaN(vrfcSn) ? 0 : vrfcSn,
rjctOpnnCn: String(row.rjctOpnnCn ?? ""), rjctOpnnCn: String(row.rjctOpnnCn ?? ""),
sewerBzmnCd: String(row.sewerBzmnCd ?? ""),
statsCd: String(row.statsCd ?? ""),
}; };
}); });
@@ -147,7 +147,7 @@ const HbVerificationDetail: React.FC<HbVerificationDetailProps> = ({
<h3 className="p-4 pb-0 text-[1.8rem] font-bold text-title"> <h3 className="p-4 pb-0 text-[1.8rem] font-bold text-title">
검증 결과 상세 검증 결과 상세
</h3> </h3>
<div className="flex"> <div className="grid grid-cols-1 lg:grid-cols-2">
<div className="flex-1 p-4"> <div className="flex-1 p-4">
<RegionalGrid <RegionalGrid
anlsSn={anlsSn} anlsSn={anlsSn}
@@ -104,12 +104,10 @@ const ScatterChart: React.FC<ScatterChartProps> = ({
anlsSn, anlsSn,
vrfcTrgtSn, vrfcTrgtSn,
); );
console.log("resultData: ", resultData);
const { data: chartData, isLoading: isLoadingChart } = useStAnlsChartData( const { data: chartData, isLoading: isLoadingChart } = useStAnlsChartData(
anlsSn, anlsSn,
vrfcTrgtSn, vrfcTrgtSn,
); );
console.log("chartData: ", chartData);
const isLoading = isLoadingGrid || isLoadingChart; const isLoading = isLoadingGrid || isLoadingChart;
@@ -303,7 +301,7 @@ const ScatterChart: React.FC<ScatterChartProps> = ({
</div> </div>
</div> </div>
) : chartConfig ? ( ) : chartConfig ? (
<div className="size-[52rem]"> <div className="size-[40rem]">
<Scatter <Scatter
data={chartConfig.data} data={chartConfig.data}
options={chartConfig.options} options={chartConfig.options}
@@ -86,7 +86,7 @@ const VerificationList: React.FC<VerificationListProps> = ({
variant="secondary" variant="secondary"
onRowClick={handleRowClick} onRowClick={handleRowClick}
viewPagination={false} viewPagination={false}
className="whitespace-nowrap text-[1.2rem] [&_td]:!px-2 [&_th]:!px-2" className="text-[1.2rem] [&_td]:!px-2 [&_th]:!px-2"
/> />
)} )}
</div> </div>
+7 -1
View File
@@ -1,6 +1,6 @@
import React from "react"; import React from "react";
import { ValueType } from "realgrid"; import { GridFitStyle, ValueType } from "realgrid";
import type { RealGridReact } from "realgrid-react"; import type { RealGridReact } from "realgrid-react";
// RealGrid 타입 정의 // RealGrid 타입 정의
@@ -162,6 +162,8 @@ export type ColumnConfig = {
editable?: boolean; // 셀 편집 가능 여부 editable?: boolean; // 셀 편집 가능 여부
/** 그리드에서 컬럼 숨김 (수식용 필드 등) */ /** 그리드에서 컬럼 숨김 (수식용 필드 등) */
visible?: boolean; visible?: boolean;
/** true이면 엑셀보내기에서 제외 (화면에는 표시 가능) */
excludeFromExcelExport?: boolean;
/** 컬럼 너비 (px). 지정 시 ... 생략 없이 텍스트 표시에 유리 */ /** 컬럼 너비 (px). 지정 시 ... 생략 없이 텍스트 표시에 유리 */
width?: number; width?: number;
/** 셀에 적용할 CSS 클래스명 (예: 'rg-cell-readonly', 'rg-cell-total') */ /** 셀에 적용할 CSS 클래스명 (예: 'rg-cell-readonly', 'rg-cell-total') */
@@ -335,6 +337,10 @@ export type DataGridProps = {
/** CompactDataGrid 전용: 그리드 영역 높이 Tailwind 클래스 */ /** CompactDataGrid 전용: 그리드 영역 높이 Tailwind 클래스 */
compactGridHeightClass?: string; compactGridHeightClass?: string;
gridHeight?: number; gridHeight?: number;
/** RealGrid `gridView.header.height` (기본 60, columnLayout 2단 헤더 등에서 조절) */
headerHeight?: number;
/** RealGrid `displayOptions.fitStyle` (기본 EVEN). 컬럼별 width 유지 시 NONE */
fitStyle?: GridFitStyle;
}; };
export type TabDataGridProps = { export type TabDataGridProps = {
@@ -15,7 +15,7 @@ export const PublicSewageFactColumn = {
{ name: 'swtrmtFcltNm', fieldName: 'swtrmtFcltNm', header: { text: '시설명(500m³/일 이상/미만)' }, editable: false, styleName: 'rg-cell-readonly' }, { name: 'swtrmtFcltNm', fieldName: 'swtrmtFcltNm', header: { text: '시설명(500m³/일 이상/미만)' }, editable: false, styleName: 'rg-cell-readonly' },
// 소재지 // 소재지
{ name: 'impdFcltPstnCn', fieldName: 'impdFcltPstnCn', header: { text: '소재지' }, editable: false, styleName: 'rg-cell-readonly' }, { 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' },
@@ -126,7 +126,7 @@ export const PublicSewageFactColumn = {
items: ['ctpvNm', 'sggNm'], items: ['ctpvNm', 'sggNm'],
}, },
'swtrmtFcltNm', 'swtrmtFcltNm',
'impdFcltPstnCn', 'fcltPstnCn',
'prcsFcltCpct', 'prcsFcltCpct',
{ {
name: 'facilityCapacityDetail', name: 'facilityCapacityDetail',
@@ -4,7 +4,7 @@ import { ValueType } from "realgrid";
// 하수도 통계 관리 > 02.하수관로 > tab 5. 맨홀 현황 // 하수도 통계 관리 > 02.하수관로 > tab 5. 맨홀 현황
// SeweragePipeInputManholeStatusItem + commonInfo.ctpvNm (그리드 행에 병합) // SeweragePipeInputManholeStatusItem + commonInfo.ctpvNm (그리드 행에 병합)
// API: yy14=2014년 … yy{(현재연도-1)%100} (필드 접두 yy + 연도 끝자리) // API: yy14=2015년 이전(2014년 데이터) … yy{(현재연도-1)%100} (필드 접두 yy + 연도 끝자리)
const MANHOLE_START_YEAR = 2014; const MANHOLE_START_YEAR = 2014;
const MANHOLE_LAST_DATA_YEAR = Math.max(MANHOLE_START_YEAR, new Date().getFullYear() - 1); const MANHOLE_LAST_DATA_YEAR = Math.max(MANHOLE_START_YEAR, new Date().getFullYear() - 1);
@@ -12,6 +12,12 @@ const MANHOLE_YY_MIN = MANHOLE_START_YEAR % 100;
const MANHOLE_YY_MAX = MANHOLE_LAST_DATA_YEAR % 100; const MANHOLE_YY_MAX = MANHOLE_LAST_DATA_YEAR % 100;
const calendarYearFromYy = (yy: number) => 2000 + yy; const calendarYearFromYy = (yy: number) => 2000 + yy;
/** yy14(2014) 구간은 헤더에 「2015년 이전」 표기 (합계·검토 컬럼과 동일) */
const manholeYearHeaderText = (yy: number): string => {
const y = calendarYearFromYy(yy);
return y === MANHOLE_START_YEAR ? "2015년 이전" : `${y}년`;
};
const intCol = (name: string, headerText: string): ColumnConfig => ({ const intCol = (name: string, headerText: string): ColumnConfig => ({
name, name,
fieldName: name, fieldName: name,
@@ -98,7 +104,7 @@ function yyYearLayout(yy: number): ColumnLayoutItem {
return { return {
name: `year${y}`, name: `year${y}`,
hideChildHeaders: false, hideChildHeaders: false,
header: { text: `${y}년` }, header: { text: manholeYearHeaderText(yy) },
items: [ items: [
{ {
name: `year${y}Material`, name: `year${y}Material`,
@@ -211,8 +211,9 @@ export const PipeTypeStatusInpColumn = {
], ],
}, },
...yearLayoutItems, ...yearLayoutItems,
"rmrk", 'rmrk',
'admdstCd', 'admdstCd',
'pipeSeCd'
] as ColumnLayoutItem[], ] as ColumnLayoutItem[],
rowStartNum: 2, rowStartNum: 2,
fixedColumns: 2, fixedColumns: 2,
@@ -49,7 +49,7 @@ export const rawPublicSewageFacilityInfoList = {
], ],
}, },
{ name: 'swtrmtFcltNm', fieldName: 'swtrmtFcltNm', header: { text: '시설명(500m³/일 이상/미만)' } }, { name: 'swtrmtFcltNm', fieldName: 'swtrmtFcltNm', header: { text: '시설명(500m³/일 이상/미만)' } },
{ name: 'impdFcltPstnCn', fieldName: 'impdFcltPstnCn', header: { text: '소재지' } }, { name: 'fcltPstnCn', fieldName: 'fcltPstnCn', header: { text: '소재지' } },
/* 2. 시설용량 (㎥/일) */ /* 2. 시설용량 (㎥/일) */
{ name: 'prcsFcltCpct', fieldName: 'prcsFcltCpct', header: { text: '시설용량(500m³/일 이상/미만)' }, footer: footerDecimal1ArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' }, { name: 'prcsFcltCpct', fieldName: 'prcsFcltCpct', header: { text: '시설용량(500m³/일 이상/미만)' }, footer: footerDecimal1ArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
@@ -132,7 +132,7 @@ export const rawPublicSewageFacilityInfoList = {
header: { text: '행정구역' }, header: { text: '행정구역' },
items: [{ column: 'ctpvNm', footerUserSpans: [{ colspan: 3 }, { colspan: 3 }] }, 'sggNm'], items: [{ column: 'ctpvNm', footerUserSpans: [{ colspan: 3 }, { colspan: 3 }] }, 'sggNm'],
}, },
'displayYear', 'swtrmtFcltNm', 'impdFcltPstnCn', 'prcsFcltCpct', 'displayYear', 'swtrmtFcltNm', 'fcltPstnCn', 'prcsFcltCpct',
{ {
name: 'groupB', name: 'groupB',
header: { text: '시설용량(㎥/일)' }, header: { text: '시설용량(㎥/일)' },
@@ -944,9 +944,19 @@ export const getST00020003Config = (statsYr: string | number) => {
{ name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false }, { name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false },
{ name: "admdstNm", fieldName: "admdstNm", header: { text: "행정구역명" }, editable: false }, { name: "admdstNm", fieldName: "admdstNm", header: { text: "행정구역명" }, editable: false },
{ name: "swrgPipeNm", fieldName: "swrgPipeNm", header: { text: "관종" }, editable: false }, { name: "swrgPipeNm", fieldName: "swrgPipeNm", header: { text: "관종" }, editable: false },
{ name: "pipeByPrstWholSum", fieldName: "pipeByPrstWhol", header: { text: "계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }, { name: "pipeByPrstWholSum", fieldName: "pipeByPrstWhol", header: { text: "계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "lyngPrlgSum", fieldName: "lyngPrlg", header: { text: "매설연장(m)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }, { name: "lyngPrlgSum", fieldName: "lyngPrlg", header: { text: "매설연장(m)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "dmltnPrlgSum", fieldName: "dmltnPrlg", header: { text: "철거연장(m)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }, { name: "dmltnPrlgSum", fieldName: "dmltnPrlg", header: { text: "철거연장(m)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{
name: "oldPipeRt",
fieldName: "oldPipeRt",
header: { text: "노후하수관로율(%)" },
valueType: ValueType.NUMBER,
dataFormat: "#,##0.0",
editable: false,
excludeFromExcelExport: true,
},
...(() => { ...(() => {
const yearColumns = []; const yearColumns = [];
for (let yr = startYear; yr <= endYear; yr++) { for (let yr = startYear; yr <= endYear; yr++) {
@@ -961,7 +971,7 @@ export const getST00020003Config = (statsYr: string | number) => {
], ],
columnLayout: [ columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] }, { name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"swrgPipeNm", "swrgPipeNm","oldPipeRt",
{ name: "summaryGroup", header: { text: "총계" }, items: ["pipeByPrstWholSum", "lyngPrlgSum", "dmltnPrlgSum"] }, { name: "summaryGroup", header: { text: "총계" }, items: ["pipeByPrstWholSum", "lyngPrlgSum", "dmltnPrlgSum"] },
...(() => { ...(() => {
const layouts = []; const layouts = [];
@@ -0,0 +1,63 @@
import { ValueType } from "realgrid";
export const ExcretaTreatmentStatusColumnConfig = {
tabKey: "ST00070001",
tabLabel: "분뇨처리시설",
rowStartNum: 2,
fixedColumns: 2,
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: "fcltNm", fieldName: "fcltNm", header: { text: "시설명" }, editable: false },
{ name: "fcltPstnCn", fieldName: "fcltPstnCn", header: { text: "소재지" }, editable: false },
{ name: "telNo", fieldName: "telNo", header: { text: "전화번호" }, editable: false },
{ name: "cmptnStrtYmd", fieldName: "cmptnStrtYmd", header: { text: "준공일" }, editable: false },
{ name: "oprtngStrtYmd", fieldName: "oprtngStrtYmd", header: { text: "가동개시일" }, editable: false },
{ name: "wholPjtcoAmt", fieldName: "wholPjtcoAmt", header: { text: "사업비\n(백만원)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "prcsFcltCpct", fieldName: "prcsFcltCpct", header: { text: "시설용량\n(㎥/일)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "cpct", fieldName: "cpct", header: { text: "처리량\n(㎥/일)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "oprtngDayCnt", fieldName: "oprtngDayCnt", header: { text: "가동일수\n(일/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "prcsMthdExpln", fieldName: "prcsMthdExpln", header: { text: "처리공법" }, editable: false },
{ name: "linkTmplntCn", fieldName: "linkTmplntCn", header: { text: "연계처리장명" }, editable: false },
{ name: "linkPrcsQnt", fieldName: "linkPrcsQnt", header: { text: "연계처리량\n(㎥/일)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 유입수질(mg/L, 개/mL) 그룹 소속
{ name: "inflwBodWqVl", fieldName: "inflwBodWqVl", header: { text: "BOD" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.00", editable: false },
{ name: "inflwTocWqVl", fieldName: "inflwTocWqVl", header: { text: "TOC" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.00", editable: false },
{ name: "inflwSsWqVl", fieldName: "inflwSsWqVl", header: { text: "SS" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.00", editable: false },
{ name: "inflwTnWqVl", fieldName: "inflwTnWqVl", header: { text: "T-N" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.00", editable: false },
{ name: "inflwTpWqVl", fieldName: "inflwTpWqVl", header: { text: "T-P" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.000", editable: false },
{ name: "inflwClfgCnt", fieldName: "inflwClfgCnt", header: { text: "대장균\n군수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 방류수질(mg/L, 개/mL) 그룹 소속
{ name: "dschgBodWqVl", fieldName: "dschgBodWqVl", header: { text: "BOD" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.00", editable: false },
{ name: "dschgTocWqVl", fieldName: "dschgTocWqVl", header: { text: "TOC" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.00", editable: false },
{ name: "dschgSsWqVl", fieldName: "dschgSsWqVl", header: { text: "SS" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.00", editable: false },
{ name: "dschgTnWqVl", fieldName: "dschgTnWqVl", header: { text: "T-N" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.00", editable: false },
{ name: "dschgTpWqVl", fieldName: "dschgTpWqVl", header: { text: "T-P" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.000", editable: false },
{ name: "dschgClfgCnt", fieldName: "dschgClfgCnt", header: { text: "대장균\n군수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 방류수역 그룹 소속
{ name: "wtsysNm", fieldName: "wtsysNm", header: { text: "수계" }, editable: false },
{ name: "trbtrNm", fieldName: "trbtrNm", header: { text: "지류" }, editable: false },
{ name: "msirbCn", fieldName: "msirbCn", header: { text: "중권역" }, editable: false },
{ name: "ssirbCn", fieldName: "ssirbCn", header: { text: "소권역" }, editable: false },
// 단일 미그룹 성격 컬럼들
{ name: "operMthdCdCn", fieldName: "operMthdCdCn", header: { text: "운영주체\n(자체/공기업/\n민간위탁)" }, editable: false },
{ name: "wholNope", fieldName: "wholNope", header: { text: "직원총수\n(명)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "sftyAcdntEvntcsCnt", fieldName: "sftyAcdntEvntcsCnt", header: { text: "안전사고\n건수\n(건/인/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.00", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"fcltNm", "fcltPstnCn", "telNo", "cmptnStrtYmd", "oprtngStrtYmd", "wholPjtcoAmt", "prcsFcltCpct", "cpct", "oprtngDayCnt", "prcsMthdExpln", "linkTmplntCn", "linkPrcsQnt",
{ name: "inflwWqGroup", header: { text: "유입수질(mg/L, 개/mL)" }, items: ["inflwBodWqVl", "inflwTocWqVl", "inflwSsWqVl", "inflwTnWqVl", "inflwTpWqVl", "inflwClfgCnt"] },
{ name: "dschgWqGroup", header: { text: "방류수질(mg/L, 개/mL)" }, items: ["dschgBodWqVl", "dschgTocWqVl", "dschgSsWqVl", "dschgTnWqVl", "dschgTpWqVl", "dschgClfgCnt"] },
{ name: "wtrAreaGroup", header: { text: "방류수역" }, items: ["wtsysNm", "trbtrNm", "msirbCn", "ssirbCn"] },
"operMthdCdCn", "wholNope", "sftyAcdntEvntcsCnt"
]
};
@@ -0,0 +1,103 @@
import { ValueType } from "realgrid";
export const MediationPumpStatusColumnConfig = {
tabKey: "ST00050001",
tabLabel: "중계펌프장",
rowStartNum: 2,
fixedColumns: 3,
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: "fcltNm", fieldName: "fcltNm", header: { text: "펌프장명" }, editable: false },
{ name: "pumpSeNm", fieldName: "pumpSeNm", header: { text: "구분\n(합류식,\n분류식)" }, editable: false },
{ name: "swtrmtFcltNm", fieldName: "swtrmtFcltNm", header: { text: "처리장명" }, editable: false },
{ name: "fcltPstnCn", fieldName: "fcltPstnCn", header: { text: "위치" }, editable: false },
{ name: "oprtngStrtYmd", fieldName: "oprtngStrtYmd", header: { text: "가동개시\n년월일\nyyyy-mm-dd" }, editable: false },
{ name: "planMltvArea", fieldName: "planMltvArea", header: { text: "계획배수면적(㏊)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 계획시간대최대배수량(㎥/일) 그룹 소속
{ name: "sndyArea", fieldName: "sndyArea", header: { text: "청천시" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "rainArea", fieldName: "rainArea", header: { text: "우천시" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "exlnQnt", fieldName: "exlnQnt", header: { text: "우수량" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 오수펌프 그룹 내부 소속
{ name: "drtwPumpGrssPpqty", fieldName: "drtwPumpGrssPpqty", header: { text: "총양수량\n(㎥/min)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 오수펌프 > 오수펌프1 그룹 소속
{ name: "drtwPumpN1DmtrArea", fieldName: "drtwPumpN1DmtrArea", header: { text: "구경(mm)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "drtwPumpN1Ppqty", fieldName: "drtwPumpN1Ppqty", header: { text: "양수량\n(㎥/min)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "drtwPumpN1Cnt", fieldName: "drtwPumpN1Cnt", header: { text: "펌프대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "drtwPumpN1RsrvCnt", fieldName: "drtwPumpN1RsrvCnt", header: { text: "예비대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 오수펌프 > 오수펌프2 그룹 소속
{ name: "drtwPumpN2DmtrArea", fieldName: "drtwPumpN2DmtrArea", header: { text: "구경(mm)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "drtwPumpN2Ppqty", fieldName: "drtwPumpN2Ppqty", header: { text: "양수량\n(㎥/min)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "drtwPumpN2Cnt", fieldName: "drtwPumpN2Cnt", header: { text: "펌프대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "drtwPumpN2RsrvCnt", fieldName: "drtwPumpN2RsrvCnt", header: { text: "예비대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 오수펌프 > 오수펌프3 그룹 소속
{ name: "drtwPumpN3DmtrArea", fieldName: "drtwPumpN3DmtrArea", header: { text: "구경(mm)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "drtwPumpN3Ppqty", fieldName: "drtwPumpN3Ppqty", header: { text: "양수량\n(㎥/min)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "drtwPumpN3Cnt", fieldName: "drtwPumpN3Cnt", header: { text: "펌프대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "drtwPumpN3RsrvCnt", fieldName: "drtwPumpN3RsrvCnt", header: { text: "예비대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 우수펌프 그룹 내부 소속
{ name: "exlnPumpGrssPpqty", fieldName: "exlnPumpGrssPpqty", header: { text: "총양수량\n(㎥/min)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 우수펌프 > 우수펌프1 그룹 소속
{ name: "exlnPumpN1DmtrArea", fieldName: "exlnPumpN1DmtrArea", header: { text: "구경(mm)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "exlnPumpN1Ppqty", fieldName: "exlnPumpN1Ppqty", header: { text: "양수량\n(㎥/min)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "exlnPumpN1Cnt", fieldName: "exlnPumpN1Cnt", header: { text: "펌프대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "exlnPumpN1RsrvCnt", fieldName: "exlnPumpN1RsrvCnt", header: { text: "예비대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 우수펌프 > 우수펌프2 그룹 소속
{ name: "exlnPumpN2DmtrArea", fieldName: "exlnPumpN2DmtrArea", header: { text: "구경(mm)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "exlnPumpN2Ppqty", fieldName: "exlnPumpN2Ppqty", header: { text: "양수량\n(㎥/min)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "exlnPumpN2Cnt", fieldName: "exlnPumpN2Cnt", header: { text: "펌프대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "exlnPumpN2RsrvCnt", fieldName: "exlnPumpN2RsrvCnt", header: { text: "예비대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 우수펌프 > 우수펌프3 그룹 소속
{ name: "exlnPumpN3DmtrArea", fieldName: "exlnPumpN3DmtrArea", header: { text: "구경(mm)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "exlnPumpN3Ppqty", fieldName: "exlnPumpN3Ppqty", header: { text: "양수량\n(㎥/min)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "exlnPumpN3Cnt", fieldName: "exlnPumpN3Cnt", header: { text: "펌프대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "exlnPumpN3RsrvCnt", fieldName: "exlnPumpN3RsrvCnt", header: { text: "예비대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 단일 컬럼
{ name: "anlElpwrUseQnt", fieldName: "anlElpwrUseQnt", header: { text: "연간전력\n사용량\n(㎾h/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"swtrmtFcltNm",
"fcltNm",
"pumpSeNm",
"fcltPstnCn",
"oprtngStrtYmd",
"planMltvArea",
{ name: "planDrainGroup", header: { text: "계획시간대최대배수량(㎥/일)" }, items: ["sndyArea", "rainArea", "exlnQnt"] },
{
name: "drtwPumpGroup",
header: { text: "오수펌프" },
items: [
"drtwPumpGrssPpqty",
{ name: "drtwPumpN1Group", header: { text: "오수펌프(1)" }, items: ["drtwPumpN1DmtrArea", "drtwPumpN1Ppqty", "drtwPumpN1Cnt", "drtwPumpN1RsrvCnt"] },
{ name: "drtwPumpN2Group", header: { text: "오수펌프(2)" }, items: ["drtwPumpN2DmtrArea", "drtwPumpN2Ppqty", "drtwPumpN2Cnt", "drtwPumpN2RsrvCnt"] },
{ name: "drtwPumpN3Group", header: { text: "오수펌프(3)" }, items: ["drtwPumpN3DmtrArea", "drtwPumpN3Ppqty", "drtwPumpN3Cnt", "drtwPumpN3RsrvCnt"] }
]
},
{
name: "exlnPumpGroup",
header: { text: "우수펌프" },
items: [
"exlnPumpGrssPpqty",
{ name: "exlnPumpN1Group", header: { text: "우수펌프(1)" }, items: ["exlnPumpN1DmtrArea", "exlnPumpN1Ppqty", "exlnPumpN1Cnt", "exlnPumpN1RsrvCnt"] },
{ name: "exlnPumpN2Group", header: { text: "우수펌프(2)" }, items: ["exlnPumpN2DmtrArea", "exlnPumpN2Ppqty", "exlnPumpN2Cnt", "exlnPumpN2RsrvCnt"] },
{ name: "exlnPumpN3Group", header: { text: "우수펌프(3)" }, items: ["exlnPumpN3DmtrArea", "exlnPumpN3Ppqty", "exlnPumpN3Cnt", "exlnPumpN3RsrvCnt"] }
]
},
"anlElpwrUseQnt"
]
};
@@ -127,6 +127,15 @@ export const SeweragePentrationRateTotColumn = {
valueType: ValueType.NUMBER, valueType: ValueType.NUMBER,
dataFormat: '#,##0.0', dataFormat: '#,##0.0',
}, },
{
name: 'rurPsplyRt',
fieldName: 'rurPsplyRt',
header: { text: '농어촌하수도보급률(%)' },
editable: false,
valueType: ValueType.NUMBER,
dataFormat: '#,##0.0',
excludeFromExcelExport: true,
},
// 비고 // 비고
{ name: 'rmrk', fieldName: 'rmrk', header: { text: '비고' } }, { name: 'rmrk', fieldName: 'rmrk', header: { text: '비고' } },
@@ -194,6 +203,7 @@ export const SeweragePentrationRateTotColumn = {
'staaPsplyRt', 'staaPsplyRt',
'altdPrcsPsplyRt', 'altdPrcsPsplyRt',
'sewerInstlRt', 'sewerInstlRt',
'rurPsplyRt',
'rmrk', 'rmrk',
'swagePplPsplyRt', 'swagePplPsplyRt',
'admdstCd', 'admdstCd',
@@ -0,0 +1,31 @@
import { ValueType } from "realgrid";
export const HumanWasteCollectionTab3ColumnConfig = {
tabKey: "ST00120003",
tabLabel: "분뇨수집·운반업",
rowStartNum: 3,
fixedColumns: 3,
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: "bzentyCnt", fieldName: "bzentyCnt", header: { text: "업체수(개소)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "empNope", fieldName: "empNope", header: { text: "종사인원(명)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "fcltSecrPrstCnt", fieldName: "fcltSecrPrstCnt", header: { text: "계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "n3TonUdrCnt", fieldName: "n3TonUdrCnt", header: { text: "3톤이하" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "n4TonUdrCnt", fieldName: "n4TonUdrCnt", header: { text: "4.5톤이하" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "n8TonUdrCnt", fieldName: "n8TonUdrCnt", header: { text: "8톤이하" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "etcCnt", fieldName: "etcCnt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "clctCnvncPrfmncQnt", fieldName: "clctCnvncPrfmncQnt", header: { text: "수집·운반실적(m³/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"bzentyCnt", "empNope",
{
name: "fcltGroup",
header: { text: "시설(차량) 확보현황(대수)" },
items: ["fcltSecrPrstCnt", "n3TonUdrCnt", "n4TonUdrCnt", "n8TonUdrCnt", "etcCnt"]
},
"clctCnvncPrfmncQnt"
]
};
@@ -0,0 +1,25 @@
import { ValueType } from "realgrid";
export const IndividualSewageTab4ColumnConfig = {
tabKey: "ST00120004",
tabLabel: "개인하수처리관련업",
rowStartNum: 3,
fixedColumns: 1,
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: "designMdsrCnt", fieldName: "designMdsrCnt", header: { text: "업소수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "designMdsrNope", fieldName: "designMdsrNope", header: { text: "종사인원(명)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "mfbizCnt", fieldName: "mfbizCnt", header: { text: "업소수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "mfbizMdsrNope", fieldName: "mfbizMdsrNope", header: { text: "종사인원(명)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "mngCnt", fieldName: "mngCnt", header: { text: "업소수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "mngMdsrNope", fieldName: "mngMdsrNope", header: { text: "종사인원(명)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
{ name: "designGroup", header: { text: "개인하수처리시설 설계·시공업" }, items: ["designMdsrCnt", "designMdsrNope"] },
{ name: "mfbizGroup", header: { text: "개인하수처리시설 제조업" }, items: ["mfbizCnt", "mfbizMdsrNope"] },
{ name: "mngGroup", header: { text: "개인하수처리시설 관리업" }, items: ["mngCnt", "mngMdsrNope"] }
]
};
@@ -0,0 +1,36 @@
import { ValueType } from "realgrid";
export const PublicHumanWasteStaffTab2ColumnConfig = {
tabKey: "ST00120002",
tabLabel: "공공기관 분뇨분야",
rowStartNum: 3,
fixedColumns: 2,
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: "ognzNm", fieldName: "ognzNm", header: { text: "직제" }, editable: false },
{ name: "empGrssCnt", fieldName: "empGrssCnt", header: { text: "직원총수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "pbadmsNope", fieldName: "pbadmsNope", header: { text: "행정직" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "techWholNope", fieldName: "techWholNope", header: { text: "계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "engrkCnt", fieldName: "engrkCnt", header: { text: "토목" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "mchnCnt", fieldName: "mchnCnt", header: { text: "기계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "prvtmCnt", fieldName: "prvtmCnt", header: { text: "전기" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "chmengCnt", fieldName: "chmengCnt", header: { text: "화공" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "envCnt", fieldName: "envCnt", header: { text: "환경" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "enjbEtcCnt", fieldName: "enjbEtcCnt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "etcCnt", fieldName: "etcCnt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"ognzNm",
"empGrssCnt",
"pbadmsNope",
{
name: "techGroup",
header: { text: "기술직" },
items: ["techWholNope", "engrkCnt", "mchnCnt", "prvtmCnt", "chmengCnt", "envCnt", "enjbEtcCnt"]
},
"etcCnt"
]
};
@@ -0,0 +1,35 @@
import { ValueType } from "realgrid";
export const PublicSewageStaffTab1ColumnConfig = {
tabKey: "ST00120001",
tabLabel: "공공기관 하수분야",
rowStartNum: 3,
fixedColumns: 2,
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: "ognzNm", fieldName: "ognzNm", header: { text: "직제" }, editable: false },
{ name: "empGrssCnt", fieldName: "empGrssCnt", header: { text: "직원총수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "pbadmsNope", fieldName: "pbadmsNope", header: { text: "행정직" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 기술직
{ name: "techWholNope", fieldName: "techWholNope", header: { text: "계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "engrkCnt", fieldName: "engrkCnt", header: { text: "토목" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "mchnCnt", fieldName: "mchnCnt", header: { text: "기계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "prvtmCnt", fieldName: "prvtmCnt", header: { text: "전기" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "chmengCnt", fieldName: "chmengCnt", header: { text: "화공" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "envCnt", fieldName: "envCnt", header: { text: "환경" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "enjbEtcCnt", fieldName: "enjbEtcCnt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "etcCnt", fieldName: "etcCnt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"ognzNm", "empGrssCnt", "pbadmsNope",
{
name: "techGroup",
header: { text: "기술직" },
items: ["techWholNope", "engrkCnt", "mchnCnt", "prvtmCnt", "chmengCnt", "envCnt", "enjbEtcCnt"]
},
"etcCnt"
]
};
@@ -0,0 +1,46 @@
import { ValueType } from "realgrid";
export const PrivateSewageTab1ColumnConfig = {
tabKey: "ST00080001",
tabLabel: "처리용량별 오수처리시설",
rowStartNum: 3,
fixedColumns: 3,
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: "wholDrtwPrcsFcltCnt", fieldName: "wholDrtwPrcsFcltCnt", header: { text: "총계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 하수처리구역 내
{ name: "wholStaaCnt", fieldName: "wholStaaCnt", header: { text: "계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step1StaaPrcsQnt", fieldName: "step1StaaPrcsQnt", header: { text: "2이하" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step2StaaPrcsQnt", fieldName: "step2StaaPrcsQnt", header: { text: "3~10" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step3StaaPrcsQnt", fieldName: "step3StaaPrcsQnt", header: { text: "11~20" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step4StaaPrcsQnt", fieldName: "step4StaaPrcsQnt", header: { text: "21~50" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step5StaaPrcsQnt", fieldName: "step5StaaPrcsQnt", header: { text: "51~100" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step6StaaPrcsQnt", fieldName: "step6StaaPrcsQnt", header: { text: "101~500" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step7StaaPrcsQnt", fieldName: "step7StaaPrcsQnt", header: { text: "501이상" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 하수처리구역 외
{ name: "staaExcpWhol", fieldName: "staaExcpWhol", header: { text: "계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step1StaaExcpPrcsQnt", fieldName: "step1StaaExcpPrcsQnt", header: { text: "2이하" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step2StaaExcpPrcsQnt", fieldName: "step2StaaExcpPrcsQnt", header: { text: "3~10" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step3StaaExcpPrcsQnt", fieldName: "step3StaaExcpPrcsQnt", header: { text: "11~20" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step4StaaExcpPrcsQnt", fieldName: "step4StaaExcpPrcsQnt", header: { text: "21~50" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step5StaaExcpPrcsQnt", fieldName: "step5StaaExcpPrcsQnt", header: { text: "51~100" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step6StaaExcpPrcsQnt", fieldName: "step6StaaExcpPrcsQnt", header: { text: "101~500" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step7StaaExcpPrcsQnt", fieldName: "step7StaaExcpPrcsQnt", header: { text: "501이상" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"wholDrtwPrcsFcltCnt",
{
name: "privateSewageFacilityGroup",
header: { text: "오수처리시설" },
items: [
{ name: "insideGroup", header: { text: "하수처리구역 내(㎥/일)" }, items: ["wholStaaCnt", "step1StaaPrcsQnt", "step2StaaPrcsQnt", "step3StaaPrcsQnt", "step4StaaPrcsQnt", "step5StaaPrcsQnt", "step6StaaPrcsQnt", "step7StaaPrcsQnt"] },
{ name: "outsideGroup", header: { text: "하수처리구역 외(㎥/일)" }, items: ["staaExcpWhol", "step1StaaExcpPrcsQnt", "step2StaaExcpPrcsQnt", "step3StaaExcpPrcsQnt", "step4StaaExcpPrcsQnt", "step5StaaExcpPrcsQnt", "step6StaaExcpPrcsQnt", "step7StaaExcpPrcsQnt"] }
]
}
]
};
@@ -0,0 +1,72 @@
import { ValueType } from "realgrid";
export const PrivateSewageTab2ColumnConfig = {
tabKey: "ST00080002",
tabLabel: "정화조현황",
rowStartNum: 4,
fixedColumns: 3,
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: "grssFcltCnt", fieldName: "grssFcltCnt", header: { text: "총 시설 수\n(A+D)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 하수처리구역 내 소속 항목들
{ name: "staaInsdWhol", fieldName: "staaInsdWhol", header: { text: "총계\nA=(B+C)/2" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "staaInsdPrcsCpctByWhol", fieldName: "staaInsdPrcsCpctByWhol", header: { text: "계(C)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "staaInsdSttkNprsflCnt", fieldName: "staaInsdSttkNprsflCnt", header: { text: "자연유하" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step1StaaInsdSttkFrcCnt", fieldName: "step1StaaInsdSttkFrcCnt", header: { text: "강제펌핑식" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "staaInsdSprktpFltrtbCnt", fieldName: "staaInsdSprktpFltrtbCnt", header: { text: "살수여상" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "staaInsdAertMthdCnt", fieldName: "staaInsdAertMthdCnt", header: { text: "폭기방법" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "staaInsdCntcAertCnt", fieldName: "staaInsdCntcAertCnt", header: { text: "접촉폭기" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "staaInsdEtcCnt", fieldName: "staaInsdEtcCnt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step1StaaInsdNope", fieldName: "step1StaaInsdNope", header: { text: "10인조\n이하" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step2StaaInsdNope", fieldName: "step2StaaInsdNope", header: { text: "11~20" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step3StaaInsdNope", fieldName: "step3StaaInsdNope", header: { text: "21~30" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step4StaaInsdNope", fieldName: "step4StaaInsdNope", header: { text: "31~50" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step5StaaInsdNope", fieldName: "step5StaaInsdNope", header: { text: "51~199" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step6StaaInsdNope", fieldName: "step6StaaInsdNope", header: { text: "200~499" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step7StaaInsdNope", fieldName: "step7StaaInsdNope", header: { text: "500~999" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step8StaaInsdNope", fieldName: "step8StaaInsdNope", header: { text: "1,000이상" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 하수처리구역 외 소속 항목들
{ name: "staaExcpWhol", fieldName: "staaExcpWhol", header: { text: "총계\nD=(E+F)/2" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "staaExcpPrcsCpctByWhol", fieldName: "staaExcpPrcsCpctByWhol", header: { text: "계(F)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "staaExcpSttkNprsflCnt", fieldName: "staaExcpSttkNprsflCnt", header: { text: "자연유하" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step1StaaExcpSttkFrcCnt", fieldName: "step1StaaExcpSttkFrcCnt", header: { text: "강제펌핑식" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "staaExcpSprktpFltrtbCnt", fieldName: "staaExcpSprktpFltrtbCnt", header: { text: "살수여상" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "staaExcpAertMthdCnt", fieldName: "staaExcpAertMthdCnt", header: { text: "폭기방법" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "staaExcpCntcAertCnt", fieldName: "staaExcpCntcAertCnt", header: { text: "접촉폭기" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "staaExcpEtcCnt", fieldName: "staaExcpEtcCnt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step1StaaExcpNope", fieldName: "step1StaaExcpNope", header: { text: "10인조\n이하" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step2StaaExcpNope", fieldName: "step2StaaExcpNope", header: { text: "11~20" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step3StaaExcpNope", fieldName: "step3StaaExcpNope", header: { text: "21~30" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step4StaaExcpNope", fieldName: "step4StaaExcpNope", header: { text: "31~50" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step5StaaExcpNope", fieldName: "step5StaaExcpNope", header: { text: "51~199" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step6StaaExcpNope", fieldName: "step6StaaExcpNope", header: { text: "200~499" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step7StaaExcpNope", fieldName: "step7StaaExcpNope", header: { text: "500~999" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "step8StaaExcpNope", fieldName: "step8StaaExcpNope", header: { text: "1,000이상" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"grssFcltCnt",
{
name: "insideSewerGroup",
header: { text: "하수처리구역 내" },
items: [
"staaInsdWhol",
{ name: "insdBGroup", header: { text: "계(B)" }, items: ["staaInsdSttkNprsflCnt", "step1StaaInsdSttkFrcCnt", "staaInsdSprktpFltrtbCnt", "staaInsdAertMthdCnt", "staaInsdCntcAertCnt", "staaInsdEtcCnt"] },
{ name: "insdCGroup", header: { text: "처리용량별" }, items: ["staaInsdPrcsCpctByWhol", "step1StaaInsdNope", "step2StaaInsdNope", "step3StaaInsdNope", "step4StaaInsdNope", "step5StaaInsdNope", "step6StaaInsdNope", "step7StaaInsdNope", "step8StaaInsdNope"] }
]
},
{
name: "outsideSewerGroup",
header: { text: "하수처리구역 외" },
items: [
"staaExcpWhol",
{ name: "excpEGroup", header: { text: "계(E)" }, items: ["staaExcpSttkNprsflCnt", "step1StaaExcpSttkFrcCnt", "staaExcpSprktpFltrtbCnt", "staaExcpAertMthdCnt", "staaExcpCntcAertCnt", "staaExcpEtcCnt"] },
{ name: "excpFGroup", header: { text: "처리용량별" }, items: ["staaExcpPrcsCpctByWhol", "step1StaaExcpNope", "step2StaaExcpNope", "step3StaaExcpNope", "step4StaaExcpNope", "step5StaaExcpNope", "step6StaaExcpNope", "step7StaaExcpNope", "step8StaaExcpNope"] }
]
}
]
};
@@ -0,0 +1,48 @@
import { ValueType } from "realgrid";
export const PrivateSewageTab3ColumnConfig = {
tabKey: "ST00080003", // 08번 개인하수처리시설 TAB3 매핑 키 고정
tabLabel: "개인하수도 관리지역 지정공고 현황",
rowStartNum: 3, // 3단 다단 레이아웃 스펙에 맞추어 3으로 설정합니다.
fixedColumns: 1,
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: "indvSwagePbancRgnCnt", fieldName: "indvSwagePbancRgnCnt", header: { text: "공고지역\n(개소)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "indvSwageDsgnScpLen", fieldName: "indvSwageDsgnScpLen", header: { text: "지정범위\n(㎢)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.00", editable: false },
// 정화조 그룹 소속 (개소수, 처리용량)
{ name: "spctnkGrssFcltCnt", fieldName: "spctnkGrssFcltCnt", header: { text: "총시설수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "spctnkQnt", fieldName: "spctnkQnt", header: { text: "처리용량\n(인/일)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 오수처리시설 그룹 소속 (개소수, 처리용량)
{ name: "drtwPrcsFcltGrssFcltCnt", fieldName: "drtwPrcsFcltGrssFcltCnt", header: { text: "총시설수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "drtwPrcsFcltQnt", fieldName: "drtwPrcsFcltQnt", header: { text: "처리용량\n(㎥/일)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }
],
columnLayout: [
// 행정구역 묶음
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
// 메인 마스터 지표
"indvSwagePbancRgnCnt",
"indvSwageDsgnScpLen",
// 정화조 다단 묶음
{
name: "septicTankGroup",
header: { text: "정화조" },
items: ["spctnkGrssFcltCnt", "spctnkQnt"]
},
// 오수처리시설 다단 묶음
{
name: "sewageTreatmentGroup",
header: { text: "오수처리시설" },
items: ["drtwPrcsFcltGrssFcltCnt", "drtwPrcsFcltQnt"]
}
]
};
@@ -0,0 +1,96 @@
import { ValueType } from "realgrid";
export const PumpStationStatusColumnConfig = {
tabKey: "ST00040002",
tabLabel: "빗물펌프장",
rowStartNum: 2,
fixedColumns: 2,
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: "fcltNm", fieldName: "fcltNm", header: { text: "시설명" }, editable: false },
{ name: "fcltPstnCn", fieldName: "fcltPstnCn", header: { text: "위치" }, editable: false },
{ name: "fcltyKndCn", fieldName: "fcltyKndCn", header: { text: "시설물종류" }, editable: false },
{ name: "oprtngStrtYmd", fieldName: "oprtngStrtYmd", header: { text: "가동개시\n년월일\nyyyy-mm-dd" }, editable: false },
{ name: "planDesignFreqCnt", fieldName: "planDesignFreqCnt", header: { text: "계획설계빈도" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "wtrStrgZoneArea", fieldName: "wtrStrgZoneArea", header: { text: "집수구역면적(㎢)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.00", editable: false },
// 유수지 그룹 소속
{ name: "rsvrYn", fieldName: "rsvrYn", header: { text: "유수지유무\n(유,무)" }, editable: false },
{ name: "rsvrImpndQnt", fieldName: "rsvrImpndQnt", header: { text: "저류량(㎥)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 흡수정 그룹 소속
{ name: "abstnRgnImdQnt", fieldName: "abstnRgnImdQnt", header: { text: "저류량(㎥)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 단일 컬럼
{ name: "grssPpqty", fieldName: "grssPpqty", header: { text: "총양수량\n(㎥/min)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 펌프시설 > 펌프시설1 그룹 소속
{ name: "pumpFcltN1DmtrExpln", fieldName: "pumpFcltN1DmtrExpln", header: { text: "구경(mm)" }, editable: false },
{ name: "pumpFcltN1PerPpqty", fieldName: "pumpFcltN1PerPpqty", header: { text: "대당 양수량\n(㎥/min·대)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "pumpFcltN1PumpCnt", fieldName: "pumpFcltN1PumpCnt", header: { text: "펌프대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "pumpFcltN1RsrvPumpCnt", fieldName: "pumpFcltN1RsrvPumpCnt", header: { text: "예비펌프대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 펌프시설 > 펌프시설2 그룹 소속
{ name: "pumpFcltN2DmtrExpln", fieldName: "pumpFcltN2DmtrExpln", header: { text: "구경(mm)" }, editable: false },
{ name: "pumpFcltN2PerPpqty", fieldName: "pumpFcltN2PerPpqty", header: { text: "대당 양수량\n(㎥/min·대)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "pumpFcltN2PumpCnt", fieldName: "pumpFcltN2PumpCnt", header: { text: "펌프대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "pumpFcltN2RsrvPumpCnt", fieldName: "pumpFcltN2RsrvPumpCnt", header: { text: "예비펌프대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 펌프시설 > 펌프시설3 그룹 소속
{ name: "pumpFcltN3DmtrExpln", fieldName: "pumpFcltN3DmtrExpln", header: { text: "구경(mm)" }, editable: false },
{ name: "pumpFcltN3PerPpqty", fieldName: "pumpFcltN3PerPpqty", header: { text: "대당 양수량\n(㎥/min·대)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "pumpFcltN3PumpCnt", fieldName: "pumpFcltN3PumpCnt", header: { text: "펌프대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "pumpFcltN3RsrvPumpCnt", fieldName: "pumpFcltN3RsrvPumpCnt", header: { text: "예비펌프대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 부대시설 그룹 소속
{ name: "prcsgFcltYn", fieldName: "prcsgFcltYn", header: { text: "전처리\n시설\n유무\n(유/무)" }, editable: false },
{ name: "ddrztnEqpmYn", fieldName: "ddrztnEqpmYn", header: { text: "탈취설비\n유무\n(유/무)" }, editable: false },
{ name: "oslfEtgtYn", fieldName: "oslfEtgtYn", header: { text: "자가발전\n유무\n(유/무)" }, editable: false },
// 단일 컬럼
{ name: "dschgWtrsExpln", fieldName: "dschgWtrsExpln", header: { text: "방류수역" }, editable: false },
// 최종처분량(ton/년) 그룹 소속
{ name: "prcptnLastDspsQnt", fieldName: "prcptnLastDspsQnt", header: { text: "침사" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "ctmnLastDspsQnt", fieldName: "ctmnLastDspsQnt", header: { text: "협잡물" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 최종처분방법 그룹 소속
{ name: "prcptnLastDspsMthdExpln", fieldName: "prcptnLastDspsMthdExpln", header: { text: "침사" }, editable: false },
{ name: "ctmnLastDspsMthdExpln", fieldName: "ctmnLastDspsMthdExpln", header: { text: "협잡물" }, editable: false },
// 운영실적 그룹 소속
{ name: "oprtngDayCnt", fieldName: "oprtngDayCnt", header: { text: "가동일수\n(일/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "grssMltvQnt", fieldName: "grssMltvQnt", header: { text: "총배수량(㎡/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"fcltNm",
"fcltPstnCn",
"fcltyKndCn",
"oprtngStrtYmd",
"planDesignFreqCnt",
"wtrStrgZoneArea",
{ name: "rsvrGroup", header: { text: "유수지" }, items: ["rsvrYn", "rsvrImpndQnt"] },
{ name: "abstnRgnGroup", header: { text: "흡수정" }, items: ["abstnRgnImdQnt"] },
{
name: "pumpFcltyGroup",
header: { text: "펌프시설" },
items: [
"grssPpqty",
{ name: "pump1SubGroup", header: { text: "펌프시설1" }, items: ["pumpFcltN1DmtrExpln", "pumpFcltN1PerPpqty", "pumpFcltN1PumpCnt", "pumpFcltN1RsrvPumpCnt"] },
{ name: "pump2SubGroup", header: { text: "펌프시설2" }, items: ["pumpFcltN2DmtrExpln", "pumpFcltN2PerPpqty", "pumpFcltN2PumpCnt", "pumpFcltN2RsrvPumpCnt"] },
{ name: "pump3SubGroup", header: { text: "펌프시설3" }, items: ["pumpFcltN3DmtrExpln", "pumpFcltN3PerPpqty", "pumpFcltN3PumpCnt", "pumpFcltN3RsrvPumpCnt"] }
]
},
{ name: "subFcltGroup", header: { text: "부대시설" }, items: ["prcsgFcltYn", "ddrztnEqpmYn", "oslfEtgtYn"] },
"dschgWtrsExpln",
{ name: "lastDspsGroup", header: { text: "최종처분량(ton/년)" }, items: ["prcptnLastDspsQnt", "ctmnLastDspsQnt"] },
{ name: "lastMthdGroup", header: { text: "최종처분방법" }, items: ["prcptnLastDspsMthdExpln", "ctmnLastDspsMthdExpln"] },
{ name: "oprtngGroup", header: { text: "운영실적" }, items: ["oprtngDayCnt", "grssMltvQnt"] }
]
};
@@ -0,0 +1,101 @@
import { ValueType } from "realgrid";
export const ReservoirStatusColumnConfig = {
tabKey: "ST00040001",
tabLabel: "하수저류시설",
rowStartNum: 2,
fixedColumns: 2,
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: "fcltNm", fieldName: "fcltNm", header: { text: "시설명" }, editable: false },
{ name: "fcltPstnCn", fieldName: "fcltPstnCn", header: { text: "위치" }, editable: false },
{ name: "oprtngStrtYmd", fieldName: "oprtngStrtYmd", header: { text: "가동개시\n년월일\nyyyy-mm-dd" }, editable: false },
{ name: "planDesignFreqCnt", fieldName: "planDesignFreqCnt", header: { text: "계획설계빈도" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 설치목적 그룹 소속 (O,X로 표기, 중복체크가능)
{ name: "fldngPrvtnYn", fieldName: "fldngPrvtnYn", header: { text: "침수예방" }, editable: false },
{ name: "wqPlltnMtgtYn", fieldName: "wqPlltnMtgtYn", header: { text: "수질오염저감" }, editable: false },
{ name: "rtlztnUsgYn", fieldName: "rtlztnUsgYn", header: { text: "하수\n재이용\n용도" }, editable: false },
// 단일 컬럼들
{ name: "fcltStrctCn", fieldName: "fcltStrctCn", header: { text: "시설구조\n(일반지하식,\n지하터널식,\n기타)" }, editable: false },
{ name: "wtrStrgZoneArea", fieldName: "wtrStrgZoneArea", header: { text: "접수구역면적(㎢)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.00", editable: false },
{ name: "impdFcltCpct", fieldName: "impdFcltCpct", header: { text: "시설용량(㎥)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "grssPpqty", fieldName: "grssPpqty", header: { text: "총양수량\n(㎥/min)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 펌프시설 > 펌프시설1 그룹 소속
{ name: "pumpFcltN1DmtrExpln", fieldName: "pumpFcltN1DmtrExpln", header: { text: "구경(mm)" }, editable: false },
{ name: "pumpFcltN1PerPpqty", fieldName: "pumpFcltN1PerPpqty", header: { text: "대당 양수량\n(㎥/min·대)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "pumpFcltN1PumpCnt", fieldName: "pumpFcltN1PumpCnt", header: { text: "펌프대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "pumpFcltN1RsrvPumpCnt", fieldName: "pumpFcltN1RsrvPumpCnt", header: { text: "예비펌프대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 펌프시설 > 펌프시설2 그룹 소속
{ name: "pumpFcltN2DmtrExpln", fieldName: "pumpFcltN2DmtrExpln", header: { text: "구경(mm)" }, editable: false },
{ name: "pumpFcltN2PerPpqty", fieldName: "pumpFcltN2PerPpqty", header: { text: "대당 양수량\n(㎥/min·대)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "pumpFcltN2PumpCnt", fieldName: "pumpFcltN2PumpCnt", header: { text: "펌프대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "pumpFcltN2RsrvPumpCnt", fieldName: "pumpFcltN2RsrvPumpCnt", header: { text: "예비펌프대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 펌프시설 > 펌프시설3 그룹 소속
{ name: "pumpFcltN3DmtrExpln", fieldName: "pumpFcltN3DmtrExpln", header: { text: "구경(mm)" }, editable: false },
{ name: "pumpFcltN3PerPpqty", fieldName: "pumpFcltN3PerPpqty", header: { text: "대당 양수량\n(㎥/min·대)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "pumpFcltN3PumpCnt", fieldName: "pumpFcltN3PumpCnt", header: { text: "펌프대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "pumpFcltN3RsrvPumpCnt", fieldName: "pumpFcltN3RsrvPumpCnt", header: { text: "예비펌프대수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 부대시설 그룹 소속
{ name: "prcsgFcltYn", fieldName: "prcsgFcltYn", header: { text: "전처리\n시설\n유무\n(유/무)" }, editable: false },
{ name: "ddrztnEqpmYn", fieldName: "ddrztnEqpmYn", header: { text: "탈취설비\n유무\n(유/무)" }, editable: false },
{ name: "oslfEtgtYn", fieldName: "oslfEtgtYn", header: { text: "자가발전\n유무\n(유/무)" }, editable: false },
// 단일 컬럼들
{ name: "mltvMthCn", fieldName: "mltvMthCn", header: { text: "배수방식\n(자연배수,\n강제배수)" }, editable: false },
{ name: "impdMthCn", fieldName: "impdMthCn", header: { text: "저류방식\n(직렬,병렬)" }, editable: false },
{ name: "impdPrcsMthdCn", fieldName: "impdPrcsMthdCn", header: { text: "저류수\n처리방법\n(자체처리,\n연계처리)" }, editable: false },
{ name: "dschgWtrsExpln", fieldName: "dschgWtrsExpln", header: { text: "방류수역\n(또는\n연계처리장명)" }, editable: false },
// 최종처분량(ton/년) 그룹 소속
{ name: "prcptnLastDspsQnt", fieldName: "prcptnLastDspsQnt", header: { text: "침사" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "ctmnLastDspsQnt", fieldName: "ctmnLastDspsQnt", header: { text: "협잡물" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 최종처분방법 그룹 소속
{ name: "prcptnLastDspsMthdExpln", fieldName: "prcptnLastDspsMthdExpln", header: { text: "침사" }, editable: false },
{ name: "ctmnLastDspsMthdExpln", fieldName: "ctmnLastDspsMthdExpln", header: { text: "협잡물" }, editable: false },
// 운영실적 그룹 소속
{ name: "oprtngDayCnt", fieldName: "oprtngDayCnt", header: { text: "가동일수\n(일/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "grssMltvQnt", fieldName: "grssMltvQnt", header: { text: "총배수량(㎡/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"fcltNm",
"fcltPstnCn",
"oprtngStrtYmd",
"planDesignFreqCnt",
{ name: "purposeGroup", header: { text: "설치목적(O,X로 표기, 중복체크가능)" }, items: ["fldngPrvtnYn", "wqPlltnMtgtYn", "rtlztnUsgYn"] },
"fcltStrctCn",
"wtrStrgZoneArea",
"impdFcltCpct",
{
name: "pumpFcltyGroup",
header: { text: "펌프시설" },
items: [
"grssPpqty",
{ name: "pump1SubGroup", header: { text: "펌프시설1" }, items: ["pumpFcltN1DmtrExpln", "pumpFcltN1PerPpqty", "pumpFcltN1PumpCnt", "pumpFcltN1RsrvPumpCnt"] },
{ name: "pump2SubGroup", header: { text: "펌프시설2" }, items: ["pumpFcltN2DmtrExpln", "pumpFcltN2PerPpqty", "pumpFcltN2PumpCnt", "pumpFcltN2RsrvPumpCnt"] },
{ name: "pump3SubGroup", header: { text: "펌프시설3" }, items: ["pumpFcltN3DmtrExpln", "pumpFcltN3PerPpqty", "pumpFcltN3PumpCnt", "pumpFcltN3RsrvPumpCnt"] }
]
},
{ name: "subFcltGroup", header: { text: "부대시설" }, items: ["prcsgFcltYn", "ddrztnEqpmYn", "oslfEtgtYn"] },
"mltvMthCn",
"impdMthCn",
"impdPrcsMthdCn",
"dschgWtrsExpln",
{ name: "lastDspsGroup", header: { text: "최종처분량(ton/년)" }, items: ["prcptnLastDspsQnt", "ctmnLastDspsQnt"] },
{ name: "lastMthdGroup", header: { text: "최종처분방법" }, items: ["prcptnLastDspsMthdExpln", "ctmnLastDspsMthdExpln"] },
{ name: "oprtngGroup", header: { text: "운영실적" }, items: ["oprtngDayCnt", "grssMltvQnt"] }
]
};
@@ -0,0 +1,24 @@
import { ValueType } from "realgrid";
export const SewerageFeeTab2ColumnConfig = {
tabKey: "ST00090002",
tabLabel: "하수도 요금",
rowStartNum: 2,
fixedColumns: 3,
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: "anlLevyQnt", fieldName: "anlLevyQnt", header: { text: "연간조정량(㎡)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "levyAmt", fieldName: "levyAmt", header: { text: "하수도사용료수익(원)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "avgUntprcAmt", fieldName: "avgUntprcAmt", header: { text: "㎡당 요금(원/㎡)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "grssPrmcoAmt", fieldName: "grssPrmcoAmt", header: { text: "총관원가(원)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "grssUnitPrmcoAmt", fieldName: "grssUnitPrmcoAmt", header: { text: "㎡당원가(원/㎡)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "rlztnRt", fieldName: "rlztnRt", header: { text: "현실화율(%)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"anlLevyQnt", "levyAmt", "avgUntprcAmt", "grssPrmcoAmt", "grssUnitPrmcoAmt", "rlztnRt"
]
};
@@ -0,0 +1,58 @@
import { ValueType } from "realgrid";
export const SewerageFinancialTab1ColumnConfig = {
tabKey: "ST00090001",
tabLabel: "하수도재정 결산",
rowStartNum: 3,
fixedColumns: 1,
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: "crfwAmt", fieldName: "crfwAmt", header: { text: "이월액" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "lbltAmt", fieldName: "lbltAmt", header: { text: "부채액\n(백만원)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "usgByWholPjtcoAmt", fieldName: "usgByWholPjtcoAmt", header: { text: "계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "tmplntWholAmt", fieldName: "tmplntWholAmt", header: { text: "소계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "tmplntFcltAmt", fieldName: "tmplntFcltAmt", header: { text: "시설비" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "tmplntMendngAmt", fieldName: "tmplntMendngAmt", header: { text: "개보수비" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "tmplntOperKeepAmt", fieldName: "tmplntOperKeepAmt", header: { text: "운영\n유지비" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "tmplntEtcAmt", fieldName: "tmplntEtcAmt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "wholSwagePplAmt", fieldName: "wholSwagePplAmt", header: { text: "소계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "swagePplFcltAmt", fieldName: "swagePplFcltAmt", header: { text: "시설비" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "swagePplMendngAmt", fieldName: "swagePplMendngAmt", header: { text: "개보수비" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "swagePplOperKeepAmt", fieldName: "swagePplOperKeepAmt", header: { text: "운영\n유지비" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "swagePplEtcAmt", fieldName: "swagePplEtcAmt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "wholSwageImdpFcltAmt", fieldName: "wholSwageImdpFcltAmt", header: { text: "소계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "swageImpdFcltAmt", fieldName: "swageImpdFcltAmt", header: { text: "시설비" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "swageImpdMendngAmt", fieldName: "swageImpdMendngAmt", header: { text: "개보수비" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "swageImpdOperKeepAmt", fieldName: "swageImpdOperKeepAmt", header: { text: "운영\n유지비" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "swageImpdFcltEtcAmt", fieldName: "swageImpdFcltEtcAmt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "etcWholAmt", fieldName: "etcWholAmt", header: { text: "소계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "etcAcdntCrfwAmt", fieldName: "etcAcdntCrfwAmt", header: { text: "사고\n이월액" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "etcNrcpAmt", fieldName: "etcNrcpAmt", header: { text: "미수납액" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "etcAmt", fieldName: "etcAmt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"crfwAmt",
{
name: "purposeGroup",
header: { text: "용도별사업비(백만원)" },
items: [
"usgByWholPjtcoAmt",
{ name: "t1Group", header: { text: "처리장" }, items: ["tmplntWholAmt", "tmplntFcltAmt", "tmplntMendngAmt", "tmplntOperKeepAmt", "tmplntEtcAmt"] },
{ name: "t2Group", header: { text: "하수관로" }, items: ["wholSwagePplAmt", "swagePplFcltAmt", "swagePplMendngAmt", "swagePplOperKeepAmt", "swagePplEtcAmt"] },
{ name: "t3Group", header: { text: "유수지 및 배수펌프장" }, items: ["wholSwageImdpFcltAmt", "swageImpdFcltAmt", "swageImpdMendngAmt", "swageImpdOperKeepAmt", "swageImpdFcltEtcAmt"] },
{ name: "t4Group", header: { text: "기타" }, items: ["etcWholAmt", "etcAcdntCrfwAmt", "etcNrcpAmt", "etcAmt"] }
]
}
]
};
@@ -0,0 +1,38 @@
import { ValueType } from "realgrid";
export const SewerageOrgCauseTab4ColumnConfig = {
tabKey: "ST00090004",
tabLabel: "원인자부담금",
rowStartNum: 3,
fixedColumns: 3,
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: "levyEvntcsCnt", fieldName: "levyEvntcsCnt", header: { text: "건수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "levyAmt", fieldName: "levyAmt", header: { text: "금액(백만원)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "trgtByWholClctnEvntcsCnt", fieldName: "trgtByWholClctnEvntcsCnt", header: { text: "건수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "trgtByWholClctnAmt", fieldName: "trgtByWholClctnAmt", header: { text: "금액(백만원)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "mltvEqpmEvntcsCnt", fieldName: "mltvEqpmEvntcsCnt", header: { text: "건수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "mltvEqpmAmt", fieldName: "mltvEqpmAmt", header: { text: "금액(백만원)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "othrCstrnOthrActrCnt", fieldName: "othrCstrnOthrActrCnt", header: { text: "건수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "othrCstrnOthrActrAmt", fieldName: "othrCstrnOthrActrAmt", header: { text: "금액(백만원)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
{ name: "levyGroup", header: { text: "부과액" }, items: ["levyEvntcsCnt", "levyAmt"] },
{
name: "collectionStatusGroup",
header: { text: "대상별 징수현황" },
items: [
{ name: "c1Group", header: { text: "계" }, items: ["trgtByWholClctnEvntcsCnt", "trgtByWholClctnAmt"] },
{ name: "c2Group", header: { text: "배수설비설치자\n(하수도법 제61조 제1항)" }, items: ["mltvEqpmEvntcsCnt", "mltvEqpmAmt"] },
{ name: "c3Group", header: { text: "타공사·타행위자\n(하수도법 제61조 제2항)" }, items: ["othrCstrnOthrActrCnt", "othrCstrnOthrActrAmt"] }
]
}
]
};
@@ -0,0 +1,62 @@
import { ValueType } from "realgrid";
export const SewerageUsageFeeTab3ColumnConfig = {
tabKey: "ST00090003",
tabLabel: "하수도 사용료",
rowStartNum: 3,
fixedColumns: 3,
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: "levyAmt", fieldName: "levyAmt", header: { text: "부과액(백만원)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "levyQnt", fieldName: "levyQnt", header: { text: "부과량(천톤)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 가정용
{ name: "hshusLevyAmt", fieldName: "hshusLevyAmt", header: { text: "부과액" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "hshusLevyQnt", fieldName: "hshusLevyQnt", header: { text: "부과량" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "hshusUntprcAmt", fieldName: "hshusUntprcAmt", header: { text: "단가" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 업무용
{ name: "taskFrLevyAmt", fieldName: "taskFrLevyAmt", header: { text: "부과액" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "taskFrLevyQnt", fieldName: "taskFrLevyQnt", header: { text: "부과량" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "taskFrUntprcAmt", fieldName: "taskFrUntprcAmt", header: { text: "단가" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 영업용(일반용)
{ name: "bsnGnrlLevyAmt", fieldName: "bsnGnrlLevyAmt", header: { text: "부과액(백만원)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "bsnGnrlLevyQnt", fieldName: "bsnGnrlLevyQnt", header: { text: "부과량(천톤)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "bsnGnrlUntprcAmt", fieldName: "bsnGnrlUntprcAmt", header: { text: "단가(원/톤)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 욕탕 1종
{ name: "massBthhsFrLevyAmt", fieldName: "massBthhsFrLevyAmt", header: { text: "부과액(백만원)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "massBthhsFrLevyQnt", fieldName: "massBthhsFrLevyQnt", header: { text: "부과량(천톤)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "massBthhsFrUntprcAmt", fieldName: "massBthhsFrUntprcAmt", header: { text: "단가(원/톤)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 욕탕 2종
{ name: "bthhsFrSpcs2LevyAmt", fieldName: "bthhsFrSpcs2LevyAmt", header: { text: "부과액" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "bthhsFrSpcs2LevyQnt", fieldName: "bthhsFrSpcs2LevyQnt", header: { text: "부과량" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "bthhsFrSpcs2UntprcAmt", fieldName: "bthhsFrSpcs2UntprcAmt", header: { text: "단가" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 산업 및 공업용
{ name: "induMdsrLevyAmt", fieldName: "induMdsrLevyAmt", header: { text: "부과액(백만원)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "induMdsrLevyQnt", fieldName: "induMdsrLevyQnt", header: { text: "부과량(천톤)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "induMdsrUntprcAmt", fieldName: "induMdsrUntprcAmt", header: { text: "단가(원/톤)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 기타
{ name: "etcLevyAmt", fieldName: "etcLevyAmt", header: { text: "부과액" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "etcLevyQnt", fieldName: "etcLevyQnt", header: { text: "부과량" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "etcLevyUntprcAmt", fieldName: "etcLevyUntprcAmt", header: { text: "단가" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
{ name: "totalGroup", header: { text: "총계" }, items: ["levyAmt", "levyQnt"] },
{ name: "g1Group", header: { text: "가정용" }, items: ["hshusLevyAmt", "hshusLevyQnt", "hshusUntprcAmt"] },
{ name: "g2Group", header: { text: "업무용" }, items: ["taskFrLevyAmt", "taskFrLevyQnt", "taskFrUntprcAmt"] },
{ name: "g3Group", header: { text: "영업용(일반용)" }, items: ["bsnGnrlLevyAmt", "bsnGnrlLevyQnt", "bsnGnrlUntprcAmt"] },
{ name: "g4Group", header: { text: "욕탕 1종(대중탕용)" }, items: ["massBthhsFrLevyAmt", "massBthhsFrLevyQnt", "massBthhsFrUntprcAmt"] },
{ name: "g5Group", header: { text: "욕탕2종" }, items: ["bthhsFrSpcs2LevyAmt", "bthhsFrSpcs2LevyQnt", "bthhsFrSpcs2UntprcAmt"] },
{ name: "g6Group", header: { text: "산업 및 공업용" }, items: ["induMdsrLevyAmt", "induMdsrLevyQnt", "induMdsrUntprcAmt"] },
{ name: "g7Group", header: { text: "기타" }, items: ["etcLevyAmt", "etcLevyQnt", "etcLevyUntprcAmt"] }
]
};
@@ -0,0 +1,48 @@
import { ValueType } from "realgrid";
export const SewerageGrayWaterTab2ColumnConfig = {
tabKey: "ST00100002",
tabLabel: "중수도 현황",
rowStartNum: 2, // 2단 그룹 헤더이므로 rowStartNum은 2로 지정합니다.
fixedColumns: 1,
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 },
// 단일 마스터 컬럼들 (image_103ea5 스펙 반영)
{ name: "fcltNm", fieldName: "fcltNm", header: { text: "건축물명/\n개발사업명" }, editable: false },
{ name: "bldgSeCn", fieldName: "bldgSeCn", header: { text: "시설물용도/\n개발사업종류" }, editable: false },
{ name: "fcltPstnCn", fieldName: "fcltPstnCn", header: { text: "주소" }, editable: false },
{ name: "lglTrgtYn", fieldName: "lglTrgtYn", header: { text: "법적의무\n대상여부\n(대상/미대상)" }, editable: false },
{ name: "cmptnStrtYmd", fieldName: "cmptnStrtYmd", header: { text: "설치완료일\nyyyy-mm-dd" }, editable: false },
{ name: "oprtngStrtYmd", fieldName: "oprtngStrtYmd", header: { text: "가동개시일\nyyyy-mm-dd" }, editable: false },
// 시설현황 그룹 소속
{ name: "archWholArea", fieldName: "archWholArea", header: { text: "건축연면적\n(㎡)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "prcsCpct", fieldName: "prcsCpct", header: { text: "처리용량\n(㎡/일)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 이용 현황 소속 컬럼들
{ name: "wtrUseQnt", fieldName: "wtrUseQnt", header: { text: "물 사용량\n(㎡/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "ruswtrUtztnQnt", fieldName: "ruswtrUtztnQnt", header: { text: "중수도\n이용량(㎡/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "sbstCntUtztnQnt", fieldName: "sbstCntUtztnQnt", header: { text: "대체수\n이용량(㎡/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "mnUsgCn", fieldName: "mnUsgCn", header: { text: "중수도용도" }, editable: false },
{ name: "ruswtrOperAmt", fieldName: "ruswtrOperAmt", header: { text: "연간운영비\n(백만원/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"fcltNm",
"bldgSeCn",
"fcltPstnCn",
"lglTrgtYn",
"cmptnStrtYmd",
"oprtngStrtYmd",
{ name: "facilityStatusGroup", header: { text: "시설현황" }, items: ["archWholArea", "prcsCpct"] },
"wtrUseQnt",
"ruswtrUtztnQnt",
"sbstCntUtztnQnt",
"mnUsgCn",
"ruswtrOperAmt"
]
};
@@ -0,0 +1,33 @@
import { ValueType } from "realgrid";
export const SewerageRainwaterTab3ColumnConfig = {
tabKey: "ST00100003",
tabLabel: "빗물이용시설현황",
rowStartNum: 2,
fixedColumns: 3,
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: "fcltNm", fieldName: "fcltNm", header: { text: "시설명" }, editable: false },
{ name: "bdstTypCn", fieldName: "bdstTypCn", header: { text: "건축물용도" }, editable: false },
{ name: "fcltPstnCn", fieldName: "fcltPstnCn", header: { text: "위치(주소)" }, editable: false },
{ name: "lglTrgtYn", fieldName: "lglTrgtYn", header: { text: "법적의무 대상여부\n(대상/미대상)" }, editable: false },
{ name: "instlCmptnYmd", fieldName: "instlCmptnYmd", header: { text: "설치완료일\n(yyyy-mm-dd)" }, editable: false },
{ name: "instlAmt", fieldName: "instlAmt", header: { text: "설치비\n(백만원)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "rcptMynCn", fieldName: "rcptMynCn", header: { text: "집수면 종류" }, editable: false },
{ name: "filtrPrcsFcltYnExpln", fieldName: "filtrPrcsFcltYnExpln", header: { text: "여과등 처리시설 유무" }, editable: false },
{ name: "impdCpct", fieldName: "impdCpct", header: { text: "저류조 용량(㎥)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 이용 현황 그룹 소속
{ name: "anlUseQnt", fieldName: "anlUseQnt", header: { text: "연간 이용량\n(㎥/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "exlnUtlzUsgExpln", fieldName: "exlnUtlzUsgExpln", header: { text: "이용용도" }, editable: false },
{ name: "anlOperAmt", fieldName: "anlOperAmt", header: { text: "연간운영비\n(백만원/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"fcltNm", "bdstTypCn", "fcltPstnCn", "lglTrgtYn", "instlCmptnYmd", "instlAmt", "rcptMynCn", "filtrPrcsFcltYnExpln", "impdCpct",
"anlUseQnt", "exlnUtlzUsgExpln", "anlOperAmt"
]
};
@@ -0,0 +1,89 @@
import { ValueType } from "realgrid";
export const SewerageReuseTab1ColumnConfig = {
tabKey: "ST00100001",
tabLabel: "공공하수처리수 재이용",
rowStartNum: 4, // 3단 계층 다단 헤더 구조이므로 4로 유지합니다.
fixedColumns: 1,
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: "swtrmtFcltNm", fieldName: "swtrmtFcltNm", header: { text: "시설명" }, editable: false },
{ name: "sncnYmd", fieldName: "sncnYmd", header: { text: "인가일\n(년/월/일)" }, editable: false },
{ name: "prcsFcltCpct", fieldName: "prcsFcltCpct", header: { text: "시설용량\n(㎥/일)" }, editable: false },
{ name: "prcsQnt", fieldName: "prcsQnt", header: { text: "연간\n하수처리량\n(천톤/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "lglYn", fieldName: "lglYn", header: { text: "법적의무대상\n(대상/미대상)" }, editable: false },
// 재이용시설 설치시 소속
{ name: "instlYn", fieldName: "instlYn", header: { text: "설치유무\n(유/무)" }, editable: false },
{ name: "oprtngStrtYmd", fieldName: "oprtngStrtYmd", header: { text: "가동개시일\nyyyy-mm-dd" }, editable: false },
{ name: "instlAprvYmd", fieldName: "instlAprvYmd", header: { text: "설치승인일\nyyyy-mm-dd" }, editable: false },
{ name: "rprcsFcltCpct", fieldName: "rprcsFcltCpct", header: { text: "용량(톤/일)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "mtcnsNm", fieldName: "mtcnsNm", header: { text: "공법/기자재" }, editable: false },
{ name: "ruswtPplLen", fieldName: "ruswtPplLen", header: { text: "공급관로길이\n(km)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.00", editable: false },
{ name: "ruswtPumpLen", fieldName: "ruswtPumpLen", header: { text: "공급펌프\n(톤/일)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 하수처리수 재이용현황
{ name: "wholUseQnt", fieldName: "wholUseQnt", header: { text: "총계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "ithlWshwtrQnt", fieldName: "ithlWshwtrQnt", header: { text: "계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "ithlClnQty", fieldName: "ithlClnQty", header: { text: "세척수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "ithlFrzgQty", fieldName: "ithlFrzgQty", header: { text: "냉각수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "ithlLdhcUswtrQnt", fieldName: "ithlLdhcUswtrQnt", header: { text: "청소수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "ithlDltnUswtrQnt", fieldName: "ithlDltnUswtrQnt", header: { text: "조경용수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "ithlRuswtrQnt", fieldName: "ithlRuswtrQnt", header: { text: "희석용수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "ithlEtcQnt", fieldName: "ithlEtcQnt", header: { text: "장내중수도" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "ithlUnsdQnt", fieldName: "ithlUnsdQnt", header: { text: "장내기타용수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "otcntrUswtrWhol", fieldName: "otcntrUswtrWhol", header: { text: "계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "otcntrClnRstrmQnt", fieldName: "otcntrClnRstrmQnt", header: { text: "청소·화장실\n용수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "otcntrWshwtrQnt", fieldName: "otcntrWshwtrQnt", header: { text: "세척·살수용수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "otcntrLdhcUswtrQnt", fieldName: "otcntrLdhcUswtrQnt", header: { text: "조경용수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "otcntrHdrplUswtrQnt", fieldName: "otcntrHdrplUswtrQnt", header: { text: "친수용수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "otcntrRvrKeepQnt", fieldName: "otcntrRvrKeepQnt", header: { text: "하천유지용수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "agrcltUswtrPstnQnt", fieldName: "agrcltUswtrPstnQnt", header: { text: "농업용수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "ugwtrChargQnt", fieldName: "ugwtrChargQnt", header: { text: "지하수충전" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "mdsrUswtrQnt", fieldName: "mdsrUswtrQnt", header: { text: "공업용수" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "rtlztnRt", fieldName: "rtlztnRt", header: { text: "재이용률\n(%)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
{ name: "seweragePlantGroup", header: { text: "하수처리장" }, items: ["swtrmtFcltNm", "sncnYmd", "prcsFcltCpct", "prcsQnt", "lglYn"] },
{
name: "reuseFacilityGroup",
header: { text: "재이용시설" },
items: [
"instlYn",
{
name: "installationGroup",
header: { text: "재이용시설 설치시" },
items: [
"oprtngStrtYmd",
"instlAprvYmd",
{
// ★ 핵심 교정: 이미지 명세에 맞춰 내부에 서브 그룹 헤더 추가 완료
name: "reProcessingFacilityGroup",
header: { text: "재처리시설" },
items: ["rprcsFcltCpct", "mtcnsNm"]
},
"ruswtPplLen",
"ruswtPumpLen"
]
}
]
},
{
name: "reuseStatusGroup",
header: { text: "하수처리수 재이용현황(천톤/년)" },
items: [
"wholUseQnt",
{ name: "internalWaterGroup", header: { text: "장내 용수" }, items: ["ithlWshwtrQnt", "ithlClnQty", "ithlFrzgQty", "ithlLdhcUswtrQnt", "ithlDltnUswtrQnt", "ithlRuswtrQnt", "ithlEtcQnt", "ithlUnsdQnt"] },
{ name: "externalWaterGroup", header: { text: "장외 용수" }, items: ["otcntrUswtrWhol", "otcntrClnRstrmQnt", "otcntrWshwtrQnt", "otcntrLdhcUswtrQnt", "otcntrHdrplUswtrQnt", "otcntrRvrKeepQnt", "agrcltUswtrPstnQnt", "ugwtrChargQnt", "mdsrUswtrQnt"] }
]
},
"rtlztnRt"
]
};
@@ -0,0 +1,28 @@
export const SewerageWwtRtlztnRegTab4ColumnConfig = {
tabKey: "ST00100004",
tabLabel: "하·폐수처리수재이용시설설계시공업등록현황",
rowStartNum: 2, // 행정구역 2단 묶음 헤더 구조이므로 2로 지정합니다.
fixedColumns: 1,
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 },
// 메인 마스터 문자열 지표들 (화면 그리드 명세서 순서 100% 매칭)
{ name: "bplcNm", fieldName: "bplcNm", header: { text: "상호(명칭)" }, editable: false },
{ name: "rprsvNm", fieldName: "rprsvNm", header: { text: "대표자" }, editable: false },
{ name: "bplcPstnCn", fieldName: "bplcPstnCn", header: { text: "주소" }, editable: false },
{ name: "regDt", fieldName: "regDt", header: { text: "등록일\nyyyy-mm-dd" }, editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"bplcNm",
"rprsvNm",
"bplcPstnCn",
"regDt"
]
};
@@ -0,0 +1,25 @@
export const SewerageWwtRtlztnSncnTab5ColumnConfig = {
tabKey: "ST00100005",
tabLabel: "하·폐수처리수재이용시설사업인가현황",
rowStartNum: 2, // 행정구역 2단 레이아웃에 최적화
fixedColumns: 1,
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: "bplcNm", fieldName: "bplcNm", header: { text: "상호(명칭)" }, editable: false },
{ name: "rprsvNm", fieldName: "rprsvNm", header: { text: "대표자" }, editable: false },
{ name: "bplcPstnCn", fieldName: "bplcPstnCn", header: { text: "주소" }, editable: false },
{ name: "coRegYmd", fieldName: "coRegYmd", header: { text: "인가일\n(년/월/일)" }, editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"bplcNm",
"rprsvNm",
"bplcPstnCn",
"coRegYmd"
]
};
@@ -1,77 +1,36 @@
import { ValueType } from "realgrid"; import { ValueType } from "realgrid";
// 하수도 통계 관리 > 13. 하수도 서비스 수준 > tab 1: 민원 export const SewageComplaintTab1ColumnConfig = {
export const ComplaintInpColumn = {
columns: [
{ name: "ctpvNm", fieldName: "ctpvNm", header: { text: "시도" } },
{ name: "sggNm", fieldName: "sggNm", header: { text: "시군구" } },
{ name: "admdstNm", fieldName: "admdstNm", header: { text: "행정구역명" } },
{
name: "swtrmtPpltnCnt",
fieldName: "swtrmtPpltnCnt",
header: { text: "하수처리장민원건수(건)" },
valueType: ValueType.NUMBER,
dataFormat: "#,##0",
},
{
name: "whol",
fieldName: "whol",
header: { text: "합계" },
valueType: ValueType.NUMBER,
dataFormat: "#,##0",
},
{ name: "odorCnt", fieldName: "odorCnt", header: { text: "악취" }, valueType: ValueType.NUMBER, dataFormat: "#,##0" },
{ name: "swagePplCnt", fieldName: "swagePplCnt", header: { text: "하수관거" }, valueType: ValueType.NUMBER, dataFormat: "#,##0" },
{ name: "dschgWqCnt", fieldName: "dschgWqCnt", header: { text: "방류수수질" }, valueType: ValueType.NUMBER, dataFormat: "#,##0" },
{ name: "ldsCnt", fieldName: "ldsCnt", header: { text: "퇴적토" }, valueType: ValueType.NUMBER, dataFormat: "#,##0" },
{ name: "plltnAcdntCnt", fieldName: "plltnAcdntCnt", header: { text: "오염사고" }, valueType: ValueType.NUMBER, dataFormat: "#,##0" },
{ name: "sewerCrgAmt", fieldName: "sewerCrgAmt", header: { text: "하수도요금" }, valueType: ValueType.NUMBER, dataFormat: "#,##0" },
{ name: "etcCnt", fieldName: "etcCnt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0" },
{
name: "crtrPpltnCvlcptEvntcsCnt",
fieldName: "crtrPpltnCvlcptEvntcsCnt",
header: { text: "인구10만명당 민원건수(건)" },
valueType: ValueType.NUMBER,
dataFormat: "#,##0.00",
},
{ name: "rmrk", fieldName: "rmrk", header: { text: "비고" } },
{ name: "statsYr", fieldName: "statsYr", header: { text: "통계연도" }, visible: false },
{ name: "admdstCd", fieldName: "admdstCd", header: { text: "행정코드" }, visible: false },
{ name: "rowType", fieldName: "rowType", header: { text: "행타입" }, visible: false },
].map((col) => ({ ...col, editable: false })),
columnLayout: [
{
name: "groupA",
hideChildHeaders: false,
header: { text: "행정구역" },
items: ["ctpvNm", "sggNm", "admdstNm"],
},
{
name: "groupB",
hideChildHeaders: false,
header: { text: "민원건수(건)" },
items: [
"whol",
"odorCnt",
"swagePplCnt",
"dschgWqCnt",
"ldsCnt",
"plltnAcdntCnt",
"sewerCrgAmt",
"etcCnt",
],
},
"swtrmtPpltnCnt",
"crtrPpltnCvlcptEvntcsCnt",
"rmrk",
"statsYr",
"admdstCd",
"rowType",
],
rowStartNum: 2,
fixedColumns: 1,
tabKey: "ST00130001", tabKey: "ST00130001",
tabLabel: "민원", tabLabel: "민원",
rowStartNum: 3, // 행정구역 3단 헤더
fixedColumns: 1,
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: "swtrmtPpltnCnt", fieldName: "swtrmtPpltnCnt", header: { text: "하수처리인구\n(명)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
// 민원유형
{ name: "whol", fieldName: "whol", header: { text: "총계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "odorCnt", fieldName: "odorCnt", header: { text: "악취" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "swagePplCnt", fieldName: "swagePplCnt", header: { text: "하수관로" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "dschgWqCnt", fieldName: "dschgWqCnt", header: { text: "배수설비" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "ldsCnt", fieldName: "ldsCnt", header: { text: "맨홀" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "plltnAcdntCnt", fieldName: "plltnAcdntCnt", header: { text: "정화조" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "sewerCrgAmt", fieldName: "sewerCrgAmt", header: { text: "하수도요금" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "etcCnt", fieldName: "etcCnt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "crtrPpltnCvlcptEvntcsCnt", fieldName: "crtrPpltnCvlcptEvntcsCnt", header: { text: "기준인구당\n민원건수\n(건/10,000명)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.00", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"swtrmtPpltnCnt",
{
name: "complaintGroup",
header: { text: "민원유형(건)" },
items: ["whol", "odorCnt", "swagePplCnt", "dschgWqCnt", "ldsCnt", "plltnAcdntCnt", "sewerCrgAmt", "etcCnt"]
},
"crtrPpltnCvlcptEvntcsCnt"
]
}; };
@@ -1,81 +1,34 @@
import { ValueType } from "realgrid"; import { ValueType } from "realgrid";
// 하수도 통계 관리 > 13. 하수도 서비스 수준 > tab 2: 주민친화시설 export const ResidentFriendlyFacilityTab2ColumnConfig = {
export const ResidentFriendlyFactTotColumn = {
columns: [
{ name: "ctpvNm", fieldName: "ctpvNm", header: { text: "시도" } },
{ name: "sggNm", fieldName: "sggNm", header: { text: "시군구" } },
{ name: "admdstNm", fieldName: "admdstNm", header: { text: "행정구역명" } },
{ name: "swtrmtFcltNm", fieldName: "swtrmtFcltNm", header: { text: "처리장명" } },
{
name: "fcltCpct",
fieldName: "fcltCpct",
header: { text: "시설용량(m³/일)" },
valueType: ValueType.NUMBER,
dataFormat: "#,##0",
},
{
name: "tmplntArea",
fieldName: "tmplntArea",
header: { text: "처리장면적(㎡)" },
valueType: ValueType.NUMBER,
dataFormat: "#,##0.00",
},
{
name: "whol",
fieldName: "whol",
header: { text: "총계" },
valueType: ValueType.NUMBER,
dataFormat: "#,##0",
},
{ name: "brkFcltArea", fieldName: "brkFcltArea", header: { text: "휴게시설" }, valueType: ValueType.NUMBER, dataFormat: "#,##0" },
{ name: "childFrshpSpacArea", fieldName: "childFrshpSpacArea", header: { text: "어린이놀이공간" }, valueType: ValueType.NUMBER, dataFormat: "#,##0" },
{ name: "bdySportsFcltArea", fieldName: "bdySportsFcltArea", header: { text: "체력단련시설" }, valueType: ValueType.NUMBER, dataFormat: "#,##0" },
{ name: "sportsFcltArea", fieldName: "sportsFcltArea", header: { text: "운동시설" }, valueType: ValueType.NUMBER, dataFormat: "#,##0" },
{ name: "pkltArea", fieldName: "pkltArea", header: { text: "주차장" }, valueType: ValueType.NUMBER, dataFormat: "#,##0" },
{ name: "eduMultiFcltArea", fieldName: "eduMultiFcltArea", header: { text: "교육 및 문화시설" }, valueType: ValueType.NUMBER, dataFormat: "#,##0" },
{ name: "wtlndMakeArea", fieldName: "wtlndMakeArea", header: { text: "습지조성(생태공원)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0" },
{ name: "etcCnt", fieldName: "etcCnt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0" },
{ name: "rmrk", fieldName: "rmrk", header: { text: "비고" } },
{ name: "statsYr", fieldName: "statsYr", header: { text: "통계연도" }, visible: false },
{ name: "admdstCd", fieldName: "admdstCd", header: { text: "행정코드" }, visible: false },
{ name: "rowType", fieldName: "rowType", header: { text: "행타입" }, visible: false },
].map((col) => ({ ...col, editable: false })),
columnLayout: [
{
name: "groupA",
hideChildHeaders: false,
header: { text: "행정구역" },
items: ["ctpvNm", "sggNm", "admdstNm"],
},
"swtrmtFcltNm",
"fcltCpct",
"tmplntArea",
{
name: "groupB",
hideChildHeaders: false,
header: { text: "주민친화시설 면적(㎡)" },
items: [
"whol",
"brkFcltArea",
"childFrshpSpacArea",
"bdySportsFcltArea",
"sportsFcltArea",
"pkltArea",
"eduMultiFcltArea",
"wtlndMakeArea",
"etcCnt",
],
},
"rmrk",
"statsYr",
"admdstCd",
"rowType",
],
rowStartNum: 2,
fixedColumns: 3,
tabKey: "ST00130002", tabKey: "ST00130002",
tabLabel: "주민친화시설", tabLabel: "주민친화시설",
rowStartNum: 3, // 행정구역 3단 헤더
fixedColumns: 1,
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: "swtrmtFcltNm", fieldName: "swtrmtFcltNm", header: { text: "처리장명" }, editable: false },
{ name: "tmplntArea", fieldName: "tmplntArea", header: { text: "처리장\n면적(㎡)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 주민친화시설 면적
{ name: "whol", fieldName: "whol", header: { text: "총계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "brkFcltArea", fieldName: "brkFcltArea", header: { text: "휴게시설" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "childFrshpSpacArea", fieldName: "childFrshpSpacArea", header: { text: "어린이놀이공간" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "bdySportsFcltArea", fieldName: "bdySportsFcltArea", header: { text: "체력단련시설" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "sportsFcltArea", fieldName: "sportsFcltArea", header: { text: "운동시설" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "pkltArea", fieldName: "pkltArea", header: { text: "주차장" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "eduMultiFcltArea", fieldName: "eduMultiFcltArea", header: { text: "교육 및\n문화시설" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "wtlndMakeArea", fieldName: "wtlndMakeArea", header: { text: "습지조성\n(생태공원)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "etcCnt", fieldName: "etcCnt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"swtrmtFcltNm", "tmplntArea",
{
name: "facilityGroup",
header: { text: "주민친화시설 면적(㎡)" },
items: ["whol", "brkFcltArea", "childFrshpSpacArea", "bdySportsFcltArea", "sportsFcltArea", "pkltArea", "eduMultiFcltArea", "wtlndMakeArea", "etcCnt"]
}
]
}; };
@@ -0,0 +1,42 @@
import { ValueType } from "realgrid";
export const DigestionTankTab2ColumnConfig = {
tabKey: "ST00110002",
tabLabel: "소화조 운영현황",
rowStartNum: 3, // 행정구역, 하수처리장명 등 기본 정보 이후 다단 헤더가 있으므로 3단 지정
fixedColumns: 1,
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: "fcltNm", fieldName: "fcltNm", header: { text: "하수\n처리장명" }, editable: false },
{ name: "digesterYn", fieldName: "digesterYn", header: { text: "소화조 유/무\n(Y/N)선택" }, editable: false },
{ name: "dsgnCpct", fieldName: "dsgnCpct", header: { text: "설계\n용량(㎥)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "actlOperCpct", fieldName: "actlOperCpct", header: { text: "실제운전\n용량(㎥)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "inputQnt", fieldName: "inputQnt", header: { text: "투입량\n(㎥/일)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "tsConc", fieldName: "tsConc", header: { text: "투입 TS 농도\n(%)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "oprtngDays", fieldName: "oprtngDays", header: { text: "가동일수\n(연간)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "gnrtGasQnt", fieldName: "gnrtGasQnt", header: { text: "발생가스량\n(㎥/일)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 소화가스 이용현황(하위 항목)
{ name: "gasTotal", fieldName: "gasTotal", header: { text: "계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "gasSale", fieldName: "gasSale", header: { text: "판매" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "gasGen", fieldName: "gasGen", header: { text: "발전" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "gasSelf", fieldName: "gasSelf", header: { text: "자체활용" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "gasEtc", fieldName: "gasEtc", header: { text: "기타(CNG등)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "surplusGas", fieldName: "surplusGas", header: { text: "잉여가스량\n(㎥/일)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"fcltNm",
{ name: "operGroup", header: { text: "소화조 운영현황" }, items: ["digesterYn", "dsgnCpct", "actlOperCpct", "inputQnt", "tsConc", "oprtngDays", "gnrtGasQnt",
{
name: "gasUsageGroup",
header: { text: "소화가스 이용현황(㎥/일)" },
items: ["gasTotal", "gasSale", "gasGen", "gasSelf", "gasEtc"]
},"surplusGas"
] },
]
};
@@ -0,0 +1,37 @@
import { ValueType } from "realgrid";
export const HumanWasteSludgeTab4ColumnConfig = {
tabKey: "ST00110004",
tabLabel: "분뇨찌꺼기(슬러지)처리현황",
rowStartNum: 2, // 행정구역 2단 레이아웃
fixedColumns: 1,
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: "fcltNm", fieldName: "fcltNm", header: { text: "분뇨\n처리장명" }, editable: false },
{ name: "gnam", fieldName: "gnam", header: { text: "발생량\n(A)=(B)+(C)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "wholDspsQnt", fieldName: "wholDspsQnt", header: { text: "계(B)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "rcycQnt", fieldName: "rcycQnt", header: { text: "재활용" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "olandLfvlm", fieldName: "olandLfvlm", header: { text: "육상매립" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "incnrQnt", fieldName: "incnrQnt", header: { text: "소각" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "oceanInputQnt", fieldName: "oceanInputQnt", header: { text: "해양투기" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "fuelQnt", fieldName: "fuelQnt", header: { text: "연료화" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "etcQnt", fieldName: "etcQnt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "nondspsQnt", fieldName: "nondspsQnt", header: { text: "미처분량\n(이월량)(C)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "swtrmtFcltNm", fieldName: "swtrmtFcltNm", header: { text: "타시설\n연계여부" }, editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"fcltNm",
"gnam",
{
name: "dspsGroup",
header: { text: "처분량" },
items: ["wholDspsQnt", "rcycQnt", "olandLfvlm", "incnrQnt", "oceanInputQnt", "fuelQnt", "etcQnt"]
},
"nondspsQnt",
"swtrmtFcltNm"
]
};
@@ -0,0 +1,30 @@
import { ValueType } from "realgrid";
export const SewageSludgeOperTab3ColumnConfig = {
tabKey: "ST00110003",
tabLabel: "하수찌꺼기 처리시설 운영현황",
rowStartNum: 2,
fixedColumns: 1,
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: "fcltNm", fieldName: "fcltNm", header: { text: "찌꺼기처리\n시설명" }, editable: false },
{ name: "prcsMthExpln", fieldName: "prcsMthExpln", header: { text: "처리방식" }, editable: false },
{ name: "fcltCpct", fieldName: "fcltCpct", header: { text: "시설용량\n(톤/일)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "anlPrcsQnt", fieldName: "anlPrcsQnt", header: { text: "연간처리량\n(톤/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "dayAvgOprtngHr", fieldName: "dayAvgOprtngHr", header: { text: "일평균\n가동시간\n(1~24)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "anlOprtngDayCnt", fieldName: "anlOprtngDayCnt", header: { text: "연중 가동일\n(1~330)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "oprtngRt", fieldName: "oprtngRt", header: { text: "가동율(%)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"fcltNm",
{
name: "operStatusGroup",
header: { text: "처리시설 운영현황" },
items: ["prcsMthExpln", "fcltCpct", "anlPrcsQnt", "dayAvgOprtngHr", "anlOprtngDayCnt", "oprtngRt"]
}
]
};
@@ -0,0 +1,103 @@
import { ValueType } from "realgrid";
export const SludgeProcessingTab1ColumnConfig = {
tabKey: "ST00110001",
tabLabel: "찌꺼기(슬러지)처리시설현황",
rowStartNum: 4, // 3단 그룹 대단위 레이아웃 명세이므로 4로 바인딩합니다.
fixedColumns: 1,
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: "fcltNm", fieldName: "fcltNm", header: { text: "하수\n처리장명" }, editable: false },
// 찌꺼기발생량
{ name: "gnamWhol", fieldName: "gnamWhol", header: { text: "합계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "itslfQnt", fieldName: "itslfQnt", header: { text: "자체" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "otsdInflwQnt", fieldName: "otsdInflwQnt", header: { text: "외부유입량" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 이송 및 함수율 지표들
{ name: "transfTmplntNm", fieldName: "transfTmplntNm", header: { text: "이송처리장" }, editable: false },
{ name: "transfPrcsQnt", fieldName: "transfPrcsQnt", header: { text: "이송처리량\n(㎥/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "srpFncRt", fieldName: "srpFncRt", header: { text: "함수율\n(%, 탈수기준)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "wholSrpPrcsQnt", fieldName: "wholSrpPrcsQnt", header: { text: "찌꺼기\n처리량 합계\n(톤/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 자체 처리 1차 대문 항목들
{ name: "itslfTs1Whol", fieldName: "itslfTs1Whol", header: { text: "자체찌꺼기\n처리량 소계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "itslfTs1RclmQnt", fieldName: "itslfTs1RclmQnt", header: { text: "매립" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
// 소각 후 처리(2차) 서브 항목들
{ name: "itslfTs1IncnrQnt", fieldName: "itslfTs1IncnrQnt", header: { text: "소각" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "incnrPrcsWhol", fieldName: "incnrPrcsWhol", header: { text: "소계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "incnrPrcsLfvlm", fieldName: "incnrPrcsLfvlm", header: { text: "매립" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "incnrPrcsPrdctRmtrlQnt", fieldName: "incnrPrcsPrdctRmtrlQnt", header: { text: "제품원료" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "incnrPrcsFmlyrQnt", fieldName: "incnrPrcsFmlyrQnt", header: { text: "복토재" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "incnrPrcsFcltNm", fieldName: "incnrPrcsFcltNm", header: { text: "시설(업체명)" }, editable: false },
// 고화 처리군
{ name: "itslfTs1AltdQnt", fieldName: "itslfTs1AltdQnt", header: { text: "고화" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "stbznPrcsWhol", fieldName: "stbznPrcsWhol", header: { text: "소계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "stbznPrcsLfvlm", fieldName: "stbznPrcsLfvlm", header: { text: "매립" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "stbznPrcsFmlyrQnt", fieldName: "stbznPrcsFmlyrQnt", header: { text: "복토재" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "stbznPrcsFcltNm", fieldName: "stbznPrcsFcltNm", header: { text: "시설(업체명)" }, editable: false },
// 건조 처리군
{ name: "itslfTs1DryQnt", fieldName: "itslfTs1DryQnt", header: { text: "건조" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "dryPrcsWhol", fieldName: "dryPrcsWhol", header: { text: "소계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "dryPrcsLfvlm", fieldName: "dryPrcsLfvlm", header: { text: "매립" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "dryPrcsIncnrQnt", fieldName: "dryPrcsIncnrQnt", header: { text: "소각" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "dryPrcsFuelQnt", fieldName: "dryPrcsFuelQnt", header: { text: "연료" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "dryPrcsPrdctRmtrlQnt", fieldName: "dryPrcsPrdctRmtrlQnt", header: { text: "제품원료" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "dryPrcsFmlyrQnt", fieldName: "dryPrcsFmlyrQnt", header: { text: "복토재" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "dryPrcsCmpstgQnt", fieldName: "dryPrcsCmpstgQnt", header: { text: "퇴비화" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "dryPrcsFcltNm", fieldName: "dryPrcsFcltNm", header: { text: "시설(업체명)" }, editable: false },
// 탄화 처리군
{ name: "itslfTs1FuelQnt", fieldName: "itslfTs1FuelQnt", header: { text: "탄화" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "fuelPrcsWhol", fieldName: "fuelPrcsWhol", header: { text: "소계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "fuelPrcsIncnrQnt", fieldName: "fuelPrcsIncnrQnt", header: { text: "소각" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "fuelPrcsFuelQnt", fieldName: "fuelPrcsFuelQnt", header: { text: "연료" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "fuelPrcsFcltNm", fieldName: "fuelPrcsFcltNm", header: { text: "시설(업체명)" }, editable: false },
// 퇴비화 독립군
{ name: "itslfTs1CmpstgQnt", fieldName: "itslfTs1CmpstgQnt", header: { text: "퇴비화" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "cmpsPrcsFcltBzentyNm", fieldName: "cmpsPrcsFcltBzentyNm", header: { text: "시설(업체명)" }, editable: false },
// 외부(민간) 위탁 처리현황
{ name: "otsdCnsgnWhol", fieldName: "otsdCnsgnWhol", header: { text: "소계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "otsdCnsgnRclmQnt", fieldName: "otsdCnsgnRclmQnt", header: { text: "매립" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "otsdCnsgnIncnrQnt", fieldName: "otsdCnsgnIncnrQnt", header: { text: "소각" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "otsdCnsgnFuelPwplQnt", fieldName: "otsdCnsgnFuelPwplQnt", header: { text: "연료" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "otsdCnsgnPrdctRmtrlQnt", fieldName: "otsdCnsgnPrdctRmtrlQnt", header: { text: "제품원료" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "otsdCnsgnFmlyrQnt", fieldName: "otsdCnsgnFmlyrQnt", header: { text: "복토재" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "otsdCnsgnCmpstgQnt", fieldName: "otsdCnsgnCmpstgQnt", header: { text: "퇴비화" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "otsdCnsgnFcltNm", fieldName: "otsdCnsgnFcltNm", header: { text: "시설(업체명)" }, editable: false },
// 수도권 광역 위탁 처리량
{ name: "cparTs2Whol", fieldName: "cparTs2Whol", header: { text: "수도권광역\n위탁처리량\n(톤/년)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }
],
columnLayout: [
{ name: "areaGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"fcltNm",
{ name: "gnamGroup", header: { text: "찌꺼기발생량(톤/년, 탈수기준)" }, items: ["gnamWhol", "itslfQnt", "otsdInflwQnt"] },
"transfTmplntNm", "transfPrcsQnt", "srpFncRt", "wholSrpPrcsQnt",
{
name: "itslfProcessingGroup",
header: { text: "자체 찌꺼기 처리량 현황(톤/년)" },
items: [
"itslfTs1Whol", "itslfTs1RclmQnt","itslfTs1IncnrQnt",
{ name: "incnrGroup", header: { text: "소각 후 처리(2차)" }, items: ["incnrPrcsWhol", "incnrPrcsLfvlm", "incnrPrcsPrdctRmtrlQnt", "incnrPrcsFmlyrQnt", "incnrPrcsFcltNm"] },
"itslfTs1AltdQnt",
{ name: "stbznGroup", header: { text: "고화 후 처리(2차)" }, items: [ "stbznPrcsWhol", "stbznPrcsLfvlm", "stbznPrcsFmlyrQnt", "stbznPrcsFcltNm"] },
"itslfTs1DryQnt",
{ name: "dryGroup", header: { text: "건조 후 처리(2차)" }, items: ["dryPrcsWhol", "dryPrcsLfvlm", "dryPrcsIncnrQnt", "dryPrcsFuelQnt", "dryPrcsPrdctRmtrlQnt", "dryPrcsFmlyrQnt", "dryPrcsCmpstgQnt", "dryPrcsFcltNm"] },
"itslfTs1FuelQnt",
{ name: "fuelGroup", header: { text: "탄화 후 처리(2차)" }, items: ["fuelPrcsWhol", "fuelPrcsIncnrQnt", "fuelPrcsFuelQnt", "fuelPrcsFcltNm"] },
"itslfTs1CmpstgQnt",
{ name: "cmpsGroup", header: { text: "퇴비화" }, items: ["cmpsPrcsFcltBzentyNm"] }
]
},
{ name: "otsdGroup", header: { text: "외부(민간) 위탁 처리량(톤/년)" }, items: ["otsdCnsgnWhol", "otsdCnsgnRclmQnt", "otsdCnsgnIncnrQnt", "otsdCnsgnFuelPwplQnt", "otsdCnsgnPrdctRmtrlQnt", "otsdCnsgnFmlyrQnt", "otsdCnsgnCmpstgQnt", "otsdCnsgnFcltNm"] },
"cparTs2Whol"
]
};
@@ -0,0 +1,45 @@
import type { ColumnConfig } from "@/components/type/DataGrid.type";
import type { GridView } from "realgrid";
export type ExcelExportVisibilitySnapshot = Map<string, boolean>;
/** 엑셀보내기 직전: 제외 컬럼 숨김, 그리드용 숨김(visible:false) 컬럼은 export에만 표시 */
export function prepareGridColumnsForExcelExport(
gridView: GridView,
columns: ColumnConfig[],
): ExcelExportVisibilitySnapshot {
const excludedNames = new Set(
columns.filter((c) => c.excludeFromExcelExport).map((c) => c.name),
);
const snapshot = new Map<string, boolean>();
columns.forEach((col) => {
const gridCol = gridView.columnByName?.(col.name);
if (!gridCol) return;
const wasVisible = gridCol.visible !== false;
snapshot.set(col.name, wasVisible);
if (excludedNames.has(col.name)) {
gridCol.visible = false;
} else if (col.visible === false) {
gridCol.visible = true;
}
});
return snapshot;
}
export function restoreGridColumnsAfterExcelExport(
gridView: GridView,
snapshot: ExcelExportVisibilitySnapshot,
): void {
snapshot.forEach((visible, name) => {
const gridCol = gridView.columnByName?.(name);
if (gridCol) gridCol.visible = visible;
});
}
export function shouldPrepareColumnsForExcelExport(columns: ColumnConfig[]): boolean {
return columns.some((c) => c.excludeFromExcelExport || c.visible === false);
}
@@ -5,6 +5,8 @@ import {
type ApiResponse, type ApiResponse,
type cancelSubmitRequest, type cancelSubmitRequest,
type cancelSubmitResponse, type cancelSubmitResponse,
type CheckStatusCodeRequest,
type CheckStatusCodeResponse,
type getReviewOpinionDetailRequest, type getReviewOpinionDetailRequest,
type getReviewOpinionDetailResponse, type getReviewOpinionDetailResponse,
type ImrRequest, type ImrRequest,
@@ -21,6 +23,8 @@ import {
type ReviewSubmitResponse, type ReviewSubmitResponse,
type SearchCondition, type SearchCondition,
type Sgg, type Sgg,
type StatiscicsExceptionResetRequest,
type StatiscicsExceptionResetResponse,
type StatiscicsManagementReviewHistoryRequest, type StatiscicsManagementReviewHistoryRequest,
type StatiscicsManagementReviewHistoryResponse, type StatiscicsManagementReviewHistoryResponse,
type StatisticsColumnGuideListResponse, type StatisticsColumnGuideListResponse,
@@ -43,6 +47,8 @@ import {
type SubmitExceptionResponse, type SubmitExceptionResponse,
type SubmitVerifyExceptionRequest, type SubmitVerifyExceptionRequest,
type SubmitVerifyExceptionResponse, type SubmitVerifyExceptionResponse,
type unSubmitDataRequest,
type unSubmitDataResponse,
type VerificationResultListRequest, type VerificationResultListRequest,
type VerificationResultListResponse, type VerificationResultListResponse,
} from "../model/statistics-interface"; } from "../model/statistics-interface";
@@ -142,7 +148,7 @@ export class StatisticsApiService implements StatisticsService {
public async getImrStatus(param: string): Promise<ImrStatusResponse> { public async getImrStatus(param: string): Promise<ImrStatusResponse> {
const response = await client.get<ImrStatusResponse>( const response = await client.get<ImrStatusResponse>(
`${ENDPOINT.STATVERIFY_SERVICE.IMR}/status/${param}`, `${ENDPOINT.STATVERIFY_SERVICE.IMR}/status/${param}`,
); );
return response.data; return response.data;
} }
@@ -311,6 +317,30 @@ export class StatisticsApiService implements StatisticsService {
); );
return response.data; return response.data;
} }
public async StatiscicsExceptionReset(param: StatiscicsExceptionResetRequest): Promise<StatiscicsExceptionResetResponse> {
const response = await stClient.put<StatiscicsExceptionResetResponse>(
`${ENDPOINT.ST_SERVICE.INPUTVERIFY}/results/exception/reset`,
param,
);
return response.data;
}
public async CheckStatusCode(param: CheckStatusCodeRequest): Promise<CheckStatusCodeResponse> {
const response = await stClient.get<CheckStatusCodeResponse>(
`${ENDPOINT.ST_SERVICE.INPUTCOMMON}/status-code`,
{ params: param },
);
return response.data;
}
public async getUnSubmitData(param: unSubmitDataRequest): Promise<unSubmitDataResponse> {
const response = await stClient.get<unSubmitDataResponse>(
`${ENDPOINT.ST_SERVICE.DASHBOARD}/submission-status`,
{ params: param },
);
return response.data;
}
} }
export const statisticsApi = new StatisticsApiService(); export const statisticsApi = new StatisticsApiService();

Some files were not shown because too many files have changed in this diff Show More