From bf241073b02582908ff7a2f3cbb21a1be307d25a Mon Sep 17 00:00:00 2001 From: leedj312 Date: Wed, 9 Jul 2025 01:36:19 +0900 Subject: [PATCH 01/11] =?UTF-8?q?=EC=88=98=EC=9A=94=EC=B2=98=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=EC=8B=9C=20=EC=98=88=EC=99=B8=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80(=ED=8C=A8=EC=8A=A4=EC=9B=8C=EB=93=9C=20?= =?UTF-8?q?=ED=99=95=EC=9D=B8=EB=9E=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/business_components/src/ui/sdmInsertForm/form.tsx | 1 + .../common/business_components/src/ui/sdmInsertForm/index.tsx | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/common/business_components/src/ui/sdmInsertForm/form.tsx b/packages/common/business_components/src/ui/sdmInsertForm/form.tsx index a42dea012..e58592837 100644 --- a/packages/common/business_components/src/ui/sdmInsertForm/form.tsx +++ b/packages/common/business_components/src/ui/sdmInsertForm/form.tsx @@ -234,6 +234,7 @@ export function SdmRegForm({ form, onCheckboxChange, selectSidoData, selectSigun }, [updateList,form]); useEffect(() => { + console.log( 'form.formState.errors ', form.formState.errors) },[form.formState.errors]) const formFields: Array<{ diff --git a/packages/common/business_components/src/ui/sdmInsertForm/index.tsx b/packages/common/business_components/src/ui/sdmInsertForm/index.tsx index c564b63dd..9b46cc653 100644 --- a/packages/common/business_components/src/ui/sdmInsertForm/index.tsx +++ b/packages/common/business_components/src/ui/sdmInsertForm/index.tsx @@ -47,7 +47,9 @@ const createFormSchema = (isBznmTotNoDisabled: boolean, isDuplicate: boolean ,up ? z.string().optional() // 패스워드는 선택 사항이며 길이 제한 없음 : z.string().optional() .refine((val) => !val || (val.length >= 8 && val.length <= 16), "패스워드는 8자 이상 16자 이내로 입력해주세요"), - dmdAplyPswdConfirm: z.string() + dmdAplyPswdConfirm: updateList?.dmdInfoPk // 업데이트일경우 + ? z.string().optional() // 패스워드는 선택 사항이며 길이 제한 없음 + :z.string() .min(1, "패스워드확인을 입력해주세요"), }).refine((data) => { // 패스워드 확인 검증 From 4745c87ab0c3ea541d706012d6cbed9b24f3a98d Mon Sep 17 00:00:00 2001 From: leedj312 Date: Wed, 9 Jul 2025 01:44:17 +0900 Subject: [PATCH 02/11] =?UTF-8?q?=EC=88=98=EC=9A=94=EC=B2=98=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=5F=20rgtr=20nullsh=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/business_components/src/ui/sdmInsertForm/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/common/business_components/src/ui/sdmInsertForm/index.tsx b/packages/common/business_components/src/ui/sdmInsertForm/index.tsx index 9b46cc653..35c609f9e 100644 --- a/packages/common/business_components/src/ui/sdmInsertForm/index.tsx +++ b/packages/common/business_components/src/ui/sdmInsertForm/index.tsx @@ -42,7 +42,7 @@ const createFormSchema = (isBznmTotNoDisabled: boolean, isDuplicate: boolean ,up .min(8, "전화번호는 8자 이상 입력해주세요") .max(11, "전화번호는 11자 이내로 입력해주세요") .regex(/^[0-9]+$/, "전화번호는 숫자만 입력 가능합니다"), - rgtr: z.string().optional(), + rgtr: z.string().nullish(), dmdAplyPswd : updateList?.dmdInfoPk // 업데이트일경우 ? z.string().optional() // 패스워드는 선택 사항이며 길이 제한 없음 : z.string().optional() From fc1aa4fe061fe26826292695cddbf8220861b8c1 Mon Sep 17 00:00:00 2001 From: JIeunhuh Date: Wed, 9 Jul 2025 11:45:53 +0900 Subject: [PATCH 03/11] =?UTF-8?q?=ED=98=84=ED=99=A9=20=EC=98=A4=ED=94=88?= =?UTF-8?q?=20=EC=8B=9C=20=EB=A0=88=EC=9D=B4=EC=96=B4=EB=AA=85=EC=97=90=20?= =?UTF-8?q?=EB=94=B0=EB=A5=B8=20featureid=20=EA=B5=AC=EB=B6=84=20=EC=9E=91?= =?UTF-8?q?=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business_components/src/ui/map/Gis.js | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/packages/common/business_components/src/ui/map/Gis.js b/packages/common/business_components/src/ui/map/Gis.js index ef5c21d5b..880c116cd 100644 --- a/packages/common/business_components/src/ui/map/Gis.js +++ b/packages/common/business_components/src/ui/map/Gis.js @@ -46,7 +46,7 @@ function Gis({ const gisCore = useMemo(() => new GisApp.core({ targetId: mapRef.current }), []); const mapInstanceRef = useRef(null); const checkedLayerIds = useRef([]); - + const layerNmRef = useRef('') // 팝업 데이터를 저장할 상태와 오버레이 참조를 저장할 ref 추가 // const [facilityInfoPopupData, setFacilityInfoPopupData] = useState([]); @@ -84,12 +84,32 @@ function Gis({ foundFeature = data; } else { // 아니면 featureId로 맵에서 Feature 인스턴스를 찾아서 사용 - const featureId = data.fid || data.ftrIdn || data.id; + let featureId + const layerName = layerNmRef.current + if (layerName === '하수재이용시설') { + featureId = data.searchPk; + } else if (layerName === '빗물이용시설') { + featureId = data.bdstInfoPk; + } else if (layerName === '하수처리시설') { + featureId = data.bscFctCd; + } else if (layerName === '중수도시설' || layerName == '온배수시설') { + featureId = data.bdstRuseFcltPk; + } else { + console.warn('해당 레이어에 대한 featureId 매핑 없음', layerNm); + featureId = data.fid || data.id || data.ftrIdn; + } gisMap.getLayers().getArray().forEach(layer => { const source = layer.getSource?.(); - if (source?.getFeatureById) { - const feature = source.getFeatureById(String(featureId).trim()); - if (feature) foundFeature = feature; + if (source?.getFeatures) { + const allFeatures = source.getFeatures(); + for (const f of allFeatures) { + const id = String(f.getId()); + // console.log('id', id, featureId) + if (id && id.split('.')[1] === String(featureId)) { + foundFeature = f; + break; + } + } } }); } @@ -360,6 +380,7 @@ function Gis({ setVisible={setTabVisible} onCheckedChange={handleCheckedLayersChange} onLayerIconClick={(nodeNm) => { + layerNmRef.current = nodeNm setLayerNm(nodeNm); setIsOpen(true); const dummyFeature = { getProperties: () => ({}), // 최소 구조 }; @@ -375,6 +396,7 @@ function Gis({ featureData={featureData || { getProperties: () => ({}) }} seletectedLayerNm={layerNm} onClose={closePopup} // 닫기 콜백 전달 + onFeatureSelect={handleFeatureSelect} /> )} {/* SearchView가 존재할 때만 렌더링 */} From 90fda952ad0efb22e8c0018cb7d8291118f51d8c Mon Sep 17 00:00:00 2001 From: JIeunhuh Date: Wed, 9 Jul 2025 13:27:34 +0900 Subject: [PATCH 04/11] =?UTF-8?q?=EC=8B=9C=EC=84=A4=20=EC=84=A0=ED=83=9D?= =?UTF-8?q?=20=EC=8B=9C=20=ED=98=84=ED=99=A9=EB=AA=A9=EB=A1=9D=20=EB=B3=B4?= =?UTF-8?q?=EC=9D=B4=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=83=9D=EC=84=B1=EC=97=AC?= =?UTF-8?q?=EB=B6=80=20props=EB=A1=9C=20=EB=84=98=EA=B8=B0=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/common/business_components/src/ui/map/Gis.js | 2 ++ .../common/business_components/src/ui/map/GisTree.js | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/common/business_components/src/ui/map/Gis.js b/packages/common/business_components/src/ui/map/Gis.js index 880c116cd..bad4d313c 100644 --- a/packages/common/business_components/src/ui/map/Gis.js +++ b/packages/common/business_components/src/ui/map/Gis.js @@ -30,6 +30,7 @@ function Gis({ setIsOpen, setFeatureData, featureData, + imgVisble = false, searchView: SearchView, detailView: DetailView, onFeatureSelect, @@ -386,6 +387,7 @@ function Gis({ }; onFeatureSelect(dummyFeature); }} + imageVisible={imgVisble} /> {/* */} diff --git a/packages/common/business_components/src/ui/map/GisTree.js b/packages/common/business_components/src/ui/map/GisTree.js index 5b30dc7f4..8a2db3ae2 100644 --- a/packages/common/business_components/src/ui/map/GisTree.js +++ b/packages/common/business_components/src/ui/map/GisTree.js @@ -10,7 +10,7 @@ import { DndProvider } from "react-dnd"; import { useGisContext } from './Gis'; import GisApp from './lib/gis.core'; -export default React.memo(function GisTree({ checkedNodes = [], setCheckedNodes = () => { }, visible, setVisible, onCheckedChange, onLayerIconClick }) { +export default React.memo(function GisTree({ checkedNodes = [], setCheckedNodes = () => { }, visible, setVisible, onCheckedChange, onLayerIconClick,imageVisible=false }) { const { gisCore, treeData } = useGisContext(); const [checked, setChecked] = useState([]); const [expanded, setExpanded] = useState([]); @@ -188,9 +188,9 @@ export default React.memo(function GisTree({ checkedNodes = [], setCheckedNodes image.src = canvas.toDataURL('image/png'); return image; }; - const handleLayerImgClick = (nodeNm) => { - console.log('click!', nodeNm) - onLayerIconClick(nodeNm) + const handleLayerImgClick = (nodeNm, nodeId) => { + if(!checked.includes(nodeId)) alert('시설을 선택해주세요') + else onLayerIconClick(nodeNm) } if (!treeData || treeData.length === 0) return null; @@ -224,7 +224,7 @@ export default React.memo(function GisTree({ checkedNodes = [], setCheckedNodes handleCheck(node.id)} className="cursor-pointer" /> {node.icon && {node.icon}} {node.text} - {depth > 0 && {handleLayerImgClick(node.text)}} alt={node.text}>} + {imageVisible ? depth > 0 && {handleLayerImgClick(node.text, node.id)}} alt={node.text}> : null} )} sort={(a, b) => { From 17f6e640a6b06abec655af339d28fa7375d2f42b Mon Sep 17 00:00:00 2001 From: swcho Date: Wed, 9 Jul 2025 15:29:36 +0900 Subject: [PATCH 05/11] =?UTF-8?q?Revert=20"feat:=20DatePicker=20zIndex=20p?= =?UTF-8?q?rops=20=EB=8B=A4=EC=8B=9C=20=EC=A0=81=EC=9A=A9"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4224375b3a5aa1e3213b96ccfc3fff067a9ce06a. --- packages/common/components/src/ui/date-picker/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/common/components/src/ui/date-picker/index.tsx b/packages/common/components/src/ui/date-picker/index.tsx index 85c584e5f..67265df0e 100644 --- a/packages/common/components/src/ui/date-picker/index.tsx +++ b/packages/common/components/src/ui/date-picker/index.tsx @@ -40,8 +40,10 @@ export function DatePicker({ From b3a69bf2ef34331c10436669de505fa9e7caf4b6 Mon Sep 17 00:00:00 2001 From: swcho Date: Wed, 9 Jul 2025 15:29:57 +0900 Subject: [PATCH 06/11] =?UTF-8?q?Revert=20"feat:=20DatePicker=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20zIndex=20props=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 52a5650ca593c82790d8d34d5f38293797f41739. --- .../components/src/ui/date-picker/index.tsx | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/packages/common/components/src/ui/date-picker/index.tsx b/packages/common/components/src/ui/date-picker/index.tsx index 67265df0e..ee5d37872 100644 --- a/packages/common/components/src/ui/date-picker/index.tsx +++ b/packages/common/components/src/ui/date-picker/index.tsx @@ -2,7 +2,7 @@ import "./date-picker.css"; import { format } from "date-fns"; import { CalendarIcon } from "lucide-react"; -import type { DayPicker } from "react-day-picker"; +import type { DayPickerSingleProps } from "react-day-picker"; import { cn } from "../../lib/utils"; import { Button } from "../button"; @@ -12,15 +12,12 @@ import { Popover, PopoverContent, PopoverTrigger } from "../popover"; type DatePickerProps = { placeholder?: string; disabled?: boolean; - selected?: Date; - zIndex?: number; // z-index prop 추가 -} & React.ComponentProps; +} & DayPickerSingleProps; export function DatePicker({ className, placeholder = "날짜 선택", disabled, - zIndex, // zIndex prop 받기 ...props }: DatePickerProps) { return ( @@ -39,13 +36,8 @@ export function DatePicker({ )} - - + + ); From f4d6b3415ba34f9e3dc245e462479c5400702618 Mon Sep 17 00:00:00 2001 From: JIeunhuh Date: Wed, 9 Jul 2025 17:41:15 +0900 Subject: [PATCH 07/11] =?UTF-8?q?=EC=A4=91=EC=88=98=EB=8F=84=EC=8B=9C?= =?UTF-8?q?=EC=84=A4=20=EC=A1=B0=EA=B1=B4=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/common/business_components/src/ui/map/Gis.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/common/business_components/src/ui/map/Gis.js b/packages/common/business_components/src/ui/map/Gis.js index bad4d313c..3a7bec1b8 100644 --- a/packages/common/business_components/src/ui/map/Gis.js +++ b/packages/common/business_components/src/ui/map/Gis.js @@ -89,11 +89,11 @@ function Gis({ const layerName = layerNmRef.current if (layerName === '하수재이용시설') { featureId = data.searchPk; - } else if (layerName === '빗물이용시설') { + } else if (layerName === '빗물이용시설'|| layerName == '중수도시설') { featureId = data.bdstInfoPk; } else if (layerName === '하수처리시설') { featureId = data.bscFctCd; - } else if (layerName === '중수도시설' || layerName == '온배수시설') { + } else if (layerName === '온배수시설' ) { featureId = data.bdstRuseFcltPk; } else { console.warn('해당 레이어에 대한 featureId 매핑 없음', layerNm); From e9ff6bbeb5a02657f5099ce69fcf51ce336fa420 Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Wed, 9 Jul 2025 18:26:15 +0900 Subject: [PATCH 08/11] =?UTF-8?q?=EB=B0=94=EC=B0=A8=ED=8A=B8=20=ED=81=AC?= =?UTF-8?q?=EA=B8=B0=EB=B9=84=EC=9C=A8=20=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ui/chart/BarChart.tsx | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/packages/common/business_components/src/ui/chart/BarChart.tsx b/packages/common/business_components/src/ui/chart/BarChart.tsx index 02d3a7c60..ddd0ac272 100644 --- a/packages/common/business_components/src/ui/chart/BarChart.tsx +++ b/packages/common/business_components/src/ui/chart/BarChart.tsx @@ -74,17 +74,25 @@ const CustomLegend = (props: any) => { ); }; +// chartData의 모든 값 중 최대값 구하기 +const getGlobalMax = (data: Record[]) => { + if (!data || data.length === 0) return 0; + return Math.max( + ...data.flatMap(item => + Object.entries(item) + .filter(([key]) => key !== 'label') + .map(([, value]) => value as number) + ) + ); +}; + export default function Chart({chartConfig=undefined, chartData=[], chartTitle='차트', chartClassName='w-full h-full', graphSize=40, yFieldText='', showLegend=false} : BarChartProps) { const colors = ["#FF6B6B", "#4ECDC4", "#45B7D1", "#FED16A", "#FFEEAD", "#D4A5A5"]; - const getMaxValue = (data: any[], keyPrefix: string) => { - return Math.max(...data.map(item => - Object.keys(item) - .filter(key => key.includes(keyPrefix)) - .map(key => item[key]) - ).flat()); - }; - - const barMaxValue = getMaxValue(chartData, 'barVal'); + const globalMax = getGlobalMax(chartData); + const tickCount = 5; + // interval을 globalMax / tickCount로 계산 + const interval = globalMax / tickCount; + const ticks = Array.from({ length: tickCount + 1 }, (_, i) => Math.round(interval * i)); return ( <> {chartTitle && chartTitle !== "" && chartTitle !== "undefined" ? ( @@ -93,8 +101,8 @@ export default function Chart({chartConfig=undefined, chartData=[], chartTitle=' ): null}
- - + + }/> {chartData && chartData.length > 0 && ( From 58e0322bfeb9933313f37d14c71c97b76c74e4fb Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Wed, 9 Jul 2025 19:33:40 +0900 Subject: [PATCH 09/11] =?UTF-8?q?=EC=B4=88=EA=B8=B0=ED=99=94=EC=8B=9C=20?= =?UTF-8?q?=ED=96=89=EC=A0=95=EB=B3=84=20A=EB=A1=9C=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=20(304=EB=9D=BC=EC=9D=B8)=20=EA=B1=B4=EB=93=A4=EC=A7=80?= =?UTF-8?q?=EB=A7=88=EC=84=B8=EC=9A=94=20...=E3=85=A0=E3=85=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business_components/src/ui/search_form_left/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/common/business_components/src/ui/search_form_left/index.tsx b/packages/common/business_components/src/ui/search_form_left/index.tsx index 4f36c078c..a891ec207 100644 --- a/packages/common/business_components/src/ui/search_form_left/index.tsx +++ b/packages/common/business_components/src/ui/search_form_left/index.tsx @@ -301,7 +301,7 @@ function SearchFormLeft({ isShowPart = false, children, selectSidoData = [], sel resetAllValues(); // 리셋 후 트리거를 false로 설정 if (setRtnPartValue) { - setRtnPartValue('0'); + setRtnPartValue('A'); } } }, [resetTrigger]); From 3ec986dfbeb8a0a834fcdcd620815e3819e352df Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Wed, 9 Jul 2025 19:52:42 +0900 Subject: [PATCH 10/11] =?UTF-8?q?datepickerrange=20=EC=83=9D=EC=84=B1(?= =?UTF-8?q?=EC=86=90=EB=8C=80=EC=A7=80=EB=A7=88=EC=84=B8=EC=9A=94)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ui/date_picker_range/index.tsx | 46 +++++++++++++++++++ .../business_components/src/ui/index.ts | 3 +- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 packages/common/business_components/src/ui/date_picker_range/index.tsx diff --git a/packages/common/business_components/src/ui/date_picker_range/index.tsx b/packages/common/business_components/src/ui/date_picker_range/index.tsx new file mode 100644 index 000000000..3a6ab1ae0 --- /dev/null +++ b/packages/common/business_components/src/ui/date_picker_range/index.tsx @@ -0,0 +1,46 @@ +import "./date-picker.css"; + +import { format } from "date-fns"; +import { CalendarIcon } from "lucide-react"; +import type { DayPickerSingleProps } from "react-day-picker"; + +import { cn } from "../../lib/utils"; +import { Button } from "@common/components/ui"; +import { Calendar } from "@common/components/ui"; +import { Popover, PopoverContent, PopoverTrigger } from "@common/components/ui"; + +type DatePickerRangeProps = { + placeholder?: string; + disabled?: boolean | ((date: Date) => boolean); +} & DayPickerSingleProps; + +export function DatePickerRange({ + className, + placeholder = "날짜 선택", + disabled, + ...props +}: DatePickerRangeProps) { + return ( + + + + + + + + + ); +} diff --git a/packages/common/business_components/src/ui/index.ts b/packages/common/business_components/src/ui/index.ts index fd1e6fe9e..eab3a7eab 100644 --- a/packages/common/business_components/src/ui/index.ts +++ b/packages/common/business_components/src/ui/index.ts @@ -21,4 +21,5 @@ export * from "./table_div"; export * from "./title"; export * from "./sdmInsertForm"; export * from "./popover_ui"; -export * from "./date_month_picker"; \ No newline at end of file +export * from "./date_month_picker"; +export * from "./date_picker_range" \ No newline at end of file From 9ab0302e0893eab8bd3872a0b03d1981eba000e8 Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Wed, 9 Jul 2025 20:00:01 +0900 Subject: [PATCH 11/11] =?UTF-8?q?=EB=8B=AC=EB=A0=A5=20=EB=A7=8C=EB=93=A0?= =?UTF-8?q?=EA=B1=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business_components/src/ui/date_picker_range/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/common/business_components/src/ui/date_picker_range/index.tsx b/packages/common/business_components/src/ui/date_picker_range/index.tsx index 3a6ab1ae0..70565230a 100644 --- a/packages/common/business_components/src/ui/date_picker_range/index.tsx +++ b/packages/common/business_components/src/ui/date_picker_range/index.tsx @@ -1,4 +1,4 @@ -import "./date-picker.css"; +import "../date_picker/date-picker.css"; import { format } from "date-fns"; import { CalendarIcon } from "lucide-react";