diff --git a/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx index c80d5b4b4..c6056a3cc 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx @@ -1,6 +1,10 @@ "use client"; import { useWrStore } from "@/app/store"; +import type { customHtdflBdst } from "@/app/store/ruseFcltMng/fcltReg/htdflReg"; +import { tableData } from "@/components/lib/func/commom"; +import HtdflRegForm from "@/components/ui/form/fcltReg/htdflReg/htdflRegForm"; +import { BdstReg } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal"; import { ContentsDiv, ScrollArea, @@ -12,15 +16,9 @@ import { UiModal, UiTable, } from "@common/business_components"; -import { Button } from "@common/components"; import ListDiv from "@common/business_components/ui/list_div"; +import { Button } from "@common/components"; import { useEffect, useState } from "react"; -import { tableData } from "@/components/lib/func/commom"; -import HtdflRegForm from "@/components/ui/form/fcltReg/htdflReg/htdflRegForm"; -import type { chgBuilding } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; -import BdstChgModal from "@/components/ui/modal/fcltReg/bdstChgModal/bdstChgModal"; -import type { customHtdflBdst } from "@/app/store/ruseFcltMng/fcltReg/htdflReg"; -import { BdstReg } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal"; import { Toaster } from "react-hot-toast"; export default function Home() { @@ -33,10 +31,10 @@ export default function Home() { const [bdstTable, setbdstTable] = useState(); const [issNewReg, setIsNewReg] = useState(false); - const [bdstChgProps, setBdstChgProps] = useState<{ - isOpen: boolean; - chgBuilding: chgBuilding[]; - }>({ isOpen: false, chgBuilding: [] }); + // const [bdstChgProps, setBdstChgProps] = useState<{ + // isOpen: boolean; + // chgBuilding: chgBuilding[]; + // }>({ isOpen: false, chgBuilding: [] }); const { htdflRes ,htdflResCount} = htdfl; @@ -49,7 +47,7 @@ export default function Home() { if (htdflRes && htdflRes.length > 0) { const htdflData = tableData(htdflRes, { code }).map( (item: customHtdflBdst) => { - let archArea = + const archArea = item?.archArea.split(".")[0] !== "-1" ? item?.archArea.split(".")[0] : "확인불가"; @@ -67,8 +65,7 @@ export default function Home() { }, [code, htdflRes]); const cellClick: (val: number | undefined, headId: string) => void = ( - val, - headId + val ) => { if ((bdstTable ?? []).length > 0 && val !== undefined) { { diff --git a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx index 426ca7f61..83679a274 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx @@ -52,7 +52,7 @@ export default function Home() { if (rainRes && rainRes.length > 0) { const rainData = tableData(rainRes, { code }).map( (item: customRainBdst) => { - let archArea = + const archArea = item?.archArea.split(".")[0] !== "-1" ? item?.archArea.split(".")[0] : "확인불가"; @@ -117,7 +117,7 @@ export default function Home() { - diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/excel.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/excel.tsx index 1ae5f56cc..18e045025 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/excel.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/excel.tsx @@ -2,7 +2,7 @@ import type { SelectDataType } from "@common/business_components/ui"; import type { customHtdflBdst } from "../../fcltReg/htdflReg"; export const excelHtdflSttnParsing = ( - excel: customHtdflBdst[], + excel: { data: customHtdflBdst[] }, sidoCode: SelectDataType[], sggCode: SelectDataType[] ): string[][] => { diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/index.tsx index fb264f669..d62ee3340 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/index.tsx @@ -1,12 +1,12 @@ import type { CommonTableProps } from "@/app/store/common/type/header"; -import { htdflSttHeadListExport, htdflSttNodeListExport } from "./headList"; -import type { sttnHeadListType } from "../rainSttn/headList"; -import type { z } from "zod"; -import { controlHeadView } from "../rainSttn"; -import type { customHtdflBdst } from "../../fcltReg/htdflReg"; -import { fetchType, getFetch, getFetchWithCount } from "@/components/lib/api"; +import { fetchType, getFetchWithCount } from "@/components/lib/api"; import type { SelectDataType } from "@common/business_components/ui"; +import type { z } from "zod"; +import type { customHtdflBdst } from "../../fcltReg/htdflReg"; +import { controlHeadView } from "../rainSttn"; +import type { sttnHeadListType } from "../rainSttn/headList"; import { excelHtdflSttnParsing } from "./excel"; +import { htdflSttHeadListExport, htdflSttNodeListExport } from "./headList"; const htdflSttHeadList = htdflSttHeadListExport; const htdflSttNodeList = htdflSttNodeListExport; @@ -45,9 +45,7 @@ export const htdflSttnStateExport: htdflSttnState = { htdflSttnResCount: 1, }, }; -const initFetch = async (page: number, total: string, con: string, txt: string, - sidoCode: SelectDataType[], - sggCode: SelectDataType[]) => { +const initFetch = async (page: number, total: string, con: string, txt: string) => { const htdflRes = await getFetchWithCount( "wr", `/drain/facilityList` + @@ -68,7 +66,7 @@ export const htdflSttnActionsExport: (set: any) => htdflSttnActions = ( sidoCode: SelectDataType[], sggCode: SelectDataType[]) => { try { - const htdflSttnRes = await initFetch(page, total, con, txt, sidoCode, sggCode); + const htdflSttnRes = await initFetch(page, total, con, txt); if (isExcel) { const htdflExcel = excelHtdflSttnParsing(htdflSttnRes, sidoCode, sggCode); set((state: htdflSttnState) => { diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/excel.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/excel.tsx index d2e39aa28..367106e58 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/excel.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/excel.tsx @@ -2,7 +2,7 @@ import type { SelectDataType } from "@common/business_components/ui"; import type { customRainBdst } from "../../fcltReg/rainReg"; export const excelRainSttnParsing = ( - excel: customRainBdst[], + excel: { data: customRainBdst[] }, sidoCode: SelectDataType[], sggCode: SelectDataType[] ): string[][] => { @@ -10,8 +10,8 @@ export const excelRainSttnParsing = ( excel.data.forEach((item) => { excelExportData.push([ - sidoCode.find((sido) => sido.val === item.ctpvCd.toString())?.text ?? "", - sggCode.find((sgg) => sgg.val === item.sggCd.toString())?.text ?? "", + sidoCode.find((sido) => sido.val === item.ctpvCd?.toString())?.text ?? "", + sggCode.find((sgg) => sgg.val === item.sggCd?.toString())?.text ?? "", item.bdstNm ?? "", item.daddr ?? "", String(item.bdstInfoPk ?? ""), diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/excel.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/excel.tsx index 442b027e3..803dc2d83 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/excel.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/excel.tsx @@ -1,15 +1,15 @@ +import { bdstUsgCd } from "@/app/store/common/code/basicCode"; import type { SelectDataType } from "@common/business_components/ui"; import type { customRswtBdst } from "../../fcltReg/rswtReg"; -import { useWrStore } from "@/app/store"; -import { bdstUsgCd } from "@/app/store/common/code/basicCode"; export const excelRSwtSttnParsing = ( - excel: customRswtBdst[], + excel: { data: customRswtBdst[] }, sidoCode: SelectDataType[], sggCode: SelectDataType[] ): string[][] => { const excelExportData: string[][] = []; excel.data.forEach((item) => { + console.log("item", item) excelExportData.push([ sidoCode.find((sido) => sido.val === item.ctpvCd.toString())?.text ?? "", sggCode.find((sgg) => sgg.val === item.sggCd.toString())?.text ?? "", @@ -18,10 +18,10 @@ export const excelRSwtSttnParsing = ( bdstUsgCd.find((cd)=> cd.val === item.reuseBuilding?.[0]?.bdstUsgCd.toString())?.text ?? "", //건축물용도 String(item.frstArchPrmsnDt ?? ""), String(item.archArea.split('.')[0] === '-1' ? '확인불가' : item.archArea.split('.')[0]), - String(item.reuseBuilding?.[0]?.rswtrObj.wtrUsqty ?? "0"), //물사용량 + // String(item.reuseBuilding?.[0]?.rswtrObj.wtrUsqty ?? "0"), //물사용량 String(item.chgBuilding.length > 0 ? "Y" : "N"), //중축・개축・재축여부 String(item.reuseBuilding?.[0]?.lawTrgtYn ?? ""), //법적의무대상여부 - String(item.reuseBuilding?.[0]?.rswtrObj.oblgTrgtWtrUsqty ?? ""), //의무대상물사용량 + // String(item.reuseBuilding?.[0]?.rswtrObj.oblgTrgtWtrUsqty ?? ""), //의무대상물사용량 String(item.reuseBuilding?.[0]?.instlCmptnDt ?? ""), //설치완료일시 String(item.reuseBuilding?.[0]?.instlCst === -1 ? "확인불가" : item.reuseBuilding?.[0]?.instlCst ?? ""), //설치비용 item.reuseBuilding?.[0]?.rswtrObj?.orgwtKndCd ?? "", //원수종류 diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/headList.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/headList.tsx index 9989290e7..2f44b2c33 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/headList.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/headList.tsx @@ -38,11 +38,11 @@ export const rswtSttHeadListExport: z.infer = [ title: "건축면적", visible: true, }, - { - id: "wtrUsqty", - title: "물사용량", - visible: true, - }, + // { + // id: "wtrUsqty", + // title: "물사용량", + // visible: true, + // }, { id: "chBuildingYn", title: "중축・개축・재축여부", @@ -54,12 +54,11 @@ export const rswtSttHeadListExport: z.infer = [ title: "법적의무대상여부", visible: true, }, - - { - id: "oblgTrgtWtrUsqty", - title: "의무대상물사용량 ", - visible: true, - }, + // { + // id: "oblgTrgtWtrUsqty", + // title: "의무대상물사용량 ", + // visible: true, + // }, { id: "instlCmptnDt", title: "설치완료일시", @@ -134,7 +133,7 @@ export const rswtSttNodeListExport: CommonTableProps[] = [ visible: true, row: 1, rowSpan: 1, - colSpan: 12, + colSpan: 10, }, { id: "rswtFcltInfo", @@ -229,15 +228,15 @@ export const rswtSttNodeListExport: CommonTableProps[] = [ rowSpan: 2, colSpan: 1, }, - { - id: "wtrUsqty", - title: "물사용량", - upName: "bdnstInfo", - visible: true, - row: 2, - rowSpan: 2, - colSpan: 1, - }, + // { + // id: "wtrUsqty", + // title: "물사용량", + // upName: "bdnstInfo", + // visible: true, + // row: 2, + // rowSpan: 2, + // colSpan: 1, + // }, { id: "chBuildingYn", title: "중축・개축・재축여부", @@ -257,15 +256,15 @@ export const rswtSttNodeListExport: CommonTableProps[] = [ rowSpan: 2, colSpan: 1, }, - { - id: "oblgTrgtWtrUsqty", - title: "의무대상물사용량", - upName: "bdnstInfo", - visible: true, - row: 2, - rowSpan: 2, - colSpan: 1, - }, + // { + // id: "oblgTrgtWtrUsqty", + // title: "의무대상물사용량", + // upName: "bdnstInfo", + // visible: true, + // row: 2, + // rowSpan: 2, + // colSpan: 1, + // }, { id: "instlCmptnDt", title: "설치완료일시", diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/index.tsx index e76095bd5..97c9dfe5b 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/index.tsx @@ -1,12 +1,12 @@ import type { CommonTableProps } from "@/app/store/common/type/header"; -import { fetchType, getFetch, getFetchWithCount } from "@/components/lib/api"; +import { fetchType, getFetchWithCount } from "@/components/lib/api"; +import type { SelectDataType } from "@common/business_components/ui"; import type { z } from "zod"; import type { customRswtBdst } from "../../fcltReg/rswtReg"; import { controlHeadView } from "../rainSttn"; import type { sttnHeadListType } from "../rainSttn/headList"; import { excelRSwtSttnParsing } from "./excel"; import { rswtSttHeadListExport, rswtSttNodeListExport } from "./headList"; -import type { SelectDataType } from "@common/business_components/ui"; @@ -30,11 +30,11 @@ export type rswtSttnState = { type rswtSttnActions = { rswtSttnInit: (isExcel: boolean, page: number, total: string, con: string, txt: string, - sidoCode: SelectDataType[], - sggCode: SelectDataType[]) => void; + sidoCode: SelectDataType[], + sggCode: SelectDataType[]) => void; rswtSttnSearch: (isExcel: boolean, page: number, total: string, con: string, txt: string, - sidoCode: SelectDataType[], - sggCode: SelectDataType[]) => void; + sidoCode: SelectDataType[], + sggCode: SelectDataType[]) => void; rswtChSttnHead: ( headList: z.infer, ) => void; @@ -72,7 +72,7 @@ export const rswtSttnActionsExport: (set: any) => rswtSttnActions = ( (txt ? `/${txt}` : "") ); if (isExcel) { - const rswtExcel = excelRSwtSttnParsing(rswtSttnRes, sidoCode, sggCode); + const rswtExcel = excelRSwtSttnParsing(rswtSttnRes, sidoCode, sggCode); set((state: rswtSttnState) => { return { ...state, @@ -111,12 +111,6 @@ export const rswtSttnActionsExport: (set: any) => rswtSttnActions = ( (con ? `/${con}` : "/0") + (txt ? `/${txt}` : "") ); - console.log("주소",`/reuseFc/waterreuseFc` + - (page ? `/${page}` : "/1") + - (total ? `/${total}` : "/20") + - (con ? `/${con}` : "/0") + - (txt ? `/${txt}` : "")) - console.log("rswtSttnRes", rswtSttnRes) if (isExcel) { const rswtExcel = excelRSwtSttnParsing(rswtSttnRes, sidoCode, sggCode); set((state: rswtSttnState) => { diff --git a/apps/wr/components/ui/modal/ldrmntSttn/ldrmntExcelModal.tsx b/apps/wr/components/ui/modal/ldrmntSttn/ldrmntExcelModal.tsx deleted file mode 100644 index 5427c5dd2..000000000 --- a/apps/wr/components/ui/modal/ldrmntSttn/ldrmntExcelModal.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import { useWrStore } from "@/app/store"; -import { pbnPrfRegExcelZod } from "@/app/store/prfmncReg/pbnstPrfmncReg/headList"; -import type { FcPrfType, PrfType } from "@/app/store/prfmncReg/pbnstPrfmncReg/type"; -import { yearOptions } from "@/components/lib/func/commom"; -import { FileUpload, Form, FormField, FormUi, SelectBox, Title } from "@common/business_components/ui"; -import { Button, Input } from "@common/components/ui"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useState } from "react"; -import { useForm } from "react-hook-form"; -import type { z } from "zod"; - -export default function LdrmntExcelModal({ data }: { data: FcPrfType }) { - const { prfmnRegData } = useWrStore((state) => state); - const [excelData, setExcelData] = useState(); - const form = useForm>({ - resolver: zodResolver(pbnPrfRegExcelZod), - defaultValues: { - ym: String(new Date().getFullYear()), - }, - }); - const onSubmit = (values: z.infer) => { - if (excelData) { - prfmnRegData(excelData as unknown as PrfType); - } - }; - const [files, setFiles] = useState(null); - return ( - <> -
-
- -
- -
-
-

- {"잠재수요처 파일"} -

- - -
-
- ( - - { - if (files) setFiles(files); - }} - fileTypes="xlsx" - > - - )} - /> -
-
- -
- - ) - -} \ No newline at end of file