From 43c50d694f5f5a6683e36a27e3428a4c337a0930 Mon Sep 17 00:00:00 2001 From: JIeunhuh Date: Tue, 8 Jul 2025 09:48:19 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=EC=9E=AC=EC=9D=B4=EC=9A=A9=20=ED=98=84?= =?UTF-8?q?=ED=99=A9=20=EB=82=98=EC=98=A4=EB=8F=84=EB=A1=9D=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 --- apps/wr/app/map/newWindowPopup.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/wr/app/map/newWindowPopup.tsx b/apps/wr/app/map/newWindowPopup.tsx index 1fbd0df33..ee6216b28 100644 --- a/apps/wr/app/map/newWindowPopup.tsx +++ b/apps/wr/app/map/newWindowPopup.tsx @@ -198,8 +198,8 @@ const NewWindowPopup: React.FC = ({ if (!pbnstSttn.isInit) { pbnSttnInit("1", "13", { partValue: "A", - sidoValue: "0", - sigunValue: "", + sidoValue: '0', + sigunValue: "0", regionValue: "", unitWaterShedValue: "", middleRegionValue: "", @@ -242,7 +242,7 @@ const NewWindowPopup: React.FC = ({ { partValue: "A", sidoValue: "0", - sigunValue: "", + sigunValue: "0", regionValue: "", unitWaterShedValue: "", middleRegionValue: "", From 1a6af2168b8a5de50810737c88dabcff515ab7f5 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Tue, 8 Jul 2025 09:48:51 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=EC=82=AC=EC=97=85=EC=B2=B4=20=ED=9E=8C?= =?UTF-8?q?=ED=8A=B8=EB=B0=95=EC=8A=A4=20=EC=9C=84=EB=A1=9C=EB=9C=A8?= =?UTF-8?q?=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ui/sdmInsertForm/sdmNameBox.tsx | 152 ++++++++++-------- 1 file changed, 87 insertions(+), 65 deletions(-) diff --git a/packages/common/business_components/src/ui/sdmInsertForm/sdmNameBox.tsx b/packages/common/business_components/src/ui/sdmInsertForm/sdmNameBox.tsx index 3c8fd7192..059d63d90 100644 --- a/packages/common/business_components/src/ui/sdmInsertForm/sdmNameBox.tsx +++ b/packages/common/business_components/src/ui/sdmInsertForm/sdmNameBox.tsx @@ -1,14 +1,14 @@ -import React, { useCallback, useEffect, useRef, useState } from 'react'; -import type { DemandCompType } from './form'; +import React, { useCallback, useEffect, useRef, useState } from "react"; +import type { DemandCompType } from "./form"; export type thisProps = { label: string | undefined; initValue: string | undefined; - dataList : DemandCompType[]; - rtnValue : (searchText: string, pageCnt: number) => void; - rtnData : (item: DemandCompType) => void; - rtnText : (text: string) => void; -} + dataList: DemandCompType[]; + rtnValue: (searchText: string, pageCnt: number) => void; + rtnData: (item: DemandCompType) => void; + rtnText: (text: string) => void; +}; /** * 수요처 검색 컴포넌트 @@ -18,88 +18,110 @@ export type thisProps = { * @param dataList 검색할 때 넘기는 데이터 리스트 * @param rtnData 검색 결과 반환 함수 */ -export const SdmSearchForm = ({label=undefined, initValue=undefined, rtnValue=()=>{}, dataList=[], rtnData=()=>{}, rtnText=()=>{} } :thisProps) => { - +export const SdmSearchForm = ({ + label = undefined, + initValue = undefined, + rtnValue = () => {}, + dataList = [], + rtnData = () => {}, + rtnText = () => {}, +}: thisProps) => { const [isOpen, setIsOpen] = useState(false); - const [textValue, setTextValue] = useState(initValue || ''); + const [textValue, setTextValue] = useState(initValue || ""); const wrapperRef = useRef(null); - const handleInputChange = useCallback((e: React.ChangeEvent) => { - const value = e.target.value; - setTextValue(value); - rtnValue(value, 10); - rtnText(value); - if (value) { - setIsOpen(true); - } else { - setIsOpen(false); - } - }, [rtnValue, rtnText]); + const handleInputChange = useCallback( + (e: React.ChangeEvent) => { + const value = e.target.value; + setTextValue(value); + rtnValue(value, 10); + rtnText(value); + if (value) { + setIsOpen(true); + } else { + setIsOpen(false); + } + }, + [rtnValue, rtnText], + ); - const handleSuggestionClick = useCallback((item: DemandCompType) => { - setTextValue(item.dmdCoNm); - rtnData(item); - setIsOpen(false); - }, [rtnData]); + const handleSuggestionClick = useCallback( + (item: DemandCompType) => { + setTextValue(item.dmdCoNm); + rtnData(item); + setIsOpen(false); + }, + [rtnData], + ); useEffect(() => { const handleClickOutside = (event: MouseEvent) => { - if (wrapperRef.current && !wrapperRef.current.contains(event.target as Node)) { + if ( + wrapperRef.current && + !wrapperRef.current.contains(event.target as Node) + ) { setIsOpen(false); } }; - document.addEventListener('mousedown', handleClickOutside); + document.addEventListener("mousedown", handleClickOutside); return () => { - document.removeEventListener('mousedown', handleClickOutside); + document.removeEventListener("mousedown", handleClickOutside); }; }, []); useEffect(() => { - if(initValue&& initValue?.length>0){ - setTextValue(initValue) + if (initValue && initValue?.length > 0) { + setTextValue(initValue); } - },[initValue]) - + }, [initValue]); + return ( -
+
setIsOpen(true)} */ - className="w-full h-[3.2rem] !text-xl pl-3 text-gray-600 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" + className="h-[3.2rem] w-full rounded-md border border-gray-300 pl-3 !text-xl text-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder={`${label}을(를) 입력하세요`} /> {isOpen && ( -
+
- {dataList && dataList.length > 0 ? dataList.map((item : DemandCompType, index : number) => ( -
handleSuggestionClick(item)} - role="button" - tabIndex={0} - onKeyDown={(e) => { - if (e.key === 'Enter' || e.key === ' ') { - handleSuggestionClick(item); - } - }} - > - {item.dmdInfoPk.substring(10,14) !== '0000' ? ( - <> - 사업자번호 : {item.dmdInfoPk.substring(0,10)}  - 종사업자번호 : {item.dmdInfoPk.substring(10,14)}  - - ) : ( - <> - 사업자번호 : {item.dmdInfoPk.substring(0,10)}  - - )} - {item.dmdCoNm} -
- )) : ( -
+ {dataList && dataList.length > 0 ? ( + dataList.map((item: DemandCompType, index: number) => ( +
handleSuggestionClick(item)} + role="button" + tabIndex={0} + onKeyDown={(e) => { + if (e.key === "Enter" || e.key === " ") { + handleSuggestionClick(item); + } + }} + > + {item.dmdInfoPk.substring(10, 14) !== "0000" ? ( + <> + 사업자번호 : {" "} + {item.dmdInfoPk.substring(0, 10)}  + + 종사업자번호 :{" "} + {" "} + {item.dmdInfoPk.substring(10, 14)}  + + ) : ( + <> + 사업자번호 : {" "} + {item.dmdInfoPk.substring(0, 10)}  + + )} + {item.dmdCoNm} +
+ )) + ) : ( +
검색 결과가 없습니다.
)} @@ -107,5 +129,5 @@ export const SdmSearchForm = ({label=undefined, initValue=undefined, rtnValue=()
)}
- ) -} \ No newline at end of file + ); +}; From 2642f734320a30a1d4db4e1ebb6064327d3054a2 Mon Sep 17 00:00:00 2001 From: jyha00 Date: Tue, 8 Jul 2025 09:54:08 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=EC=9E=AC=EC=9D=B4=EC=9A=A9=EC=8B=9C?= =?UTF-8?q?=EC=84=A4=ED=98=84=ED=99=A9=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=ED=95=AD=EB=AA=A9=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD,=20=ED=97=A4=EB=93=9C=EB=A6=AC=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EB=B2=88=ED=98=B8=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruseFcltMng/fcltSttn/pbnstSttn/page.tsx | 2 +- .../fcltSttn/rainSttn/headList.tsx | 6 +- .../fcltSttn/rswtSttn/headList.tsx | 6 +- .../ui/modal/sttn/headChModal/headChModal.tsx | 141 +++++++++++------- 4 files changed, 92 insertions(+), 63 deletions(-) diff --git a/apps/wr/app/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx b/apps/wr/app/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx index 13a71263e..e2d54d6f8 100644 --- a/apps/wr/app/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx @@ -173,7 +173,7 @@ export default function PbnstSttn() {
diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx index 8dd2a4d6f..ad2223473 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx @@ -136,7 +136,7 @@ export const rainSttHeadListExport: z.infer = [ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "bdnstInfo", - title: "1.건축물정보", + title: "건축물정보", visible: true, row: 1, rowSpan: 1, @@ -144,7 +144,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ }, { id: "rainFcltInfo", - title: "2.빗물이용시설정보", + title: "빗물이용시설정보", visible: true, row: 1, rowSpan: 1, @@ -152,7 +152,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ }, { id: "insenInfo", - title: "3.인센티브 정보", + title: "인센티브 정보", visible: true, row: 1, rowSpan: 1, diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/headList.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/headList.tsx index 804617ad8..9989290e7 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/headList.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/headList.tsx @@ -130,7 +130,7 @@ export const rswtSttHeadListExport: z.infer = [ export const rswtSttNodeListExport: CommonTableProps[] = [ { id: "bdnstInfo", - title: "1.건축물정보", + title: "건축물정보", visible: true, row: 1, rowSpan: 1, @@ -138,7 +138,7 @@ export const rswtSttNodeListExport: CommonTableProps[] = [ }, { id: "rswtFcltInfo", - title: "2.중수도시설정보", + title: "중수도시설정보", visible: true, row: 1, rowSpan: 1, @@ -146,7 +146,7 @@ export const rswtSttNodeListExport: CommonTableProps[] = [ }, { id: "insenInfo", - title: "3.인센티브 정보", + title: "인센티브 정보", visible: true, row: 1, rowSpan: 1, diff --git a/apps/wr/components/ui/modal/sttn/headChModal/headChModal.tsx b/apps/wr/components/ui/modal/sttn/headChModal/headChModal.tsx index 83a5a3523..4b3c8aa75 100644 --- a/apps/wr/components/ui/modal/sttn/headChModal/headChModal.tsx +++ b/apps/wr/components/ui/modal/sttn/headChModal/headChModal.tsx @@ -1,5 +1,5 @@ import { useWrStore } from "@/app/store"; -import { sttnHeadListType } from "@/app/store/ruseFcltMng/fcltSttn/rainSttn/headList"; +import { sttnHeadListType } from "@/app/store/ruseFcltMng/fcltSttn/rainSttn/headList"; import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from "@common/business_components/ui"; import { Button, Checkbox } from "@common/components/ui"; import { zodResolver } from "@hookform/resolvers/zod"; @@ -7,33 +7,54 @@ import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import { z } from "zod"; -export default function HeadChModal({headList, type }:{headList : z.infer ,type:string }) { - const { rainChSttnHead , rswtChSttnHead, htdflChSttnHead, pbnstChSttnHead} = useWrStore((state) => state); - - - let items = headList.map(item => ({id:item.id, title:item.title, val:item.visible })); - - - const form = useForm>({ - resolver: zodResolver(sttnHeadListType), - defaultValues: [], - }) +export default function HeadChModal({ headList, type }: { headList: z.infer, type: string }) { + const { rainChSttnHead, rswtChSttnHead, htdflChSttnHead, pbnstChSttnHead } = useWrStore((state) => state); - useEffect(() =>{ - form.reset(headList) + let items = headList.map(item => ({ id: item.id, title: item.title, val: item.visible })); - },[headList]) + /*const form = useForm>({ + resolver: zodResolver(sttnHeadListType), + defaultValues: [], + }) - const onSubmit = (valueList : z.infer ) =>{ - if(type==='RNB'){ + + useEffect(() =>{ + form.reset(headList) + + + },[headList])*/ + + const form = useForm>({ + resolver: zodResolver(sttnHeadListType), + defaultValues: headList, + }); + + useEffect(() => { + form.reset(headList); + }, [headList, form]); + + const rawValues = form.watch(); + const values: Array<{ visible: boolean }> = Array.isArray(rawValues) + ? rawValues + : Object.values(rawValues); + + const allChecked = values.every((v) => v.visible); + + const toggleAll = (checked: boolean) => { + const newValues = values.map((v) => ({ ...v, visible: checked })); + form.reset(newValues); + }; + + const onSubmit = (valueList: z.infer) => { + if (type === 'RNB') { rainChSttnHead(valueList) - }else if(type=== 'RST'){ + } else if (type === 'RST') { rswtChSttnHead(valueList) - }else if(type === 'HTB'){ + } else if (type === 'HTB') { htdflChSttnHead(valueList) - }else if(type === 'PBN'){ + } else if (type === 'PBN') { pbnstChSttnHead(valueList) } } @@ -42,42 +63,50 @@ export default function HeadChModal({headList, type }:{headList : z.infer
- - -
-

조회항목 설정

-
- {items.map((item,index) => ( - - { - return ( - - - - { - field.onChange(checked); - return; - } - } - /> - - - {item.title} - - - ); - }} - /> - ))} + + +
+

조회항목 설정

+
+ {/* 전체 선택/해제 체크박스 */} + + + toggleAll(checked as boolean)} + /> + + 전체 + + {items.map((item, index) => ( + { + return ( + + + { + field.onChange(checked); + return; + } + } + /> + + + {item.title} + + + ); + }} + /> + ))} From 3bba3dce98200f52bfbf8126eb67c2545fb63874 Mon Sep 17 00:00:00 2001 From: JIeunhuh Date: Tue, 8 Jul 2025 10:32:56 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=96=B4=EB=AA=85=20?= =?UTF-8?q?=EA=B0=80=EC=A0=B8=EC=98=AC=EB=95=8C=20=EC=B2=B4=ED=81=AC?= =?UTF-8?q?=EB=90=9C=20=EA=B0=92=EB=A7=8C=20=EA=B0=80=EC=A0=B8=EC=98=A4?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/map/newWindowPopup.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/wr/app/map/newWindowPopup.tsx b/apps/wr/app/map/newWindowPopup.tsx index ee6216b28..c60c3b537 100644 --- a/apps/wr/app/map/newWindowPopup.tsx +++ b/apps/wr/app/map/newWindowPopup.tsx @@ -123,9 +123,9 @@ const NewWindowPopup: React.FC = ({ if (!featureData) return; ///////////////////////////////////////////// 피쳐데이터 선택 시 각 시설별 데이터 처리 /////////////////////////////////////////////// useEffect(() => { + const layerId = getSelectedLayers(); if (featureData && typeof featureData.getProperties === "function") { const selectedVal = featureData.getProperties(); - const layerId = getSelectedLayers(); let featureCd = layerId == '하수재이용시설' ? selectedVal?.swtrmt_fclt_cd : layerId == '빗물이용시설' || layerId == '중수도시설' ? selectedVal?.bdst_nm : layerId == '하수처리시설' ? 'a' : null; if (featureCd && featureCd !== fcltPk) { if (layerId == '하수재이용시설') { @@ -157,9 +157,9 @@ const NewWindowPopup: React.FC = ({ setHtdflDetailModal({ isOpen: true, data: htdflSttnRes[0] }); setViewMode("detail") } - else if(layerId =='하수처리시설') setViewMode('nothing') + else if(layerId =='하수처리시설') onClose(); } - } else if (seletectedLayerNm) { setViewMode("list") } + } else if (layerId === null && seletectedLayerNm) { setViewMode("list") } }, [featureData]); ///////////////////////////////////////////// 피쳐데이터 선택 시 각 시설별 데이터 처리 /////////////////////////////////////////////// @@ -179,7 +179,7 @@ const NewWindowPopup: React.FC = ({ }; const getSelectedLayers = () => { let result = null; - const layers = gisMap ? gisMap.getLayers().getArray() : []; // gisMap이 null인지 확인 후 레이어 가져오기 + const layers = gisMap ? gisMap.getLayers().getArray().filter((l:any) => l.getVisible()) : []; // gisMap이 null인지 확인 후 레이어 가져오기 let featureLayer: { get: (key: string) => any } = { get: (key: string) => null }; // 피처가 속한 레이어를 찾기 위한 변수 layers.forEach((layer: any) => { const source = layer.getSource();