Files
frontend/apps/wr/app/store/stats/rswtStat/excel.tsx
T
2025-09-15 16:23:47 +09:00

50 lines
1.6 KiB
TypeScript

import type { SelectDataType } from "@common/business_components/ui";
import type { RswtStatProps } from ".";
export const excelRswtStat = (excelList: RswtStatProps[], rswtBdstType : SelectDataType[] ) : (string | number)[][] => {
console.log('bdstUsgCd ', rswtBdstType)
const excelData: (string | number)[][] = [];
excelList.forEach((item) => {
excelData.push([
//시도
String(item.ctpvCd) ?? "",
//시군구
String(item.sggCd) ?? "",
//행정구역명
String(item.areaNm) ?? "",
//건축물명
String(item.bdstNm) ?? "",
//건축물용도코드(빈칸)
//String(item.bdstUsgCd) ?? "",
rswtBdstType?.find((cd)=> cd.val === item.bdstUsgCd.toString())?.text ?? "", //건축물용도
//주소
String(item.daddr) ?? "",
//법적의무대상여부
String(item.lawTrgtYn)==="Y" ? "대상" : "미대상",
//설치완료일자
item.instlCmptnDt ? String(item.instlCmptnDt).substring(0, 10) : "",
//가동개시일(빈칸)
//String(item.instlCst) ?? "",
"",
//건축물면적
// item.archArea ?? "",
//처리용량
item.filtrTrtmfctCpct ?? "",
//물사용량
item.wtrUsqty ?? "",
//중수도+대체수이용량
item.rswtAltSum ?? "",
//중수도이용량
item.rswtrUsqty ?? "",
//대체수이용량
item.altUswtrUtztnQnt ?? "",
//중수도용도
String(item.utztnUsgCd) ?? "",
//연간운영비
item.anlOperCst ?? "",
]);
});
return excelData;
}