From a5aeeb3d40d48505d6bdcc152f505a3e9b5c1f21 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Sat, 28 Jun 2025 15:00:43 +0900 Subject: [PATCH 01/13] =?UTF-8?q?datemonthPicker=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ui/date_month_picker/index.tsx | 82 ++++++++++++ .../src/ui/date_month_picker/mothPicker.tsx | 125 ++++++++++++++++++ .../business_components/src/ui/index.ts | 3 +- 3 files changed, 209 insertions(+), 1 deletion(-) create mode 100644 packages/common/business_components/src/ui/date_month_picker/index.tsx create mode 100644 packages/common/business_components/src/ui/date_month_picker/mothPicker.tsx diff --git a/packages/common/business_components/src/ui/date_month_picker/index.tsx b/packages/common/business_components/src/ui/date_month_picker/index.tsx new file mode 100644 index 000000000..d318b561f --- /dev/null +++ b/packages/common/business_components/src/ui/date_month_picker/index.tsx @@ -0,0 +1,82 @@ +'use client'; + +import { cn } from "../../lib/utils"; +import { + Popover, + PopoverTrigger, + PopoverContent, + Button, +} from "@common/components/ui"; +import { ko } from "date-fns/locale"; +import { format } from "date-fns"; +import { useState } from "react"; +import { MonthPicker } from "./mothPicker"; +import { CalendarIcon } from "lucide-react"; + +type MonthPickerProps = { + field: { value: string; onChange: (date: string) => void }; // yyyyMM 문자열 + selectClass?: string; + readOnly?: boolean; +}; + +// yyyyMM → Date 객체 +const parseYYYYMM = (value: string) => { + const year = Number(value.substring(0, 4)); + const month = Number(value.substring(4, 6)) - 1; + return new Date(year, month); +}; + +// Date 객체 → yyyyMM 문자열 +const formatDateToYYYYMM = (date: Date) => { + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, "0"); + return `${year}${month}`; +}; + +export const DateMonthPicker = ({ + field, + selectClass, + readOnly = false, +}: MonthPickerProps) => { + const [open, setOpen] = useState(false); + + const parsedDate = field?.value ? parseYYYYMM(field.value) : new Date(); + + const handleSelect = ( + date: Date | undefined, + shouldClosePopover?: boolean + ) => { + if (!readOnly && date) { + field.onChange(formatDateToYYYYMM(date)); + if (shouldClosePopover) setOpen(false); + } + }; + + return ( + + + + + + + + + ); +}; diff --git a/packages/common/business_components/src/ui/date_month_picker/mothPicker.tsx b/packages/common/business_components/src/ui/date_month_picker/mothPicker.tsx new file mode 100644 index 000000000..acf17fba4 --- /dev/null +++ b/packages/common/business_components/src/ui/date_month_picker/mothPicker.tsx @@ -0,0 +1,125 @@ +import { cn } from "../../lib/utils"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@common/components/ui"; +import { + eachMonthOfInterval, + endOfYear, + format, + isEqual, + isFuture, + parse, + startOfMonth, + startOfToday, +} from "date-fns"; +import { ko } from "date-fns/locale"; + +function getStartOfCurrentMonth() { + return startOfMonth(startOfToday()); +} + +export type MonthPickerProps = { + currentMonth: Date; + onMonthChange: ( + newMonth: Date | undefined, + shouldClosePopover?: boolean + ) => void; +}; + +export function MonthPicker({ currentMonth, onMonthChange }: MonthPickerProps) { + + const today = startOfToday(); +const currentYear = today.getFullYear(); + const yearFromProp = format(currentMonth, "yyyy"); +const selectedYear = parseInt(yearFromProp); + + // 현재 월의 시작 날짜 + const fullYearStart = parse(yearFromProp, "yyyy", new Date()); + + const yearEnd = + selectedYear === currentYear ? today : endOfYear(fullYearStart); + + + + + const yearRange = Array.from({ length: 21 }, (_, i) => currentYear - 20 + i); + const months = eachMonthOfInterval({ start: fullYearStart, end: yearEnd }); + + const getMonthButtonClass = (month: Date) => + cn( + "inline-flex h-9 w-16 items-center justify-center rounded-md p-0 text-sm font-normal ring-offset-white transition-colors hover:bg-slate-100 hover:text-slate-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 aria-selected:opacity-100 dark:ring-offset-slate-950 dark:hover:bg-slate-800 dark:hover:text-slate-50 dark:focus-visible:ring-slate-800", + isEqual(month, currentMonth) && + "bg-slate-900 text-slate-50 hover:bg-slate-900 hover:text-slate-50 focus:bg-slate-900 focus:text-slate-50 dark:bg-slate-50 dark:text-slate-900 dark:hover:bg-slate-50 dark:hover:text-slate-900 dark:focus:bg-slate-50 dark:focus:text-slate-900", + !isEqual(month, currentMonth) && + isEqual(month, getStartOfCurrentMonth()) && + "bg-slate-100 text-slate-900 dark:bg-slate-800 dark:text-slate-50" + ); + + return ( +
+
+
+ {/* 년도 셀렉트 */} +
+ +
+ + {/* 월 그리드 */} +
+ {months.map((month) => ( +
+ +
+ ))} +
+
+
+
+ ); +} diff --git a/packages/common/business_components/src/ui/index.ts b/packages/common/business_components/src/ui/index.ts index 19d966a53..fd1e6fe9e 100644 --- a/packages/common/business_components/src/ui/index.ts +++ b/packages/common/business_components/src/ui/index.ts @@ -20,4 +20,5 @@ export * from "./table"; export * from "./table_div"; export * from "./title"; export * from "./sdmInsertForm"; -export * from "./popover_ui" \ No newline at end of file +export * from "./popover_ui"; +export * from "./date_month_picker"; \ No newline at end of file From dc6348e4f9db01708f445decd46063c9dd8225b6 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Sat, 28 Jun 2025 16:20:15 +0900 Subject: [PATCH 02/13] =?UTF-8?q?=EB=AA=A8=EB=8B=AC=EC=95=88=EC=97=90=20di?= =?UTF-8?q?v=20=EA=B0=90=EC=8B=B8=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business_components/src/ui/dialog_ui/index.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/common/business_components/src/ui/dialog_ui/index.tsx b/packages/common/business_components/src/ui/dialog_ui/index.tsx index b9e341279..bbb27d327 100644 --- a/packages/common/business_components/src/ui/dialog_ui/index.tsx +++ b/packages/common/business_components/src/ui/dialog_ui/index.tsx @@ -1,4 +1,5 @@ import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader } from "@common/components"; +import { cn } from "../../lib/utils"; type ModalType = { bodyClass: string; @@ -25,15 +26,20 @@ export function UiModal({ return ( <> - - {noHeaderYn === 'N' && ( + + {noHeaderYn === 'N' && ( {headerTitle} )} - {(open && body)} + {(open && body) ? +
{body}
:<> + + + + } {noFooterYn === 'N' && ( {footerContent} From 0dcbe8549caa13decc9721b0f51490ac273dea19 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Tue, 1 Jul 2025 10:28:48 +0900 Subject: [PATCH 03/13] =?UTF-8?q?libphonenumber=20=EB=9D=BC=EC=9D=B4?= =?UTF-8?q?=EB=B8=8C=EB=9F=AC=EB=A6=AC=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20?= =?UTF-8?q?=EC=A0=84=ED=99=94=EB=B2=88=ED=98=B8=20=EC=9E=85=EB=A0=A5=20?= =?UTF-8?q?=ED=95=84=EB=93=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/business_components/package.json | 1 + .../src/ui/sdmInsertForm/form.tsx | 30 ++++++++++++++++--- .../src/ui/sdmInsertForm/index.tsx | 4 +-- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/packages/common/business_components/package.json b/packages/common/business_components/package.json index e7aae9fc5..da6f8c344 100644 --- a/packages/common/business_components/package.json +++ b/packages/common/business_components/package.json @@ -35,6 +35,7 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "date-fns": "^3.6.0", + "libphonenumber-js": "^1.12.9", "lucide-react": "^0.474.0", "path": "^0.12.7", "react-day-picker": "^8.10.1", diff --git a/packages/common/business_components/src/ui/sdmInsertForm/form.tsx b/packages/common/business_components/src/ui/sdmInsertForm/form.tsx index 6ccaac946..2d7d2bf90 100644 --- a/packages/common/business_components/src/ui/sdmInsertForm/form.tsx +++ b/packages/common/business_components/src/ui/sdmInsertForm/form.tsx @@ -3,9 +3,9 @@ import { SelectBox } from "../select"; import { Input } from "@common/components"; import { FormUi } from "../form_ui"; import { useCallback, useEffect, useState } from "react"; +import { AsYouType } from "libphonenumber-js"; import type { ControllerRenderProps, UseFormReturn } from "react-hook-form"; import { SdmSearchForm } from "./sdmNameBox"; -import { set } from "date-fns"; // 수요처 정보 export type DemandCompType = { @@ -79,6 +79,19 @@ export function SdmRegForm({ form, onCheckboxChange, selectSidoData, selectSigun const [updateCoNm, setUpdateNm] = useState('') + + const formatPhoneNumber = (value:string) => { + const input = value; + const formatter = new AsYouType("KR"); + const formatted = formatter.input(input); + + // 저장할 값 처리: 숫자만 추출 + const digitsOnly = input.replace(/\D/g, ""); + + return formatted + }; + + const initializeSigunData = useCallback((sidoCd: string) => { if (sidoCd === '0') { setSigunValue('0'); @@ -325,14 +338,23 @@ export function SdmRegForm({ form, onCheckboxChange, selectSidoData, selectSigun { name: "telno", label: "전화번호", - component: (field) => ( + component: (field) => + + { + const formattedValue = formatPhoneNumber(field.value??''); // 초기 렌더링 시에도 포맷 적용 + + return ( { + const value = e.target.value.replace(/\D/g, ''); // 숫자만 저장 + field.onChange(value); + }} /> - ) + )} }, { diff --git a/packages/common/business_components/src/ui/sdmInsertForm/index.tsx b/packages/common/business_components/src/ui/sdmInsertForm/index.tsx index 13e461910..4219602e6 100644 --- a/packages/common/business_components/src/ui/sdmInsertForm/index.tsx +++ b/packages/common/business_components/src/ui/sdmInsertForm/index.tsx @@ -41,8 +41,8 @@ const createFormSchema = (isBznmTotNoDisabled: boolean, isDuplicate: boolean ,up telno: z.string() .min(8, "전화번호는 8자 이상 입력해주세요") .max(11, "전화번호는 11자 이내로 입력해주세요") - .regex(/^[0-9-]+$/, "전화번호는 숫자와 하이픈(-)만 입력 가능합니다"), - rgtr: z.string().optional(), + .regex(/^[0-9]+$/, "전화번호는 숫자만 입력 가능합니다"), + rgtr: z.string().optional(), dmdAplyPswd : updateList?.dmdInfoPk // 업데이트일경우 ? z.string().optional() // 패스워드는 선택 사항이며 길이 제한 없음 : z.string().optional() From 557cb7c882221a41323874078eec85f6595574d7 Mon Sep 17 00:00:00 2001 From: swcho Date: Tue, 1 Jul 2025 17:18:59 +0900 Subject: [PATCH 04/13] =?UTF-8?q?feat:=20SN(=ED=95=98=EC=88=98=EA=B4=80?= =?UTF-8?q?=EB=A1=9C)=20GIS=20=EA=B3=B5=ED=86=B5=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=BB=A4=EB=B0=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business_components/src/ui/map/Gis.js | 19 +++++++++---------- .../src/ui/map/lib/gis.core.js | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/packages/common/business_components/src/ui/map/Gis.js b/packages/common/business_components/src/ui/map/Gis.js index 8b8acf1cb..fa1cf7ab4 100644 --- a/packages/common/business_components/src/ui/map/Gis.js +++ b/packages/common/business_components/src/ui/map/Gis.js @@ -1,20 +1,19 @@ -import './lib/css/gis.common.css'; -import React, { createContext, useContext, useEffect, useMemo, useRef, useState, useCallback } from 'react'; +import { Search } from 'lucide-react'; import OlMap from 'ol/Map'; import View from 'ol/View'; import { defaults as defaultControls, OverviewMap } from 'ol/control'; import { defaults } from 'ol/interaction'; import * as olProj from 'ol/proj'; -import proj4 from 'proj4'; import { register } from 'ol/proj/proj4'; -import GisApp from './lib/gis.core'; -import GisContent from './GisContent'; -import GisTree from './GisTree'; +import proj4 from 'proj4'; +import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'; import GisLonLat from './GisLonLat'; +import GisMapToggle from './GisMapToggle'; import GisSelect from './GisSelect'; import GisToolBar from './GisToolBar'; -import GisMapToggle from './GisMapToggle'; -import { Search } from 'lucide-react'; +import GisTree from './GisTree'; +import './lib/css/gis.common.css'; +import GisApp from './lib/gis.core'; export const GisContext = createContext({ gisCore: null, gisMap: null, treeData: null, checkedLayerIds: null }); export const useGisContext = () => useContext(GisContext); @@ -122,7 +121,7 @@ function Gis({ isOpen , gisMaps, isSearchModalOpen, treeData = [], isSearch = fa projection: GisApp.TO_PROJ, zoom: gisCore.defaults.zoom, center: olProj.transform( - [126.6757, 37.5585], + [127.4875, 37.4916], GisApp.FROM_PROJ, GisApp.TO_PROJ ), @@ -242,4 +241,4 @@ function Gis({ isOpen , gisMaps, isSearchModalOpen, treeData = [], isSearch = fa ); } -export default React.memo(Gis); \ No newline at end of file +export default React.memo(Gis); diff --git a/packages/common/business_components/src/ui/map/lib/gis.core.js b/packages/common/business_components/src/ui/map/lib/gis.core.js index db58c898f..ddfcec3a1 100644 --- a/packages/common/business_components/src/ui/map/lib/gis.core.js +++ b/packages/common/business_components/src/ui/map/lib/gis.core.js @@ -94,7 +94,7 @@ GisApp.core.prototype = { target: '', centerX: 37.2806094, centerY: 127.0032502, - zoom: 12, + zoom: 15, minZoom: 6, maxZoom: 20, }, From 031307aa182af9c811ecb31eabdb90cc2716f8ef Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Wed, 2 Jul 2025 15:14:04 +0900 Subject: [PATCH 05/13] =?UTF-8?q?searchFormLeft=20=EC=B4=88=EA=B8=B0?= =?UTF-8?q?=ED=99=94=20=EC=8B=9C=20A=EB=A1=9C=20=EC=B4=88=EA=B8=B0?= =?UTF-8?q?=ED=99=94=ED=95=98=EB=8F=84=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 --- .../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 e7858df2a..d0da2cd1a 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 8d7bf041458019a6873d06327f424f5b43ca2293 Mon Sep 17 00:00:00 2001 From: swcho Date: Wed, 2 Jul 2025 16:18:43 +0900 Subject: [PATCH 06/13] =?UTF-8?q?etc:=20.env.devolpoment=20=ED=94=84?= =?UTF-8?q?=EB=A1=9D=EC=8B=9C=20=ED=98=B8=EC=8A=A4=ED=8A=B8=20=EC=A3=BC?= =?UTF-8?q?=EC=86=8C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/sn/.env.development | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/sn/.env.development b/apps/sn/.env.development index fab02e36c..d51017aff 100644 --- a/apps/sn/.env.development +++ b/apps/sn/.env.development @@ -1,6 +1,6 @@ NEXT_PUBLIC_SITE_ID = SN NEXT_PUBLIC_PORT = 11302 -NEXT_PUBLIC_PROXY_HOST = http://con.mind-one.co.kr:11302 +NEXT_PUBLIC_PROXY_HOST = http://localhost:3002 NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000 NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver NEXT_PUBLIC_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver #TODO 운영에서 바꿔야 함 From 0f0ddb6c26d1317bcf041f52db1a3a0d5fc55bc5 Mon Sep 17 00:00:00 2001 From: swcho Date: Wed, 2 Jul 2025 16:26:19 +0900 Subject: [PATCH 07/13] =?UTF-8?q?etc:=20.env.development=20NEXT=5FPUBLIC?= =?UTF-8?q?=5FPORT=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/sn/.env.development | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/sn/.env.development b/apps/sn/.env.development index d51017aff..3358454e7 100644 --- a/apps/sn/.env.development +++ b/apps/sn/.env.development @@ -1,5 +1,5 @@ NEXT_PUBLIC_SITE_ID = SN -NEXT_PUBLIC_PORT = 11302 +NEXT_PUBLIC_PORT = 3002 NEXT_PUBLIC_PROXY_HOST = http://localhost:3002 NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000 NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver From c7c868431fde9fa407dfeeb237128eef444ac634 Mon Sep 17 00:00:00 2001 From: swcho Date: Wed, 2 Jul 2025 16:50:14 +0900 Subject: [PATCH 08/13] =?UTF-8?q?etc:=20.env.development=20=EB=A1=A4?= =?UTF-8?q?=EB=B0=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/sn/.env.development | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/sn/.env.development b/apps/sn/.env.development index 3358454e7..fab02e36c 100644 --- a/apps/sn/.env.development +++ b/apps/sn/.env.development @@ -1,6 +1,6 @@ NEXT_PUBLIC_SITE_ID = SN -NEXT_PUBLIC_PORT = 3002 -NEXT_PUBLIC_PROXY_HOST = http://localhost:3002 +NEXT_PUBLIC_PORT = 11302 +NEXT_PUBLIC_PROXY_HOST = http://con.mind-one.co.kr:11302 NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000 NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver NEXT_PUBLIC_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver #TODO 운영에서 바꿔야 함 From b657ee97eb0ced68807f6816e0fc78faabcea479 Mon Sep 17 00:00:00 2001 From: swcho Date: Wed, 2 Jul 2025 19:21:52 +0900 Subject: [PATCH 09/13] =?UTF-8?q?feat:=20UITable,=20UITable2=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=88=AB=EC=9E=90=20=EA=B0=80?= =?UTF-8?q?=EC=9A=B4=EB=8D=B0=20=EC=A0=95=EB=A0=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/common/business_components/src/ui/table/index-2.tsx | 4 +--- packages/common/business_components/src/ui/table/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/common/business_components/src/ui/table/index-2.tsx b/packages/common/business_components/src/ui/table/index-2.tsx index b6a9750b0..5961ea396 100644 --- a/packages/common/business_components/src/ui/table/index-2.tsx +++ b/packages/common/business_components/src/ui/table/index-2.tsx @@ -110,9 +110,7 @@ export function UiTable2({ ? 'text-right' : head.align === 'center' ? 'text-center' - : typeof el[head.id] === 'number' - ? 'text-right' - : 'text-center' + : 'text-center' } ${cellClick && idx === index ? '!font-[1000] cursor-pointer' : cellClick ? 'cursor-pointer' : ''} diff --git a/packages/common/business_components/src/ui/table/index.tsx b/packages/common/business_components/src/ui/table/index.tsx index cd25bc8db..bb90153c2 100644 --- a/packages/common/business_components/src/ui/table/index.tsx +++ b/packages/common/business_components/src/ui/table/index.tsx @@ -82,7 +82,7 @@ export function UiTable({ tableData, headlist, pageSize, total, headName, childr boldArray.includes(index) ? : Date: Wed, 2 Jul 2025 20:14:13 +0900 Subject: [PATCH 10/13] =?UTF-8?q?feat:=20UiModal=20=EC=9D=B4=EC=A0=84=20?= =?UTF-8?q?=EB=8F=99=EC=9E=91=20=EB=B0=A9=EC=8B=9D=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=ED=95=98=EB=8A=94=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 --- .../src/ui/dialog_ui/index.tsx | 58 ++++++++++--------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/packages/common/business_components/src/ui/dialog_ui/index.tsx b/packages/common/business_components/src/ui/dialog_ui/index.tsx index bbb27d327..df7fffd3a 100644 --- a/packages/common/business_components/src/ui/dialog_ui/index.tsx +++ b/packages/common/business_components/src/ui/dialog_ui/index.tsx @@ -1,7 +1,7 @@ import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader } from "@common/components"; import { cn } from "../../lib/utils"; -type ModalType = { +type ModalType = { bodyClass: string; body: React.ReactNode; open?: boolean; @@ -10,43 +10,45 @@ type ModalType = { noFooterYn?: 'N' | 'Y'; headerTitle?: string; footerContent?: React.ReactNode; + useDirectRender?: boolean; } -export function UiModal({ - bodyClass, - body, - open, +export function UiModal({ + bodyClass, + body, + open, onOpenChange, noHeaderYn = 'N', noFooterYn = 'N', headerTitle, - footerContent + footerContent, + useDirectRender = false }: ModalType) { - + return ( <> - + - {noHeaderYn === 'N' && ( - - - {headerTitle} - - - )} - {(open && body) ? -
{body}
:<> - - - - } - {noFooterYn === 'N' && ( - - {footerContent} - - )} -
-
+ {noHeaderYn === 'N' && ( + + + {headerTitle} + + + )} + {(open && body) ? + useDirectRender + ? body + :
{body}
+ : <> + } + {noFooterYn === 'N' && ( + + {footerContent} + + )} +
+
); } From 711412b82e6ae86722b0c9082508a9f3f09e2cc3 Mon Sep 17 00:00:00 2001 From: swcho Date: Thu, 3 Jul 2025 09:35:36 +0900 Subject: [PATCH 11/13] =?UTF-8?q?feat:=201=EC=B0=A8(=EC=88=98=EC=9A=94?= =?UTF-8?q?=EC=9D=BC)=20=EA=B0=90=EB=A6=AC=EC=A7=80=EC=A0=81=EC=82=AC?= =?UTF-8?q?=ED=95=AD=EB=8C=80=EC=9D=91=20-=20=ED=95=98=EC=88=98=EA=B4=80?= =?UTF-8?q?=EB=A1=9C,=20=ED=95=98=EC=88=98=EB=A7=A8=ED=99=80,=20=ED=95=98?= =?UTF-8?q?=EC=88=98=ED=8E=8C=ED=94=84=EC=9E=A5,=20=EC=9A=B0=EC=88=98?= =?UTF-8?q?=ED=86=A0=EC=8B=A4=20=EA=B2=80=EC=83=89=20=EA=B5=AC=ED=98=84=20?= =?UTF-8?q?-=20UiTable=20number=20=EA=B0=92=20=EA=B0=80=EC=9A=B4=EB=8D=B0?= =?UTF-8?q?=20=EC=A0=95=EB=A0=AC=20-=20=EC=9D=BC=EB=A0=A8=EB=B2=88?= =?UTF-8?q?=ED=98=B8=20=EC=BB=AC=EB=9F=BC=20=EC=82=AD=EC=A0=9C=20-=20?= =?UTF-8?q?=ED=99=98=EA=B2=BD=EC=B2=AD,=20=EC=8B=9C=EB=8F=84,=20=EC=8B=9C?= =?UTF-8?q?=EA=B5=B0=EA=B5=AC=20=EC=BB=AC=EB=9F=BC=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?-=20=EA=B4=80=EB=A6=AC=EB=85=84=EB=8F=84=20=EC=82=AD=EC=A0=9C?= =?UTF-8?q?=20-=20=EC=98=A4=EC=88=98=EC=A0=84=ED=99=98=EC=9C=A8=200~1=20?= =?UTF-8?q?=EC=82=AC=EC=9D=B4=EC=9D=98=20=EA=B0=92=EB=A7=8C=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=20=EA=B0=80=EB=8A=A5=ED=95=98=EA=B2=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 --- apps/sn/app/(map-layout)/map/SearchModal.tsx | 403 +++++++++--------- .../map/components/common/index.ts | 1 + .../components/popupComponent/MsSwagePpl.tsx | 8 +- .../components/popupComponent/sewagePump.tsx | 19 +- .../map/components/popupComponent/smh.tsx | 20 +- .../popupComponent/stormWaterPump.tsx | 17 +- .../map/featureClickEventPopup.tsx | 22 +- .../(with-base-layout)/ii/irsetting/page.tsx | 7 +- .../app/(with-base-layout)/ii/rdii/page.tsx | 29 +- .../(with-base-layout)/ii/rdiiResult/page.tsx | 6 +- .../app/(with-base-layout)/ii/result/page.tsx | 5 +- .../(with-base-layout)/oper/floodPre/page.tsx | 18 - .../(with-base-layout)/oper/oldPp/page.tsx | 18 - apps/sn/app/components/ui/verticalTable.tsx | 16 +- pnpm-lock.yaml | 19 +- 15 files changed, 324 insertions(+), 284 deletions(-) diff --git a/apps/sn/app/(map-layout)/map/SearchModal.tsx b/apps/sn/app/(map-layout)/map/SearchModal.tsx index 44ec1d17c..d3cac8956 100644 --- a/apps/sn/app/(map-layout)/map/SearchModal.tsx +++ b/apps/sn/app/(map-layout)/map/SearchModal.tsx @@ -115,7 +115,7 @@ const SearchModal: React.FC = ({ const [yearFilter, setYearFilter] = useState({ 시작: "", 종료: "", - 경과년도: "", + // 경과년도: "", }); const [가동개시_시작_월, set가동개시_시작_월] = useState(''); @@ -182,7 +182,7 @@ const SearchModal: React.FC = ({ setYearFilter({ 시작: "", 종료: "", - 경과년도: "", + // 경과년도: "", }); setShowTable(false); setTableCount(0); @@ -247,34 +247,34 @@ const SearchModal: React.FC = ({ const pplCqlFilters = () => { const cqlFilters: string[] = []; // 추후 작성 예정 - // if (변수1) cqlFilters.push(`용도코드='${변수1}'`); - // if (변수2) cqlFilters.push(`재질코드='${변수2}'`); - // if (변수3) cqlFilters.push(`행정읍면동코드='${변수3}'`); + if (변수1) cqlFilters.push(`usg_cd='${변수1}'`); + if (변수2) cqlFilters.push(`mqlt_cd='${변수2}'`); + if (변수3) cqlFilters.push(`pbadms_emd_cd='${변수3}'`); // if (변수4) cqlFilters.push(`경과년도='${변수4}'`); - // // 설치년도 범위 - // const startDate = getDateString( - // yearFilter.시작, - // 가동개시_시작_월, - // 가동개시_시작_일, - // "19000101", - // ); - // const endDate = getDateString( - // yearFilter.종료, - // 가동개시_종료_월, - // 가동개시_종료_일, - // `${todayYear}${todayMonth}${todayDate}`, - // ); - // cqlFilters.push( - // `설치시작년도 >= '${startDate}' and 설치시작년도 <= '${endDate}'`, - // ); - // // 관경(mm) 범위 - // if (시작1 && 종료1) cqlFilters.push(`관경 BETWEEN ${시작1} AND ${종료1}`); - // else if (시작1) cqlFilters.push(`관경 >= ${시작1}`); - // else if (종료1) cqlFilters.push(`관경 <= ${종료1}`); - // // 연장(m) 범위 - // if (시작2 && 종료2) cqlFilters.push(`연장 BETWEEN ${시작2} AND ${종료2}`); - // else if (시작2) cqlFilters.push(`연장 >= ${시작2}`); - // else if (종료2) cqlFilters.push(`연장 <= ${종료2}`); + // 설치년도 범위 + const startDate = getDateString( + yearFilter.시작, + 가동개시_시작_월, + 가동개시_시작_일, + "19000101", + ); + const endDate = getDateString( + yearFilter.종료, + 가동개시_종료_월, + 가동개시_종료_일, + `${todayYear}${todayMonth}${todayDate}`, + ); + cqlFilters.push( + `instl_ymd >= '${startDate}' and instl_ymd <= '${endDate}'`, + ); + // 관경(mm) 범위 + if (시작1 && 종료1) cqlFilters.push(`pdmt BETWEEN ${시작1} AND ${종료1}`); + else if (시작1) cqlFilters.push(`pdmt >= ${시작1}`); + else if (종료1) cqlFilters.push(`pdmt <= ${종료1}`); + // 연장(m) 범위 + if (시작2 && 종료2) cqlFilters.push(`prlg BETWEEN ${시작2} AND ${종료2}`); + else if (시작2) cqlFilters.push(`prlg >= ${시작2}`); + else if (종료2) cqlFilters.push(`prlg <= ${종료2}`); return cqlFilters; }; @@ -319,27 +319,27 @@ const SearchModal: React.FC = ({ const mhCqlFilters = () => { const cqlFilters: string[] = []; // // 설치년도 범위 - // const startDate = getDateString( - // yearFilter.시작, - // 가동개시_시작_월, - // 가동개시_시작_일, - // "19000101", - // ); - // const endDate = getDateString( - // yearFilter.종료, - // 가동개시_종료_월, - // 가동개시_종료_일, - // `${todayYear}${todayMonth}${todayDate}`, - // ); - // cqlFilters.push( - // `설치시작년도 >= '${startDate}' and 설치시작년도 <= '${endDate}'`, - // ); + const startDate = getDateString( + yearFilter.시작, + 가동개시_시작_월, + 가동개시_시작_일, + "19000101", + ); + const endDate = getDateString( + yearFilter.종료, + 가동개시_종료_월, + 가동개시_종료_일, + `${todayYear}${todayMonth}${todayDate}`, + ); + cqlFilters.push( + `설치시작년도 >= '${startDate}' and 설치시작년도 <= '${endDate}'`, + ); // if (변수1) cqlFilters.push(`경과년도='${변수1}'`); - // if (변수2) cqlFilters.push(`용도코드='${변수2}'`); - // // 구경(mm) 범위 - // if (시작1 && 종료1) cqlFilters.push(`구경 BETWEEN ${시작1} AND ${종료1}`); - // else if (시작1) cqlFilters.push(`구경 >= ${시작1}`); - // else if (종료1) cqlFilters.push(`구경 <= ${종료1}`); + if (변수2) cqlFilters.push(`용도코드='${변수2}'`); + // 구경(mm) 범위 + if (시작1 && 종료1) cqlFilters.push(`구경 BETWEEN ${시작1} AND ${종료1}`); + else if (시작1) cqlFilters.push(`구경 >= ${시작1}`); + else if (종료1) cqlFilters.push(`구경 <= ${종료1}`); return cqlFilters; }; @@ -347,32 +347,32 @@ const SearchModal: React.FC = ({ const psmtnCqlFilters = () => { const cqlFilters: string[] = []; // 설치년도 범위 - // const startDate = getDateString( - // yearFilter.시작, - // 가동개시_시작_월, - // 가동개시_시작_일, - // "19000101", - // ); - // const endDate = getDateString( - // yearFilter.종료, - // 가동개시_종료_월, - // 가동개시_종료_일, - // `${todayYear}${todayMonth}${todayDate}`, - // ); - // cqlFilters.push( - // `설치시작년도 >= '${startDate}' and 설치시작년도 <= '${endDate}'`, - // ); + const startDate = getDateString( + yearFilter.시작, + 가동개시_시작_월, + 가동개시_시작_일, + "19000101", + ); + const endDate = getDateString( + yearFilter.종료, + 가동개시_종료_월, + 가동개시_종료_일, + `${todayYear}${todayMonth}${todayDate}`, + ); + cqlFilters.push( + `instl_ymd >= '${startDate}' and instl_ymd <= '${endDate}'`, + ); // if (변수1) cqlFilters.push(`경과년도='${변수1}'`); - // // 일일처리용량 범위 - // if (시작1 && 종료1) - // cqlFilters.push(`일일처리용량 BETWEEN ${시작1} AND ${종료1}`); - // else if (시작1) cqlFilters.push(`일일처리용량 >= ${시작1}`); - // else if (종료1) cqlFilters.push(`일일처리용량 <= ${종료1}`); - // // 우수양수능력 범위 - // if (시작2 && 종료2) - // cqlFilters.push(`우수양수능력 BETWEEN ${시작2} AND ${종료2}`); - // else if (시작2) cqlFilters.push(`우수양수능력 >= ${시작2}`); - // else if (종료2) cqlFilters.push(`우수양수능력 <= ${종료2}`); + // 일일처리용량 범위 + if (시작1 && 종료1) + cqlFilters.push(`daily_prcs_cpct BETWEEN ${시작1} AND ${종료1}`); + else if (시작1) cqlFilters.push(`daily_prcs_cpct >= ${시작1}`); + else if (종료1) cqlFilters.push(`daily_prcs_cpct <= ${종료1}`); + // 우수양수능력 범위 + if (시작2 && 종료2) + cqlFilters.push(`excln_wpmp_ablt BETWEEN ${시작2} AND ${종료2}`); + else if (시작2) cqlFilters.push(`excln_wpmp_ablt >= ${시작2}`); + else if (종료2) cqlFilters.push(`excln_wpmp_ablt <= ${종료2}`); return cqlFilters; }; @@ -380,24 +380,24 @@ const SearchModal: React.FC = ({ const otflCqlFilters = () => { const cqlFilters: string[] = []; // 설치년도 범위 - // const startDate = getDateString( - // yearFilter.시작, - // 가동개시_시작_월, - // 가동개시_시작_일, - // "19000101", - // ); - // const endDate = getDateString( - // yearFilter.종료, - // 가동개시_종료_월, - // 가동개시_종료_일, - // `${todayYear}${todayMonth}${todayDate}`, - // ); - // cqlFilters.push( - // `설치시작년도 >= '${startDate}' and 설치시작년도 <= '${endDate}'`, - // ); + const startDate = getDateString( + yearFilter.시작, + 가동개시_시작_월, + 가동개시_시작_일, + "19000101", + ); + const endDate = getDateString( + yearFilter.종료, + 가동개시_종료_월, + 가동개시_종료_일, + `${todayYear}${todayMonth}${todayDate}`, + ); + cqlFilters.push( + `instl_ymd >= '${startDate}' and instl_ymd <= '${endDate}'`, + ); // if (변수1) cqlFilters.push(`경과년도='${변수1}'`); // if (변수2) cqlFilters.push(`하천명 ILIKE '%${변수1}%'`); - // // 계획방류량 범위 + // 계획방류량 범위 // if (시작1 && 종료1) // cqlFilters.push(`계획방류량 BETWEEN ${시작1} AND ${종료1}`); // else if (시작1) cqlFilters.push(`계획방류량 >= ${시작1}`); @@ -502,7 +502,7 @@ const SearchModal: React.FC = ({ /> {/* 경과년도 */} -
+ {/*
@@ -516,7 +516,7 @@ const SearchModal: React.FC = ({ setYearFilter({ ...yearFilter, 경과년도: val }); }} /> -
+
*/} {/* 용도코드 */}