From 2323c67131d5449e9abd0be78dcfc16bf2d65025 Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Tue, 1 Apr 2025 14:20:05 +0900 Subject: [PATCH 1/9] =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EB=84=A4?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EC=88=98=EC=A0=95=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business_components/src/ui/table/index.tsx | 13 +++++++++---- .../src/ui/table/uiPageNations.tsx | 17 ++++++++--------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/packages/common/business_components/src/ui/table/index.tsx b/packages/common/business_components/src/ui/table/index.tsx index 9635a7e21..5413fbf78 100644 --- a/packages/common/business_components/src/ui/table/index.tsx +++ b/packages/common/business_components/src/ui/table/index.tsx @@ -1,4 +1,5 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@common/components"; +import { useState } from "react"; import UiPageNations from "./uiPageNations"; type UiTableProps = { @@ -9,6 +10,7 @@ type UiTableProps = { total: number; children: React.ReactNode | undefined; cellClick : ((index:number|undefined)=>void) | undefined; + onPageChange: (page: number) => void; } type UiHeadProps = { @@ -16,9 +18,12 @@ type UiHeadProps = { title: string; } -export function UiTable({ tableData, headlist, pageSize, total, children, headName, cellClick }: UiTableProps) { - const cur = 1; - +export function UiTable({ tableData, headlist, pageSize, total, children, headName, cellClick, onPageChange }: UiTableProps) { + const [cur, setCur] = useState(1); + const handlePageChange = (page: number) => { + setCur(page); + onPageChange(page); + } return ( <> {headName ?
@@ -43,7 +48,7 @@ export function UiTable({ tableData, headlist, pageSize, total, children, headNa ))} - {total <= 0 ? <> : } + {total <= 0 ? <> : }
); diff --git a/packages/common/business_components/src/ui/table/uiPageNations.tsx b/packages/common/business_components/src/ui/table/uiPageNations.tsx index 99199d163..891fc4c81 100644 --- a/packages/common/business_components/src/ui/table/uiPageNations.tsx +++ b/packages/common/business_components/src/ui/table/uiPageNations.tsx @@ -1,19 +1,18 @@ 'use client'; import { useEffect, useState } from "react"; -import { - Pagination, - PaginationContent, - PaginationItem, - PaginationPrevious, - PaginationLink, - PaginationNext -} from "./lib/pagination"; +import { PaginationNext } from "./lib/pagination"; +import { PaginationLink } from "./lib/pagination"; +import { PaginationPrevious } from "./lib/pagination"; +import { PaginationItem } from "./lib/pagination"; +import { PaginationContent } from "./lib/pagination"; +import { Pagination } from "./lib/pagination"; interface CommonPageNationsProps { total: number; cur: number; pageSize: number; + onPageChange: (page: number) => void; } export default function UiPageNations(commonPageNationsProps: CommonPageNationsProps) { @@ -30,7 +29,7 @@ export default function UiPageNations(commonPageNationsProps: CommonPageNationsP const endPage = Math.min(startPage + pagesPerGroup - 1, totalPages); const handlePageChange = (page: number) => { - setPageProps({ ...pageProps, cur: page }); + pageProps.onPageChange(page); }; return ( From 677c6501f3766dc03dbcdde21a6aa9a7795ca0d6 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Wed, 2 Apr 2025 15:22:18 +0900 Subject: [PATCH 2/9] =?UTF-8?q?=EA=B2=80=EC=83=89=EA=B9=8C=EC=A7=80=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EA=B2=BD=EA=B8=B0=EB=8F=84=20=EB=A7=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ruseFcltMng/fcltReg/rainReg/page.tsx | 14 ++--- .../ruseFcltMng/fcltReg/rainReg/index.tsx | 54 +++++++++++-------- .../components/ui/modal/bdstReg/component.tsx | 6 ++- 3 files changed, 43 insertions(+), 31 deletions(-) diff --git a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx index 789b74ab9..5e7a3c181 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx @@ -54,6 +54,8 @@ export default function Home() { const { rainRes } = rain; const [rainForm, setRainForm] = useState(); const [bdstTable, setbdstTable] = useState(); + const [searchTxt , setSearchTxt] = useState() + const nodeList = headMakeColSpan(rain.upHeadList); useEffect(() => { if (!rain.isInit) { @@ -65,10 +67,10 @@ export default function Home() { if (code.sggCd.length > 0) { const table = rainRes.map((item) => { const sggText = code.sggCd.find( - (cd) => cd.val.toString() === item.sggCd + (cd) => cd.val === Number(item.sggCd) )?.text; const cityText = code.cityCd.find( - (cd) => cd.val.toString() === item.ctpvCd + (cd) => cd.val === Number(item.ctpvCd) )?.text; return { ...item, sggText: sggText, cityText: cityText }; }); @@ -95,14 +97,12 @@ export default function Home() { {setSearchTxt(e)}} /> - + void; - dataInit: () => void; + init: (txt:string|undefined) => void; + rainSearTxt: (txt:string) => void; rainReg: (data: RainyBuilding) => void; rainUpdate: (data: RainyBuilding) => void; }; @@ -247,17 +247,17 @@ const findBdstInfo = async(sggCd:string, searchTxt:string)=>{ } -const initFetch = async () => { - return await getFectch("wr", "/reuseFc/rainyInfoList/1/20/41"); +const initFetch = async (txt:string|undefined) => { + return await getFectch("wr", `/reuseFc/rainyInfoList/1/20/41` +(txt? `/${txt}`:'')); }; export const rainFacActionsExport: (set: any) => rainFacSActions = ( set: any ) => { return { - init: async () => { + init: async (txt:string|undefined) => { try { // 파라이터 수정 통합관리자 =0, 시관리자=시코드, 시군구 관리자= 시군구 코드 를 세번째 파라미터로 지정 / 건축물 서치가 있을경우 4번째 파라미터로 던지기 즉 1/20/42(서울시)/영현빌딩 이런식으로) - const rainRes = await initFetch(); + const rainRes = await initFetch(txt); // 여기서 상태 업데이트 return set((state: rainFacState) => ({ ...state, @@ -273,20 +273,30 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = ( console.log("finally"); } }, - dataInit: () => - set((state: rainFacState) => { - console.log(" state ", state.rain); - return { - rain: { - ...state.rain, - isInit: false, - }, - }; - }), + rainSearTxt: async(txt:string) =>{ + try{ + + const rainRes = await getFectch('wr' , `/reuseFc/rainyInfoList/1/20/41` +(txt? `/${txt}`:'')) + set((state: rainFacState) => { + return { + rain: { + ...state.rain, + rainRes: rainRes, + isInit: false, + }, + }; + })} + catch(erTxt){ + console.log("error", erTxt) + } + }, rainReg: async (data: RainyBuilding) => { try { const res = await postFectch("/reuseFc/rainyInfo", data); - const rainRes = await initFetch(); + if(res.ok){ + alert(" 등록이 완료되었습니다.") + } + const rainRes = await initFetch(undefined); set((state: rainFacState) => ({ ...state, rain: { @@ -311,7 +321,7 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = ( alert(" 수정이 완료되었습니다.") } - const rainRes = await initFetch(); + const rainRes = await initFetch(undefined); set((state: rainFacState) => ({ ...state, rain: { diff --git a/apps/wr/components/ui/modal/bdstReg/component.tsx b/apps/wr/components/ui/modal/bdstReg/component.tsx index e0a389182..0787cf1bc 100644 --- a/apps/wr/components/ui/modal/bdstReg/component.tsx +++ b/apps/wr/components/ui/modal/bdstReg/component.tsx @@ -19,7 +19,7 @@ export type objSearchType = { export function BdstReg() { - const { rain, code, bdst,findBdst } = useWrStore((state) => { + const { rain, code, bdst,init } = useWrStore((state) => { return state; }); @@ -112,10 +112,11 @@ export function BdstReg() { setText={ setSearchTxt} /> */} - +
+
+
From ea4a4504ee6b3b501cd84049345d3d82747ab397 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Wed, 2 Apr 2025 15:24:38 +0900 Subject: [PATCH 3/9] =?UTF-8?q?=EC=9E=98=EB=AA=BB=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/components/ui/modal/bdstReg/component.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/wr/components/ui/modal/bdstReg/component.tsx b/apps/wr/components/ui/modal/bdstReg/component.tsx index 0787cf1bc..3d78386ea 100644 --- a/apps/wr/components/ui/modal/bdstReg/component.tsx +++ b/apps/wr/components/ui/modal/bdstReg/component.tsx @@ -19,7 +19,7 @@ export type objSearchType = { export function BdstReg() { - const { rain, code, bdst,init } = useWrStore((state) => { + const { rain, code, bdst,findBdst } = useWrStore((state) => { return state; }); @@ -42,7 +42,7 @@ export function BdstReg() { setObjSearch({...objSearch,sgg: String(val)}) }; - const searchBdst=()=>{ + const searchBdst=(searchTxt: string | undefined)=>{ if(objSearch.city===""){ alert('시도조건은 필수 입니다.') return @@ -112,7 +112,7 @@ export function BdstReg() { setText={ setSearchTxt} /> */} - +
From 8fd441bcbfadf5c0b54248e4e320863401960536 Mon Sep 17 00:00:00 2001 From: truthwing Date: Wed, 2 Apr 2025 17:45:38 +0900 Subject: [PATCH 4/9] =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=B8=94=20=ED=81=AC?= =?UTF-8?q?=EA=B8=B0=20=EC=A0=84=EC=B2=B4=EB=A1=9C=20=EC=9E=A1=EA=B2=8C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EC=99=84=EB=A3=8C.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/common/business_components/src/ui/list_div/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/common/business_components/src/ui/list_div/index.tsx b/packages/common/business_components/src/ui/list_div/index.tsx index a096a4c04..2c437e1af 100644 --- a/packages/common/business_components/src/ui/list_div/index.tsx +++ b/packages/common/business_components/src/ui/list_div/index.tsx @@ -2,7 +2,7 @@ function ListDiv(props: {children: React.ReactNode}) { return ( -
+
{props.children}
) From b2891234ab7e2a4e93cfe4c2a4356b3064fe5a72 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Wed, 2 Apr 2025 17:48:32 +0900 Subject: [PATCH 5/9] =?UTF-8?q?=EC=8B=A0=EA=B7=9C=20=EB=93=B1=EB=A1=9D=20,?= =?UTF-8?q?=20=EA=B1=B4=EC=B6=95=EB=AC=BC=20=EC=A1=B0=ED=9A=8C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ruseFcltMng/fcltReg/rainReg/page.tsx | 28 ++- .../app/ruseFcltMng/fcltReg/rswtReg/page.tsx | 145 +++++++++------ apps/wr/app/store/common/code/index.ts | 48 ++++- .../ruseFcltMng/fcltReg/bdstReg/index.tsx | 10 +- .../ruseFcltMng/fcltReg/rainReg/index.tsx | 10 +- .../ruseFcltMng/fcltReg/rswtReg/index.tsx | 169 +++++++++--------- .../ui/form/fcltReg/rainReg/component.tsx | 3 +- .../ui/form/fcltReg/rswtrReg/component.tsx | 26 +-- .../components/ui/modal/bdstReg/component.tsx | 13 +- 9 files changed, 273 insertions(+), 179 deletions(-) diff --git a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx index 5e7a3c181..d1d539506 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx @@ -21,6 +21,8 @@ import ListDiv from "@common/business_components/ui/list_div"; import { Button, TableHead, TableRow } from "@common/components"; import { useEffect, useState } from "react"; + + export const headMakeColSpan = (upHeadList: TableUpperProps[]) => { return ( <> @@ -32,7 +34,7 @@ export const headMakeColSpan = (upHeadList: TableUpperProps[]) => { ) : head.upName === "upChangeRe" && head.upSequnce === 1 ? ( - {"중축 개축 증축 "} + {"중축 개축 재축 "} ) : null )} @@ -47,6 +49,10 @@ export const headMakeColSpan = (upHeadList: TableUpperProps[]) => { ); }; + +//------------------------------------------------------------------------------------------------------- + + export default function Home() { const { rain, code, init } = useWrStore((state) => { return state; @@ -59,7 +65,7 @@ export default function Home() { const nodeList = headMakeColSpan(rain.upHeadList); useEffect(() => { if (!rain.isInit) { - init(); + init(undefined); } }, [rain.isInit, init]); @@ -72,7 +78,12 @@ export default function Home() { const cityText = code.cityCd.find( (cd) => cd.val === Number(item.ctpvCd) )?.text; - return { ...item, sggText: sggText, cityText: cityText }; + const bdstusgText = code.bdstUsgCd.find( + (cd) =>cd.val === item?.reuseBuilding[0]?.bdstUsgCd + ) + + + return { ...item, sggText: sggText, cityText: cityText ,bdsgUsgText:bdstusgText }; }); setbdstTable(table); @@ -106,16 +117,17 @@ export default function Home() { } + body={} bodyClass="sm:max-w-7xl" />
-
-
+
+
+ {nodeList} +
@@ -145,3 +158,6 @@ export default function Home() { ); } + + + diff --git a/apps/wr/app/ruseFcltMng/fcltReg/rswtReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/rswtReg/page.tsx index e4b0dc16f..ecb7dff20 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/rswtReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/rswtReg/page.tsx @@ -1,69 +1,112 @@ -'use client' +"use client"; import { useWrStore } from "@/app/store"; import type { TableUpperProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; import { RswtrRegForm } from "@/components/ui/form/fcltReg/rswtrReg/component"; -import { ScrollArea, SearchDiv, SearchInput, UiTable } from "@common/business_components"; -import { Button, TableHead, TableRow } from "@common/components"; - - -const headMakeColSpan = (upHeadList: TableUpperProps[]) => { - return (<> - { - upHeadList.map((head: TableUpperProps) => - (!head.upSequnce ? {head.title} : - head.upName === 'upChangeRe' && head.upSequnce === 1 ? {'중축 개축 증축 '} : null))} - - - {upHeadList.map((head: TableUpperProps) => - (head.upName === 'upChangeRe' ? {head.title} : null))} - - ) -} +import { BdstReg } from "@/components/ui/modal/bdstReg/component"; +import { + ContentsDiv, + ScrollArea, + SearchDiv, + SearchFormLeft, + SearchFormRight, + SearchInput, + Title, + UiModal, + UiTable, +} from "@common/business_components"; +import ListDiv from "@common/business_components/ui/list_div"; +import { Button} from "@common/components"; +import { headMakeColSpan } from "../rainReg/page"; +import { useEffect, useState } from "react"; +import type { RswtBuilding } from "@/app/store/ruseFcltMng/fcltReg/rswtReg"; export default function Home() { - const {rswt} = useWrStore((state) => state); + const { code,rswt,initRswt } = useWrStore((state) => state); const nodeList = headMakeColSpan(rswt.upHeadList); - const total = 100; + const [bdstTable, setbdstTable] = useState(); + + const {rswtRes} = rswt; - const headName = () => { - return ( -

○건축물 목록

- ) - } + + useEffect(() => { + if (!rswt.isInit) { + initRswt(undefined); + } + }, [rswt.isInit, initRswt]); + useEffect(() => { + if (code.sggCd.length > 0) { + console.log(rswtRes) + const table = rswtRes?.map((item) => { + const sggText = code.sggCd.find( + (cd) => cd.val === Number(item.sggCd) + )?.text; + const cityText = code.cityCd.find( + (cd) => cd.val === Number(item.ctpvCd) + )?.text; + return { ...item, sggText: sggText, cityText: cityText }; + }); + + setbdstTable(table); + } + }, [code, rswtRes]); return ( <> -
-
-

중수도시설 등록

-
- -
- + +
+
+ + <SearchDiv> + <SearchFormLeft> + <SearchInput + className="col-span-3 my-7" + label="건물명:" + textValue={""} + setText={function (val: string): void { + throw new Error("Function not implemented."); + }} + /> + </SearchFormLeft> + <SearchFormRight> + <Button className="mr-4 rounded-lg">조회</Button> + <Button className="mr-4 rounded-lg">저장</Button> + <UiModal + butNm="신규등록" + title="건축물 시설 등록(중수도시설)" + body={<BdstReg moType={"rswt"}></BdstReg>} + bodyClass="sm:max-w-7xl" + /> + </SearchFormRight> + </SearchDiv> </div> - <div className='w-1/5 flex items-center justify-end'> - <Button className='mr-4 rounded-lg'>조회</Button> - <Button className='mr-4 rounded-lg'>저장</Button> - <Button className='mr-4 rounded-lg'>신규등록</Button> </div> - </SearchDiv> - </div> - </div> - <div className="colsapn-1 pl-11"> - <UiTable tableData={rswt.rswtOfObject} headlist={rswt.upHeadList} pageSize={100} total={10} headName={headName()}> - {nodeList} - </UiTable> - </div> - <div className="colsapn-1 pr-11 max-h-full ovreflow-y-scroll"> - <ScrollArea> - <RswtrRegForm></RswtrRegForm> - </ScrollArea> - </div> - - </div> + <div className="grid grid-cols-6 gap-4 "> + <div className="col-span-4"> + <ListDiv> + <UiTable + tableData={bdstTable||[]} + headlist={rswt.upHeadList} + pageSize={100} + total={10} + headName={"○건축물 목록"} + cellClick={undefined} + > + {nodeList} + </UiTable> + </ListDiv> + </div> + <div className="col-span-2 max-h-full ovreflow-y-scroll"> + <ListDiv> + <ScrollArea> + <RswtrRegForm></RswtrRegForm> + </ScrollArea> + </ListDiv> + </div> + </div> + </ContentsDiv> </> ); } diff --git a/apps/wr/app/store/common/code/index.ts b/apps/wr/app/store/common/code/index.ts index 3d1250119..99a278f63 100644 --- a/apps/wr/app/store/common/code/index.ts +++ b/apps/wr/app/store/common/code/index.ts @@ -11,7 +11,7 @@ export const yn :selectArray[]=[ {val:'N', text:'N'}, ] - +//공통 건축물 용도 export const bdstUsgCd: selectArray[] = [ { val: 1, text: "운동장" }, { val: 2, text: "체육관" }, @@ -30,7 +30,7 @@ export const bdstUsgCd: selectArray[] = [ { val: 15, text: "대규모점포" }, { val: 16, text: "기타" }, ]; - +//빗물 집수면 종류 용도 export const rainFcltCd = [ { val: "1", text: "지붕" }, { val: "2", text: "건물옥상" }, @@ -44,6 +44,48 @@ export const rainFcltCd = [ { val: "10", text: "확인불가" }, ]; +//중수도 필수 원수종류 +export const rswtBdstType :selectArray[]= [ + { text: "숙박업", val: "17" }, + { text: "목욕장업", val: "18" }, + { text: "공장", val: "19" }, + { text: "발전시설", val: "20" }, + { text: "관광단지개발사업", val: "21" }, + { text: "도시개발사업", val: "22" }, + { text: "산업단지개발사업", val: "23" }, + { text: "택지개발사업", val: "24" }, + { text: "대규모점포(대형마트)", val: "25" }, + { text: "대규모점포(전문점)", val: "26" }, + { text: "대규모점포(백화점)", val: "27" }, + { text: "대규모점포(쇼핑센터)", val: "28" }, + { text: "대규모점포(복합쇼핑몰)", val: "29" }, + { text: "물류시설", val: "30" }, + { text: "운수시설(여객자동차터미널)", val: "31" }, + { text: "운수시설(철도시설)", val: "32" }, + { text: "운수시설(공항시설)", val: "33" }, + { text: "운수시설(항만시설)", val: "34" }, + { text: "업무시설(공공업무시설)", val: "35" }, + { text: "업무시설(금융업소)", val: "36" }, + { text: "업무시설(사무소)", val: "37" }, + { text: "업무시설(결혼상담소 등 소개업소)", val: "38" }, + { text: "업무시설(출판사)", val: "39" }, + { text: "업무시설(신문사)", val: "40" }, + { text: "업무시설(오피스텔)", val: "41" }, + { text: "교정시설", val: "42" }, + { text: "방송국", val: "43" }, + { text: "전신전화국", val: "44" }, + { text: "기타", val: "45" }, +]; + + +const orgwtKndCd = [ + { text: "오수(변기 오수 제외)", val: "1" }, + { text: "오수", val: "2" }, + { text: "폐수", val: "3" }, + { text: "오수 및 폐수", val: "4" }, + { text: "기타", val: "5" }, +]; + export const chBuCd = [ { val: "1", text: "증축" }, { val: "2", text: "개축" }, @@ -60,6 +102,7 @@ export type comCodeState = { bdstUsgCd: selectArray[]; cityCd: selectArray[]; sggCd: selectArray[]; + orgwtKndCd:selectArray[]; yn:selectArray[]; }; }; @@ -99,6 +142,7 @@ export const comCodeStateExport: comCodeState = { rainFcltCd: rainFcltCd, bdstUsgCd: bdstUsgCd, chBuCd:chBuCd, + orgwtKndCd:orgwtKndCd, cityCd: [], sggCd: [], yn:yn diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/bdstReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/bdstReg/index.tsx index ffa920f39..f7b990dba 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/bdstReg/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/bdstReg/index.tsx @@ -34,12 +34,12 @@ export type bdstState = { }; type bdstActions = { - findBdst: (sggCd:string, searchTxt:string) => void ; + findBdst: (sggCd:string, searchTxt:string, flag:string) => void ; }; - const findBdstInfo = async(sggCd:string, searchTxt:string)=>{ - return await getFectch('wr', `/reuseFc/building/${sggCd}`+(searchTxt?`/${searchTxt}`:'')) + const findBdstInfo = async(sggCd:string, searchTxt:string ,flg:string)=>{ + return await getFectch('wr', `/reuseFc/building/${flg}/${sggCd}`+(searchTxt?`/${searchTxt}`:'' )) } @@ -55,10 +55,10 @@ export const bdstActionsExport: (set: any) => bdstActions = ( ) => { return { - findBdst: async(sggCd:string, searchTxt:string) =>{ + findBdst: async(sggCd:string, searchTxt:string ,flg:string ) =>{ try{ - const bdst = await findBdstInfo(sggCd, searchTxt); + const bdst = await findBdstInfo(sggCd, searchTxt, flg); return set((state:bdstState) =>({ ...state, bdst:{ diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx index 38ab1cced..c0acef859 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx @@ -92,6 +92,7 @@ export type chgBuilding={ export type RainyBuilding = { + bdstInfoPk: number|null; ctpvCd: number; sggCd: number; bdstNm: string; @@ -99,7 +100,6 @@ export type RainyBuilding = { frstArchPrmsnDt: Date; archArea: string; archChgArea: number; - bdstInfoPk: number; reuseBuilding: reuseBuilding[]; chgBuilding:chgBuilding[] }; @@ -146,7 +146,8 @@ export const upHeadList: TableUpperProps[] = [ { id: "sggText", title: "시군구" }, { id: "bdstNm", title: "시설명" }, { id: "daddr", title: "위치" }, - { id: "bdstUsgCd", title: "건축물용도" }, + { id: "bdstUsgText", title: "건축물용도" }, + // { id: "bdstUsgCd", title: "건축물용도" }, { id: "frstArchPrmsnDt", title: "최초건축허가일" }, { id: "archArea", title: "건축면적" }, { id: "lawTrgtYn", title: "법적의무대상여부" }, @@ -241,10 +242,7 @@ export const rainFacStateExport: rainFacState = { }, }; -const findBdstInfo = async(sggCd:string, searchTxt:string)=>{ - return await getFectch('wr', `/reuseFc/building/${sggCd}/${searchTxt}`) - -} + const initFetch = async (txt:string|undefined) => { diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx index 16cd43b44..000218b96 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx @@ -1,94 +1,97 @@ -import { upHeadList, type bdstType, type selectArray, type TableUpperProps } from "../rainReg"; +import { getFectch } from "@/components/lib/api"; +import { upHeadList, type chgBuilding, type TableUpperProps } from "../rainReg"; +export type RswtBuilding = { + bdstInfoPk: number; + ctpvCd: number; + sggCd: number; + bdstNm: string; + daddr: string; + frstArchPrmsnDt: Date; + archArea: string; + archChgArea: number; + reuseBuilding: rswtReuseBuilding[]; + chgBuilding: chgBuilding[]; +}; -const rswtOfObject:bdstType[] = [ - { - sido: "서울", - sigungo: "종로구", - facilityName: "그랑서울", - location: "종로 33", - locationgubun: "업무시설", - firstConstructionPermission : '2024-10-10', - buildingArea: "50", - facilityCapacity: "800,000", - reuse: "Y", - permissionDay:'2024-10-10', - register: "Y", - legalTargetYn:"Y" - }, - { - sido: "서울", - sigungo: "종로구", - facilityName: "그랑서울", - location: "종로 33", - locationgubun: "업무시설", - firstConstructionPermission : '2024-10-10', - buildingArea: "50", - facilityCapacity: "800,000", - reuse: "Y", - permissionDay:'2024-10-10', - register: "Y", - legalTargetYn:"Y" - }, - { - sido: "서울", - sigungo: "종로구", - facilityName: "그랑서울", - location: "종로 33", - locationgubun: "업무시설", - firstConstructionPermission : '2024-10-10', - buildingArea: "50", - facilityCapacity: "800,000", - reuse: "Y", - permissionDay:'2024-10-10', - register: "Y", - legalTargetYn:"Y" - }, -] +export type rswtReuseBuilding = { + bdstRuseFcltPk: number; + bdstInfoFk: number; + instlCmptnDt: Date | undefined; + instlCst: number | undefined; + operMngCd: number; + lawTrgtYn: string | undefined; + anlOperCst: number; + instlCstSprtYn: string | undefined; + instlCstSprtAmt: number | undefined; + bdstUsgCd: number | undefined; + grntchBdstCertYn: string | undefined; + grntchBdstCertNo: string | undefined; + grntchBdstCertGrd: string | undefined; + grntchBdstCertYr: string | undefined; + rswtrObj: rswtrObj | null; +}; +export type rswtrObj = { + bdstRuseFcltFk: number | undefined; + wtrUsqty: number | undefined; + oblgTrgtWtrUsqty: number | undefined; + orgwtKndCd: string | undefined; + filtrTrtmfctProcs: string | undefined; + filtrTrtmfctUsgCd: string | undefined; + rswtrUsqty: number; + altUswtrUtztnYn: string; + altUswtrKndCd: string; + altUswtrUtztnQnt: number; + altUswtrIdntyMthdCd: string; +}; +const rswtRes: RswtBuilding[] = []; -const selectHomeWater = [ - { text: '집수면', val: "1" }, - { text: "종류", val: "2" }, - ]; - - const selectYN= [ - { text: 'Y', val: "1" }, - { text: 'N', val: "2" }, - ]; - -export type rswtFacState ={ rswt:{ +export type rswtFacState = { + rswt: { isInit: boolean; upHeadList: TableUpperProps[]; - rswtOfObject: bdstType[]; - selectHomeWater:selectArray[]; - selectYN:selectArray[]; -}} + rswtRes: RswtBuilding[]; + }; +}; type rswtFacSActions = { - decrementList: () => void -} + initRswt: (txt: string | undefined) => void; +}; export type rswtFacType = rswtFacState & rswtFacSActions; -export const rswtFacStateExport:rswtFacState= {rswt:{ - isInit:false, +export const rswtFacStateExport: rswtFacState = { + rswt: { + isInit: false, upHeadList: upHeadList, - rswtOfObject: rswtOfObject, - selectHomeWater:selectHomeWater, - selectYN:selectYN - - -}} -export const rswtFacActionsExport:(set:any)=>rswtFacSActions=(set: any) => { - return { - decrementList:()=>set( - (state:rswtFacState) => { - return ( - {rain:{ - upHeadList: state.rswt.upHeadList, - rainOfObject: - state.rswt.rswtOfObject.slice(0, state.rswt.rswtOfObject.length - 1) - }})} - ) - } -} + rswtRes: rswtRes, + }, +}; + +const initFetch = async (txt: string | undefined) => { + return await getFectch( + "wr", + `/reuseFc/waterreuseFc/1/20/01` + (txt ? `/${txt}` : "") + ); +}; +export const rswtFacActionsExport: (set: any) => rswtFacSActions = ( + set: any +) => { + return { + initRswt: async (txt: string | undefined) => { + try { + const rswtRes = await initFetch(txt); + return set((state: rswtFacState) => ({ + ...state, + rswt: { + ...state.rswt, + rswtRes: rswtRes, + isInit: false, + }, + })); + } catch (error) { + console.log(error); + } + }, + }; +}; diff --git a/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx b/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx index bf57cc97e..d78092aea 100644 --- a/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx +++ b/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx @@ -142,15 +142,14 @@ export function RainRegForm({ }; if (isModal) { + // regRainForm.bdstInfoPk = null; rainReg(regRainForm); } else { - console.log(" regRainForm ", regRainForm) rainUpdate(regRainForm); } }; function onSubmit(values: z.infer<typeof formSchema>) { - console.log(values); objToForm(values); } diff --git a/apps/wr/components/ui/form/fcltReg/rswtrReg/component.tsx b/apps/wr/components/ui/form/fcltReg/rswtrReg/component.tsx index cd8c4a02b..f563b3c53 100644 --- a/apps/wr/components/ui/form/fcltReg/rswtrReg/component.tsx +++ b/apps/wr/components/ui/form/fcltReg/rswtrReg/component.tsx @@ -33,7 +33,7 @@ const formSchema = z.object({ }); export function RswtrRegForm() { - const { rswt } = useWrStore((state) => state); + const { rswt,code } = useWrStore((state) => state); const form = useForm<z.infer<typeof formSchema>>({ resolver: zodResolver(formSchema), @@ -165,7 +165,7 @@ export function RswtrRegForm() { <FormUi label="필수 종류"> <SelectBox selectClass={selectClass} - selectArray={rswt.selectYN} + selectArray={code.orgwtKndCd} onSelectValue={onSelectValue} {...field} /> @@ -189,23 +189,7 @@ export function RswtrRegForm() { )} /> </div> - <div className="col-span-5 pl-6"> - <FormField - control={form.control} - name="utztmUsgCd" - render={({ field }) => ( - <FormUi label="이용용도"> - <SelectBox - selectClass={selectClass} - label={""} - selectArray={rswt.selectYN} - onSelectValue={onSelectValue} - {...field} - /> - </FormUi> - )} - /> - </div> + </div> <div className=" my-2"> @@ -226,7 +210,7 @@ export function RswtrRegForm() { <SelectBox selectClass={selectClass} label={""} - selectArray={rswt.selectYN} + selectArray={code.yn} onSelectValue={onSelectValue} {...field} /> @@ -265,7 +249,7 @@ export function RswtrRegForm() { <SelectBox selectClass={selectClass} label={""} - selectArray={rswt.selectYN} + selectArray={code.yn} onSelectValue={onSelectValue} {...field} /> diff --git a/apps/wr/components/ui/modal/bdstReg/component.tsx b/apps/wr/components/ui/modal/bdstReg/component.tsx index 3d78386ea..0d842700f 100644 --- a/apps/wr/components/ui/modal/bdstReg/component.tsx +++ b/apps/wr/components/ui/modal/bdstReg/component.tsx @@ -11,6 +11,8 @@ import { useEffect, useState } from "react"; import { RainRegForm } from "../../form/fcltReg/rainReg/component"; import { getCityCd, type selectArray } from "@/app/store/common/code"; import { getCity } from "@/components/lib/func/commom"; +import { RswtrRegForm } from "../../form/fcltReg/rswtrReg/component"; +import { HtdflRegForm } from "../../form/fcltReg/htdflReg/component"; export type objSearchType = { sgg: string|number; @@ -18,7 +20,7 @@ export type objSearchType = { }; -export function BdstReg() { +export function BdstReg({moType}:{moType:string} ) { const { rain, code, bdst,findBdst } = useWrStore((state) => { return state; }); @@ -52,7 +54,7 @@ export function BdstReg() { data = objSearch.sgg } - findBdst(String(data), searchTxt || "") + findBdst(String(data), searchTxt || "","RNB" ) } @@ -133,7 +135,12 @@ export function BdstReg() { <div className="border-t border-gray-300 my-4"></div> <ScrollArea className="h-[60vh]"> <div> - <RainRegForm rainForm={rainBdstForm } isModal={true}/> + {moType === 'rain'? + <RainRegForm rainForm={rainBdstForm} isModal={true} /> + :moType==='rswt'?<RswtrRegForm></RswtrRegForm> + :<HtdflRegForm></HtdflRegForm> + } + </div> </ScrollArea> </div> From 0528abb25b066d116863d145d7124435125b0dec Mon Sep 17 00:00:00 2001 From: leedj312 <dlehd467@gmail.com> Date: Wed, 2 Apr 2025 18:15:36 +0900 Subject: [PATCH 6/9] =?UTF-8?q?=EC=A0=84=EC=B2=B4=EC=BD=94=EB=93=9C?= =?UTF-8?q?=EA=B0=91=20=EB=84=A3=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx | 4 +--- apps/wr/app/store/common/code/index.ts | 1 + apps/wr/components/ui/modal/bdstReg/component.tsx | 10 +++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx index d1d539506..225f37ba5 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx @@ -127,8 +127,7 @@ export default function Home() { <div className="grid grid-cols-6 gap-4 "> <div className="col-span-4 max-h-full ovreflow-y-scroll"> <ListDiv> - <ScrollArea> - <UiTable + <UiTable tableData={bdstTable || []} headlist={rain.upHeadList} pageSize={100} @@ -138,7 +137,6 @@ export default function Home() { > {nodeList} </UiTable> - </ScrollArea> </ListDiv> </div> <div className="col-span-2 max-h-full ovreflow-y-scroll"> diff --git a/apps/wr/app/store/common/code/index.ts b/apps/wr/app/store/common/code/index.ts index 99a278f63..7125f5b71 100644 --- a/apps/wr/app/store/common/code/index.ts +++ b/apps/wr/app/store/common/code/index.ts @@ -128,6 +128,7 @@ export const getCityCd = async (set: any) => { val: item.mctpvCd, text: item.mctpvKornNm, })); + cityCd.unshift({val:0,text:'전체'}) set((state: comCodeState) => ({ code: { ...state.code, diff --git a/apps/wr/components/ui/modal/bdstReg/component.tsx b/apps/wr/components/ui/modal/bdstReg/component.tsx index 0d842700f..541b7e53d 100644 --- a/apps/wr/components/ui/modal/bdstReg/component.tsx +++ b/apps/wr/components/ui/modal/bdstReg/component.tsx @@ -45,11 +45,11 @@ export function BdstReg({moType}:{moType:string} ) { }; const searchBdst=(searchTxt: string | undefined)=>{ - if(objSearch.city===""){ - alert('시도조건은 필수 입니다.') - return + let data =objSearch.city; + if(objSearch.city==="" ){ + + data = String(code.cityCd[0]?.val) } - let data =objSearch.city; if(objSearch.sgg !=="" ){ data = objSearch.sgg } @@ -94,7 +94,7 @@ export function BdstReg({moType}:{moType:string} ) { selectArray={code.cityCd} onSelectValue={getSelCity} > - {" "} + {""} </SelectBox> <SelectBox className="col-span-3" From f66bbed334a48c9c5fa4bda633cb5e9c3865c86a Mon Sep 17 00:00:00 2001 From: leedj312 <dlehd467@gmail.com> Date: Wed, 2 Apr 2025 18:18:28 +0900 Subject: [PATCH 7/9] =?UTF-8?q?date=20picker=20ko=20/=20=20=ED=85=8C?= =?UTF-8?q?=EC=9D=B4=EB=B8=94=20classname=20=20hight=20=EB=B6=80=EB=B6=84?= =?UTF-8?q?=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/business_components/src/ui/date_picker/index.tsx | 2 ++ packages/common/business_components/src/ui/table/index.tsx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/common/business_components/src/ui/date_picker/index.tsx b/packages/common/business_components/src/ui/date_picker/index.tsx index 16aa2c075..a7694789b 100644 --- a/packages/common/business_components/src/ui/date_picker/index.tsx +++ b/packages/common/business_components/src/ui/date_picker/index.tsx @@ -9,6 +9,7 @@ import type { DayPickerSingleProps } from "react-day-picker"; import { Button, Calendar, Popover, PopoverContent, PopoverTrigger } from "@common/components/ui"; import { cn } from "../../lib/utils"; import { FormControl } from "../form"; +import { ko } from "date-fns/locale"; type DatePickerProps = DayPickerSingleProps & { field: { value: Date; onChange: (date: Date | undefined) => void } ,selectClass:string|undefined }; @@ -41,6 +42,7 @@ export function DatePicker({ field, selectClass }: DatePickerProps) { selected={field?.value} onSelect={field?.onChange} initialFocus + locale={ko} /> </PopoverContent> </Popover> diff --git a/packages/common/business_components/src/ui/table/index.tsx b/packages/common/business_components/src/ui/table/index.tsx index 9635a7e21..10a1a5ef2 100644 --- a/packages/common/business_components/src/ui/table/index.tsx +++ b/packages/common/business_components/src/ui/table/index.tsx @@ -24,7 +24,7 @@ export function UiTable({ tableData, headlist, pageSize, total, children, headNa {headName ? <div className="card-header"> <h3 className="text-2xl font-medium text-label">{headName}</h3> </div> : <></>} - <div className="card !m-[1.2rem] max-h-[40rem] overflow-auto !p-0r"> + <div className="card !m-[1.2rem] overflow-auto !p-0r"> <Table> <TableHeader> {children ? <>{children}</> : <TableRow> From 07442cd458a0f6411433b2a36d299169fd80983d Mon Sep 17 00:00:00 2001 From: leedj312 <dlehd467@gmail.com> Date: Wed, 2 Apr 2025 18:27:49 +0900 Subject: [PATCH 8/9] =?UTF-8?q?=EC=84=A0=ED=83=9D=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx | 1 - apps/wr/components/ui/form/fcltReg/rainReg/component.tsx | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx index c0acef859..f15a170df 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx @@ -307,7 +307,6 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = ( console.log("e", e); alert("등록 오류입니다."); } finally { - alert("등록이 완료되었습니다."); } }, rainUpdate: async (data: RainyBuilding) => { diff --git a/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx b/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx index d78092aea..1f3412698 100644 --- a/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx +++ b/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx @@ -70,12 +70,14 @@ export function RainRegForm({ ...rb?.rainyObj, ...data.reuseBuilding?.at(0), pntfColKnd: selectedOption ? String(selectedOption.val) : undefined, - frstArchPrmsnDt: new Date(data.frstArchPrmsnDt) + frstArchPrmsnDt: new Date(data.frstArchPrmsnDt ||null) + }; form.reset(formData); } else { formData = { - ...data + ...data, + frstArchPrmsnDt: new Date(data.frstArchPrmsnDt||null) }; form.reset(formData); From 965accac4abe027a947071e1758eb5413c322f7d Mon Sep 17 00:00:00 2001 From: leedj312 <dlehd467@gmail.com> Date: Thu, 3 Apr 2025 09:22:18 +0900 Subject: [PATCH 9/9] =?UTF-8?q?=EC=8B=9C=EC=97=B0=20=EC=88=98=E3=85=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/page.tsx | 4 ++-- apps/wr/components/ui/form/fcltReg/rainReg/component.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/wr/app/page.tsx b/apps/wr/app/page.tsx index 05a47c53a..f46ccea25 100644 --- a/apps/wr/app/page.tsx +++ b/apps/wr/app/page.tsx @@ -19,9 +19,9 @@ export default function Home() { <Button className="place-self-auto"> <Link href="matMng/matDmd/coReg">수요처 등록</Link> </Button> - <Button className="place-self-auto"> + {/* <Button className="place-self-auto"> <Link href="ruseFcltMng/fcltReg/htdflReg">온배수 등록</Link> - </Button> + </Button> */} </div> </> ); diff --git a/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx b/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx index 1f3412698..659297d4e 100644 --- a/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx +++ b/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx @@ -70,8 +70,8 @@ export function RainRegForm({ ...rb?.rainyObj, ...data.reuseBuilding?.at(0), pntfColKnd: selectedOption ? String(selectedOption.val) : undefined, - frstArchPrmsnDt: new Date(data.frstArchPrmsnDt ||null) - + frstArchPrmsnDt: new Date(data.frstArchPrmsnDt ||null), + instlCmptnDt: new Date(data?.instlCmptnDt ||null) }; form.reset(formData); } else {