367 lines
13 KiB
TypeScript
367 lines
13 KiB
TypeScript
import { ValueType } from "realgrid";
|
|
|
|
import type { GridView } from "@/components/type/DataGrid.type";
|
|
import {
|
|
footerAvgDecimalArrayByDivision,
|
|
footerDecimal1ArrayByDivision,
|
|
footerDecimal2ArrayByDivision,
|
|
footerIntArrayByDivision,
|
|
} from "@/components/util/grid/footerSummary";
|
|
|
|
const getDivisionFooterLabel = (grid: GridView, divisionIndex: number, withSuffix: boolean) => {
|
|
const dataSource = grid.getDataSource();
|
|
const uniqueValues = new Set<string>();
|
|
|
|
for (let i = 0; i < dataSource.getRowCount(); i++) {
|
|
const val = dataSource.getValue(i, "displayYear");
|
|
if (val) uniqueValues.add(String(val));
|
|
}
|
|
|
|
const divisionValues = Array.from(uniqueValues);
|
|
if (divisionValues.length <= divisionIndex) {
|
|
return withSuffix ? "합계" : "";
|
|
}
|
|
|
|
const label = divisionValues[divisionIndex] ?? "";
|
|
return withSuffix ? `${label}합계` : label;
|
|
};
|
|
|
|
const divisionFooterCallbacks = [
|
|
{ valueCallback: (grid: GridView) => getDivisionFooterLabel(grid, 0, true) },
|
|
{ valueCallback: (grid: GridView) => getDivisionFooterLabel(grid, 1, true) },
|
|
];
|
|
|
|
const divisionFooterLabelOnly = [
|
|
{ valueCallback: (grid: GridView) => getDivisionFooterLabel(grid, 0, false) },
|
|
{ valueCallback: (grid: GridView) => getDivisionFooterLabel(grid, 1, false) },
|
|
];
|
|
|
|
const reviewFacilityAddressColumns = [
|
|
{
|
|
name: "ctpvNm",
|
|
fieldName: "ctpvNm",
|
|
header: { text: "시도" },
|
|
mergeCells: true,
|
|
sortdisable: true,
|
|
footer: divisionFooterCallbacks,
|
|
},
|
|
{
|
|
name: "sggNm",
|
|
fieldName: "sggNm",
|
|
header: { text: "시군구" },
|
|
mergeCells: true,
|
|
sortdisable: true,
|
|
},
|
|
{
|
|
name: "displayYear",
|
|
fieldName: "displayYear",
|
|
header: { text: "구분" },
|
|
sortdisable: true,
|
|
footer: divisionFooterLabelOnly,
|
|
},
|
|
];
|
|
|
|
const reviewFacilityAddressLayout = {
|
|
name: "areaGroup",
|
|
header: { text: "행정구역" },
|
|
items: [
|
|
{ column: "ctpvNm", footerUserSpans: [{ colspan: 3 }, { colspan: 3 }] },
|
|
"sggNm",
|
|
],
|
|
};
|
|
|
|
const textCol = (name: string, header: string) => ({
|
|
name,
|
|
fieldName: name,
|
|
header: { text: header },
|
|
});
|
|
|
|
const decimal1Col = (name: string, header: string) => ({
|
|
name,
|
|
fieldName: name,
|
|
header: { text: header },
|
|
footer: footerDecimal1ArrayByDivision,
|
|
valueType: ValueType.NUMBER,
|
|
numberFormat: "#,##0.0",
|
|
});
|
|
|
|
const decimal2Col = (name: string, header: string) => ({
|
|
name,
|
|
fieldName: name,
|
|
header: { text: header },
|
|
footer: footerDecimal2ArrayByDivision,
|
|
valueType: ValueType.NUMBER,
|
|
numberFormat: "#,##0.00",
|
|
});
|
|
|
|
const intCol = (name: string, header: string) => ({
|
|
name,
|
|
fieldName: name,
|
|
header: { text: header },
|
|
footer: footerIntArrayByDivision,
|
|
valueType: ValueType.NUMBER,
|
|
numberFormat: "#,##0",
|
|
});
|
|
|
|
// 하수도 통계 검토 10. 물 재이용
|
|
const rawWaterReuseList = [
|
|
{
|
|
tabKey: "ST00100001",
|
|
tabLabel: "공공하수처리수 재이용",
|
|
rowStartNum: 4,
|
|
fixedColumns: 2,
|
|
columns: [
|
|
...reviewFacilityAddressColumns,
|
|
textCol("swtrmtFcltNm", "시설명"),
|
|
textCol("sncnYmd", "인가일\n(년/월/일)"),
|
|
decimal1Col("prcsFcltCpct", "시설용량\n(㎥/일)"),
|
|
decimal1Col("prcsQnt", "연간\n하수처리량\n(천톤/년)"),
|
|
textCol("lglYn", "법적의무대상\n(대상/미대상)"),
|
|
textCol("instlYn", "설치유무\n(유/무)"),
|
|
textCol("oprtngStrtYmd", "가동개시일\nyyyy-mm-dd"),
|
|
textCol("instlAprvYmd", "설치승인일\nyyyy-mm-dd"),
|
|
decimal1Col("rprcsFcltCpct", "용량(톤/일)"),
|
|
textCol("mtcnsNm", "공법/기자재"),
|
|
decimal2Col("ruswtPplLen", "공급관로길이\n(km)"),
|
|
decimal1Col("ruswtPumpLen", "공급펌프\n(톤/일)"),
|
|
decimal1Col("wholUseQnt", "총계"),
|
|
decimal1Col("ithlWshwtrQnt", "계"),
|
|
decimal1Col("ithlClnQty", "세척수"),
|
|
decimal1Col("ithlFrzgQty", "냉각수"),
|
|
decimal1Col("ithlLdhcUswtrQnt", "청소수"),
|
|
decimal1Col("ithlDltnUswtrQnt", "조경용수"),
|
|
decimal1Col("ithlRuswtrQnt", "희석용수"),
|
|
decimal1Col("ithlEtcQnt", "장내중수도"),
|
|
decimal1Col("ruswtIthlEtcUswqty", "장내기타용수"),
|
|
decimal1Col("otcntrUswtrWhol", "계"),
|
|
decimal1Col("otcntrClnToiletQnt", "청소·화장실\n용수"),
|
|
decimal1Col("otcntrWshwtrQnt", "세척·살수용수"),
|
|
decimal1Col("otcntrLdhcUswtrQnt", "조경용수"),
|
|
decimal1Col("otcntrHdrplUswtrQnt", "친수용수"),
|
|
decimal1Col("otcntrRvrKeepQnt", "하천등 유지용수"),
|
|
decimal1Col("agrcltUswtrPstnQnt", "농업용수"),
|
|
decimal1Col("ugwtrChargQnt", "지하수충전"),
|
|
decimal1Col("iwtrQnt", "공업용수"),
|
|
{
|
|
name: "rtlztnRt",
|
|
fieldName: "rtlztnRt",
|
|
header: { text: "재이용률\n(%)" },
|
|
footer: footerAvgDecimalArrayByDivision,
|
|
valueType: ValueType.NUMBER,
|
|
numberFormat: "#,##0.0",
|
|
},
|
|
textCol("rmrk", "비고"),
|
|
],
|
|
columnLayout: [
|
|
reviewFacilityAddressLayout,
|
|
"displayYear",
|
|
{
|
|
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",
|
|
"ruswtIthlEtcUswqty",
|
|
],
|
|
},
|
|
{
|
|
name: "externalWaterGroup",
|
|
header: { text: "장 외 용 수" },
|
|
items: [
|
|
"otcntrUswtrWhol",
|
|
"otcntrClnToiletQnt",
|
|
"otcntrWshwtrQnt",
|
|
"otcntrLdhcUswtrQnt",
|
|
"otcntrHdrplUswtrQnt",
|
|
"otcntrRvrKeepQnt",
|
|
"agrcltUswtrPstnQnt",
|
|
"ugwtrChargQnt",
|
|
"iwtrQnt",
|
|
],
|
|
},
|
|
],
|
|
},
|
|
"rtlztnRt",
|
|
"rmrk",
|
|
],
|
|
},
|
|
{
|
|
tabKey: "ST00100002",
|
|
tabLabel: "중수도 현황",
|
|
rowStartNum: 2,
|
|
fixedColumns: 2,
|
|
columns: [
|
|
...reviewFacilityAddressColumns,
|
|
textCol("fcltNm", "건축물명/\n개발사업명"),
|
|
textCol("bldgSeCn", "시설물용도/\n개발사업종류"),
|
|
textCol("fcltPstnCn", "주소"),
|
|
textCol("lglTrgtYn", "법적의무\n대상여부\n(대상/미대상)"),
|
|
textCol("cmptnStrtYmd", "설치완료일\nyyyy-mm-dd"),
|
|
textCol("oprtngStrtYmd", "가동개시일\nyyyy-mm-dd"),
|
|
intCol("archWhlar", "건축연면적\n(㎡)"),
|
|
decimal1Col("prcsCpct", "처리용량\n(㎥/일)"),
|
|
intCol("ruswtrWtrUsqty", "물 사용량\n(㎥/년)"),
|
|
intCol("ruswtrUtztnQnt", "중수도\n이용량\n(㎥/년)"),
|
|
intCol("sbstCntUtztnQnt", "대체수\n이용량\n(㎥/년)"),
|
|
textCol("ruswtrUsgCn", "중수도용도"),
|
|
decimal1Col("ruswtrOperAmt", "연간운영비\n(백만원/년)"),
|
|
textCol("rmrk", "비고"),
|
|
],
|
|
columnLayout: [
|
|
reviewFacilityAddressLayout,
|
|
"displayYear",
|
|
"fcltNm",
|
|
"bldgSeCn",
|
|
"fcltPstnCn",
|
|
"lglTrgtYn",
|
|
"cmptnStrtYmd",
|
|
"oprtngStrtYmd",
|
|
{
|
|
name: "facilityStatusGroup",
|
|
header: { text: "시설현황" },
|
|
items: ["archWhlar", "prcsCpct"],
|
|
},
|
|
"ruswtrWtrUsqty",
|
|
"ruswtrUtztnQnt",
|
|
"sbstCntUtztnQnt",
|
|
"ruswtrUsgCn",
|
|
"ruswtrOperAmt",
|
|
"rmrk",
|
|
],
|
|
},
|
|
{
|
|
tabKey: "ST00100003",
|
|
tabLabel: "빗물이용시설 현황",
|
|
rowStartNum: 2,
|
|
fixedColumns: 2,
|
|
columns: [
|
|
...reviewFacilityAddressColumns,
|
|
textCol("fcltNm", "시설명"),
|
|
textCol("bdstSeCn", "건축물용도"),
|
|
textCol("fcltPstnCn", "위치\n(주소)"),
|
|
textCol("lglTrgtYn", "법적의무\n대상여부\n(대상/미대상)"),
|
|
textCol("instlCmptnYmd", "설치완료일\nyyyy-mm-dd"),
|
|
decimal1Col("fcltInstlAmt", "설치비\n(백만원)"),
|
|
textCol("rcptKndCn", "집수면 종류"),
|
|
textCol("filtrPrcsFcltExpln", "여과등\n처리시설\n유무"),
|
|
decimal1Col("fcltRtntnkCpct", "저류조 용량\n(㎥)"),
|
|
intCol("anlUseQnt", "연간 이용량\n(㎥/년)"),
|
|
textCol("exlnUtlzUsgExpln", "이용용도"),
|
|
decimal1Col("anlOperAmt", "연간운영비\n(백만원/년)"),
|
|
textCol("rmrk", "비고"),
|
|
],
|
|
columnLayout: [
|
|
reviewFacilityAddressLayout,
|
|
"displayYear",
|
|
"fcltNm",
|
|
"bdstSeCn",
|
|
"fcltPstnCn",
|
|
"lglTrgtYn",
|
|
"instlCmptnYmd",
|
|
"fcltInstlAmt",
|
|
"rcptKndCn",
|
|
"filtrPrcsFcltExpln",
|
|
"fcltRtntnkCpct",
|
|
"anlUseQnt",
|
|
"exlnUtlzUsgExpln",
|
|
"anlOperAmt",
|
|
"rmrk",
|
|
],
|
|
},
|
|
{
|
|
tabKey: "ST00100004",
|
|
tabLabel: "하ㆍ폐수처리수 재이용시설 시공업 등록현황",
|
|
rowStartNum: 2,
|
|
fixedColumns: 2,
|
|
columns: [
|
|
...reviewFacilityAddressColumns,
|
|
textCol("bplcNm", "상호(명칭)"),
|
|
textCol("rprsvNm", "대표자"),
|
|
textCol("bplcPstnCn", "주소"),
|
|
textCol("coRegYmd", "등록일\nyyyy-mm-dd"),
|
|
textCol("rmrk", "비고"),
|
|
],
|
|
columnLayout: [
|
|
reviewFacilityAddressLayout,
|
|
"displayYear",
|
|
"bplcNm",
|
|
"rprsvNm",
|
|
"bplcPstnCn",
|
|
"coRegYmd",
|
|
"rmrk",
|
|
],
|
|
},
|
|
{
|
|
tabKey: "ST00100005",
|
|
tabLabel: "하ㆍ폐수처리수 재이용시설 시공업 인가현황",
|
|
rowStartNum: 2,
|
|
fixedColumns: 2,
|
|
columns: [
|
|
...reviewFacilityAddressColumns,
|
|
textCol("bplcNm", "상호(명칭)"),
|
|
textCol("rprsvNm", "대표자"),
|
|
textCol("bplcPstnCn", "주소"),
|
|
textCol("coRegYmd", "인가일\n(년/월/일)"),
|
|
textCol("rmrk", "비고"),
|
|
],
|
|
columnLayout: [
|
|
reviewFacilityAddressLayout,
|
|
"displayYear",
|
|
"bplcNm",
|
|
"rprsvNm",
|
|
"bplcPstnCn",
|
|
"coRegYmd",
|
|
"rmrk",
|
|
],
|
|
},
|
|
];
|
|
|
|
export const WaterReuseInfoListRvw = rawWaterReuseList.map((tab) => ({
|
|
...tab,
|
|
columns: tab.columns.map((col) => ({
|
|
...col,
|
|
editable: false,
|
|
styleName: "rg-cell-readonly",
|
|
})),
|
|
}));
|
|
|
|
/** @deprecated `WaterReuseInfoListRvw` 사용 */
|
|
export const WaterReuseInfoList = WaterReuseInfoListRvw;
|