From f4de1a60277fc834b3c4c27ed4e0b9763152ee93 Mon Sep 17 00:00:00 2001 From: ljpark Date: Thu, 19 Feb 2026 18:12:34 +0900 Subject: [PATCH] =?UTF-8?q?dm=5Fnew:=20=EA=B8=B0=ED=83=80=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 --- .../example/sewage/guri/page.tsx | 30 ++++----- apps/dm_new/app/(with-layout)/layout.tsx | 6 +- apps/dm_new/app/common/comFunction.ts | 65 +++++++++++++++++++ apps/dm_new/app/common/transValueFormat.tsx | 26 ++++++++ apps/dm_new/components/LoginModal.tsx | 12 ++-- apps/dm_new/components/TopNav.tsx | 4 +- apps/dm_new/tsconfig.json | 1 + apps/dm_new/types/style.d.ts | 1 + 8 files changed, 119 insertions(+), 26 deletions(-) create mode 100644 apps/dm_new/app/common/comFunction.ts create mode 100644 apps/dm_new/app/common/transValueFormat.tsx create mode 100644 apps/dm_new/types/style.d.ts diff --git a/apps/dm_new/app/(with-layout)/example/sewage/guri/page.tsx b/apps/dm_new/app/(with-layout)/example/sewage/guri/page.tsx index 2031bbed9..7efa38116 100644 --- a/apps/dm_new/app/(with-layout)/example/sewage/guri/page.tsx +++ b/apps/dm_new/app/(with-layout)/example/sewage/guri/page.tsx @@ -21,22 +21,22 @@ function Hr({ className = "" }: HrProps) { return
; } -type ImgCardProps = { - src: string; - alt: string; -}; +// type ImgCardProps = { +// src: string; +// alt: string; +// }; -function ImgCard({ src, alt }: ImgCardProps) { - return ( -
- {alt} -
- ); -} +// function ImgCard({ src, alt }: ImgCardProps) { +// return ( +//
+// {alt} +//
+// ); +// } export default function GreywaterPage() { return ( diff --git a/apps/dm_new/app/(with-layout)/layout.tsx b/apps/dm_new/app/(with-layout)/layout.tsx index f3c5088e1..7ea176c6d 100644 --- a/apps/dm_new/app/(with-layout)/layout.tsx +++ b/apps/dm_new/app/(with-layout)/layout.tsx @@ -1,13 +1,13 @@ // app/(with-layout)/layout.tsx import "../reuse.module.css"; -import type { ReactNode } from "react"; +import { StoreProvider } from "../store"; import TopNav from "@/components/TopNav"; export default function ReuseLandingLayout({ children }: { children: React.ReactNode }) { return ( - <> +
{children}
{/* TopNav 높이만큼 */} - +
); } diff --git a/apps/dm_new/app/common/comFunction.ts b/apps/dm_new/app/common/comFunction.ts new file mode 100644 index 000000000..ec4894d49 --- /dev/null +++ b/apps/dm_new/app/common/comFunction.ts @@ -0,0 +1,65 @@ +import type { RegionData, } from "../store/wrStatus/type"; + + + +export const regionData:RegionData[] = [ + { name: '서울', x: 170, y: 140, values: [0.3, 0.3, 0.2, 0.2] }, + { name: '인천', x: 120, y: 150, values: [0.3, 0.3, 0.2, 0.2] }, + { name: '경기', x: 210, y: 210, values: [0.3, 0.3, 0.2, 0.2] }, + { name: '강원', x: 330, y: 120, values: [0.3, 0.3, 0.2, 0.2] }, + { name: '충북', x: 260, y: 280, values: [0.3, 0.3, 0.2, 0.2] }, + { name: '충남', x: 100, y: 320, values: [0.3, 0.3, 0.2, 0.2] }, + { name: '세종', x: 180, y: 305, values: [0.3, 0.3, 0.2, 0.2] }, + { name: '대전', x: 195, y: 360, values: [0.3, 0.3, 0.2, 0.2] }, + { name: '전북', x: 170, y: 450, values: [0.3, 0.3, 0.2, 0.2] }, + { name: '전남', x: 160, y: 600, values: [0.3, 0.3, 0.2, 0.2] }, + { name: '광주', x: 120, y: 530, values: [0.3, 0.3, 0.2, 0.2] }, + { name: '경북', x: 400, y: 320, values: [0.3, 0.3, 0.2, 0.2] }, + { name: '경남', x: 310, y: 530, values: [0.3, 0.3, 0.2, 0.2] }, + { name: '대구', x: 350, y: 450, values: [0.3, 0.3, 0.2, 0.2] }, + { name: '울산', x: 450, y: 500, values: [0.3, 0.3, 0.2, 0.2] }, + { name: '부산', x: 420, y: 550, values: [0.3, 0.3, 0.2, 0.2] }, + { name: '제주', x: 60, y: 750, values: [0.3, 0.3, 0.2, 0.2] }, + ] + +export const regionIdMap: Record = { + 서울: '서울특별시', + 부산: '부산광역시', + 대구: '대구광역시', + 인천: '인천광역시', + 광주: '광주광역시', + 대전: '대전광역시', + 울산: '울산광역시', + 세종: '세종특별자치시', + 경기: '경기도', + 강원: '강원특별자치도', + 충북: '충청북도', + 충남: '충청남도', + 전북: '전라북도', + 전남: '전라남도', + 경북: '경상북도', + 경남: '경상남도', + 제주: '제주특별자치도' + }; + + +export const makeRegion = (region: string) => { + if (region === '서울특별시') return '서울' + if (region === '부산광역시') return '부산' + if (region === '대구광역시') return '대구' + if (region === '인천광역시') return '인천' + if (region === '광주광역시') return '광주' + if (region === '대전광역시') return '대전' + if (region === '울산광역시') return '울산' + if (region === '세종특별자치시') return '세종' + if (region === '경기도') return '경기' + if (region === '강원특별자치도') return '강원' + if (region === '충청북도') return '충북' + if (region === '충청남도') return '충남' + if (region === '전북특별자치도') return '전북' + if (region === '전라남도') return '전남' + if (region === '경상북도') return '경북' + if (region === '경상남도') return '경남' + if (region === '제주특별자치도') return '제주' + return region; +} diff --git a/apps/dm_new/app/common/transValueFormat.tsx b/apps/dm_new/app/common/transValueFormat.tsx new file mode 100644 index 000000000..4d76d84e0 --- /dev/null +++ b/apps/dm_new/app/common/transValueFormat.tsx @@ -0,0 +1,26 @@ +import React from 'react' + +type CommonProps = { + value: string | number | ''; + format: string; +} + +export default function TransValueFormat({value='', format=''}: CommonProps) { + return ( + format === 'yyyyMMdd' ? + <>{value.toString().substring(0,4)+'-'+value.toString().substring(4,6)+'-'+value.toString().substring(6,8)} + : format === 'number' ? + <>{String(value ?? '').includes('.') + ? String(value).split('.').map((part, index) => + index === 0 ? part.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : part + ).join('.') + : String(value ?? '').replace(/\B(?=(\d{3})+(?!\d))/g, ",")} + : format === 'float1' ? + <>{String(value ?? '').includes('.') + ? String(value).split('.').map((part, index) => + index === 0 ? part.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : part + ).join('.') + : String(value ?? '').replace(/\B(?=(\d{3})+(?!\d))/g, ",")} + : <>{value} + ) +} \ No newline at end of file diff --git a/apps/dm_new/components/LoginModal.tsx b/apps/dm_new/components/LoginModal.tsx index dadf776ae..fb42e51f5 100644 --- a/apps/dm_new/components/LoginModal.tsx +++ b/apps/dm_new/components/LoginModal.tsx @@ -1,6 +1,6 @@ "use client"; -import { useEffect, useId, useMemo, useState } from "react"; +import { useEffect, useId, useState } from "react"; import { useRouter } from "next/navigation"; type LoginModalProps = { @@ -11,7 +11,7 @@ type LoginModalProps = { type FieldKey = "bizNo" | "workerNo" | "pw"; -const REGISTER_HREF = "/reuse/apply/place"; +const REGISTER_HREF = "/apply/dmdco"; function isBizNoValid(v: string) { return /^\d{3}-\d{2}-\d{5}$/.test(v); @@ -30,7 +30,7 @@ export default function LoginModal({ open, onClose, onSuccess }: LoginModalProps const [bizNo, setBizNo] = useState(""); const [workerNo, setWorkerNo] = useState(""); - const [noWorker, setNoWorker] = useState(false); + const [noWorker, setNoWorker] = useState(true); // 종사업자번호 해당없음 checked const [pw, setPw] = useState(""); // ✅ 유효성/서버 에러 표시용 @@ -63,7 +63,7 @@ export default function LoginModal({ open, onClose, onSuccess }: LoginModalProps if (noWorker) { setWorkerNo(""); setErrors((p) => { - const { workerNo: _w, ...rest } = p; + const { workerNo: _unused, ...rest } = p; return rest; }); } @@ -204,7 +204,7 @@ export default function LoginModal({ open, onClose, onSuccess }: LoginModalProps
); -} \ No newline at end of file +} diff --git a/apps/dm_new/components/TopNav.tsx b/apps/dm_new/components/TopNav.tsx index 31d665c98..8e7369c44 100644 --- a/apps/dm_new/components/TopNav.tsx +++ b/apps/dm_new/components/TopNav.tsx @@ -2,11 +2,11 @@ import Link from "next/link"; import { usePathname, useRouter } from "next/navigation"; -import { useEffect, useId, useMemo, useState } from "react"; +import { useEffect, useMemo, useState } from "react"; import LoginModal from "@/components/LoginModal"; import { fetchAnonymousMenu, isMenuActive, type MenuItem } from "@/app/store/common"; -const REGISTER_HREF = "/reuse/apply/place"; +// const REGISTER_HREF = "/reuse/apply/place"; const LS_TOKEN_KEY = "reuse_accessToken"; const LS_USER_KEY = "reuse_userName"; diff --git a/apps/dm_new/tsconfig.json b/apps/dm_new/tsconfig.json index 493584782..ba8cd2c2f 100644 --- a/apps/dm_new/tsconfig.json +++ b/apps/dm_new/tsconfig.json @@ -40,6 +40,7 @@ "include": [ ".eslintrc.*", "next-env.d.ts", + "**/*.d.ts", "**/*.ts", "**/*.tsx", "**/*.mts", diff --git a/apps/dm_new/types/style.d.ts b/apps/dm_new/types/style.d.ts new file mode 100644 index 000000000..cbe652dbe --- /dev/null +++ b/apps/dm_new/types/style.d.ts @@ -0,0 +1 @@ +declare module "*.css";