diff --git a/apps/dm/.env.local b/apps/dm/.env.local index 234d496d9..17aa8ddc8 100644 --- a/apps/dm/.env.local +++ b/apps/dm/.env.local @@ -1,12 +1,13 @@ -NEXT_PUBLIC_SITE_ID = DM +NEXT_PUBLIC_SITE_ID = DN +NEXT_PUBLIC_PORT = 3015 NEXT_PUBLIC_CLAIM_NAME = Authorization NEXT_PUBLIC_AUTH_USER_ID = token-id NEXT_PUBLIC_ACCESS_TOKEN = access-token NEXT_PUBLIC_REFRESH_TOKEN = refresh-token -NEXT_PUBLIC_PORT = 3005 -NEXT_PUBLIC_PROXY_HOST = http://localhost:3005 -NEXT_PUBLIC_CS_SERVER_API_URL = http://dev.onasys.co.kr:8000 +NEXT_PUBLIC_PROXY_HOST = http://localhost:3015 +NEXT_PUBLIC_CM_LOGIN_PAGE_URL = http://dev.onasys.co.kr:3000/auth/login NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000 +NEXT_PUBLIC_CS_SERVER_API_URL = http://dev.onasys.co.kr:8000 NEXT_PUBLIC_DM_SERVER_API_URL = http://con.mind-one.co.kr:11083/reuse-service/api/v1 # NEXT_PUBLIC_FO_SERVER_API_URL = http://192.168.1.222:8883/operation-service/api/v1 NEXT_PUBLIC_FO_SERVER_API_URL = http://con.mind-one.co.kr:11083/operation-service/api/v1 @@ -19,7 +20,6 @@ NEXT_PUBLIC_NGII_PARAM = 04trYP9_xwLAfALjwZ-B8g&service=WMTS&request=GetTile&ver NEXT_PUBLIC_GATEWAY_URL=http://con.mind-one.co.kr:11083 # 개발 서버 API #NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.128:8883/sewerage-service/api # 최용성 #NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.66:8883/sewerage-service/api # 박이정 -NEXT_PUBLIC_CM_LOGIN_PAGE_URL = / NEXT_PUBLIC_FINDADRESS_URL=https://business.juso.go.kr/addrlink/addrLinkApi.do diff --git a/apps/dm/.env.mindone b/apps/dm/.env.mindone index 64b982cdc..9a5005d2b 100644 --- a/apps/dm/.env.mindone +++ b/apps/dm/.env.mindone @@ -1,23 +1,25 @@ -NEXT_PUBLIC_SITE_ID = DM -NEXT_PUBLIC_PORT = 11035 -NEXT_PUBLIC_PROXY_HOST = http://con.mind-one.co.kr:11035 -NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000 -NEXT_PUBLIC_DM_SERVER_API_URL = http://con.mind-one.co.kr:11083/reuse-service/api/v1 -NEXT_PUBLIC_FO_SERVER_API_URL = http://con.mind-one.co.kr:11083/operation-service/api/v1 -NEXT_PUBLIC_CS_SERVER_API_URL = http://dev.onasys.co.kr:8000 -NEXT_PUBLIC_CS_TUS_UPLOAD = /attach-service/api/v1/tus/upload +NEXT_PUBLIC_SITE_ID = DN +NEXT_PUBLIC_PORT = 11315 NEXT_PUBLIC_CLAIM_NAME = Authorization NEXT_PUBLIC_AUTH_USER_ID = token-id NEXT_PUBLIC_ACCESS_TOKEN = access-token NEXT_PUBLIC_REFRESH_TOKEN = refresh-token +NEXT_PUBLIC_PROXY_HOST = http://con.mind-one.co.kr:11315 +NEXT_PUBLIC_CM_LOGIN_PAGE_URL = http://dev.onasys.co.kr:3000/auth/login +NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000 +NEXT_PUBLIC_CS_SERVER_API_URL = http://dev.onasys.co.kr:8000 +NEXT_PUBLIC_DM_SERVER_API_URL = http://con.mind-one.co.kr:11083/reuse-service/api/v1 +NEXT_PUBLIC_FO_SERVER_API_URL = http://con.mind-one.co.kr:11083/operation-service/api/v1 NEXT_PUBLIC_WR_SERVER_API_URL = http://con.mind-one.co.kr:11083/reuse-service/api/v1 +#NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver +#NEXT_PUBLIC_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver +NEXT_PUBLIC_CS_TUS_UPLOAD = /attach-service/api/v1/tus/upload NEXT_PUBLIC_NGII_URL = https://map.ngii.go.kr NEXT_PUBLIC_NGII_PARAM = 04trYP9_xwLAfALjwZ-B8g&service=WMTS&request=GetTile&version=1.0.0&format=image/png&layer=korean_map&style=korean&tilematrixset=korean&tilematrix={z}&tilecol={x}&tilerow={y} NEXT_PUBLIC_SEWERAGE_API_URL=http://con.mind-one.co.kr:11083/sewerage-service # 개발 서버 API NEXT_PUBLIC_GATEWAY_URL=http://con.mind-one.co.kr:11083 # 개발 서버 API # NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.128:8883/sewerage-service/api # 최용성 #NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.66:8883/sewerage-service/api # 박이정 -NEXT_PUBLIC_CM_LOGIN_PAGE_URL = / NEXT_PUBLIC_FINDADRESS_URL=https://business.juso.go.kr/addrlink/addrLinkApi.do diff --git a/apps/dm/.env.production b/apps/dm/.env.production index 5a401c89a..b413d1312 100644 --- a/apps/dm/.env.production +++ b/apps/dm/.env.production @@ -1,5 +1,5 @@ # 공단 운영 -NEXT_PUBLIC_SITE_ID = DM +NEXT_PUBLIC_SITE_ID = DN NEXT_PUBLIC_PORT = 3000 NEXT_PUBLIC_CLAIM_NAME = Authorization NEXT_PUBLIC_AUTH_USER_ID = token-id @@ -8,16 +8,16 @@ NEXT_PUBLIC_REFRESH_TOKEN = refresh-token #NEXT_PUBLIC_PROXY_HOST = https://devreuse.hasuon.or.kr #NEXT_PUBLIC_CM_LOGIN_PAGE_URL = https://devqueen.hasuon.or.kr/auth/login NEXT_PUBLIC_SERVER_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000 -NEXT_PUBLIC_FO_SERVER_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000/operation-service/api/v1 NEXT_PUBLIC_CS_SERVER_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000 -NEXT_PUBLIC_CS_TUS_UPLOAD = /attach-service/api/v1/tus/upload +NEXT_PUBLIC_FO_SERVER_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000/operation-service/api/v1 +NEXT_PUBLIC_WR_SERVER_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000/reuse-service/api/v1 NEXT_PUBLIC_GEOSERVER_URL = http://172.29.143.87:8080/geoserver NEXT_PUBLIC_LX_GEOSERVER_URL = http://172.29.143.87:8080/geoserver_swl -NEXT_PUBLIC_WR_SERVER_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000/reuse-service/api/v1 +NEXT_PUBLIC_CS_TUS_UPLOAD = /attach-service/api/v1/tus/upload NEXT_PUBLIC_SEWERAGE_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000/sewerage-service -NEXT_PUBLIC_GATEWAY_URL = http://apigateway.iipbs-was.svc.cluster.local:8000 NEXT_PUBLIC_NGII_URL = http://172.29.143.87/poiact NEXT_PUBLIC_NGII_PARAM = BDE2BEF39DAFEC293AB6730150F222AC&service=WMTS&request=GetTile&version=1.0.0&format=image/png&layer=korean_map&style=korean&tilematrixset=korean&tilematrix={z}&tilecol={y}&tilerow={x} +NEXT_PUBLIC_GATEWAY_URL = http://apigateway.iipbs-was.svc.cluster.local:8000 NEXT_PUBLIC_FINDADRESS_URL=https://business.juso.go.kr/addrlink/addrLinkApi.do diff --git a/apps/dm/.gitignore b/apps/dm/.gitignore deleted file mode 100644 index c1b3c4e38..000000000 --- a/apps/dm/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/.pnp -.pnp.* -.yarn/* -!.yarn/patches -!.yarn/plugins -!.yarn/releases -!.yarn/versions - -# testing -/coverage - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* -.pnpm-debug.log* - -# env files (can opt-in for committing if needed) - -# vercel -.vercel - -# typescript -*.tsbuildinfo -next-env.d.ts diff --git a/apps/dm/app/(base-layout)/layout.tsx b/apps/dm/app/(base-layout)/layout.tsx deleted file mode 100644 index 5caa088b0..000000000 --- a/apps/dm/app/(base-layout)/layout.tsx +++ /dev/null @@ -1,16 +0,0 @@ -"use client"; -import Base from "../base"; -import "../globals.css"; -import { StoreProvider } from "../store"; - -export default function BaseLayout({ - children, -}: Readonly<{ - children: React.ReactNode; -}>) { - return ( - - {children} - - ); -} diff --git a/apps/dm/app/(base-layout)/pages/sdmMng/sdmApplyList/page.tsx b/apps/dm/app/(base-layout)/pages/sdmMng/sdmApplyList/page.tsx deleted file mode 100644 index 8c681876c..000000000 --- a/apps/dm/app/(base-layout)/pages/sdmMng/sdmApplyList/page.tsx +++ /dev/null @@ -1,209 +0,0 @@ -"use client" -import { Table, TableBody, TableCell, TableRow } from '@common/components/ui/table'; - -import { useDmStore } from '@/app/store'; -import { ContentsDiv, Title, UiModal, UiTable } from '@common/business_components/ui'; -import ListDiv from '@common/business_components/ui/list_div'; -import { useEffect, useState } from 'react'; -import { Toaster } from 'react-hot-toast'; -import SdmLogin from '../sdmLogin/page'; -import type { DemandCompBizType } from '@/app/store/sdmMng'; -import TransValueFormat from '@/app/common/transValueFormat'; -import { useRouter } from 'next/navigation'; - -const TABLE_STYLES = { - header: "text-center border border-[var(--border)] bg-[rgb(234,243,251)] text-[rgb(100,119,132)] whitespace-pre-line", - cell: "text-right whitespace-pre-line", - fullWidth: "text-center border border-[var(--border)] bg-[rgb(234,243,251)] text-[rgb(100,119,132)] whitespace-pre-line", - table: "fixed w-full" -} as const; - -type SdmApplyProps = { - sdmNo : string; -} - -export default function SdmApplyList({}: SdmApplyProps) { - - const router = useRouter(); - - const {getSdmInfoStatusList, Sdm, Common} = useDmStore((state) => state); - const {successLogin, sdmInfoStatusList, upHeadSdmInfoStatus} = Sdm; - const {selectSidoData, selectSigunData} = Common; - const [isLogin, setIsLogin] = useState(false); - const [isLoginStorageInfo, setIsLoginStorageInfo] = useState(false); - const [sdmApplyDetail, setSdmApplyDetail] = useState({} as DemandCompBizType); - const [transformedList, setTransformedList] = useState([]); - - useEffect(() => { - console.log('sessionStorage : ',sessionStorage.getItem('user')); - const user = sessionStorage.getItem('user'); - if (user) { - setIsLoginStorageInfo(true); - } - }, []); - - useEffect(() => { - if (successLogin || isLoginStorageInfo) { - setIsLogin(true); - const user = sessionStorage.getItem('user'); - if (user) { - try { - const userData = JSON.parse(user); - getSdmInfoStatusList(userData.dmdInfoId); - } catch (error) { - console.error('Error parsing user data:', error); - } - } - } - }, [successLogin, getSdmInfoStatusList, isLoginStorageInfo]); - - // 데이터 변환을 위한 별도의 useEffect - useEffect(() => { - if (sdmInfoStatusList.length > 0) { - - - const newTransformedList = sdmInfoStatusList.map((item: DemandCompBizType) => ({ - ...item, - ctpvCd: selectSidoData.find(sido => sido.val === item.ctpvCd?.trim())?.text || '', - sggCd: selectSigunData.find(sigun => sigun.val === item.sggCd?.trim())?.text || '', - })); - setTransformedList(newTransformedList); - } - }, [sdmInfoStatusList, selectSidoData, selectSigunData]); - - const onClickSdmStatus = (index: number | undefined) => { - if (index !== undefined) { - const selectedStatus = transformedList[index]; - if (selectedStatus) { - - - setSdmApplyDetail(selectedStatus); - } - } - } - - return ( - <> - - <ContentsDiv> - <ListDiv> - <div className="overflow-y-scroll h-[250px]"> - <div className="h-[110%] w-[99%]"> - <UiTable - headName='수요정보 신청현황' - tableData={transformedList} - headlist={upHeadSdmInfoStatus} - pageSize={0} - total={0} - cellClick={(index) => onClickSdmStatus(index)} - onPageChange={() => {}} - /> - </div> - </div> - </ListDiv> - <ListDiv> - <div className="card-header"> - <h3 className="text-2xl font-medium text-label">수요신청 상세현황</h3> - </div> - <div className={`card !m-[1.2rem] !p-0r`}> - <Table variant="secondary" style={{ tableLayout: 'fixed', width: '100%' }}> - <TableBody> - <TableRow> - <TableCell colSpan={1} className={TABLE_STYLES.header}>요구시기</TableCell> - <TableCell colSpan={2} className={TABLE_STYLES.cell}>{sdmApplyDetail?.dmndTmng?.toString()}</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.header}>요구수량(m³/일)</TableCell> - <TableCell colSpan={2} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.dmndQty} format="number"/>}</TableCell> - </TableRow> - <TableRow> - <TableCell colSpan={1} className={TABLE_STYLES.header}>사용용도</TableCell> - <TableCell colSpan={2} className={TABLE_STYLES.cell}>{sdmApplyDetail?.useUsgCd}</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.header}>희망단가(원/m³)</TableCell> - <TableCell colSpan={2} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.wntUntprc} format="number"/>}</TableCell> - </TableRow> - <TableRow> - <TableCell colSpan={6} className={TABLE_STYLES.fullWidth}>요구수량</TableCell> - </TableRow> - <TableRow> - <TableCell colSpan={1} className={TABLE_STYLES.header}>총대장균군수(개/100ml)</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.cell}>{ sdmApplyDetail?.grssClfg!=-1?<TransValueFormat value={sdmApplyDetail?.grssClfg ?? ''} format="number"/>:''} {sdmApplyDetail?.grssClfg?sdmApplyDetail.grssClfg!=-1? '이하':'불검출':'-'} </TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.header}>결합잔류염소(mg/L)​</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.combResdch ?? ''} format="number"/>} {sdmApplyDetail?.combResdch?'이하':'-'}</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.header}>탁도(NTU)</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.trbt ?? ''} format="number"/>} {sdmApplyDetail?.trbt?'이하':'-'}</TableCell> - </TableRow> - <TableRow> - <TableCell colSpan={1} className={TABLE_STYLES.header}>생물학적 산소요구량(BOD)(mg/L)</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.blgcOxygDmndQnt ?? ''} format="number"/>} {sdmApplyDetail?.blgcOxygDmndQnt?'이하':'-'}</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.header}>냄새</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.smll} format="number"/>} {sdmApplyDetail?.smll?'이하':'-'}</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.header}>색도(도)</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.crmty ?? ''} format="number"/>} {sdmApplyDetail?.crmty?'이하':'-'}</TableCell> - </TableRow> - <TableRow> - <TableCell colSpan={1} className={TABLE_STYLES.header}>총질소(T-N)(mg/L)</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.tn ?? ''} format="number"/>} {sdmApplyDetail?.tn?'이하':'-'}</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.header}>총인(T-P)(mg/L)​</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.tph ?? ''} format="number"/>} {sdmApplyDetail?.tph?'이하':'-'}</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.header}>수소이온농도(pH)​</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.ph} format="number"/>}</TableCell> - </TableRow> - <TableRow> - <TableCell colSpan={1} className={TABLE_STYLES.header}>염화물(mgCL/L)​</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.clIonQnt ?? ''} format="number"/>} {sdmApplyDetail?.clIonQnt?'이하':'-'}</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.header}>전기전도도(㎲/cm)​</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.cell}>{<TransValueFormat value={sdmApplyDetail?.cdtnv ?? ''} format="number"/>} {sdmApplyDetail?.cdtnv?'이하':'-'}</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.header}>비고</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.cell}>{sdmApplyDetail?.rmrk}</TableCell> - </TableRow> - <TableRow> - <TableCell colSpan={6} className={TABLE_STYLES.fullWidth}>공급처 후보지​</TableCell> - </TableRow> - <TableRow> - <TableCell colSpan={1} className={TABLE_STYLES.header}>후보지1</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.cell}>{ sdmApplyDetail?.splyCndtList?.[0]?.ruseUtztnFcltNm ?? ""}</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.header}>후보지2</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.cell}>{sdmApplyDetail?.splyCndtList?.[1]?.ruseUtztnFcltNm ?? ""}</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.header}>후보지3</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.cell}>{sdmApplyDetail?.splyCndtList?.[2]?.ruseUtztnFcltNm ?? ""}</TableCell> - </TableRow> - </TableBody> - </Table> - </div> - </ListDiv> - <ListDiv> - <div className="card-header"> - <h3 className="text-2xl font-medium text-label">수요신청 진행상태</h3> - </div> - <div className={`card !m-[1.2rem] !p-0r`}> - <Table variant="secondary" style={{ tableLayout: 'fixed', width: '100%' }}> - <TableBody> - <TableRow> - <TableCell colSpan={1} className={TABLE_STYLES.header}>진행상태</TableCell> - <TableCell colSpan={2} className={TABLE_STYLES.cell}>{sdmApplyDetail?.status?.toString()}</TableCell> - <TableCell colSpan={1} className={TABLE_STYLES.header}>공급처매칭결과</TableCell> - <TableCell colSpan={2} className={TABLE_STYLES.cell}>{sdmApplyDetail?.ruseUtztnFcltNm??''}</TableCell> - </TableRow> - </TableBody> - </Table> - </div> - </ListDiv> - </ContentsDiv> - {!isLogin? - <UiModal - body={<SdmLogin/>} - bodyClass="sm:max-w-[90vw] w-[530px] h-[430px]" - open={!isLogin} - onOpenChange={(open) => { - if(!open){ - setIsLogin(false) - router.push('/'); - } - }} - noHeaderYn="Y" - noFooterYn="Y" - /> - :null} - <Toaster position="top-center" /> - </> - ); -} diff --git a/apps/dm/app/(base-layout)/pages/sdmMng/sdmInfoInsert/modalSimilar/page.tsx b/apps/dm/app/(base-layout)/pages/sdmMng/sdmInfoInsert/modalSimilar/page.tsx deleted file mode 100644 index 35836d07c..000000000 --- a/apps/dm/app/(base-layout)/pages/sdmMng/sdmInfoInsert/modalSimilar/page.tsx +++ /dev/null @@ -1,166 +0,0 @@ -"use client" - -import { useDmStore } from '@/app/store'; -import type { MoneyDetailType, SimilarCaseType } from '@/app/store/sdmMng'; -import { SelectBox, Title, UiTable } from '@common/business_components/ui'; -import { HeadMakeColSpan } from '@common/business_components/ui/table/HeadMakeColSpan'; -import { Table, TableBody, TableCell, TableHeader, TableRow } from '@common/components/ui/table'; -import { useEffect, useMemo, useState } from 'react'; - -type modalType = { - sply: number | 0; - usageCd: string | ''; - money: number | 0; -}; - -const searchUseTypeList = [ - { text: '공급량', val: 'S' }, - { text: '사용용도', val: 'U' }, -]; - -export default function ModalSimilarPage({ sply = 0, usageCd = '', money = 0 }: modalType) { - const { Sdm, getSimilarCaseList } = useDmStore((state) => state); - const [searchUseType, setSearchUseType] = useState<{text: string, value: string}>({text: '공급량', value: 'S'}); - const [moneyDetailList, setMoneyDetailList] = useState<MoneyDetailType[]>([]); - const { - upHeadSimilarCaseList, - similarCaseList, - upHeadMoneyDetailList, - } = Sdm; - - const rowSpans = useMemo(() => { - const spans: { [key: number]: number } = {}; - let currentValue = ''; - let currentSpan = 0; - let startIndex = 0; - - similarCaseList.forEach((item: SimilarCaseType, index: number) => { - if (item.ruseBizNm === currentValue - || item.bizBgngDate === currentValue - || item.bizEndDate === currentValue - || item.reqBizReuseFcltCst === currentValue) { - currentSpan++; - spans[startIndex] = currentSpan; - } else { - currentValue = item.ruseBizNm; - currentSpan = 1; - startIndex = index; - spans[index] = 1; - } - }); - - return spans; - }, [similarCaseList]); - - const handleCellClick = (index: number) => { - setMoneyDetailList([{ - reqBizGrssCst: similarCaseList[index]?.reqBizGrssCst ?? '', - reqBizReuseFcltCst: similarCaseList[index]?.reqBizReuseFcltCst ?? '', - reqBizPplCst: similarCaseList[index]?.reqBizPplCst ?? '', - reqBizArchCst: similarCaseList[index]?.reqBizArchCst ?? '', - reqBizMchnCst: similarCaseList[index]?.reqBizMchnCst ?? '', - reqBizMtrngCst: similarCaseList[index]?.reqBizMtrngCst ?? '', - reqBizGisCst: similarCaseList[index]?.reqBizGisCst ?? '', - reqBizCctvCst: similarCaseList[index]?.reqBizCctvCst ?? '', - reqBizCmcnCst: similarCaseList[index]?.reqBizCmcnCst ?? '', - reqBizWstCst: similarCaseList[index]?.reqBizWstCst ?? '', - reqBizDesignCst: similarCaseList[index]?.reqBizDesignCst ?? '', - reqBizSpvsCst: similarCaseList[index]?.reqBizSpvsCst ?? '', - reqBizSbsdCst: similarCaseList[index]?.reqBizSbsdCst ?? '', - reqBizEtc: similarCaseList[index]?.reqBizEtc ?? '', - prcmPlanNlep: similarCaseList[index]?.prcmPlanNlep ?? '', - prcmPlanLcep: similarCaseList[index]?.prcmPlanLcep ?? '', - prcmPlanBrdnCst: similarCaseList[index]?.prcmPlanBrdnCst ?? '', - prcmPlanEcqrRt: similarCaseList[index]?.prcmPlanEcqrRt ?? '', - prcmPlanGrssCst: similarCaseList[index]?.prcmPlanGrssCst ?? '', - clclnNlep: similarCaseList[index]?.clclnNlep ?? '', - clclnLcep: similarCaseList[index]?.clclnLcep ?? '', - clclnBrdnCst: similarCaseList[index]?.clclnBrdnCst ?? '', - clclnEcqrRt: similarCaseList[index]?.clclnEcqrRt ?? '', - clclnGrssCst: similarCaseList[index]?.clclnGrssCst ?? '' - }]); - } - - useEffect(() => { - const type = searchUseType.value; - getSimilarCaseList(type, type === 'S' ? sply : type === 'U' ? usageCd : money); - }, [getSimilarCaseList, money, searchUseType, sply, usageCd]); - - return ( - <div className="align-top w-[1360px] h-full"> - <Title title="유사사례 조회" /> - <div className="overflow-x-auto h-[480px] w-full mt-8" tabIndex={0} aria-label="유사사례 테이블 영역"> - <div className="w-[150%]"> - <div className="card-header justify-self-start"> - <h3 className="text-2xl font-medium text-label">유사사례</h3> - <SelectBox - tabIndex={0} - aria-label="검색 기준 선택" - selectArray={searchUseTypeList} - value={searchUseType.value} - onSelectValue={(val) => { - setSearchUseType({text: searchUseTypeList.find(item => item.val === val)?.text ?? '', value: val.toString()}); - }} - className="w-[140px] ml-20" - label="" - selectClass="w-[140px]" - /> - </div> - <div className={`card !m-[1.2rem] !p-0r`}> - <Table variant="secondary"> - <TableHeader className="font-bold"> - <HeadMakeColSpan upHeadList={upHeadSimilarCaseList} /> - </TableHeader> - <TableBody className='text-center'> - {similarCaseList.length > 0 ? similarCaseList?.map((el: SimilarCaseType, index) => ( - <TableRow key={`similar-case-row-${index}-${el.ruseBizNm}-${el.bizBgngDate}`}> - {upHeadSimilarCaseList.map((head) => ( - head.id && head.id.length > 1 && ( - <TableCell - tabIndex={head.id === 'someClickableId' ? 0 : undefined} - role="button" - aria-label={`유사사례 ${head.id} 클릭 시 상세 정보 표시`} - className={`${head.align === 'right' ? 'text-right' : head.align === 'center' ? 'text-center' : typeof el[head.id as keyof SimilarCaseType] === 'number' ? 'text-right' : 'text-center'} cursor-pointer`} - key={`similar-case-cell-${head.id}-${index}-${el.ruseBizNm}`} - rowSpan={(head.id === 'businessName' || head.id ==='businessDuration' || head.id === 'money') ? rowSpans[index] : undefined} - style={(head.id === 'businessName' || head.id === 'businessDuration' || head.id === 'money') && index > 0 && similarCaseList[index - 1]?.ruseBizNm === el.ruseBizNm ? { display: 'none' } : undefined} - onClick={() => handleCellClick(index)} - onKeyDown={(e) => { - if (e.key === 'Enter' || e.key === ' ') { - handleCellClick(index); - } - }} - > - {typeof el[head.id as keyof SimilarCaseType] !== 'number' - ? String(el[head.id as keyof SimilarCaseType] ?? '') - : String(el[head.id as keyof SimilarCaseType]).includes('.') - ? String(el[head.id as keyof SimilarCaseType]).split('.').map((part, index) => - index === 0 ? part.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : part - ).join('.') - : String(el[head.id as keyof SimilarCaseType] ?? '').replace(/\B(?=(\d{3})+(?!\d))/g, ",")} - </TableCell> - ) - ))} - </TableRow> - )) : <></>} - </TableBody> - </Table> - </div> - </div> - </div> - <div className="overflow-x-auto h-[270px] w-full mt-8 overflow-y-hidden"> - <div className="w-[130%]"> - <UiTable - headName={"사업비 상세정보"} - tableData={moneyDetailList} - headlist={upHeadMoneyDetailList} - pageSize={0} - total={0} - cellClick={undefined} - onPageChange={() => {}} - /> - </div> - </div> - </div> - ) -} \ No newline at end of file diff --git a/apps/dm/app/(base-layout)/pages/sdmMng/sdmInfoInsert/page.tsx b/apps/dm/app/(base-layout)/pages/sdmMng/sdmInfoInsert/page.tsx deleted file mode 100644 index df418b20f..000000000 --- a/apps/dm/app/(base-layout)/pages/sdmMng/sdmInfoInsert/page.tsx +++ /dev/null @@ -1,294 +0,0 @@ -"use client"; - -/** - * 수요정보등록 화면 - * - * 🔗 사용 API - * - 수요정보등록: POST /reuseFc/request/demandInfo - */ -import { useDmStore } from "@/app/store"; -import { sdmInfoFormSchema, type DemandCompBizType, type SdmInfoFormData } from "@/app/store/sdmMng"; -import { SdmInfoRegForm } from "@/components/ui/sdmInfoInsertForm/component"; -import { UiModal } from "@common/business_components/ui/dialog_ui"; -import { Button } from "@common/components/ui"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useRouter, useSearchParams } from "next/navigation"; -import { Suspense, useEffect, useState } from "react"; -import { FormProvider, useForm, type SubmitHandler } from "react-hook-form"; -import toast, { Toaster } from "react-hot-toast"; -import SdmLogin from "../sdmLogin/page"; - - - -function SdmInfoInsertContent() { - const searchParams = useSearchParams(); - const { insertSdmInfoData, Sdm, setSubsInfo } = useDmStore((state) => state); - const { successLogin } = Sdm; - const [ismoneyDisabled, setIsmoneyDisabled] = useState(false); - const formSchema = sdmInfoFormSchema; - - const [isLogin, setIsLogin] = useState(false); - const [facilityName, setFacilityName] = useState<string>(""); - const [defaultValues, setDefaultValues] = useState<SdmInfoFormData>({ - sdmNm: "", - demandYmd: new Date(), - demandQnty: "", - usePurpose: "", - money: "", - /**요구수질 */ - reqWaterQlty: "", - grssClfg: null, - tn: null, - combResdch: null, - tph: null, - trbt: null, - ph: null, - bod: null, - /**컬럼확인필요 */ - clIonQnt: null, - smll: "", - cdtnv: null, - crmty: null, - rmrk: "", - /** 후보지 제목 */ - candidateTitle: [ - { ruseUtztnFcltNm: "", ruseUtztnFcltCd: "" }, - { ruseUtztnFcltNm: "", ruseUtztnFcltCd: "" }, - { ruseUtztnFcltNm: "", ruseUtztnFcltCd: "" }, - ], - }); - - useEffect(() => { - const user = sessionStorage.getItem("user"); - - - setDefaultValues((prev) => ({ - ...prev, - sdmNm: searchParams.get("dmdCoNm") || "", - })); - if (searchParams.get("dmdInfoId")) { - // const data = { - // dmdCoNm: searchParams.get("dmdCoNm") || '', - // ctpvCd: searchParams.get("ctpvCd") || '', - // sggCd: searchParams.get("sggCd") || '', - // dmdInfoId: searchParams.get("dmdInfoId") || '', - // daddr: searchParams.get("daddr") || '', - // telno: searchParams.get("telno") || '', - // } - - // sessionStorage.setItem("user", JSON.stringify(data || {})); - } - //sessionStorage.setItem("user", JSON.parse(user||'') || ""); - setIsLogin(user || searchParams.get("dmdInfoId") ? true : false); - }, [searchParams]); - - useEffect(() => { - const local = localStorage.getItem("user"); - if (local) { - setIsLogin(true); - } - setSubsInfo([]); // subsInfo 초기화 후보지 처음 화면 들어올때 초기화(스토어내 객체만) - }, [setSubsInfo]); - - const form = useForm<SdmInfoFormData>({ - resolver: zodResolver(formSchema), - defaultValues, - mode: "onSubmit", - }); - - const subsInfo = useDmStore((state) => state.map.subsInfo); - - useEffect(() => { - //map.subsInfo 스토어 객체 값이 변경되면 해당 값이 폼에 자동으로 들어가도록 수정 대신 값이 있어야함 - if (subsInfo.length > 0) { - form.setValue("candidateTitle", subsInfo); - } - }, [subsInfo, form]); - - //후보지 팝업 값 셋팅 - useEffect(() => { - const handleMessage = (event: MessageEvent) => { - if (event.data?.type === "SET_SUBS_INFO") { - setSubsInfo(event.data.payload); // zustand로 값 설정 - } - }; - - window.addEventListener("message", handleMessage); - return () => window.removeEventListener("message", handleMessage); - }, [setSubsInfo]); - - // 로그인 성공 시 모달 닫기 및 폼 업데이트 - useEffect(() => { - if (successLogin) { - setIsLogin(true); - const user = sessionStorage.getItem("user"); - if (user) { - try { - const userData = JSON.parse(user); - if (userData.dmdCoNm) { - setFacilityName(userData.dmdCoNm); - form.setValue("sdmNm", userData.dmdCoNm); // 수요처명(회사명) - } - } catch (error) { - console.error("Error parsing user data:", error); - } - } - } - }, [successLogin, form]); - - useEffect(() => { - console.log("Form state changed:", form.formState.errors); - }, [form.formState.errors]); - - // 체크박스 상태가 변경될 때마다 money 필드의 에러를 초기화 - useEffect(() => { - if (ismoneyDisabled) { - form.clearErrors("money"); - form.setValue("money", ""); - } - }, [ismoneyDisabled, form]); - const router = useRouter(); - const onSubmit: SubmitHandler<SdmInfoFormData> = async (data) => { - try { - const dmSubsInfo = data.candidateTitle?.filter( - (item) => item.ruseUtztnFcltNm && item.ruseUtztnFcltCd - ); - // Transform form data to madata.candidateTitletch API schema - const apiData: DemandCompBizType = { - dmdInfoId: - JSON.parse( - sessionStorage.getItem("user") || "{}" - )?.dmdInfoId?.toString() || - searchParams.get("dmdInfoId") + (searchParams.get("bznmTotNo") || ""), - dmdInfoFk: - JSON.parse( - sessionStorage.getItem("user") || "{}" - )?.dmdInfoId?.toString() || - searchParams.get("dmdInfoId") + (searchParams.get("bznmTotNo") || ""), - dmdCoNm: - JSON.parse( - sessionStorage.getItem("user") || "{}" - )?.dmdCoNm?.toString() || data.sdmNm, - ctpvCd: - JSON.parse( - sessionStorage.getItem("user") || "{}" - )?.ctpvCd?.toString() || - searchParams.get("ctpvCd") || - "", - sggCd: - JSON.parse( - sessionStorage.getItem("user") || "{}" - )?.sggCd?.toString() || - searchParams.get("sggCd") || - "", - daddr: - JSON.parse( - sessionStorage.getItem("user") || "{}" - )?.daddr?.toString() || - searchParams.get("daddr") || - "", - telno: - JSON.parse( - sessionStorage.getItem("user") || "{}" - )?.telno?.toString() || - searchParams.get("telno") || - "", - rgtr: - JSON.parse( - sessionStorage.getItem("user") || "{}" - )?.rgtr?.toString() || - searchParams.get("rgtr") || - "", - useUsgCd: data.usePurpose || "", - wntUntprc: Number(data.money) || "", - dmndTmng: data.demandYmd || new Date(), - dmndQty: Number(data.demandQnty) || "", - grssClfg: data.grssClfg === null ? -1 : Number(data.grssClfg), - tn: Number(data.tn) || null, - combResdch: Number(data.combResdch) || null, - tph: Number(data.tph) || null, - trbt: Number(data.trbt) || null, - ph: data.ph || "", - blgcOxygDmndQnt: Number(data.bod) || null, - clIonQnt: Number(data.clIonQnt) || null, - smll: data.smll || "", - cdtnv: Number(data.cdtnv) || null, - crmty: Number(data.crmty) || null, - rmrk: data.rmrk || "", - bzmnNo: "", - dmdAplyPswd: "", - index: 0, - reqDt: "", - dmdInfoSn: 0, - status: "", - splyCndtList: dmSubsInfo || [], - }; - - await insertSdmInfoData(apiData); - setTimeout(() => { - router.push("/"); - }, 1000); // 0.8초 후 이동 - } catch (error) { - console.error("Error submitting form:", error); - } - }; - - return ( - <div className="min-h-screen bg-[#F2F2F2]"> - <div className="container mx-auto px-4 py-8"> - <div className="text-center mb-8"> - <h1 className="text-4xl font-bold text-gray-900 underline"> - 수요정보 등록 - </h1> - </div> - - <div className="max-w-3xl mx-auto bg-white rounded-lg shadow-md p-6"> - <FormProvider {...form}> - <form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6"> - <SdmInfoRegForm - form={form} - onCheckboxChange={setIsmoneyDisabled} - facilityName={facilityName} - /> - <div className="flex justify-center pt-4"> - <Button - color="sky" - size={"sm"} - type="submit" - className="w-40 font-semibold py-2 px-4 rounded-md " - > - 수요정보 등록 - </Button> - </div> - </form> - </FormProvider> - </div> - </div> - - {!isLogin ? ( - <UiModal - body={<SdmLogin />} - bodyClass="sm:max-w-[90vw] w-[530px] h-[430px]" - open={!isLogin} - onOpenChange={(open) => { - if (!open) { - toast.dismiss(); - router.push("/"); - } - }} - noHeaderYn="Y" - noFooterYn="Y" - /> - ) : null} - <Toaster position="top-center" /> - </div> - ); -} - -export default function MyForm() { - return ( - <Suspense fallback={<div>Loading...</div>}> - <SdmInfoInsertContent /> - </Suspense> - ); -} diff --git a/apps/dm/app/(base-layout)/pages/sdmMng/sdmInsert/page.tsx b/apps/dm/app/(base-layout)/pages/sdmMng/sdmInsert/page.tsx deleted file mode 100644 index 79eb07830..000000000 --- a/apps/dm/app/(base-layout)/pages/sdmMng/sdmInsert/page.tsx +++ /dev/null @@ -1,67 +0,0 @@ -"use client"; - -import { useDmStore } from "@/app/store"; -import SdmInsertForm from '@common/business_components/ui/sdmInsertForm'; -import type { DemandCompType } from "@common/business_components/ui/sdmInsertForm/form"; -import { useRouter } from "next/navigation"; -import { useCallback, useEffect, useRef } from "react"; -import { Toaster } from "react-hot-toast"; - -export default function MyForm() { - const { Common, initializeCommonData, getDemandCompList, insertSdmData, Sdm } = useDmStore((state) => state); - const { selectSidoData, selectSigunData } = Common; - const { demandCompList, successNextPage } = Sdm; - const router = useRouter(); - const formDataRef = useRef<DemandCompType | null>(null); - - useEffect(() => { - initializeCommonData(); - }, [initializeCommonData]); - - useEffect(() => { - if (successNextPage && formDataRef.current) { - const data = formDataRef.current; - console.log(data); - const queryParams = new URLSearchParams({ - dmdCoNm: data.dmdCoNm || '', - ctpvCd: data.ctpvCd || '', - sggCd: data.sggCd || '', - dmdInfoId: data.dmdInfoId || '', - daddr: data.daddr || '', - telno: data.telno || '', - }); - router.push(`/pages/sdmMng/sdmInfoInsert?${queryParams.toString()}`); - } - }, [successNextPage, router]); - - const callback = useCallback((searchText: string, pageCnt: number) => { - searchText = searchText.trim(); - if (searchText.length > 0) { - getDemandCompList(searchText, pageCnt); - } - }, [getDemandCompList]); - - const handleInsertSdmData = useCallback((data: import('@common/business_components/ui/sdmInsertForm/form').DemandCompType) => { - const convertedData: DemandCompType = { - ...data, - }; - formDataRef.current = convertedData; - insertSdmData(convertedData) - }, [insertSdmData]); - - return ( - <div className="min-h-screen bg-[#F2F2F2]"> - <div className="pt-12"> - <SdmInsertForm - selectSidoData={selectSidoData} - selectSigunData={selectSigunData} - dataList={demandCompList} - rtnValue={callback} - rtnInputData={handleInsertSdmData} - openNetwork={true} - /> - <Toaster position="top-center" /> - </div> - </div> - ); -} diff --git a/apps/dm/app/(base-layout)/pages/sdmMng/sdmLogin/page.tsx b/apps/dm/app/(base-layout)/pages/sdmMng/sdmLogin/page.tsx deleted file mode 100644 index 2fd6fc461..000000000 --- a/apps/dm/app/(base-layout)/pages/sdmMng/sdmLogin/page.tsx +++ /dev/null @@ -1,18 +0,0 @@ -'use client' - -import { SdmLoginForm } from '@/components/ui/sdmLoginForm/component'; - -export default function SdmLogin() { - return ( - <div className="container mx-auto px-4 py-8"> - <div className="text-center mb-8"> - <h1 className="text-4xl font-bold text-gray-900 underline"> - 수요처 로그인 - </h1> - </div> - <div className="max-w-3xl mx-auto bg-white rounded-lg shadow-md p-6"> - <SdmLoginForm /> - </div> - </div> - ); -} \ No newline at end of file diff --git a/apps/dm/app/(base-layout)/pages/sdmMng/sdmLogout/page.tsx b/apps/dm/app/(base-layout)/pages/sdmMng/sdmLogout/page.tsx deleted file mode 100644 index 2c682bdbf..000000000 --- a/apps/dm/app/(base-layout)/pages/sdmMng/sdmLogout/page.tsx +++ /dev/null @@ -1,22 +0,0 @@ -"use client"; -/** - * 수요처 로그아웃 화면 - * - * 🔗 사용 API - * - */ -import { useDmStore } from "@/app/store"; -import { useRouter } from "next/navigation"; -import { useEffect } from "react"; - -export default function SdmLogout() { - const router = useRouter(); - const { actionLogout } = useDmStore((state) => state); - - useEffect(() => { - actionLogout(); - router.push("/pages/sdmMng/sdmInfoInsert"); - }, [actionLogout, router]); - - return null; -} diff --git a/apps/dm/app/(base-layout)/pages/wrAbout/page.tsx b/apps/dm/app/(base-layout)/pages/wrAbout/page.tsx deleted file mode 100644 index da3324ffc..000000000 --- a/apps/dm/app/(base-layout)/pages/wrAbout/page.tsx +++ /dev/null @@ -1,339 +0,0 @@ -'use client'; - -import { useEffect, useRef, useState } from 'react'; -import Image from 'next/image'; - -const NAVS = [ - { id: 'card1', label: '물재이용이란' }, - { id: 'card2', label: '물재이용 필요성' }, - { id: 'card3', label: '빗물 재이용' }, - { id: 'card4', label: '중수 재이용' }, - { id: 'card5', label: '하수 재이용' }, - { id: 'card6', label: '물재이용 목표' }, -]; - -export default function WrAboutPage() { - const [activeIdx, setActiveIdx] = useState(0); - const navRefs = useRef<(HTMLLIElement | null)[]>([]); - const cardRefs = useRef<(HTMLElement | null)[]>([]); - - // 클릭 시 이동 - const handleNavClick = (idx: number) => { - setActiveIdx(idx); - const targetCard = cardRefs.current[idx]; - if (targetCard) { - targetCard.scrollIntoView({ behavior: 'smooth', block: 'start' }); - } - }; - - // 키보드 이벤트 처리 - const handleKeyDown = (e: React.KeyboardEvent, idx: number) => { - if (e.key === 'Enter' || e.key === ' ') { - e.preventDefault(); - handleNavClick(idx); - } - }; - - useEffect(() => { - const observerOptions = { - root: null, - rootMargin: '-200px 0px 0px 0px', // 상단에서 200px 지점을 기준으로 - threshold: 0 - }; - - const observer = new IntersectionObserver((entries) => { - entries.forEach((entry) => { - if (entry.isIntersecting) { - const idx = cardRefs.current.findIndex(ref => ref === entry.target); - if (idx !== -1) { - setActiveIdx(idx); - } - } - }); - }, observerOptions); - - // 각 카드 요소를 관찰 - const cardsSnapshot = [...cardRefs.current]; - - cardsSnapshot.forEach((card) => { - if (card) { - observer.observe(card); - } - }); - - return () => { - cardsSnapshot.forEach((card) => { - if (card) { - observer.unobserve(card); - } - }); - }; - }, []); - - return ( - <div className='bg-[#F2F2F2]'> - <main className="relative w-[950px] mx-auto pt-[100px] font-sans"> - {/* 사이드바 */} - <nav className="fixed left-[290px] top-[195px] w-[210px] z-50" aria-label="물재이용 정보 섹션 내비게이션"> - <ul role="list" className="relative space-y-6"> - {NAVS.map((nav, idx) => ( - <li - key={nav.id} - ref={(el) => { navRefs.current[idx] = el; }} - role="listitem" - tabIndex={0} - aria-current={idx === activeIdx ? 'true' : 'false'} - aria-label={`현재 위치: ${nav.label}`} - onClick={() => handleNavClick(idx)} - onKeyDown={(e) => handleKeyDown(e, idx)} - className={`font-NotoSansKR nav-item relative pl-6 text-2xl font-bold text-[#383838] cursor-pointer transition-all duration-300 - after:content-[''] after:absolute after:top-6 after:left-[0.5rem] after:w-[2px] after:h-[24px] after:bg-[#C5C5C5] last:after:hidden - ${idx === activeIdx ? 'text-4xl font-bold text-[#383838]' : ''}`} - > - <span className={`absolute left-[0.5rem] top-1 w-4 h-4 rounded-full -translate-x-1/2 transition-all duration-300 - ${idx === activeIdx ? 'bg-blue-500 border-blue-500' : 'bg-white border-gray-400 border'}`}></span> - {nav.label} - </li> - ))} - </ul> - </nav> - - <article ref={(el) => { cardRefs.current[0] = el; }} className="card-wrap pl-[100px] mb-24 !pt-0" id="card1" aria-labelledby="card1-title"> - <h2 id="card1-title" className="font-NotoSansKR relative text-center text-4xl font-medium text-gray-900 mb-6"> - <span className="absolute left-1/2 top-[-15px] -translate-x-1/2 w-24 h-2 bg-blue-500 rounded-full"></span> - 물재이용이란 - </h2> - <section aria-labelledby="card1-desc" className="bg-white border border-gray-300 rounded-xl p-[60px] pt-[70px] pb-[70px] "> - <h1 id="card1-desc" className="font-NotoSansKR text-[#269DDA] text-5xl font-bold mb-8">물 재이용이 무엇인가요?</h1> - <p className="font-NotoSansKR text-[#231815] text-2xl mb-10 leading-relaxed"> - 물 재이용은 빗물, 오수, 하수처리수, 폐수처리수 및 발전소 온배수를<br /> - 물 재이용시설을 이용하여 처리하고, 그 처리된 물을 생활, 공업, 농업, 조경,<br /> - 하천 유지 등의 용도로 이용하는 것을 말합니다. - </p> - <Image - src="/img/wrAbout/img_01_1.png" - alt="이 이미지는 물 재이용 시스템의 개요를 나타냅니다. 가정, 공공기관, 하수처리장 등에서 발생한 생활하수, 빗물, 하수처리수를 물 재이용 시설에서 처리한 후, 청소나 화장실, 농업, 살수차, 하천 유지, 공장, 공원 및 골프장 등 다양한 용도로 활용하는 과정을 도식화한 것입니다." - width={800} - height={400} - className="w-[90%] mx-auto mb-8 rounded" - /> - <p className="font-NotoSansKR text-center font-normal text-2xl"> - 환경부는 2011년에 '물의 재이용 촉진 및 지원에 관한 법률'을 제정하여<br /> - 한국환경공단과 함께 물 재이용 확대 및 촉진을 위해 노력하고 있습니다. - </p> - </section> - </article> - - {/* 카드2 */} - <article ref={(el) => { cardRefs.current[1] = el; }} className="card-wrap pl-[100px] mb-24" id="card2" aria-labelledby="card2-title"> - <h2 id="card2-title" className="font-NotoSansKR relative text-center text-4xl font-medium text-gray-900 mb-6"> - <span className="absolute left-1/2 top-[-15px] -translate-x-1/2 w-24 h-2 bg-blue-500 rounded-full"></span> - 물재이용 필요성 - </h2> - <section aria-labelledby="card2-desc" className="bg-white border border-gray-300 rounded-xl p-[60px] pt-[70px] pb-[70px] "> - <h1 id="card2-desc" className="font-NotoSansKR text-[#D63F1F] text-5xl font-semibold mb-8">물 재이용, 왜 필요한가요?</h1> - <p className="font-NotoSansKR text-2xl font-normal mb-10 leading-relaxed"> - 빗물, 중수, 하수처리수는 지속적으로 이용 가능한 순환자원입니다.<br /> - 물 재이용을 통한 효율적인 수자원 활용은 물 스트레스국가인 우리나라에서<br />가뭄대응능력 향상 및 하천수질보전을 위해 반드시 필요한 일입니다. - </p> - <Image - src="/img/wrAbout/img_02_1.png" - alt="이 이미지는 기후변화로 인한 온도 상승 추이를 설명한다. 왼쪽에는 지구 그림과 온도계가 함께 표시되어 있으며, 지구 평균 기온은 지난 100년간 약 0.9℃ 상승했음을 나타낸다. 오른쪽에는 대한민국 지도와 함께 온도계가 있으며, 지난 100년간 약 1.8℃ 상승했음을 보여준다. 이는 지구 평균보다 2배 높은 수치이며, 자료 출처는 「기후변화 평가보고서 2020, 환경부·기상청」이다." - width={800} - height={400} - className="w-[90%] mx-auto mb-8 w-[80%]" - /> - <p className="font-NotoSansKR text-2xl mb-10 leading-relaxed"> - - 우리나라의 기후변화 진행속도는 세계 평균을 상회하고 있습니다.<br /> - - 기후변화로 인한 국지적인 가뭄은 더욱 자주, 더욱 심하게 일어나고 있으며, 우리의 물 안보를 위협하고 있습니다. - </p> - <Image - src="/img/wrAbout/img_02_2.png" - alt="세계 평균 1인당 강수량은 15,044m³이며, 대한민국은 2,546m³로 약 1/6 수준입니다. 계절별 강수량은 봄 10%, 여름 70%, 가을 15%, 겨울 5%입니다. 이는 여름철에 강수량이 집중되는 문제를 나타냅니다." - width={800} - height={400} - className="w-[90%] mx-auto mb-8" - /> - <p className="font-NotoSansKR text-2xl mb-10 leading-relaxed"> - - 우리나라의 1인당 강수량은 2,546㎥ 으로 세계 평균 15,044㎥의 약 1/6 수준입니다.<br /> - - 우리나라 강수량의 70%는 여름철에 집중되어 있어 이용 가능한 수자원확보가 어렵습니다. - </p> - <Image - src="/img/wrAbout/img_02_3.png" - alt="물 재이용은 환경을 보호하며 지속 가능한 발전이 가능하게 하고, 안정적인 수자원 확보, 깨끗하고 경제적인 공업용수 공급, 하천 수질 개선을 통한 생태계 회복에 기여합니다." - width={800} - height={400} - className="w-[93%] mx-auto" - /> - </section> - </article> - - {/* 카드3 */} - <article ref={(el) => { cardRefs.current[2] = el; }} className="card-wrap pl-[100px] mb-24" id="card3" aria-labelledby="card3-title"> - <h2 id="card3-title" className="font-NotoSansKR relative text-center text-4xl font-medium text-gray-900 mb-6"> - <span className="absolute left-1/2 top-[-15px] -translate-x-1/2 w-24 h-2 bg-blue-500 rounded-full"></span> - 빗물 재이용 - </h2> - <section aria-labelledby="card3-desc" className="bg-white border border-gray-300 rounded-xl p-[60px] pt-[70px] pb-[70px] "> - <h1 id="card3-desc" className="font-NotoSansKR leading-snug text-[#269DDA] text-5xl font-bold mb-6">친환경 수자원 빗물,<br />편리하게 사용할 수 있어요!</h1> - <p className="font-NotoSansKR text-2xl mb-10 leading-relaxed">가뭄을 극복하고 홍수를 예방하기 위해<br />비가 내릴 때 빗물을 모아두었다가 사용합니다.</p> - <Image - src="/img/wrAbout/img_03_1.png" - alt="주택 지붕에 내린 빗물을 저장조에 모아 조경용수, 화장실용수, 세척·살수용수로 재활용하는 과정을 보여줍니다." - width={800} - height={400} - className="w-[90%] mx-auto mb-6" - /> - <Image - src="/img/wrAbout/img_03_2.png" - alt="빗물이용" - width={200} - height={100} - className="mb-5 w-[20%]" - /> - <p className="font-NotoSansKR text-2xl leading-relaxed"> - - 의무 설치대상: 지붕면적 1,000㎡ 이상의 운동장, 체육관, 공공업무시설 등<br /> - - 설 치 기 준: 집수시설, 처리시설, 빗물 저류조(지붕 집수면적 x 0.05m 이상)<br /> - - 활 용 용 도: 골프장 등의 조경용수, 화장실용수, 세척·살수용수 등 - </p> - </section> - </article> - - {/* 카드4 */} - <article ref={(el) => { cardRefs.current[3] = el; }} className="card-wrap pl-[100px] mb-24" id="card4" aria-labelledby="card4-title"> - <h2 id="card4-title" className="font-NotoSansKR relative text-center text-4xl font-medium text-gray-900 mb-6"> - <span className="absolute left-1/2 top-[-15px] -translate-x-1/2 w-24 h-2 bg-blue-500 rounded-full"></span> - 중수 재이용 - </h2> - <section aria-labelledby="card4-desc" className="bg-white border border-gray-300 rounded-xl p-[60px] pt-[70px] pb-[70px] "> - <h1 id="card4-desc" className="font-NotoSansKR leading-snug text-[#9771B0] text-5xl font-bold mb-6">요모조모 쓸모 많은 중수,<br />알뜰하게 재이용할 수 있어요!</h1> - <p className="font-NotoSansKR text-2xl mb-10 leading-relaxed">한번 사용한 물을 중수도 시설을 통해 재생하여<br />개별적 또는 지역적으로 재이용할 수 있습니다.</p> - <Image - src="/img/wrAbout/img_04_1.png" - alt="욕실, 세면대, 주방, 세탁기 등에서 발생한 생활용수를 중수도 시설에서 처리하여 화장실 변기용수와 조경용수로 재이용하는 시스템 흐름도입니다." - width={800} - height={400} - className="w-[90%] mx-auto mb-6" - /> - <Image - src="/img/wrAbout/img_04_2.png" - alt="중수재이용" - width={200} - height={100} - className="mb-5 w-[20%]" - /> - <p className="font-NotoSansKR text-2xl leading-relaxed"> - - 의무 설치대상: 일정규모 이상의 대규모점포, 숙박/목욕장, 공장, 각종 개발사업 등<br /> - - 의무 재이용량: 물 사용량의 10% 이상<br /> - - 활 용 용 도: 청소·화장실용수, 세척·살수용수, 조경용수, 공업용수 등 - </p> - </section> - </article> - - {/* 카드5 */} - <article ref={(el) => { cardRefs.current[4] = el; }} className="card-wrap pl-[100px] mb-24" id="card5" aria-labelledby="card5-title"> - <h2 id="card5-title" className="font-NotoSansKR relative text-center text-4xl font-medium text-gray-900 mb-6"> - <span className="absolute left-1/2 top-[-15px] -translate-x-1/2 w-24 h-2 bg-blue-500 rounded-full"></span> - 하수 재이용 - </h2> - <section aria-labelledby="card5-desc" className="bg-white border border-gray-300 rounded-xl p-[60px] pt-[70px] pb-[70px] "> - <h1 id="card5-desc" className="font-NotoSansKR leading-snug text-[#00818A] text-5xl font-bold mb-6">아직 할 일이 많은 하수처리수,<br />풍족하게 재이용할 수 있어요!</h1> - <p className="font-NotoSansKR text-2xl mb-10 leading-relaxed">사용하고 버려져 공공하수처리장으로 모여든 물은<br />용도에 맞는 처리 후 재이용 할 수 있습니다.</p> - <Image - src="/img/wrAbout/img_05_1.png" - alt="주택과 건물에서 발생한 하수가 공공하수처리장을 거쳐 처리된 후, 물 재이용 시설에서 정화되어 공업용수, 하천유지용수, 농업용수, 세척·살수용수로 재활용됩니다." - width={800} - height={400} - className="w-[90%] mx-auto mb-6" - /> - <Image - src="/img/wrAbout/img_05_2.png" - alt="하수처리 재이용" - width={200} - height={100} - className="mb-5 w-[20%]" - /> - <p className="font-NotoSansKR text-2xl leading-relaxed"> - - 의무 이용대상: 공공하수처리장(시설용량 5,000㎥/일 이상)<br /> - - 의무 재이용량: 일 하수처리량의 10% 이상<br /> - - 활 용 용 도: 공업용수, 하천유지용수, 농업용수 등 - </p> - </section> - </article> - - {/* 카드6 */} - <article ref={(el) => { cardRefs.current[5] = el; }} className="card-wrap pl-[100px] mb-24" id="card6" aria-labelledby="card6-title"> - <h2 id="card6-title" className="font-NotoSansKR relative text-center text-4xl font-medium text-gray-900 mb-6"> - <span className="absolute left-1/2 top-[-15px] -translate-x-1/2 w-24 h-2 bg-blue-500 rounded-full"></span> - 물재이용 목표 - </h2> - <section aria-labelledby="card6-desc" className="bg-white border border-gray-300 rounded-xl p-[60px] pt-[70px] pb-[70px] "> - <h1 id="card6-desc" className="font-NotoSansKR leading-snug text-[#269DDA] text-5xl font-bold mb-6">2030년 물 재이용 목표를 위해<br />모두의 관심과 노력이 필요합니다.</h1> - <p className="font-NotoSansKR text-2xl mb-6 leading-relaxed"> - 환경부는 2030년까지의 제2차 물 재이용 기본계획을 수립하여<br />한국환경공단과 함께 물 재이용 확대 및 촉진을 위해 노력하고 있습니다. - </p> - <Image - src="/img/wrAbout/img_06_1.png" - alt="지속가능한 물 재이용 정착으로 건전한 물순환 확산" - width={800} - height={400} - className="w-[80%] mx-auto mb-6" - /> - <div className="flex gap-3 flex-wrap justify-between bg-gray-100 p-6 rounded-lg mb-8"> - <div className="flex-1 text-center"> - <Image - src="/img/wrAbout/icon_01.png" - alt="" - width={70} - height={70} - className="mx-auto mb-4 w-[auto] h-[70px]" - /> - <h3 className="font-NotoSansKR text-center font-medium text-nowrap mb-2 text-2xl">도시 물 순환이용<br />체계로의 전환</h3> - <ul className="font-NotoSansKR text-xl text-gray-600 leading-relaxed space-y-1"> - <li className="text-nowrap">- 지속가능한 물 순환이용체계 구축</li> - <li>- 물 재이용시설 관리체계 강화</li> - </ul> - </div> - <div className="flex-1 text-center"> - <Image - src="/img/wrAbout/icon_02.png" - alt="" - width={70} - height={70} - className="mx-auto mb-4 w-[auto] h-[70px]" - /> - <h3 className="font-NotoSansKR text-center font-medium text-nowrap mb-2 text-2xl">유역기반 하수처리수 재이용<br />수요확대 및 공급체계 구축</h3> - <ul className="font-NotoSansKR text-xl text-gray-600 leading-relaxed space-y-1"> - <li>- 유역기반 통합물관리 연계 강화</li> - <li>- 하수처리수 재이용 공업용수 공급 활성화</li> - <li>- 하수처리수 재이용을 활용한 물순환 촉진</li> - </ul> - </div> - <div className="flex-1 text-center"> - <Image - src="/img/wrAbout/icon_03.png" - alt="" - width={70} - height={70} - className="mx-auto mb-4 w-[auto] h-[70px]" - /> - <h3 className="font-NotoSansKR text-center font-medium text-nowrap mb-2 text-2xl">물 재이용 인식제고<br />및 산업발전 기반 마련</h3> - <ul className="font-NotoSansKR text-xl text-gray-600 leading-relaxed space-y-1"> - <li>- 물 재이용 교육 및 대국민 홍보 강화</li> - <li>- 핵심기술 육성 및 산업발전 지원 강화</li> - </ul> - </div> - </div> - <Image - src="/img/wrAbout/img_06_2.png" - alt="물 재이용량은 2014년 13.3억톤에서 2030년 25.9억톤까지 증가할 것으로 예상됩니다. 그에 따른 기대 효과로는 연간 상수대체 17.9억톤, 물산업 시장성장 약 2조3,541억 원, 건천화된 73개 하천 해소, 약 20,550명의 고용 효과가 포함됩니다." - width={800} - height={400} - className="w-[90%] mx-auto" - /> - </section> - </article> - </main> - </div> - ); -} diff --git a/apps/dm/app/(base-layout)/pages/wrExample/page.tsx b/apps/dm/app/(base-layout)/pages/wrExample/page.tsx deleted file mode 100644 index 4849c02b0..000000000 --- a/apps/dm/app/(base-layout)/pages/wrExample/page.tsx +++ /dev/null @@ -1,364 +0,0 @@ -import Image from "next/image"; - -export default function WrExamplePage() { - return ( - <div className="bg-[#F2F2F2]"> - <div className="relative w-[950px] mx-auto pt-[50px] font-sans"> - <h2 className="font-NotoSansKR relative text-center text-4xl font-bold text-gray-900 mb-6"> - <span className="absolute left-1/2 top-[-15px] -translate-x-1/2 w-24 h-2 rounded-full"></span> - 물 재이용사례 - </h2> - </div> - <div className="bg-[#F2F2F2] text-gray-800"> - <div className="relative w-[950px] mx-auto pt-[50px] font-sans"> - {/* 카드 1 */} - <div className="card-wrap mb-24" id="card1"> - <h2 className="font-NotoSansKR relative text-center text-4xl font-bold text-gray-900 mb-6"> - <span className="absolute left-1/2 top-[-15px] -translate-x-1/2 w-24 h-2 bg-blue-500 rounded-full"></span> - 사업사례 1 - </h2> - <div className="bg-white border border-gray-300 rounded-xl p-[60px] pt-[70px] pb-[70px]"> - {/* 사업명 */} - <section> - <h2 className="font-NotoSansKR text-2xl text-[#657D91] font-bold bg-[#EAEFF3] p-3 rounded mb-4">사업명</h2> - <p className="font-NotoSansKR text-2xl font-semibold text-gray-800 leading-relaxed"> - 경기권역 반도체 사업장 물 재이용 사업<br /> - : 삼성전자 반도체 사업장 하수재이용수 공급(재이용시설 설치, 공급망 구축 등) - </p> - </section> - {/* 사업 배경 및 목적 */} - <section className="mt-8"> - <h2 className="font-NotoSansKR text-2xl text-[#657D91] font-bold bg-[#EAEFF3] p-3 rounded mb-4">사업 배경 및 목적</h2> - <p className="font-NotoSansKR text-2xl font-semibold text-gray-800 leading-relaxed"> - 삼성전자는 환경경영전략 실현과 반도체 공장의 안정적 용수 공급을 위해 하수 재이용수를 공업용수로 도입하기로 결정 - </p> - </section> - {/* 사업 주요 내용 */} - <section className="mt-8"> - <h2 className="font-NotoSansKR text-2xl text-[#657D91] font-bold bg-[#EAEFF3] p-3 rounded mb-4">사업 주요 내용</h2> - <p className="font-NotoSansKR text-2xl font-semibold text-gray-800 leading-relaxed"> - 1단계 사업[화성·오산(12만㎥/일) → 삼성 화성·기흥(29년 공급)]<br /> - 2단계 사업[수원(21만㎥/일) → 삼성 평택(30년 공급)] - </p> - </section> - {/* 특이사항 */} - <section className="mt-8"> - <h2 className="font-NotoSansKR text-2xl text-[#657D91] font-bold bg-[#EAEFF3] p-3 rounded mb-4">특이사항</h2> - <p className="font-NotoSansKR text-2xl font-semibold text-gray-800 leading-relaxed"> - 본 사업은 광역 하수 재이용 공급망 구축의 첫 사업으로 초기 민관협의체를 구성·운영 후 관계기관(환경부, 경기도, 지자체, 공단, 수공, 삼성전자) 간 MOU 체결을 통해 사업을 추진하였으며, 반도체 사업장에 하수 재이용수를 공업용수로 공급하는 국내 첫 사업으로 위협부담 해소를 위해 사업을 단계별로 시행 - </p> - </section> - {/* 단계별 시각 정보 */} - <section className="bg-white px-4 mt-8"> - <Image - src="/img/wrExample/img_ex_01_1.png" - alt="사업단계 설명" - width={800} - height={400} - className="w-[100%] mx-auto mb-8" - /> - </section> - </div> - </div> - - {/* 카드2 */} - <div className="card-wrap mb-24" id="card2"> - <h2 className="font-NotoSansKR relative text-center text-4xl font-bold text-gray-900 mb-6"> - <span className="absolute left-1/2 top-[-15px] -translate-x-1/2 w-24 h-2 bg-blue-500 rounded-full"></span> - 사업사례 2 - </h2> - <div className="bg-white border border-gray-300 rounded-xl p-[60px] pt-[70px] pb-[70px]"> - {/* 사업명 */} - <section> - <h2 className="font-NotoSansKR text-2xl text-[#657D91] font-bold bg-[#EAEFF3] p-3 rounded mb-4">사업명</h2> - <p className="font-NotoSansKR text-2xl font-semibold text-gray-800 leading-relaxed"> - 경기도 파주시 하수재이용<br /> - : 운정·금촌하수처리시설의 하수처리수를 막공법(U/F, R/O)으로 재처리하여 파주 LCD 산업단지내 3개 업체*에 공업용수 공급<br /><br /> - *LG디스플레이(P10공장), 희성전자, 엔비텍 등 - </p> - </section> - {/* 사업 방식 */} - <section className="mt-8"> - <h2 className="font-NotoSansKR text-2xl text-[#657D91] font-bold bg-[#EAEFF3] p-3 rounded mb-4">사업 방식</h2> - <p className="font-NotoSansKR text-2xl font-semibold text-gray-800 leading-relaxed"> - 민간투자사업(시행사 : 파주그린허브(주), 운영사 : 테크로스) - </p> - </section> - {/* 사업 주요 내용 */} - <section className="mt-8"> - <h2 className="font-NotoSansKR text-2xl text-[#657D91] font-bold bg-[#EAEFF3] p-3 rounded mb-4">사업 주요 내용</h2> - <p className="font-NotoSansKR text-2xl font-semibold text-gray-800 leading-relaxed"> - 처리공정 : 전처리분리막(U/F) + 역삼투서비(R/O)<br /> - 공급량 : 4만m³/일<br /> - 관로 : 13.6km<br /> - 사업비 : 651억원 - </p> - </section> - {/* 특이사항 */} - <section className="mt-8"> - <h2 className="font-NotoSansKR text-2xl text-[#657D91] font-bold bg-[#EAEFF3] p-3 rounded mb-4">특이사항</h2> - <p className="font-NotoSansKR text-2xl font-semibold text-gray-800 leading-relaxed"> - 하수처리수 재이용시설 자체 농축폐수 처리공정 개발 및 적용 성공사례 - </p> - <div className="grid grid-cols-1 gap-0 items-start"> - {/* 좌측 이미지 */} - <div> - <Image - src="/img/wrExample/img_ex_02_1.png" - alt="적용 성공사례 지도" - width={1000} - height={1200} - className="w-[100%] mx-auto" - /> - </div> - - {/* 우측 표 */} - <div className="space-y-3"> - {/* 하수처리수 공급 */} - <div> - <table className="min-w-full h-[500px]text-center border border-black"> - <colgroup> - <col style={{ width: "20%" }} /> - <col style={{ width: "40%" }} /> - <col style={{ width: "40%" }} /> - </colgroup> - <tbody> - <tr> - <td colSpan={3} className="font-NotoSansKR bg-[#ffc000] h-[30px] text-xl text-white font-semibold text-center pt-[6px] pb-[6px] px-0">하수처리수 공급</td> - </tr> - <tr className="text-xl h-[30px]"> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">위치</td> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">금촌하수</td> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">운정하수</td> - </tr> - <tr className="text-sm"> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">시설용량</td> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">44,000㎥/일</td> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">60,000㎥/일</td> - </tr> - <tr className="text-sm"> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">유입량</td> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">27,000㎥/일<br />자연유하</td> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">30,000㎥/일<br />이송펌프장</td> - </tr> - </tbody> - </table> - {/* 첫 화살표 (자연유하 / 관로이송) */} - <div className="flex h-[30px] justify-between items-center my-3 px-4"> - <div className="flex text-xl items-center gap-1 text-orange-600 font-bold pl-6"> - <span className="font-NotoSansKR">자연유하: 161m</span> - <Image - src="/img/wrExample/img_arrow_down_1.png" - alt="오른쪽 화살표" - width={24} - height={24} - className="h-6 w-6" - /> - </div> - <div className="flex text-xl items-center gap-1 text-orange-600 font-bold"> - <Image - src="/img/wrExample/img_arrow_down_1.png" - alt="왼쪽 화살표" - width={24} - height={24} - className="h-6 w-6" - /> - <span className="font-NotoSansKR">관로이송: 3.2km</span> - </div> - </div> - </div> - - {/* 물재이용 처리시설 */} - <div> - <table className="min-w-full text-center border border-black"> - <colgroup> - <col style={{ width: "50%" }} /> - <col style={{ width: "50%" }} /> - </colgroup> - <tbody> - <tr> - <td colSpan={2} className="font-NotoSansKR bg-[#00b050] text-xl h-[30px] text-white font-semibold text-center pt-[6px] pb-[6px] px-0">물재이용 처리시설</td> - </tr> - <tr className="text-sm"> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">유입유량</td> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">57,000㎥/일</td> - </tr> - <tr className="text-sm"> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">재이용시설</td> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">40,000㎥/일</td> - </tr> - <tr className="text-sm"> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">농축폐수처리</td> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">17,000㎥/일</td> - </tr> - </tbody> - </table> - {/* 두 번째 화살표 (공급관로) */} - <div className="flex flex-col items-center my-3"> - <div className="flex h-[30px] items-center gap-1 text-xl text-blue-600 font-semibold"> - <span className="font-NotoSansKR">공급관로 L=10.4km</span> - <Image - src="/img/wrExample/img_arrow_down_2.png" - alt="아래 화살표" - width={24} - height={24} - className="h-6 w-6" - /> - </div> - </div> - </div> - - {/* 수요처 공급 */} - <div> - <table className="min-w-full text-center border border-black"> - <colgroup> - <col style={{ width: "50%" }} /> - <col style={{ width: "50%" }} /> - </colgroup> - <tbody> - <tr> - <td colSpan={2} className="font-NotoSansKR bg-[#3399ff] h-[30px] text-xl text-white font-semibold text-center pt-[6px] pb-[6px] px-0">수요처 공급</td> - </tr> - <tr className="text-sm"> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">수요처</td> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">LG디스플레이 외 2개사</td> - </tr> - <tr className="text-sm"> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">수요량</td> - <td className="font-NotoSansKR text-xl h-[30px] border-black border p-1 font-bold">40,000㎥/일</td> - </tr> - </tbody> - </table> - </div> - </div> - </div> - </section> - </div> - </div> - - {/* 카드3 */} - <div className="card-wrap mb-24" id="card3"> - <h2 className="font-NotoSansKR relative text-center text-4xl font-bold text-gray-900 mb-6"> - <span className="absolute left-1/2 top-[-15px] -translate-x-1/2 w-24 h-2 bg-blue-500 rounded-full"></span> - 사업사례 3 - </h2> - <div className="bg-white border border-gray-300 rounded-xl p-[60px] pt-[70px] pb-[70px]"> - {/* 사업명 */} - <section> - <h2 className="font-NotoSansKR text-2xl text-[#657D91] font-bold bg-[#EAEFF3] p-3 rounded mb-4">사업명</h2> - <p className="font-NotoSansKR text-2xl font-semibold text-gray-800 leading-relaxed"> - 충남 보령 하수재이용<br /> - : 보령·신보령화력발전소에 하루 1만톤의 탈황용수 공급을 위해 보령하수처리시설의 하수처리수 재이용 사업 추진 - </p> - </section> - {/* 사업 방식 */} - <section className="mt-8"> - <h2 className="font-NotoSansKR text-2xl text-[#657D91] font-bold bg-[#EAEFF3] p-3 rounded mb-4">사업 방식</h2> - <p className="font-NotoSansKR text-2xl font-semibold text-gray-800 leading-relaxed"> - 2017년 한국환경공단과 사업대행 위 · 수탁 협약 체결 - </p> - </section> - {/* 사업 주요 내용 */} - <section className="mt-8"> - <h2 className="font-NotoSansKR text-2xl text-[#657D91] font-bold bg-[#EAEFF3] p-3 rounded mb-4">사업 주요 내용</h2> - <p className="font-NotoSansKR text-2xl font-semibold text-gray-800 leading-relaxed"> - 처리공정 : 전처리분리막(U/F) + 역삼투서비(R/O)<br /> - 공급량 : 1만m3/일<br /> - 관로 : 8.7km<br /> - 사업비 : 315억원(국비 216억원, 재원협의(안)) - </p> - </section> - {/* 특이사항 */} - <section className="mt-8"> - <h2 className="font-NotoSansKR text-2xl text-[#657D91] font-bold bg-[#EAEFF3] p-3 rounded mb-4">특이사항</h2> - <p className="font-NotoSansKR text-2xl font-semibold text-gray-800 leading-relaxed"> - 국내 유일 하수재이용 공업용수 공급 재정사업으로 2016년 충남 서부권 가뭄 시 지역사회 기여 차원에서 기관간 MOU (환경부, 충청남도, 보령시, 한국중부발전㈜)를 바탕 - 으로 추진 되어 경제성보다 공익성을 바탕으로 국가전력 기반시설의 안정적 운영 도모 - </p> - <div className="p-2"> - <Image - src="/img/wrExample/img_ex_03_1.png" - alt="국가전력 기반시설 설명" - width={700} - height={350} - className="w-[100%] mx-auto" - /> - </div> - </section> - </div> - </div> - - {/* 카드4 */} - <div className="card-wrap mb-24" id="card4"> - <h2 className="font-NotoSansKR relative text-center text-4xl font-bold text-gray-900 mb-6"> - <span className="absolute left-1/2 top-[-15px] -translate-x-1/2 w-24 h-2 bg-blue-500 rounded-full"></span> - 사업사례 4 - </h2> - <div className="bg-white border border-gray-300 rounded-xl p-[60px] pt-[70px] pb-[70px]"> - {/* 사업명 */} - <section> - <h2 className="font-NotoSansKR text-2xl text-[#657D91] font-bold bg-[#EAEFF3] p-3 rounded mb-4">사업명</h2> - <p className="font-NotoSansKR text-2xl font-semibold text-gray-800 leading-relaxed"> - 경기도 수원시 빗물이용과 중수도 - </p> - </section> - {/* 사업 내용 */} - <section className="mt-8"> - <h2 className="font-NotoSansKR text-2xl text-[#657D91] font-bold bg-[#EAEFF3] p-3 rounded mb-4">사업 내용</h2> - <p className="font-NotoSansKR text-2xl font-semibold text-gray-800 leading-relaxed"> - (빗물) 월드컵경기장 등 4개소에 노면 빗물분사시스템 및 빗물 공급기를 설치하여 혹서기 도시 열섬효과 및 도로 비산먼지 저감<br /> -   ※ 시설 가동중 도로 노면 온도의 7.2 ~ 26.3℃ 감소 효과 확인(21.7월, 수원시청).<br /> -   다만, 가뭄기나 강우량이 적을 경우 빗물을 원활히 공급하기 다소 곤란<br /><br /> - - (중수도) 수원시청, 장안구청, 월드컵경기장에 빗물 연계 중수도를 화장실·조경용수 등으로 사용하여 수도요금 절감(연 7백~30백만원) - </p> - <div className="grid grid-cols-1 md:grid-cols-2 gap-2 items-start p-2"> - <div> - <Image - src="/img/wrExample/img_ex_04_1.png" - alt="월드컵경기장 인근도로 노면 살수 이미지" - width={350} - height={250} - className="w-[100%] mx-auto" - /> - <span className="font-NotoSansKR text-xl block text-center font-semibold my-2"><월드컵경기장 인근도로 노면 살수></span> - </div> - <div> - <Image - src="/img/wrExample/img_ex_04_2.png" - alt="주유기 모양의 빗물 공급기 이미지" - width={350} - height={250} - className="w-[100%] mx-auto" - /> - <span className="font-NotoSansKR text-xl block text-center font-semibold my-2"><주유기 모양의 빗물 공급기></span> - </div> - <div> - <Image - src="/img/wrExample/img_ex_04_3.png" - alt="빗물주유기에서 살수용수 공급 이미지" - width={350} - height={250} - className="w-[100%] mx-auto" - /> - <span className="font-NotoSansKR text-xl block text-center font-semibold my-2"><빗물주유기에서 살수용수 공급></span> - </div> - <div> - <Image - src="/img/wrExample/img_ex_04_4.png" - alt="빗물 공급기 및 빗물분사장치 위치" - width={350} - height={250} - className="w-[100%] mx-auto" - /> - <span className="font-NotoSansKR text-xl block text-center font-semibold my-2"><빗물 공급기 및 빗물분사장치 위치></span> - </div> - </div> - </section> - </div> - </div> - </div> - </div> - </div> - ); -} - diff --git a/apps/dm/app/(base-layout)/pages/wrOverview/page.tsx b/apps/dm/app/(base-layout)/pages/wrOverview/page.tsx deleted file mode 100644 index 3e5825899..000000000 --- a/apps/dm/app/(base-layout)/pages/wrOverview/page.tsx +++ /dev/null @@ -1,113 +0,0 @@ -import Image from "next/image"; - -export default function WrOverviewPage() { - return ( - <div className="bg-[#F2F2F2]"> - <div className="relative w-[950px] mx-auto pt-[50px] font-sans"> - {/* 카드 1 - 물재이용 사업 추진 절차 */} - <div className="card-wrap mb-24" id="card1"> - <h2 className="font-NotoSansKR relative text-center text-4xl font-bold text-gray-900 mb-6"> - <span className="absolute left-1/2 top-[-15px] -translate-x-1/2 w-24 h-2 bg-blue-500 rounded-full"></span> - 물재이용 사업 추진 절차 - </h2> - <div className="bg-white border border-gray-300 rounded-xl p-[60px] py-[50px]"> - <table className="table-fixed w-full text-center text-sm"> - <caption className="sr-only">물 재이용 추진 절차 상세 표</caption> - <colgroup> - <col style={{ width: "28%" }} /> - <col style={{ width: "2%" }} /> - <col style={{ width: "35%" }} /> - <col style={{ width: "5%" }} /> - <col style={{ width: "30%" }} /> - </colgroup> - <tbody> - {/* 1단계 */} - <tr><td></td><td></td><td className="font-NotoSansKR text-[17px] bg-[#EAEFF3] font-bold py-5">타당성 조사</td><td></td><td></td></tr> - <tr><td></td><td></td><td className="font-NotoSansKR text-2xl font-bold text-center">↓</td><td></td><td></td></tr> - {/* 2단계 */} - <tr><td className="font-NotoSansKR text-2xl bg-[#F4D62D] text-black font-bold py-5">매칭시스템 신청</td><td></td><td className="font-NotoSansKR text-[17px] bg-[#EAEFF3] font-bold py-5">사업계획(안) 수립</td><td></td><td></td></tr> - <tr><td></td><td></td><td className="font-NotoSansKR text-2xl font-bold text-center">↓</td><td></td><td></td></tr> - {/* 3단계 */} - <tr><td className="font-NotoSansKR text-2xl bg-[#F4D62D] text-black font-bold py-5">하수도정보시스템 신청</td><td></td><td className="font-NotoSansKR text-[17px] bg-[#EAEFF3] font-bold py-5">국고지원 신청</td><td className="font-NotoSansKR text-2xl font-bold">→</td><td className="font-NotoSansKR text-2xl text-[#fff] bg-[#00B076] font-bold py-5">기술검토(한국환경공단)</td></tr> - <tr><td></td><td></td><td className="font-NotoSansKR text-2xl font-bold text-center">↓</td><td></td><td></td></tr> - {/* 4단계 */} - <tr><td></td><td></td><td className="font-NotoSansKR text-[17px] bg-[#EAEFF3] font-bold py-5">국고지원 확정 통보</td><td></td><td></td></tr> - <tr><td></td><td></td><td className="font-NotoSansKR text-2xl font-bold text-center">↓</td><td></td><td></td></tr> - {/* 5단계 */} - <tr><td></td><td></td><td className="font-NotoSansKR text-[17px] bg-[#EAEFF3] font-bold py-5">사업계획 수립(실시설계)</td><td></td><td></td></tr> - <tr><td></td><td></td><td className="font-NotoSansKR text-2xl font-bold text-center">↓</td><td></td><td></td></tr> - {/* 6단계 */} - <tr><td className="font-NotoSansKR text-2xl bg-[#F4D62D] text-black font-bold py-5">(행정관) 기술검토 신청</td><td></td><td className="font-NotoSansKR text-[17px] bg-[#EAEFF3] font-bold py-5">재원협의(지방환경관서장)</td><td className="font-NotoSansKR text-2xl font-bold">→</td><td className="font-NotoSansKR text-2xl text-[#fff] bg-[#00B076] font-bold py-5">기술검토(한국환경공단)</td></tr> - <tr><td></td><td></td><td className="font-NotoSansKR text-2xl font-bold text-center">↓</td><td></td><td></td></tr> - {/* 7단계 */} - <tr><td className="font-NotoSansKR text-2xl bg-[#F4D62D] text-black font-bold py-5">(행정관) 기술검토 신청</td><td></td><td className="font-NotoSansKR text-[17px] bg-[#EAEFF3] font-bold py-5">설치승인(시도지사)</td><td className="font-NotoSansKR text-2xl font-bold">→</td><td className="font-NotoSansKR text-2xl text-[#fff] bg-[#00B076] font-bold py-5">기술검토(한국환경공단)</td></tr> - <tr><td></td><td></td><td className="font-NotoSansKR text-2xl font-bold text-center">↓</td><td></td><td></td></tr> - {/* 8단계 */} - <tr><td></td><td></td><td className="font-NotoSansKR text-[17px] bg-[#EAEFF3] font-bold py-5">공사시행</td><td></td><td></td></tr> - <tr><td></td><td></td><td className="font-NotoSansKR text-2xl font-bold text-center">↓</td><td></td><td></td></tr> - {/* 9단계 */} - <tr><td className="font-NotoSansKR text-2xl bg-[#F4D62D] text-black font-bold py-5">(행정관) 기술검토 신청</td><td></td><td className="font-NotoSansKR text-[17px] bg-[#EAEFF3] font-bold py-5">준공(국고정산)</td><td className="font-NotoSansKR text-2xl font-bold">→</td><td className="font-NotoSansKR text-2xl text-[#fff] bg-[#00B076] font-bold py-5">기술검토(한국환경공단)</td></tr> - </tbody> - </table> - </div> - </div> - - {/* 카드 2 - 물재이용 매칭 시스템 */} - <div className="mt-36 card-wrap mb-24" id="card2"> - <h2 className="font-NotoSansKR relative text-center text-4xl font-bold text-gray-900 mb-6"> - <span className="absolute left-1/2 top-[-15px] -translate-x-1/2 w-24 h-2 bg-blue-500 rounded-full"></span> - 물재이용 매칭 시스템이란? - </h2> - <div className="bg-white border border-gray-300 rounded-xl p-[60px] pt-[70px] pb-[70px]"> - {/* 개요 */} - <section> - <h2 className="font-NotoSansKR text-2xl text-[#657D91] font-bold bg-[#EAEFF3] p-3 rounded mb-4">개요</h2> - <p className="font-NotoSansKR text-2xl font-bold text-gray-800 leading-relaxed"> - 기후변화 및 지자체의 개발속도 차이에 따라 물 자원의 수요-공급 불균형이 발생하여 빗물, 중수도, 하수처리 재처리수 등의 공급 여유가 있는 지자체의 재이용수를 부족한 지자체 수요처에 공급하여 불균형 해소를 통한 수자원 절약 및 물 자원 순환 - </p> - </section> - - {/* 구성 */} - <section className="mt-8"> - <h2 className="font-NotoSansKR text-2xl text-[#657D91] font-bold bg-[#EAEFF3] p-3 rounded mb-4">구성</h2> - <ul className=" font-NotoSansKR list-[square] pl-6 text-2xl font-bold text-gray-800 leading-relaxed space-y-2"> - <li>공급자: 하수처리장, 빗물이용시설, 중수도 등</li> - <li>수요자: 산업체(냉각수), 공공시설(조경, 도로청소), 농민(농업용수) 등</li> - <li>시스템: 수질, 수량, 거리 기반 매칭, 중개</li> - <li>운영주체: 한국환경공단</li> - </ul> - </section> - - {/* 절차 */} - <section className="mt-8"> - <h2 className="font-NotoSansKR text-2xl text-[#657D91] font-bold bg-[#EAEFF3] p-3 rounded mb-4">사업 주요 내용</h2> - <p className="font-NotoSansKR text-2xl font-bold text-gray-800 leading-relaxed"> - ① 공급자 등록 → ② 수요자 조건 입력 → ③ 매칭 검토 → ④ 시스템 매칭 → ⑤ 계약·공급 이행 - </p> - </section> - - {/* 기대효과 */} - <section className="mt-8"> - <h2 className="font-NotoSansKR text-2xl text-[#657D91] font-bold bg-[#EAEFF3] p-3 rounded mb-4">기대효과</h2> - <ul className="font-NotoSansKR list-[square] pl-6 text-2xl font-bold text-gray-800 leading-relaxed space-y-2"> - <li>물 자원 수요-공급 조정을 통한 효율적 분배</li> - <li>물 재이용시설 데이터 수집으로 체계적 관리</li> - <li>지자체, 사업시행자 등 재이용 정보 획득 용이</li> - </ul> - <div className="text-center my-6"> - <Image - src="/img/wrOverview/img_ov_01_1.png" - alt="하수 재이용 시스템 흐름도. 저장탱크에서 재처리된 물이 손 씻기, 수도, 세정 등에 공급되며 재이용 활성화를 통해 최적의 물공급 방안이 마련되는 과정을 시각화함." - width={650} - height={500} - className="h-[500px] mx-auto mb-4 rounded" - /> - <p className="font-NotoSansKR text-2xl font-bold text-gray-800 mt-10">(하수 재이용 시스템 개요도)</p> - </div> - </section> - </div> - </div> - </div> - </div> - ); -} \ No newline at end of file diff --git a/apps/dm/app/(base-layout)/pages/wrStatus/page.tsx b/apps/dm/app/(base-layout)/pages/wrStatus/page.tsx deleted file mode 100644 index f8d9704d4..000000000 --- a/apps/dm/app/(base-layout)/pages/wrStatus/page.tsx +++ /dev/null @@ -1,387 +0,0 @@ -'use client'; - -import { regionData, regionIdMap } from '@/app/common/comFunction'; -import { useDmStore } from '@/app/store'; -import type { DmStatusDataType } from '@/app/store/wrStatus/type'; -import { CHART_FORM, MainChart, type ChartConfig } from '@common/business_components'; -import React, { useEffect, useRef, useState, useCallback } from 'react'; -import { setCookie } from "../../../../src/shared/lib"; - -setCookie("site-id-key", process.env.NEXT_PUBLIC_SITE_ID || "DM"); - -interface WrStatusChartProps { - chartForm: string; - chartConfig: ChartConfig; - chartData: any; - chartTitle: string; - chartClassName?: string; - graphSize?: number; - yFieldText? : string | undefined; - yFieldText2? : string | undefined; - showLegend? : boolean; - setXAxisYearTick ?: boolean; -} - -export default function WrStatusPage() { - - - - - const { Common, dmStatus, getDmStatusData,initializeCommonData} = useDmStore((state) => state); - const { year:defaultYear, statusData,facilityTotals ,chartData} = dmStatus; - const [selectedRegion, setSelectedRegion] = useState<string | null>(null); - const [hoveredRegion, setHoveredRegion] = useState<string | null>(null); - const [tooltipPosition, setTooltipPosition] = useState<{ x: number; y: number } | null>(null); - const [chartOption, setChartOption] = useState<WrStatusChartProps>({} as WrStatusChartProps); - - const svgContainerRef = useRef<HTMLDivElement>(null); - const colorLegend = [ - { label: '하수', color: '#FF6B6B', key: 'sewage' }, - { label: '빗물', color: '#4ECDC4', key: 'rainwater' }, - { label: '중수도', color: '#45B7D1', key: 'reclaimed' }, - ]; - const facilityTotalsColor = ['#FF6B6B', '#4ECDC4', '#45B7D1', '#FED16A']; - // const [defaultYear, setDefaultYear] = useState<string>(""); - // const defaultYear= '2023'; - - - const handleMarkerClick = (regionId: string) => { - if (selectedRegion === regionId) { - setSelectedRegion(null); - } else { - setSelectedRegion(regionId); - } - }; - - - useEffect(() => { - initializeCommonData(); - }, [initializeCommonData]); - - const createDonutMarker = useCallback((svg: SVGSVGElement, x: number, y: number, name: string, values: number[]) => { - const colors = ['#FF6B6B', '#4ECDC4', '#45B7D1', '#FED16A']; - const radius = 26; - const innerRadius = 18; - // const regionId = regionIdMap[name]; - const regionId = regionIdMap[name]; - if (!regionId) { - console.warn(`Invalid region name: ${name}`); - return; - } - const g = document.createElementNS('http://www.w3.org/2000/svg', 'g'); - g.setAttribute('transform', `translate(${x}, ${y})`); - g.setAttribute('id', `marker-${name}`); - g.style.cursor = 'pointer'; - g.setAttribute('role', 'button'); - g.setAttribute('tabindex', '0'); - g.setAttribute('aria-label', `${name} 지역 선택`); - - const bg = document.createElementNS('http://www.w3.org/2000/svg', 'circle'); - bg.setAttribute('r', radius.toString()); - bg.setAttribute('fill', 'white'); - bg.setAttribute('pointer-events', 'all'); - g.appendChild(bg); - - let startAngle = 0; - values.forEach((value, idx) => { - const endAngle = startAngle + value * 2 * Math.PI; - const x1 = radius * Math.sin(startAngle); - const y1 = -radius * Math.cos(startAngle); - const x2 = radius * Math.sin(endAngle); - const y2 = -radius * Math.cos(endAngle); - const largeArc = endAngle - startAngle > Math.PI ? 1 : 0; - const d = `M ${x1} ${y1} A ${radius} ${radius} 0 ${largeArc} 1 ${x2} ${y2} L 0 0 Z`; - - const path = document.createElementNS('http://www.w3.org/2000/svg', 'path'); - path.setAttribute('d', d); - path.setAttribute('fill', colors[idx % colors.length] as string); - g.appendChild(path); - - startAngle = endAngle; - }); - - const center = document.createElementNS('http://www.w3.org/2000/svg', 'circle'); - center.setAttribute('r', innerRadius.toString()); - center.setAttribute('fill', 'white'); - g.appendChild(center); - - const text = document.createElementNS('http://www.w3.org/2000/svg', 'text'); - text.setAttribute('x', '0'); - text.setAttribute('y', '2'); - text.setAttribute('text-anchor', 'middle'); - text.setAttribute('font-size', '13'); - text.setAttribute('font-weight', 'bold'); - text.setAttribute('dominant-baseline', 'middle'); - text.setAttribute('fill', 'black'); - text.textContent = name || ''; - g.appendChild(text); - - g.addEventListener('mouseenter', (e) => { - setHoveredRegion(regionId); - setTooltipPosition({ x: e.clientX, y: e.clientY }); - }); - - g.addEventListener('mouseleave', () => { - setHoveredRegion(null); - setTooltipPosition(null); - }); - - g.addEventListener('click', () => { - handleMarkerClick(regionId); - }); - - g.addEventListener('keydown', (e) => { - if (e.key === 'Enter' || e.key === ' ') { - e.preventDefault(); - - const matrix = g.getScreenCTM(); - if (!matrix) return; // 또는 console.warn('matrix is null'); return; - - const point = svg.createSVGPoint(); - point.x = 0; - point.y = 0; - const transformed = point.matrixTransform(matrix); - - setTooltipPosition({ x: transformed.x, y: transformed.y }); - setHoveredRegion(regionId); - handleMarkerClick(regionId); - } - }); - - svg.appendChild(g); - }, [handleMarkerClick, regionIdMap]); - - - useEffect(() => { - if(Common.selectSidoData&&Common.selectSidoData.length>1) { - getDmStatusData(Common.selectSidoData); - } - },[Common.selectSidoData, getDmStatusData]) - - useEffect(() => { - const loadSVG = async () => { - try { - const response = await fetch('/img/wrStatus/southKoreaMap.svg'); - const svgText = await response.text(); - - if (svgContainerRef.current) { - svgContainerRef.current.innerHTML = svgText; - - const svg = svgContainerRef.current.querySelector('svg') as SVGSVGElement; - if (svg) { - svg.style.width = '58%'; - svg.style.height = 'auto'; - svg.style.objectFit = 'contain'; - - // Set default fills - const paths = svg.querySelectorAll('path'); - paths.forEach(path => { - if (!path.getAttribute('fill') || path.getAttribute('fill') === 'none') { - path.setAttribute('fill', '#ffffff'); - } - }); - - // Create markers - regionData.forEach(region => { - createDonutMarker(svg, region.x, region.y, region.name, region.values); - }); - } - } - } catch (error) { - console.error('SVG 로딩 실패:', error); - if (svgContainerRef.current) { - svgContainerRef.current.innerHTML = "<p className='text-red-500'>SVG 로딩 실패</p>"; - } - } - }; - - loadSVG(); - }, [createDonutMarker, regionData]); - - useEffect(() => { - const svg = svgContainerRef.current?.querySelector('svg'); - if (svg) { - const paths = svg.querySelectorAll('path'); - paths.forEach(path => { - const pathId = path.getAttribute('id'); - if (pathId) { - if (selectedRegion === pathId) { - path.setAttribute('fill', '#2563eb'); - } else { - const original = '#ffffff'; - path.setAttribute('fill', original); - } - } - }); - } - }, [selectedRegion]); - useEffect(() => { - if(chartData.length>0){ - const chartConfig = chartData.reduce((config, element) => { - config[element.label] = { - label: element.label, - color : "hsl(var(--chart-1))" - }; - return config; - }, {} as Record<string, { label: string; color: string; }>) satisfies ChartConfig; - - const Option = { - chartForm : CHART_FORM.BAR, - chartConfig : chartConfig, - chartData : chartData, - chartTitle : '', - chartClassName : "w-full h-[350px] ", - graphSize : 10, - yFieldText : '시설(개소)', - showLegend : true - } - setChartOption(Option) - }else{ - setChartOption({} as WrStatusChartProps) - } - }, [chartData]); - - return ( - <div className="flex h-screen bg-[#F2F2F2] text-gray-800"> - {/* 우측 콘텐츠 영역 */} - <main className="flex-1 p-6 overflow-auto"> - {/* 상단 제목 */} - <div className="mb-6 flex justify-between items-center"> - <h2 className="text-2xl font-bold">물재이용 현황</h2> - </div> - - {/* 콘텐츠 본문 */} - <div className="grid grid-cols-1 xl:grid-cols-2 gap-4"> - {/* 지도 카드 */} - <div className="bg-white rounded-xl shadow border border-[#DBE2E6] overflow-hidden max-h-[900px]"> - {/* 타이틀 영역 */} - <div className="border-b border-[#DBE2E6] px-4 py-3"> - <h3 className="text-[12px] font-semibold">{`재이용시설현황(${defaultYear})`}</h3> - <p className="text-[12px] text-[#999] font-medium">행정구역별 재이용시설현황(개소)</p> - </div> - - {/* 본문 콘텐츠 */} - <div className="p-4"> - <div className="bg-[#E2EDF3] p-4 rounded shadow relative"> - <div className="flex justify-center"> - <div - ref={svgContainerRef} - className="w-full max-w-5xl max-h-[680px] overflow-y-auto block mx-auto" - aria-label="대한민국 지역별 재이용시설 분포도" - role="region" - tabIndex={0} - /> - </div> - - {typeof window !== 'undefined' && hoveredRegion && tooltipPosition && ( - <div - className="fixed bg-white text-[12px] text-gray-700 border border-gray-300 shadow-lg rounded px-3 py-2 z-50" - style={{ - top: tooltipPosition.y + 10, - left: tooltipPosition.x + 10, - pointerEvents: 'none', - }} - > - <div className="font-semibold mb-1">{hoveredRegion}</div> - <div className="space-y-1"> - {colorLegend.map(({ label, color, key }) => ( - <div key={key+'' +color} className="flex items-center space-x-2"> - <span className="text-[12px] inline-block w-3 h-3 rounded-sm" style={{ backgroundColor: color }}></span> - <span className="text-[12px]"> - {label}:{' '} - {statusData?.find(d => d.region === hoveredRegion)?.[key as keyof DmStatusDataType] || '-'} - </span> - </div> - ))} - </div> - </div> - )} - - {/* 범례 */} - <div className="absolute bottom-2 right-2 bg-white rounded-lg shadow-md p-4 text-sm space-y-2"> - {facilityTotals?.map((item, index) => ( - <div key ={'fcltTotal' +index}className="flex items-center space-x-2"> - <span className="inline-block w-4 h-4 rounded-sm" style={{backgroundColor:facilityTotalsColor[index]}}></span> - <span className="text-[12px] text-gray-900">{item}</span> - </div> - )) } - </div> - </div> - </div> - </div> - - {/* 우측 콘텐츠 (표 + 차트) */} - <div className="col-span-1 flex flex-col space-y-4"> - {/* 재이용시설현황 표 */} - <div className="bg-white rounded-xl shadow border border-[#DBE2E6] overflow-hidden"> - {/* 타이틀 + 버튼 영역 */} - <div className="flex justify-between items-center border-b border-[#436d85] px-4 py-3"> - <div> - <h3 className="text-[12px] font-semibold">{`재이용시설현황(${defaultYear})`}</h3> - <p className="text-[12px] text-[#999] font-medium">행정구역별 재이용시설현황[개소(천m³/년)]</p> - </div> - </div> - <div className="p-4"> - <div className="rounded border border-[#DBE2E6] shadow overflow-auto max-h-[292px] p-4"> - <table className="min-w-full text-sm text-center"> - <caption className="sr-only text-[12px]">행정구역별 하수, 빗물, 중수도, 온배수 재이용시설 수</caption> - <thead className="bg-gray-50 text-xs text-gray-600 uppercase border-b"> - <tr> - <th className="text-[12px] font-semibold px-4 py-2">번호</th> - <th className="text-[12px] font-semibold px-4 py-2">시도</th> - <th className="text-[12px] font-semibold px-4 py-2">하수재이용시설</th> - <th className="text-[12px] font-semibold px-4 py-2">빗물이용시설</th> - <th className="text-[12px] font-semibold px-4 py-2">중수도시설</th> - {/* <th className="text-[12px] font-semibold px-4 py-2">하수(이용량,천𝓂³/년)</th> - <th className="text-[12px] font-semibold px-4 py-2">빗물(이용량,천𝓂³/년)</th> - <th className="text-[12px] font-semibold px-4 py-2">중수도(이용량,천𝓂³/년)</th> - <th className="text-[12px] font-semibold px-4 py-2">온배수(이용량,천𝓂³/년)</th> */} - </tr> - </thead> - <tbody className="divide-y"> - {statusData?.map((row, index) => ( - <tr key={index} className="hover:bg-gray-50"> - <td className="text-[12px] px-4 py-2 text-center"> - {index+1} - </td> - <td className="text-[12px]">{row.region}</td> - <td className="text-[12px]">{row.sewage}</td> - <td className="text-[12px]">{row.rainwater}</td> - <td className="text-[12px]">{row.reclaimed}</td> - </tr> - ))} - </tbody> - </table> - </div> - </div> - </div> - - {/* 재이용통계 차트 */} - <div className="bg-white rounded-xl shadow border border-[#DBE2E6] overflow-hidden"> - <div className="border-b border-[#DBE2E6] px-4 py-3"> - <h3 className="text-[12px] font-semibold">{`재이용통계(${defaultYear})`}</h3> - <p className="text-[12px] text-[#999] font-medium">행정구역별 재이용시설 현황 개소수 그래프</p> - </div> - <div className="p-4 bg-[#f9fbfd]"> - <div className="h-[305px] text-gray-500"> - {chartOption? - <MainChart - chartForm={chartOption.chartForm} - chartConfig={chartOption.chartConfig} - chartData={chartOption.chartData?.filter(item=>item.label!= '')} - chartTitle={chartOption.chartTitle} - chartClassName={chartOption.chartClassName} - graphSize={chartOption.graphSize} - yFieldText={chartOption.yFieldText} - showLegend={chartOption.showLegend} - /> - :<></>} - </div> - </div> - </div> - </div> - </div> - </main> - </div> - ); -}; diff --git a/apps/dm_new/app/(landing)/reuse/_components/CaseTabsCarousel.tsx b/apps/dm/app/(landing)/reuse/_components/CaseTabsCarousel.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/_components/CaseTabsCarousel.tsx rename to apps/dm/app/(landing)/reuse/_components/CaseTabsCarousel.tsx diff --git a/apps/dm_new/app/(landing)/reuse/_components/ImageSlider.tsx b/apps/dm/app/(landing)/reuse/_components/ImageSlider.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/_components/ImageSlider.tsx rename to apps/dm/app/(landing)/reuse/_components/ImageSlider.tsx diff --git a/apps/dm_new/app/(landing)/reuse/_components/Lnb.tsx b/apps/dm/app/(landing)/reuse/_components/Lnb.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/_components/Lnb.tsx rename to apps/dm/app/(landing)/reuse/_components/Lnb.tsx diff --git a/apps/dm_new/app/(landing)/reuse/_components/LoginStatus.tsx b/apps/dm/app/(landing)/reuse/_components/LoginStatus.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/_components/LoginStatus.tsx rename to apps/dm/app/(landing)/reuse/_components/LoginStatus.tsx diff --git a/apps/dm_new/app/(landing)/reuse/_components/PostcodeModal.tsx b/apps/dm/app/(landing)/reuse/_components/PostcodeModal.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/_components/PostcodeModal.tsx rename to apps/dm/app/(landing)/reuse/_components/PostcodeModal.tsx diff --git a/apps/dm_new/app/(landing)/reuse/_components/SideIndicator.tsx b/apps/dm/app/(landing)/reuse/_components/SideIndicator.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/_components/SideIndicator.tsx rename to apps/dm/app/(landing)/reuse/_components/SideIndicator.tsx diff --git a/apps/dm_new/app/(landing)/reuse/_components/SubPageHeader.tsx b/apps/dm/app/(landing)/reuse/_components/SubPageHeader.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/_components/SubPageHeader.tsx rename to apps/dm/app/(landing)/reuse/_components/SubPageHeader.tsx diff --git a/apps/dm_new/app/(landing)/reuse/_components/TopNav.tsx b/apps/dm/app/(landing)/reuse/_components/TopNav.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/_components/TopNav.tsx rename to apps/dm/app/(landing)/reuse/_components/TopNav.tsx diff --git a/apps/dm_new/app/(landing)/reuse/_constants/lnb.ts b/apps/dm/app/(landing)/reuse/_constants/lnb.ts similarity index 100% rename from apps/dm_new/app/(landing)/reuse/_constants/lnb.ts rename to apps/dm/app/(landing)/reuse/_constants/lnb.ts diff --git a/apps/dm_new/app/(landing)/reuse/_hooks/useScrollSpy.ts b/apps/dm/app/(landing)/reuse/_hooks/useScrollSpy.ts similarity index 100% rename from apps/dm_new/app/(landing)/reuse/_hooks/useScrollSpy.ts rename to apps/dm/app/(landing)/reuse/_hooks/useScrollSpy.ts diff --git a/apps/dm_new/app/(landing)/reuse/_sections/Cases.tsx b/apps/dm/app/(landing)/reuse/_sections/Cases.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/_sections/Cases.tsx rename to apps/dm/app/(landing)/reuse/_sections/Cases.tsx diff --git a/apps/dm_new/app/(landing)/reuse/_sections/Hero.tsx b/apps/dm/app/(landing)/reuse/_sections/Hero.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/_sections/Hero.tsx rename to apps/dm/app/(landing)/reuse/_sections/Hero.tsx diff --git a/apps/dm_new/app/(landing)/reuse/_sections/IntroCards.tsx b/apps/dm/app/(landing)/reuse/_sections/IntroCards.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/_sections/IntroCards.tsx rename to apps/dm/app/(landing)/reuse/_sections/IntroCards.tsx diff --git a/apps/dm_new/app/(landing)/reuse/_sections/ProcessFlow.tsx b/apps/dm/app/(landing)/reuse/_sections/ProcessFlow.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/_sections/ProcessFlow.tsx rename to apps/dm/app/(landing)/reuse/_sections/ProcessFlow.tsx diff --git a/apps/dm_new/app/(landing)/reuse/apply/layout.tsx b/apps/dm/app/(landing)/reuse/apply/layout.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/apply/layout.tsx rename to apps/dm/app/(landing)/reuse/apply/layout.tsx diff --git a/apps/dm_new/app/(landing)/reuse/apply/modal/CandidateSiteModal.tsx b/apps/dm/app/(landing)/reuse/apply/modal/CandidateSiteModal.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/apply/modal/CandidateSiteModal.tsx rename to apps/dm/app/(landing)/reuse/apply/modal/CandidateSiteModal.tsx diff --git a/apps/dm_new/app/(landing)/reuse/apply/modal/SimilarCaseModal.tsx b/apps/dm/app/(landing)/reuse/apply/modal/SimilarCaseModal.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/apply/modal/SimilarCaseModal.tsx rename to apps/dm/app/(landing)/reuse/apply/modal/SimilarCaseModal.tsx diff --git a/apps/dm_new/app/(landing)/reuse/apply/modal/WaterQualityRefModal.tsx b/apps/dm/app/(landing)/reuse/apply/modal/WaterQualityRefModal.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/apply/modal/WaterQualityRefModal.tsx rename to apps/dm/app/(landing)/reuse/apply/modal/WaterQualityRefModal.tsx diff --git a/apps/dm_new/app/(landing)/reuse/apply/place/page.tsx b/apps/dm/app/(landing)/reuse/apply/place/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/apply/place/page.tsx rename to apps/dm/app/(landing)/reuse/apply/place/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/apply/register/page.tsx b/apps/dm/app/(landing)/reuse/apply/register/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/apply/register/page.tsx rename to apps/dm/app/(landing)/reuse/apply/register/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/apply/status/page.tsx b/apps/dm/app/(landing)/reuse/apply/status/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/apply/status/page.tsx rename to apps/dm/app/(landing)/reuse/apply/status/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/business/globalCase/australia/page.tsx b/apps/dm/app/(landing)/reuse/business/globalCase/australia/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/business/globalCase/australia/page.tsx rename to apps/dm/app/(landing)/reuse/business/globalCase/australia/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/business/globalCase/eu/page.tsx b/apps/dm/app/(landing)/reuse/business/globalCase/eu/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/business/globalCase/eu/page.tsx rename to apps/dm/app/(landing)/reuse/business/globalCase/eu/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/business/globalCase/overview/page.tsx b/apps/dm/app/(landing)/reuse/business/globalCase/overview/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/business/globalCase/overview/page.tsx rename to apps/dm/app/(landing)/reuse/business/globalCase/overview/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/business/globalCase/singapore/page.tsx b/apps/dm/app/(landing)/reuse/business/globalCase/singapore/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/business/globalCase/singapore/page.tsx rename to apps/dm/app/(landing)/reuse/business/globalCase/singapore/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/business/globalCase/taiwan/page.tsx b/apps/dm/app/(landing)/reuse/business/globalCase/taiwan/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/business/globalCase/taiwan/page.tsx rename to apps/dm/app/(landing)/reuse/business/globalCase/taiwan/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/business/layout.tsx b/apps/dm/app/(landing)/reuse/business/layout.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/business/layout.tsx rename to apps/dm/app/(landing)/reuse/business/layout.tsx diff --git a/apps/dm_new/app/(landing)/reuse/business/rain/suwon/page.tsx b/apps/dm/app/(landing)/reuse/business/rain/suwon/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/business/rain/suwon/page.tsx rename to apps/dm/app/(landing)/reuse/business/rain/suwon/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/business/sewage/bolyeong/page.tsx b/apps/dm/app/(landing)/reuse/business/sewage/bolyeong/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/business/sewage/bolyeong/page.tsx rename to apps/dm/app/(landing)/reuse/business/sewage/bolyeong/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/business/sewage/cheongju/page.tsx b/apps/dm/app/(landing)/reuse/business/sewage/cheongju/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/business/sewage/cheongju/page.tsx rename to apps/dm/app/(landing)/reuse/business/sewage/cheongju/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/business/sewage/guri/page.tsx b/apps/dm/app/(landing)/reuse/business/sewage/guri/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/business/sewage/guri/page.tsx rename to apps/dm/app/(landing)/reuse/business/sewage/guri/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/business/sewage/hwanggu/page.tsx b/apps/dm/app/(landing)/reuse/business/sewage/hwanggu/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/business/sewage/hwanggu/page.tsx rename to apps/dm/app/(landing)/reuse/business/sewage/hwanggu/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/business/sewage/paju/page.tsx b/apps/dm/app/(landing)/reuse/business/sewage/paju/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/business/sewage/paju/page.tsx rename to apps/dm/app/(landing)/reuse/business/sewage/paju/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/business/sewage/yeosu/page.tsx b/apps/dm/app/(landing)/reuse/business/sewage/yeosu/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/business/sewage/yeosu/page.tsx rename to apps/dm/app/(landing)/reuse/business/sewage/yeosu/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/cases/greywater/page.tsx b/apps/dm/app/(landing)/reuse/cases/greywater/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/cases/greywater/page.tsx rename to apps/dm/app/(landing)/reuse/cases/greywater/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/cases/layout.tsx b/apps/dm/app/(landing)/reuse/cases/layout.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/cases/layout.tsx rename to apps/dm/app/(landing)/reuse/cases/layout.tsx diff --git a/apps/dm_new/app/(landing)/reuse/cases/rain/page.tsx b/apps/dm/app/(landing)/reuse/cases/rain/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/cases/rain/page.tsx rename to apps/dm/app/(landing)/reuse/cases/rain/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/cases/treated/page.tsx b/apps/dm/app/(landing)/reuse/cases/treated/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/cases/treated/page.tsx rename to apps/dm/app/(landing)/reuse/cases/treated/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/intro/greywater/page.tsx b/apps/dm/app/(landing)/reuse/intro/greywater/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/intro/greywater/page.tsx rename to apps/dm/app/(landing)/reuse/intro/greywater/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/intro/law/page.tsx b/apps/dm/app/(landing)/reuse/intro/law/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/intro/law/page.tsx rename to apps/dm/app/(landing)/reuse/intro/law/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/intro/layout.tsx b/apps/dm/app/(landing)/reuse/intro/layout.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/intro/layout.tsx rename to apps/dm/app/(landing)/reuse/intro/layout.tsx diff --git a/apps/dm_new/app/(landing)/reuse/intro/rain/page.tsx b/apps/dm/app/(landing)/reuse/intro/rain/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/intro/rain/page.tsx rename to apps/dm/app/(landing)/reuse/intro/rain/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/intro/treated/page.tsx b/apps/dm/app/(landing)/reuse/intro/treated/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/intro/treated/page.tsx rename to apps/dm/app/(landing)/reuse/intro/treated/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/layout.tsx b/apps/dm/app/(landing)/reuse/layout.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/layout.tsx rename to apps/dm/app/(landing)/reuse/layout.tsx diff --git a/apps/dm_new/app/(landing)/reuse/page.tsx b/apps/dm/app/(landing)/reuse/page.tsx similarity index 100% rename from apps/dm_new/app/(landing)/reuse/page.tsx rename to apps/dm/app/(landing)/reuse/page.tsx diff --git a/apps/dm_new/app/(landing)/reuse/reuse.module.css b/apps/dm/app/(landing)/reuse/reuse.module.css similarity index 100% rename from apps/dm_new/app/(landing)/reuse/reuse.module.css rename to apps/dm/app/(landing)/reuse/reuse.module.css diff --git a/apps/dm/app/(popup-layout)/map/popup/page.tsx b/apps/dm/app/(popup-layout)/map/popup/page.tsx index e410ad2a7..1c625bcac 100644 --- a/apps/dm/app/(popup-layout)/map/popup/page.tsx +++ b/apps/dm/app/(popup-layout)/map/popup/page.tsx @@ -29,10 +29,15 @@ const Map = () => { ruseUtztnFcltCd: fclt.pbnstRuseFcltId, })); + if (!window.opener || typeof window.opener.postMessage !== "function") { + alert("부모 창을 찾을 수 없습니다. 팝업이 'noopener'로 열렸거나, 보안 정책으로 차단되었을 수 있어요."); + return; + } + window.opener.postMessage( { type: "SET_SUBS_INFO", - payload: subsInfoList, // 또는 필요한 데이터 + payload: subsInfoList, // 배열로 전송 (최대 3개) }, "*" ); @@ -52,9 +57,23 @@ const Map = () => { //하수처리시설코드로 재이용시설 목록 조회 const reuseData = async (ruseFcltPk: any) => { + if (!ruseFcltPk) { + console.warn("[reuseData] ruseFcltPk가 없습니다."); + return; + } try { + console.log("[reuseData] API 호출 - ruseFcltPk:", ruseFcltPk); const response = await mapService.getPbnstRuseFclts(ruseFcltPk); - const data = response.data || []; + console.log("[reuseData] API 응답 전체:", response); + // 응답이 배열이면 바로 사용, 객체면 .data 추출 + const data = Array.isArray(response) + ? response + : Array.isArray(response?.data) + ? response.data + : response?.data + ? [response.data] + : []; + console.log("[reuseData] 파싱된 data:", data); setSelectedFclts((prev) => { const newItems = data.filter( (item: any) => @@ -62,7 +81,7 @@ const Map = () => { Object.keys(item).length > 0 && !prev.some((f) => f.pbnstRuseFcltId === item.pbnstRuseFcltId) ); - console.log(newItems); + console.log("[reuseData] 추가될 newItems:", newItems); return [...prev, ...newItems]; }); } catch (error) { @@ -75,11 +94,45 @@ const Map = () => { fetchData(); }, []); + // 부모창에 초기 선택값 요청 (팝업 열릴 때 기존 선택 목록 받아오기) + useEffect(() => { + const origin = window.location.origin; + if (window.opener) { + window.opener.postMessage({ type: "REQUEST_INIT_SUBS_INFO" }, origin); + } + }, []); + + // 부모창에서 초기 선택값 수신 + useEffect(() => { + const origin = window.location.origin; + + const handler = (event: MessageEvent) => { + if (event.origin !== origin) return; + + const data = event.data; + if (!data || typeof data !== "object") return; + + if (data.type === "INIT_SUBS_INFO") { + const list = Array.isArray(data.payload) ? data.payload : []; + setSelectedFclts( + list.map((x) => ({ + ruseUtztnFcltNm: x.ruseUtztnFcltNm ?? "", + pbnstRuseFcltId: x.ruseUtztnFcltCd ?? "", + })) + ); + } + }; + + window.addEventListener("message", handler); + return () => window.removeEventListener("message", handler); + }, []); + // 레이어 생성 후 초기화 처리 const onCheckedLayersChange = () => { //수요처 ID const urlParams = new URLSearchParams(window.location.search); const dmdInfoId = urlParams.get("dmdInfoId"); + console.log("[하이라이트] dmdInfoId:", dmdInfoId); //수요처 위치로 화면 이동 const maps = gisMaps.current; @@ -88,22 +141,42 @@ const Map = () => { const featureId = `${layerNm}.${dmdInfoId}`; let foundFeature: any = null; + // 현재 로드된 레이어 목록 출력 + const allLayerNames = maps + .getLayers() + .getArray() + .map((l: any) => l.get("lyrTyNm") || l.get("name") || "(unnamed)"); + console.log("[하이라이트] 전체 레이어 목록:", allLayerNames); + console.log("[하이라이트] 탐색 대상 레이어:", layerNm); + console.log("[하이라이트] 탐색 대상 featureId:", featureId); + maps .getLayers() .getArray() .forEach((layer: any) => { if (layer.get("lyrTyNm") == layerNm) { + console.log("[하이라이트] 레이어 발견:", layerNm); const source = layer.getSource?.(); if (source?.getFeatureById) { const feature = source.getFeatureById(String(featureId).trim()); + console.log("[하이라이트] feature 탐색결과:", feature); if (feature) { foundFeature = feature; return; - } + } + // feature 못 찾을 때 소스 내 전체 feature ID 출력 + if (source?.getFeatures) { + const allIds = source.getFeatures().map((f: any) => f.getId()); + console.log("[하이라이트] 소스 내 전체 feature ID:", allIds); + } } } }); + if (!foundFeature) { + console.warn("[하이라이트] feature를 찾지 못했습니다. 위 레이어 목록/ID를 확인하세요."); + } + if (foundFeature) { const geometry = foundFeature.getGeometry(); @@ -133,7 +206,7 @@ const Map = () => { { width: 30 } ); } else { - alert("수요처의 좌표정보를 찾을수 없으므로, 상단 조회조건의 시설명을 입력하여 위치를 조회하시기 바랍니다."); + console.warn("수요처의 좌표정보를 찾을 수 없습니다. dmdInfoId:", dmdInfoId); } const formatNumber = (val: any) => { @@ -185,6 +258,7 @@ const Map = () => { // 검색해서 재이용시설 선택하면 해당 시설로 화면 이동 처리 useEffect(() => { + console.warn(selectDataPk); if (!selectDataPk || Object.keys(selectDataPk).length === 0) return; const maps = gisMaps.current; let foundFeature: any = null; @@ -226,8 +300,12 @@ const Map = () => { // 재이용시설 클릭 시 선택 시설목록에 추가 const onFeatureSelect = (data: any) => { + // feature의 모든 속성 출력 (어떤 키가 있는지 확인) + const properties = data.getProperties?.() ?? {}; + console.log("[onFeatureSelect] feature 속성 전체:", properties); // 처리시설코드 const swtrmtFcltCd = data.get("swtrmt_fclt_cd"); + console.log("[onFeatureSelect] swtrmt_fclt_cd:", swtrmtFcltCd); reuseData(swtrmtFcltCd); }; diff --git a/apps/dm/app/(popup-layout)/map/popup/selectedFcltList.tsx b/apps/dm/app/(popup-layout)/map/popup/selectedFcltList.tsx index bdf4d7e2c..5c742684f 100644 --- a/apps/dm/app/(popup-layout)/map/popup/selectedFcltList.tsx +++ b/apps/dm/app/(popup-layout)/map/popup/selectedFcltList.tsx @@ -22,36 +22,32 @@ export default function SelectedFcltList({ const TableContent = ( <> - <thead className="bg-gray-100 text-gray-700 text-[13px]"> + <thead className="bg-gray-100 text-gray-600 text-[11px] font-medium border-b border-cyan-800"> <tr> - <th className="px-3 py-2 text-left border-b">시설명</th> - <th className="px-3 py-2 text-right border-b"> - 하수처리량 - <br /> - (㎥/일) + <th className="px-2 py-1.5 text-left w-1/3">시설명</th> + <th className="px-2 py-1.5 text-right whitespace-nowrap"> + 처리량(㎥/일) </th> - <th className="px-3 py-2 text-right border-b"> - 재이용량 - <br /> - (㎥/일) + <th className="px-2 py-1.5 text-right whitespace-nowrap"> + 재이용량(㎥/일) </th> - <th className="px-3 py-2 border-b">삭제</th> + <th className="px-2 py-1.5 text-center w-10">삭제</th> </tr> </thead> <tbody> {data.map((item) => ( - <tr key={item.pbnstRuseFcltId} className="border-b last:border-none"> - <td className="px-3 py-2 text-[12px]">{item.ruseUtztnFcltNm}</td> - <td className="px-3 py-2 text-right text-[12px]"> + <tr key={item.pbnstRuseFcltId} className="border-b border-gray-100 last:border-none hover:bg-gray-50/50"> + <td className="px-2 py-1.5 text-[11px] font-medium text-gray-800 break-keep">{item.ruseUtztnFcltNm}</td> + <td className="px-2 py-1.5 text-right text-[11px] text-gray-600"> {Number(item.splyExtraCpct || 0).toLocaleString()} </td> - <td className="px-3 py-2 text-right text-[12px]"> + <td className="px-2 py-1.5 text-right text-[11px] text-gray-600"> {Number(item.ruseCpct || 0).toLocaleString()} </td> - <td className="px-3 py-2 text-center"> + <td className="px-2 py-1.5 text-center"> <button onClick={() => handleDelete(item.pbnstRuseFcltId)} - className="text-red-500 hover:text-red-700 text-sm font-bold" + className="text-gray-400 hover:text-red-500 text-[11px] font-bold transition-colors" aria-label="삭제" title="삭제" > @@ -64,15 +60,13 @@ export default function SelectedFcltList({ </> ); - if (data.length === 0) return null; - return ( - <div className="fixed right-40 top-[8rem] w-[40rem] max-h-[130rem] overflow-auto bg-white shadow-lg rounded p-4 border border-gray-300 z-50"> - <h3 className="bg-cyan-700 text-white text-xl font-bold mb-2 p-2"> + <div className="fixed right-20 top-[3.5rem] w-[22rem] max-h-[80vh] overflow-hidden bg-white/95 backdrop-blur-sm shadow-[0_4px_12px_rgba(0,0,0,0.1)] rounded-lg border border-gray-200 z-50 flex flex-col"> + <h3 className="bg-cyan-700 text-white text-[13px] font-semibold p-2"> 선택된 시설 </h3> - <div className="overflow-x-auto"> - <table className="w-full text-sm text-gray-800 border border-gray-200"> + <div className="overflow-y-auto w-full"> + <table className="w-full text-sm text-gray-800 border-t border-gray-200 table-fixed"> {TableContent} </table> </div> diff --git a/apps/dm/app/(popup-layout)/map/service/map.ts b/apps/dm/app/(popup-layout)/map/service/map.ts index 00e3ab561..dea14f0d0 100644 --- a/apps/dm/app/(popup-layout)/map/service/map.ts +++ b/apps/dm/app/(popup-layout)/map/service/map.ts @@ -6,7 +6,7 @@ import { DEV_URL_WR, DEV_URL_SN } from "@/components/ui/config"; export type LyrStngProps = { lyr_sn: string lyr_nm: string - upper_lyr_sn: string + upper_lyr_sn: string drawOrdr: string flterSql: string gobjTy: string @@ -29,7 +29,7 @@ export type LyrStngProps = { export const mapService = { //레이어 설정 조회 getLyrStngs: async () => { - const response = await fetch(`${DEV_URL_SN}/api/v1/map/lyrStngs/DM_NETWORK`, { + const response = await fetch(`${DEV_URL_SN}/map/lyrStngs/DM_NETWORK`, { method: 'GET', headers: { 'Accept': 'application/json', @@ -42,7 +42,7 @@ export const mapService = { return response.json(); }, - getPbnstRuseFclts: async (ruseFcltPk:any) => { + getPbnstRuseFclts: async (ruseFcltPk: any) => { const response = await fetch(`${DEV_URL_WR}/reuseFc/pubFc/${ruseFcltPk}`, { method: 'GET', headers: { diff --git a/apps/dm_new/app/(with-layout)/apply/dmdco/page.tsx b/apps/dm/app/(with-layout)/apply/dmdco/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/apply/dmdco/page.tsx rename to apps/dm/app/(with-layout)/apply/dmdco/page.tsx diff --git a/apps/dm_new/app/(with-layout)/apply/layout.tsx b/apps/dm/app/(with-layout)/apply/layout.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/apply/layout.tsx rename to apps/dm/app/(with-layout)/apply/layout.tsx diff --git a/apps/dm_new/app/(with-layout)/apply/modal/WaterQualityRefModal.tsx b/apps/dm/app/(with-layout)/apply/modal/WaterQualityRefModal.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/apply/modal/WaterQualityRefModal.tsx rename to apps/dm/app/(with-layout)/apply/modal/WaterQualityRefModal.tsx diff --git a/apps/dm_new/app/(with-layout)/apply/register/page.tsx b/apps/dm/app/(with-layout)/apply/register/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/apply/register/page.tsx rename to apps/dm/app/(with-layout)/apply/register/page.tsx diff --git a/apps/dm_new/app/(with-layout)/apply/status/page.tsx b/apps/dm/app/(with-layout)/apply/status/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/apply/status/page.tsx rename to apps/dm/app/(with-layout)/apply/status/page.tsx diff --git a/apps/dm_new/app/(with-layout)/example/globalCase/australia/page.tsx b/apps/dm/app/(with-layout)/example/globalCase/australia/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/example/globalCase/australia/page.tsx rename to apps/dm/app/(with-layout)/example/globalCase/australia/page.tsx diff --git a/apps/dm_new/app/(with-layout)/example/globalCase/eu/page.tsx b/apps/dm/app/(with-layout)/example/globalCase/eu/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/example/globalCase/eu/page.tsx rename to apps/dm/app/(with-layout)/example/globalCase/eu/page.tsx diff --git a/apps/dm_new/app/(with-layout)/example/globalCase/overview/page.tsx b/apps/dm/app/(with-layout)/example/globalCase/overview/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/example/globalCase/overview/page.tsx rename to apps/dm/app/(with-layout)/example/globalCase/overview/page.tsx diff --git a/apps/dm_new/app/(with-layout)/example/globalCase/singapore/page.tsx b/apps/dm/app/(with-layout)/example/globalCase/singapore/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/example/globalCase/singapore/page.tsx rename to apps/dm/app/(with-layout)/example/globalCase/singapore/page.tsx diff --git a/apps/dm_new/app/(with-layout)/example/globalCase/taiwan/page.tsx b/apps/dm/app/(with-layout)/example/globalCase/taiwan/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/example/globalCase/taiwan/page.tsx rename to apps/dm/app/(with-layout)/example/globalCase/taiwan/page.tsx diff --git a/apps/dm_new/app/(with-layout)/example/layout.tsx b/apps/dm/app/(with-layout)/example/layout.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/example/layout.tsx rename to apps/dm/app/(with-layout)/example/layout.tsx diff --git a/apps/dm_new/app/(with-layout)/example/rain/suwon/page.tsx b/apps/dm/app/(with-layout)/example/rain/suwon/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/example/rain/suwon/page.tsx rename to apps/dm/app/(with-layout)/example/rain/suwon/page.tsx diff --git a/apps/dm_new/app/(with-layout)/example/sewage/bolyeong/page.tsx b/apps/dm/app/(with-layout)/example/sewage/bolyeong/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/example/sewage/bolyeong/page.tsx rename to apps/dm/app/(with-layout)/example/sewage/bolyeong/page.tsx diff --git a/apps/dm_new/app/(with-layout)/example/sewage/cheongju/page.tsx b/apps/dm/app/(with-layout)/example/sewage/cheongju/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/example/sewage/cheongju/page.tsx rename to apps/dm/app/(with-layout)/example/sewage/cheongju/page.tsx diff --git a/apps/dm_new/app/(with-layout)/example/sewage/guri/page.tsx b/apps/dm/app/(with-layout)/example/sewage/guri/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/example/sewage/guri/page.tsx rename to apps/dm/app/(with-layout)/example/sewage/guri/page.tsx diff --git a/apps/dm_new/app/(with-layout)/example/sewage/hwanggu/page.tsx b/apps/dm/app/(with-layout)/example/sewage/hwanggu/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/example/sewage/hwanggu/page.tsx rename to apps/dm/app/(with-layout)/example/sewage/hwanggu/page.tsx diff --git a/apps/dm_new/app/(with-layout)/example/sewage/paju/page.tsx b/apps/dm/app/(with-layout)/example/sewage/paju/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/example/sewage/paju/page.tsx rename to apps/dm/app/(with-layout)/example/sewage/paju/page.tsx diff --git a/apps/dm_new/app/(with-layout)/example/sewage/yeosu/page.tsx b/apps/dm/app/(with-layout)/example/sewage/yeosu/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/example/sewage/yeosu/page.tsx rename to apps/dm/app/(with-layout)/example/sewage/yeosu/page.tsx diff --git a/apps/dm_new/app/(with-layout)/intro/greywater/page.tsx b/apps/dm/app/(with-layout)/intro/greywater/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/intro/greywater/page.tsx rename to apps/dm/app/(with-layout)/intro/greywater/page.tsx diff --git a/apps/dm_new/app/(with-layout)/intro/law/page.tsx b/apps/dm/app/(with-layout)/intro/law/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/intro/law/page.tsx rename to apps/dm/app/(with-layout)/intro/law/page.tsx diff --git a/apps/dm_new/app/(with-layout)/intro/layout.tsx b/apps/dm/app/(with-layout)/intro/layout.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/intro/layout.tsx rename to apps/dm/app/(with-layout)/intro/layout.tsx diff --git a/apps/dm_new/app/(with-layout)/intro/rain/page.tsx b/apps/dm/app/(with-layout)/intro/rain/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/intro/rain/page.tsx rename to apps/dm/app/(with-layout)/intro/rain/page.tsx diff --git a/apps/dm_new/app/(with-layout)/intro/sewage/page.tsx b/apps/dm/app/(with-layout)/intro/sewage/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/intro/sewage/page.tsx rename to apps/dm/app/(with-layout)/intro/sewage/page.tsx diff --git a/apps/dm_new/app/(with-layout)/layout.tsx b/apps/dm/app/(with-layout)/layout.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/layout.tsx rename to apps/dm/app/(with-layout)/layout.tsx diff --git a/apps/dm_new/app/(with-layout)/status/greywater/page.tsx b/apps/dm/app/(with-layout)/status/greywater/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/status/greywater/page.tsx rename to apps/dm/app/(with-layout)/status/greywater/page.tsx diff --git a/apps/dm_new/app/(with-layout)/status/layout.tsx b/apps/dm/app/(with-layout)/status/layout.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/status/layout.tsx rename to apps/dm/app/(with-layout)/status/layout.tsx diff --git a/apps/dm_new/app/(with-layout)/status/rain/page.tsx b/apps/dm/app/(with-layout)/status/rain/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/status/rain/page.tsx rename to apps/dm/app/(with-layout)/status/rain/page.tsx diff --git a/apps/dm_new/app/(with-layout)/status/sewage/page.tsx b/apps/dm/app/(with-layout)/status/sewage/page.tsx similarity index 100% rename from apps/dm_new/app/(with-layout)/status/sewage/page.tsx rename to apps/dm/app/(with-layout)/status/sewage/page.tsx diff --git a/apps/dm_new/app/api/postcode/route.ts b/apps/dm/app/api/postcode/route.ts similarity index 100% rename from apps/dm_new/app/api/postcode/route.ts rename to apps/dm/app/api/postcode/route.ts diff --git a/apps/dm/app/base.tsx b/apps/dm/app/base.tsx deleted file mode 100644 index bae02acb2..000000000 --- a/apps/dm/app/base.tsx +++ /dev/null @@ -1,28 +0,0 @@ -"use client"; - -import { BaseLayout } from "@common/components"; -import type { MenuItem } from "./store/common"; -import { useDmStore } from "./store"; -import { usePathname, useRouter } from "next/navigation"; - -export default function Base({ - children, -}: Readonly<{ - children: React.ReactNode; -}>) { - const { getMenuAuth } = useDmStore((state) => state); - - const router = useRouter(); - const pathname = usePathname(); - - const handleClick = (id: MenuItem) => { - getMenuAuth(id.menuCd); - router.push(id.urlPath); - }; - - return ( - <BaseLayout currentPath={pathname ?? ""} handleMenuClick={handleClick}> - {children} - </BaseLayout> - ); -} diff --git a/apps/dm_new/app/commonOrigin.css b/apps/dm/app/commonOrigin.css similarity index 100% rename from apps/dm_new/app/commonOrigin.css rename to apps/dm/app/commonOrigin.css diff --git a/apps/dm/app/globals.css b/apps/dm/app/globals.css index f30aa3031..2fee793a1 100644 --- a/apps/dm/app/globals.css +++ b/apps/dm/app/globals.css @@ -1,4 +1,5 @@ -@import "../../../packages/common/components/src/base.css"; +/* @import "../../../packages/common/components/src/base.css"; */ +/* @import "../../../packages/common/components/src/base.css"; */ @tailwind base; @tailwind components; @@ -68,3 +69,15 @@ @apply bg-background text-foreground; } } + +@font-face { + font-family: "NotoSansKR"; + src: url("/fonts/NotoSansKR-Regular.woff2") format("woff2"); + font-weight: 400; + font-style: normal; + font-display: swap; +} + +body { + font-family: "NotoSansKR", sans-serif; +} diff --git a/apps/dm/app/layout.tsx b/apps/dm/app/layout.tsx index 7224c9dc2..0e45865e7 100644 --- a/apps/dm/app/layout.tsx +++ b/apps/dm/app/layout.tsx @@ -15,7 +15,11 @@ export default function RootLayout({ <head> <title>물재이용 대민 - {children} + +
+ {children} +
+ ); } diff --git a/apps/dm_new/app/main/SideIndicator.tsx b/apps/dm/app/main/SideIndicator.tsx similarity index 100% rename from apps/dm_new/app/main/SideIndicator.tsx rename to apps/dm/app/main/SideIndicator.tsx diff --git a/apps/dm_new/app/main/_hooks/useScrollSpy.ts b/apps/dm/app/main/_hooks/useScrollSpy.ts similarity index 100% rename from apps/dm_new/app/main/_hooks/useScrollSpy.ts rename to apps/dm/app/main/_hooks/useScrollSpy.ts diff --git a/apps/dm_new/app/main/_sections/Cases.tsx b/apps/dm/app/main/_sections/Cases.tsx similarity index 100% rename from apps/dm_new/app/main/_sections/Cases.tsx rename to apps/dm/app/main/_sections/Cases.tsx diff --git a/apps/dm_new/app/main/_sections/Hero.tsx b/apps/dm/app/main/_sections/Hero.tsx similarity index 100% rename from apps/dm_new/app/main/_sections/Hero.tsx rename to apps/dm/app/main/_sections/Hero.tsx diff --git a/apps/dm_new/app/main/_sections/IntroCards.tsx b/apps/dm/app/main/_sections/IntroCards.tsx similarity index 100% rename from apps/dm_new/app/main/_sections/IntroCards.tsx rename to apps/dm/app/main/_sections/IntroCards.tsx diff --git a/apps/dm_new/app/main/_sections/ProcessFlow.tsx b/apps/dm/app/main/_sections/ProcessFlow.tsx similarity index 100% rename from apps/dm_new/app/main/_sections/ProcessFlow.tsx rename to apps/dm/app/main/_sections/ProcessFlow.tsx diff --git a/apps/dm_new/app/main/layout.tsx b/apps/dm/app/main/layout.tsx similarity index 100% rename from apps/dm_new/app/main/layout.tsx rename to apps/dm/app/main/layout.tsx diff --git a/apps/dm_new/app/main/page.tsx b/apps/dm/app/main/page.tsx similarity index 100% rename from apps/dm_new/app/main/page.tsx rename to apps/dm/app/main/page.tsx diff --git a/apps/dm/app/page.tsx b/apps/dm/app/page.tsx deleted file mode 100644 index fdb323086..000000000 --- a/apps/dm/app/page.tsx +++ /dev/null @@ -1,36 +0,0 @@ -"use client" - -import Link from 'next/link'; -import { Button } from '@common/components/ui'; - -export default function Home() { - return ( - <> -
- - - - - - -
-
- -
- - ); -} diff --git a/apps/dm_new/app/reuse.module.css b/apps/dm/app/reuse.module.css similarity index 100% rename from apps/dm_new/app/reuse.module.css rename to apps/dm/app/reuse.module.css diff --git a/apps/dm/app/store/common/index.tsx b/apps/dm/app/store/common/index.tsx index 6721d2620..e875c2eca 100644 --- a/apps/dm/app/store/common/index.tsx +++ b/apps/dm/app/store/common/index.tsx @@ -327,12 +327,95 @@ const fetchEnvPartData = async (): Promise => { } }; +function sortMenus(items: MenuItem[]): MenuItem[] { + return [...items] + .sort((a, b) => a.sortSeq - b.sortSeq) + .map((item) => ({ + ...item, + children: item.children ? sortMenus(item.children) : [], + })); +} + +function isVisible(item: MenuItem): boolean { + return item.useYn !== "N" && item.otptYn !== "N"; +} + +function normalizeMenus(items: MenuItem[]): MenuItem[] { + return sortMenus(items) + .filter(isVisible) + .map((item) => ({ + ...item, + children: item.children ? normalizeMenus(item.children) : [], + })); +} + +export const REUSE_SITE_ID = process.env.NEXT_PUBLIC_SITE_ID || "DM"; +const anonymousMenuCache = new Map(); +const anonymousMenuInFlight = new Map>(); + +export async function fetchAnonymousMenu(siteId = REUSE_SITE_ID): Promise { + const cached = anonymousMenuCache.get(siteId); + if (cached) return cached; + + const inFlight = anonymousMenuInFlight.get(siteId); + if (inFlight) return inFlight; + + const request = (async () => { + const response = await fetch(`/cms-service/api/v1/menu/anonymous/user/${siteId}`, { + method: "GET", + headers: { "Content-Type": "application/json" }, + cache: "no-store", + }); + + if (!response.ok) { + throw new Error(`Failed to load menu: ${response.status}`); + } + + const data = (await response.json()) as MenuItem[]; + const normalized = Array.isArray(data) ? normalizeMenus(data) : []; + anonymousMenuCache.set(siteId, normalized); + return normalized; + })(); + + anonymousMenuInFlight.set(siteId, request); + try { + return await request; + } finally { + anonymousMenuInFlight.delete(siteId); + } +} + +function isPathMatched(pathname: string, urlPath: string) { + if (!urlPath) return false; + return pathname === urlPath || pathname.startsWith(`${urlPath}/`); +} + +function hasMatchedPathInTree(menu: MenuItem, pathname: string): boolean { + if (isPathMatched(pathname, menu.urlPath)) return true; + return (menu.children ?? []).some((child) => hasMatchedPathInTree(child, pathname)); +} + +export function findActiveTopMenu(menus: MenuItem[], pathname: string): MenuItem | null { + const level1Menus = menus.filter((menu) => menu.levelNo === 1 || menu.parentId === null); + const matched = level1Menus.filter((menu) => hasMatchedPathInTree(menu, pathname)); + + return matched[0] ?? level1Menus[0] ?? null; +} + +export function hasAnyChild(item: MenuItem): boolean { + return Array.isArray(item.children) && item.children.length > 0; +} + +export function isMenuActive(pathname: string, menu: MenuItem): boolean { + return isPathMatched(pathname, menu.urlPath); +} /**==================================== * Store - expaort ====================================*/ export type CommonAction = { initializeCommonData: () => Promise; getMenuAuth: (menuCd:number) => Promise; + fetchAnonymousMenu: (siteId?: string) => Promise; } export type CommonType = { @@ -413,7 +496,7 @@ export const CommonReducer:(set:any)=>CommonAction=(set: any) => { } }) )}, + fetchAnonymousMenu: async (siteId = REUSE_SITE_ID) => fetchAnonymousMenu(siteId) } } - export type CommonStore = CommonType & CommonAction; diff --git a/apps/dm/app/store/sdmMng/index.tsx b/apps/dm/app/store/sdmMng/index.tsx index 2e52ac13d..1f4bfa572 100644 --- a/apps/dm/app/store/sdmMng/index.tsx +++ b/apps/dm/app/store/sdmMng/index.tsx @@ -1,4 +1,4 @@ -import { fetchType, getFetch, postFetch } from "@/components/ui/api"; +import { fetchType, getFetch, postFetch, getFetchWithCount } from "@/components/ui/api"; import type { SelectDataType } from "@common/business_components/ui"; import type { TableUpperProps } from "../common"; import toast from "react-hot-toast"; @@ -10,34 +10,27 @@ import { z } from "zod"; =====================================*/ export const sdmInfoFormSchema = z.object({ - sdmNm: z.string().min(1, "수요처를 선택해주세요"), - demandYmd: z.date().optional(), - demandQnty: z - .string() - .min(1, "요구수량을 입력해주세요") - .regex(/^[0-9]+$/, "요구수량은 숫자만 입력 가능합니다"), - usePurpose: z.string().optional(), - money: z.string().regex(/^[0-9]+$/, "희망단가는 숫자만 입력 가능합니다"), - /**요구수질 */ - reqWaterQlty: z.string().optional(), + dmdInfoId: z.string().optional(), + dmndTmng: z.date().optional(), + dmndQty: z.number().min(1, "요구수량을 입력해주세요"), + wntUntprc: z.number().min(1, "희망단가를 입력해주세요"), + useUsgCd: z.string().min(1, "사용용도를 선택해주세요"), + /** 수질 */ grssClfg: z.number().nullish(), tn: z.number().nullish(), combResdch: z.number().nullish(), tph: z.number().nullish(), trbt: z.number().nullish(), ph: z.string().nullish(), - bod: z.number().nullish(), - /**컬럼확인필요 */ + blgcOxygDmndQnt: z.number().nullish(), clIonQnt: z.number().nullish(), smll: z.string(), cdtnv: z.number().nullish(), crmty: z.number().nullish(), + rmrk: z.string().optional(), - /* telno: z.string() - .min(8, "전화번호는 8자 이상 입력해주세요") - .max(12, "전화번호는 12자 이내로 입력해주세요") - .regex(/^[0-9-]+$/, "전화번호는 숫자와 하이픈(-)만 입력 가능합니다"), */ - candidateTitle: z + + splyCndtList: z .array( z.object({ ruseUtztnFcltNm: z.string(), @@ -45,58 +38,6 @@ export const sdmInfoFormSchema = z.object({ }) ) .optional(), -}).superRefine((data, ctx) => { - const disabledFields = disableRules[data.usePurpose ?? ""] || []; - // 모든 수질 관련 필드 - // 총대장균군수는 null 값을 불검출로 표시하기때문에 해당 검사에서 제외함. - const allFields: (keyof typeof data)[] = [ - "tn", "combResdch", "tph", - "trbt", "ph", "bod", "clIonQnt", - "smll", "cdtnv", "crmty", - ]; - - const allFieldsName: Record = { - tn: "총질소(T-N)(mg/L)", - combResdch: "결합잔류염소(mg/L)", - tph: "총인(T-P)(mg/L)", - trbt: "탁도(NTU)", - ph: "수소이온농도(pH)", - bod: "생물학적 산소요구량(BOD)(mg/L)", - clIonQnt: "염화물(mgCL/L)", - smll: "냄새", - cdtnv: "전기전도도(㎲/cm)", - crmty: "색도(도)", - }; - allFields.forEach((field) => { - const isDisabled = disabledFields.includes(field); - if (!isDisabled) { - // disabled가 아닌 필드는 반드시 값이 있어야 함 - const value = data[field]; - if (typeof value === "string") { - if (value.trim().length === 0) { - ctx.addIssue({ - code: z.ZodIssueCode.custom, - path: [field], - message: `${allFieldsName[field]} 을 입력해주세요.`, - }); - } - } else if (typeof value === "number") { - if (value <= 0 || Number.isNaN(value)) { - ctx.addIssue({ - code: z.ZodIssueCode.custom, - path: [field], - message: `${allFieldsName[field]} 을 입력해주세요.`, - }); - } - } else if (value == null) { - ctx.addIssue({ - code: z.ZodIssueCode.custom, - path: [field], - message: `${allFieldsName[field]} 을 입력해주세요.`, - }); - } - } - }); }); export type SdmInfoFormData = z.infer; @@ -109,6 +50,7 @@ export type DemandCompBizType = { dmdInfoFk: string | ''; bzmnNo: string | ''; dmdCoNm: string | ''; + zip: string | ''; daddr: string | ''; telno: string | ''; rgtr: string | ''; @@ -135,8 +77,9 @@ export type DemandCompBizType = { dmdInfoSn: number | ''; status: string | ''; splyCndtList: SupplyCandidate[] | [], - ruseUtztnFcltNm?: string | '' - + ruseUtztnFcltNm?: string | ''; + regDt: string | ''; + mdfcnDt : string | ''; } // 공급 후보자 타입 정의 @@ -393,7 +336,7 @@ const defaultRules: Record = { // 사용용도 const useTypesData: SelectDataType[] = [ - { text: '청소', val: "청소" }, +/* { text: '청소', val: "청소" }, { text: "화장실용수", val: "화장실용수" }, { text: "세척", val: "세척" }, { text: "살수", val: "살수" }, @@ -401,7 +344,7 @@ const useTypesData: SelectDataType[] = [ { text: "농업_간접용수", val: "농업_간접용수" }, { text: "농업_직접용수", val: "농업_직접용수" }, { text: "하천", val: "하천" }, - { text: "공업", val: "공업" }, + { text: "공업", val: "공업" }, */ ]; // 유사사례 모달 헤더 @@ -512,13 +455,28 @@ const postSdmData = async (data: DemandCompType) => { } // 수요정보 등록 -const postSdmInfoData = async (data: DemandCompBizType) => { +const postSdmInfoData = async (data: SdmInfoFormData): Promise => { try { await postFetch("/reuseFc/request/demandInfo", data); - toast.success('수요 정보 등록에 성공하였습니다.'); + alert('수요 정보 등록에 성공하였습니다.'); + return true; } catch (error) { console.log(error); - toast.error('수요 정보 등록에 실패하였습니다.'); + alert('수요 정보 등록에 실패하였습니다.'); + return false; + } +} + +// 수요정보 수정 +const fetchUpdateSdmInfoData = async (data: SdmInfoFormData): Promise => { + try { + await postFetch("/reuseFc/request/updateDemandInfo", data); + alert('수요 정보 수정에 성공하였습니다.'); + return true; + } catch (error) { + console.log(error); + alert('수요 정보 수정에 실패하였습니다.'); + return false; } } @@ -532,6 +490,8 @@ const postSdmLoginData = async (data: DemandCompType) => { let loginSuccess = false; if (status === 200 && loginData != null) { alert("수요처 로그인에 성공하였습니다."); + delete loginData.dmdAplyPswd; + delete loginData.rgtr; sessionStorage.setItem("user", JSON.stringify(loginData)); loginSuccess = true; } else if (status === 401) { @@ -592,12 +552,15 @@ const fetchGetSimilarCaseList = async (part: string, value: number | string) => export type SdmActions = { initializeSdmData: () => void; insertSdmData: (data: DemandCompType) => Promise; - insertSdmInfoData: (data: DemandCompBizType) => Promise; + insertSdmInfoData: (data: SdmInfoFormData) => Promise; + updateSdmInfoData: (data: SdmInfoFormData) => Promise; getDemandCompList: (searchText: string, pageCnt: number) => Promise; actionLogin: (data: DemandCompType) => Promise; getSdmInfoStatusList: (dmdInfoId: string) => Promise; getSimilarCaseList: (part: string, value: number | string) => Promise; actionLogout: () => Promise; + + getUseTypesData: () => Promise; } export type SdmType = { @@ -665,8 +628,12 @@ export const SdmReducer = (set: any): SdmActions => { } }, - insertSdmInfoData: async (data: DemandCompBizType) => { - postSdmInfoData(data); + insertSdmInfoData: async (data: SdmInfoFormData): Promise => { + return await postSdmInfoData(data); + }, + + updateSdmInfoData: async (data: SdmInfoFormData): Promise => { + return await fetchUpdateSdmInfoData(data); }, // 수요처 정보 @@ -717,6 +684,7 @@ export const SdmReducer = (set: any): SdmActions => { bzmnNo: res.bzmnNo, dmdCoNm: res.dmdCoNm, dmdInfoId: res.dmdInfoId, + zip: res.zip || '', daddr: res.daddr, telno: res.telno.replace(/(\d{3})(\d{4})(\d{4})/, '$1-$2-$3'), rgtr: res.rgtr, @@ -762,7 +730,6 @@ export const SdmReducer = (set: any): SdmActions => { ruseBizNm: maskedBizNm, }; }); - console.log(similarCaseList); if (similarCaseList && similarCaseList.length !== 0) { set((state: SdmType) => ({ @@ -791,6 +758,24 @@ export const SdmReducer = (set: any): SdmActions => { successLogin: false, } })) + }, + + getUseTypesData: async () => { + //http://dev.onasys.co.kr:3000/server/cms-service/api/v1/lwpo-cds?lwpoCdNm=&sort=regDt,desc&upCd=WR018&page=0&size=10 + + const upCd = await getFetchWithCount( + fetchType.CS, + "/cms-service/api/v1/lwpo-cds/?lwpoCdNm=&sort=regDt,desc&upCd=WR018&page=0&size=100" + ); + + const comUseTypes = upCd.content.filter(el=>el.lwpoCdNm != '친수용수').map((el: any) => ({ text: el.lwpoCdNm, val: el.lwpoCd })); + + set((state: SdmType) => ({ + Sdm: { + ...state.Sdm, + useTypesData: comUseTypes, + } + })); } } } diff --git a/apps/dm_new/app/store/sdmMng/postcode-service.ts b/apps/dm/app/store/sdmMng/postcode-service.ts similarity index 100% rename from apps/dm_new/app/store/sdmMng/postcode-service.ts rename to apps/dm/app/store/sdmMng/postcode-service.ts diff --git a/apps/dm/app/store/store.tsx b/apps/dm/app/store/store.tsx index f885a3bd0..25508bae2 100644 --- a/apps/dm/app/store/store.tsx +++ b/apps/dm/app/store/store.tsx @@ -33,7 +33,7 @@ export const StoreZus = ( ) => { return createStore()((set) => { if (typeof window !== "undefined") { - tokenManager.setToken("site-id-key", "DM"); + tokenManager.setToken("site-id-key", process.env.NEXT_PUBLIC_SITE_ID||"DM"); tokenManager.setToken("site-theme-key", "green"); } diff --git a/apps/dm/app/style/PublicReuseFaciltyInsert.module.css b/apps/dm/app/style/PublicReuseFaciltyInsert.module.css deleted file mode 100644 index 6fc6f75ee..000000000 --- a/apps/dm/app/style/PublicReuseFaciltyInsert.module.css +++ /dev/null @@ -1,9 +0,0 @@ -.formInsideTitle{ - background-color: gray; - text-align: center; -} - - - -.smallTitle{ -} \ No newline at end of file diff --git a/apps/dm_new/components/CandidateSiteModal.tsx b/apps/dm/components/CandidateSiteModal.tsx similarity index 100% rename from apps/dm_new/components/CandidateSiteModal.tsx rename to apps/dm/components/CandidateSiteModal.tsx diff --git a/apps/dm_new/components/CaseImageSlider.tsx b/apps/dm/components/CaseImageSlider.tsx similarity index 100% rename from apps/dm_new/components/CaseImageSlider.tsx rename to apps/dm/components/CaseImageSlider.tsx diff --git a/apps/dm_new/components/CaseTabsCarousel.tsx b/apps/dm/components/CaseTabsCarousel.tsx similarity index 100% rename from apps/dm_new/components/CaseTabsCarousel.tsx rename to apps/dm/components/CaseTabsCarousel.tsx diff --git a/apps/dm_new/components/ImageSlider.tsx b/apps/dm/components/ImageSlider.tsx similarity index 100% rename from apps/dm_new/components/ImageSlider.tsx rename to apps/dm/components/ImageSlider.tsx diff --git a/apps/dm_new/components/Lnb.tsx b/apps/dm/components/Lnb.tsx similarity index 100% rename from apps/dm_new/components/Lnb.tsx rename to apps/dm/components/Lnb.tsx diff --git a/apps/dm_new/components/LoginModal.tsx b/apps/dm/components/LoginModal.tsx similarity index 100% rename from apps/dm_new/components/LoginModal.tsx rename to apps/dm/components/LoginModal.tsx diff --git a/apps/dm_new/components/LoginStatus.tsx b/apps/dm/components/LoginStatus.tsx similarity index 100% rename from apps/dm_new/components/LoginStatus.tsx rename to apps/dm/components/LoginStatus.tsx diff --git a/apps/dm_new/components/PostcodeModal.tsx b/apps/dm/components/PostcodeModal.tsx similarity index 100% rename from apps/dm_new/components/PostcodeModal.tsx rename to apps/dm/components/PostcodeModal.tsx diff --git a/apps/dm_new/components/SubPageHeader.tsx b/apps/dm/components/SubPageHeader.tsx similarity index 100% rename from apps/dm_new/components/SubPageHeader.tsx rename to apps/dm/components/SubPageHeader.tsx diff --git a/apps/dm_new/components/TopNav.tsx b/apps/dm/components/TopNav.tsx similarity index 100% rename from apps/dm_new/components/TopNav.tsx rename to apps/dm/components/TopNav.tsx diff --git a/apps/dm/components/toastFromUi.tsx b/apps/dm/components/toastFromUi.tsx deleted file mode 100644 index 24b0b985f..000000000 --- a/apps/dm/components/toastFromUi.tsx +++ /dev/null @@ -1,53 +0,0 @@ - -import { Button } from "@common/components/ui"; -import Link from "next/link"; -import toast from "react-hot-toast"; - -export function ToastFormUi(body:string,title:string,url:string,buttonName:string){ - - //const router = useRouter(); - - return( - - toast.custom((t) => ( - -
-
-
-
- -
-
-

- {title} -

-

- {body} -

-
-
-
-
- -
-
- -
-
- )) - ) -} \ No newline at end of file diff --git a/apps/dm/components/ui/api/index.ts b/apps/dm/components/ui/api/index.ts index abb0c2c73..49d244d25 100644 --- a/apps/dm/components/ui/api/index.ts +++ b/apps/dm/components/ui/api/index.ts @@ -1,6 +1,7 @@ //8880 import { AUTH_USER_ID, CLAIM_NAME } from "@/src/shared/config"; import { getCookie } from "@common/components/lib/cookie"; +import { DEV_URL_FO, DEV_URL_WR, LOCAL_URL } from "../config/"; const tokenId = getCookie(AUTH_USER_ID); @@ -10,7 +11,9 @@ export const fetchType = { COMMON: "common", WR: "wr", FO: "fo", - SN: "sn" + SN: "sn", + LOCAL: "LOCAL", + CS: "CS", }; const API_VERSION = "/api/v1" @@ -44,6 +47,55 @@ export const getFetch = async (type: string, url: string) => { return res; }; +export const getFetchWithCount = async (type: string, url: string) => { + const div = + type === fetchType.COMMON + ? DEV_URL_FO + : type === fetchType.LOCAL + ? LOCAL_URL + : type === fetchType.CS + ? "" + : DEV_URL_WR; + const apiUrl = div + url; + + const response = await fetch(apiUrl, { + method: "GET", + headers: { + accept: "application/json", + }, + }); + + if (!response.ok) { + console.log(`오류 발생: ${response.status}`); + } + + const contentType = response.headers.get("content-type") ?? ""; + + if (contentType.includes("application/json")) { + // JSON 응답 처리 + const res = await response.json(); + + return res; + } else if(contentType.includes('application/octet-stream')) { + // 파일 응답 처리 (ex. PDF, Excel 등) + + console.log('contentType ' ,contentType) + const blob = await response.blob(); + const blobUrl = window.URL.createObjectURL(blob); + const a = document.createElement("a"); + const filename = "downloaded_file.PDF"; + + a.href = blobUrl; + a.download = filename; + a.click(); + window.URL.revokeObjectURL(blobUrl); + + return null; // 다운로드이므로 반환값 없음 + }else{ + throw Error('오류 발생') + } +}; + export const postFetch = async (url: string, params: RequestParams) => { const baseUrl = servers[fetchType.WR]; const response = await fetch(baseUrl + url, { diff --git a/apps/dm/components/ui/config/index.ts b/apps/dm/components/ui/config/index.ts index 1585bb767..8dc7bdb50 100644 --- a/apps/dm/components/ui/config/index.ts +++ b/apps/dm/components/ui/config/index.ts @@ -1,6 +1,6 @@ import { PROXY_HOST } from "@/src/shared/config/env"; export const LOCAL_URL = PROXY_HOST; -export const DEV_URL_FO = "/operation-service"; -export const DEV_URL_WR = "/reuse-service"; -export const DEV_URL_SN = "/sewerage-service"; +export const DEV_URL_FO = "/operation-service/api/v1"; +export const DEV_URL_WR = "/reuse-service/api/v1"; +export const DEV_URL_SN = "/sewerage-service/api/v1"; diff --git a/apps/dm/components/ui/map/SearchInputText/SearchInputText.tsx b/apps/dm/components/ui/map/SearchInputText/SearchInputText.tsx index 05f41d09b..b37fdb788 100644 --- a/apps/dm/components/ui/map/SearchInputText/SearchInputText.tsx +++ b/apps/dm/components/ui/map/SearchInputText/SearchInputText.tsx @@ -94,7 +94,7 @@ export default function SearchInputText({ value={textValue || ""} onChange={handleInputChange} onKeyDown={handleKeyDown} - 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="w-full h-8 text-xs pl-2 pr-2 text-gray-600 border border-gray-300 rounded focus:outline-none focus:ring-1 focus:ring-blue-500" placeholder={`${label}을(를) 입력하세요`} onClick={() => { setTextValue(""); @@ -109,10 +109,10 @@ export default function SearchInputText({ searchList.map((item, index) => (
handleSuggestionClick(item.bscFctNm)} role="button" @@ -127,7 +127,7 @@ export default function SearchInputText({
)) ) : ( -
+
검색 결과가 없습니다.
)} diff --git a/apps/dm/components/ui/map/searchBar/searchBar.tsx b/apps/dm/components/ui/map/searchBar/searchBar.tsx index 7ca64bbce..c52b85b0a 100644 --- a/apps/dm/components/ui/map/searchBar/searchBar.tsx +++ b/apps/dm/components/ui/map/searchBar/searchBar.tsx @@ -62,50 +62,51 @@ export function SearchBar({ ); return ( -
-
+
+
onSelectValue(val.toString(), "ctpvCd")} value={sidoValue || Common.selectSidoData[0]?.val || ""} /> onSelectValue(val.toString(), "sggCd")} value={sigunValue} /> - - { - let sggOrCity = ""; - if (searchNm) { - if (sigunValue === "0" || sigunValue === "") { - sggOrCity = sidoValue; - } else { - sggOrCity = sigunValue; + +
+ { + let sggOrCity = ""; + if (searchNm) { + if (sigunValue === "0" || sigunValue === "") { + sggOrCity = sidoValue; + } else { + sggOrCity = sigunValue; + } + findRuseFclt(sggOrCity, searchNm); } - findRuseFclt(sggOrCity, searchNm); - } - }} - setRtnData={(rtnData: any) => { - setHasuPk(rtnData); - }} - searchList={map.ruseFcltList || []} - /> + }} + setRtnData={(rtnData: any) => { + setHasuPk(rtnData); + }} + searchList={map.ruseFcltList || []} + /> +
- -
-
- {(form.getValues("candidateTitle") || []).map( - (candidate: any, index: number) => ( - - ) - )} -
-
- ), - }, - ]; +// { +// name: "candidateTitle", +// label: CANDIDATE || "공급처 후보지 선택(필수아님)", +// formIndex: 2, +// component: () => ( +//
+//
+// +// +//
+//
+// {(form.getValues("candidateTitle") || []).map( +// (candidate: any, index: number) => ( +// +// ) +// )} +//
+//
+// ), +// }, +// ]; - const normalFields = formFields.filter( - (f) => f.formIndex === 0 && f.component - ); +// const normalFields = formFields.filter( +// (f) => f.formIndex === 0 && f.component +// ); - const candidateFields = formFields.filter( - (f) => f.formIndex === 2 && f.component - ); +// const candidateFields = formFields.filter( +// (f) => f.formIndex === 2 && f.component +// ); - return ( - <> - {normalFields.map(({ name, label, component, required }) => - component ? ( - - name === "money" ? ( -
- - {component(field)} -
- ) : ( - // {component(field)} - - ) - } - /> - ) : null - )} +// return ( +// <> +// {normalFields.map(({ name, label, component, required }) => +// component ? ( +// +// name === "money" ? ( +//
+// +// {component(field)} +//
+// ) : ( +// // {component(field)} +// +// ) +// } +// /> +// ) : null +// )} -
- 요구수질 -
- { - const disabledFields = usePurpose ? disableRules[usePurpose] : []; - const isDisabled = disabledFields - ? disabledFields.includes(field.name) - : true; - return ( - -
-
- { - const inputValue = e.target.value.replace( - /[^0-9]/g, - "" - ); // 정수만 - field.onChange( - inputValue === "" ? null : Number(inputValue) - ); - }} - value={ - field.value !== undefined && field.value !== null - ? `${field.value}` - : "불검출" - } - maxLength={6} - disabled={isDisabled} - onBlur={field.onBlur} - name={field.name} - ref={field.ref} - /> - {/* TODO: 총대장균군수 확인 필요*/} - {field.value !== null ? ( - - 이하 - - ) : ( - <> - )} -
-
-
- ); - }} - /> - { - const disabledFields = usePurpose ? disableRules[usePurpose] : []; - const isDisabled = disabledFields - ? disabledFields.includes(field.name) - : true; - return ( - -
-
- { - const inputValue = e.target.value.replace( - /[^0-9]/g, - "" - ); // 정수만 - field.onChange( - inputValue === "" ? null : Number(inputValue) - ); - }} - value={ - field.value !== undefined && field.value !== null - ? `${field.value}` - : "" - } - maxLength={6} - disabled={isDisabled} - onBlur={field.onBlur} - name={field.name} - ref={field.ref} - /> - - 이하 - -
-
-
- ); - }} - /> - { - const disabledFields = usePurpose ? disableRules[usePurpose] : []; - const isDisabled = disabledFields - ? disabledFields.includes(field.name) - : true; - return ( - -
-
- { - const cleanValue = sanitizeInput( - e.target.value, - true - ); - field.onChange( - cleanValue === "" ? null : Number(cleanValue) - ); - }} - value={field.value ?? ""} - maxLength={6} - disabled={isDisabled} - onBlur={field.onBlur} - name={field.name} - ref={field.ref} - /> - - 이상 - -
-
-
- ); - }} - /> - { - const disabledFields = usePurpose ? disableRules[usePurpose] : []; - const isDisabled = disabledFields - ? disabledFields.includes(field.name) - : true; - return ( - -
-
- { - const cleanValue = sanitizeInput( - e.target.value, - true - ); - field.onChange( - cleanValue === "" ? null : Number(cleanValue) - ); - }} - value={field.value ?? ""} - maxLength={6} - disabled={isDisabled} - onBlur={field.onBlur} - name={field.name} - ref={field.ref} - /> - - 이하 - -
-
-
- ); - }} - /> - { - const disabledFields = usePurpose ? disableRules[usePurpose] : []; - const isDisabled = disabledFields - ? disabledFields.includes(field.name) - : true; - return ( - -
-
- { - const inputValue = e.target.value.replace( - /[^0-9]/g, - "" - ); // 정수만 - field.onChange( - inputValue === "" ? null : Number(inputValue) - ); - }} - value={ - field.value !== undefined && field.value !== null - ? `${field.value}` - : "" - } - maxLength={6} - disabled={isDisabled} - onBlur={field.onBlur} - name={field.name} - ref={field.ref} - /> - - 이하 - -
-
-
- ); - }} - /> -
- -
- { - const cleanValue = sanitizeInput(e.target.value, true); - isSetPh(cleanValue, 1); - }} - value={frontPHdata ?? ""} - maxLength={5} - /> - ~ - { - const cleanValue = sanitizeInput(e.target.value, true); - isSetPh(cleanValue, 0); - }} - value={backPHdata ?? ""} - maxLength={5} - /> -
-
- { - const disabledFields = usePurpose ? disableRules[usePurpose] : []; - const isDisabled = disabledFields - ? disabledFields.includes(field.name) - : true; - return ( - -
-
- { - const inputValue = e.target.value.replace( - /[^0-9]/g, - "" - ); // 정수만 - field.onChange( - inputValue === "" ? null : Number(inputValue) - ); - }} - value={ - field.value !== undefined && field.value !== null - ? `${field.value}` - : "" - } - maxLength={6} - disabled={isDisabled} - onBlur={field.onBlur} - name={field.name} - ref={field.ref} - /> - - 이하 - -
-
-
- ); - }} - /> - { - const disabledFields = usePurpose ? disableRules[usePurpose] : []; - const isDisabled = disabledFields - ? disabledFields.includes(field.name) - : true; - return ( - -
-
- { - const inputValue = e.target.value.replace( - /[^0-9]/g, - "" - ); // 정수만 - field.onChange( - inputValue === "" ? null : Number(inputValue) - ); - }} - value={ - field.value !== undefined && field.value !== null - ? `${field.value}` - : "" - } - maxLength={6} - disabled={isDisabled} - onBlur={field.onBlur} - name={field.name} - ref={field.ref} - /> - - 이하 - -
-
-
- ); - }} - /> - { - const disabledFields = usePurpose ? disableRules[usePurpose] : []; - const isDisabled = disabledFields - ? disabledFields.includes(field.name) - : true; - return ( - - { - field.onChange(val.toString()); - }} - value={field.value} - readOnly={isDisabled} - onBlur={field.onBlur} - ref={field.ref} - /> - - ); - }} - /> - { - const disabledFields = usePurpose ? disableRules[usePurpose] : []; - const isDisabled = disabledFields - ? disabledFields.includes(field.name) - : true; - return ( - -
-
- { - const inputValue = e.target.value.replace( - /[^0-9]/g, - "" - ); // 정수만 - field.onChange( - inputValue === "" ? null : Number(inputValue) - ); - }} - value={ - field.value !== undefined && field.value !== null - ? `${field.value}` - : "" - } - maxLength={6} - disabled={isDisabled} - onBlur={field.onBlur} - name={field.name} - ref={field.ref} - /> - - 이하 - -
-
-
- ); - }} - /> - { - const disabledFields = usePurpose ? disableRules[usePurpose] : []; - const isDisabled = disabledFields - ? disabledFields.includes(field.name) - : true; - return ( - -
-
- { - const inputValue = e.target.value.replace( - /[^0-9]/g, - "" - ); // 정수만 - field.onChange( - inputValue === "" ? null : Number(inputValue) - ); - }} - value={ - field.value !== undefined && field.value !== null - ? `${field.value}` - : "" - } - maxLength={6} - disabled={isDisabled} - onBlur={field.onBlur} - name={field.name} - ref={field.ref} - /> - - 이하 - -
-
-
- ); - }} - /> - { - return ( - -
-
- { - field.onChange(e.target.value); - }} - value={ - field.value !== undefined && field.value !== "" - ? `${field.value}` - : "" - } - onBlur={field.onBlur} - name={field.name} - ref={field.ref} - /> -
-
-
- ); - }} - /> -
-
+//
+// 요구수질 +//
+// { +// const disabledFields = usePurpose ? disableRules[usePurpose] : []; +// const isDisabled = disabledFields +// ? disabledFields.includes(field.name) +// : true; +// return ( +// +//
+//
+// { +// const inputValue = e.target.value.replace( +// /[^0-9]/g, +// "" +// ); // 정수만 +// field.onChange( +// inputValue === "" ? null : Number(inputValue) +// ); +// }} +// value={ +// field.value !== undefined && field.value !== null +// ? `${field.value}` +// : "불검출" +// } +// maxLength={6} +// disabled={isDisabled} +// onBlur={field.onBlur} +// name={field.name} +// ref={field.ref} +// /> +// {/* TODO: 총대장균군수 확인 필요*/} +// {field.value !== null ? ( +// +// 이하 +// +// ) : ( +// <> +// )} +//
+//
+//
+// ); +// }} +// /> +// { +// const disabledFields = usePurpose ? disableRules[usePurpose] : []; +// const isDisabled = disabledFields +// ? disabledFields.includes(field.name) +// : true; +// return ( +// +//
+//
+// { +// const inputValue = e.target.value.replace( +// /[^0-9]/g, +// "" +// ); // 정수만 +// field.onChange( +// inputValue === "" ? null : Number(inputValue) +// ); +// }} +// value={ +// field.value !== undefined && field.value !== null +// ? `${field.value}` +// : "" +// } +// maxLength={6} +// disabled={isDisabled} +// onBlur={field.onBlur} +// name={field.name} +// ref={field.ref} +// /> +// +// 이하 +// +//
+//
+//
+// ); +// }} +// /> +// { +// const disabledFields = usePurpose ? disableRules[usePurpose] : []; +// const isDisabled = disabledFields +// ? disabledFields.includes(field.name) +// : true; +// return ( +// +//
+//
+// { +// const cleanValue = sanitizeInput( +// e.target.value, +// true +// ); +// field.onChange( +// cleanValue === "" ? null : Number(cleanValue) +// ); +// }} +// value={field.value ?? ""} +// maxLength={6} +// disabled={isDisabled} +// onBlur={field.onBlur} +// name={field.name} +// ref={field.ref} +// /> +// +// 이상 +// +//
+//
+//
+// ); +// }} +// /> +// { +// const disabledFields = usePurpose ? disableRules[usePurpose] : []; +// const isDisabled = disabledFields +// ? disabledFields.includes(field.name) +// : true; +// return ( +// +//
+//
+// { +// const cleanValue = sanitizeInput( +// e.target.value, +// true +// ); +// field.onChange( +// cleanValue === "" ? null : Number(cleanValue) +// ); +// }} +// value={field.value ?? ""} +// maxLength={6} +// disabled={isDisabled} +// onBlur={field.onBlur} +// name={field.name} +// ref={field.ref} +// /> +// +// 이하 +// +//
+//
+//
+// ); +// }} +// /> +// { +// const disabledFields = usePurpose ? disableRules[usePurpose] : []; +// const isDisabled = disabledFields +// ? disabledFields.includes(field.name) +// : true; +// return ( +// +//
+//
+// { +// const inputValue = e.target.value.replace( +// /[^0-9]/g, +// "" +// ); // 정수만 +// field.onChange( +// inputValue === "" ? null : Number(inputValue) +// ); +// }} +// value={ +// field.value !== undefined && field.value !== null +// ? `${field.value}` +// : "" +// } +// maxLength={6} +// disabled={isDisabled} +// onBlur={field.onBlur} +// name={field.name} +// ref={field.ref} +// /> +// +// 이하 +// +//
+//
+//
+// ); +// }} +// /> +//
+// +//
+// { +// const cleanValue = sanitizeInput(e.target.value, true); +// isSetPh(cleanValue, 1); +// }} +// value={frontPHdata ?? ""} +// maxLength={5} +// /> +// ~ +// { +// const cleanValue = sanitizeInput(e.target.value, true); +// isSetPh(cleanValue, 0); +// }} +// value={backPHdata ?? ""} +// maxLength={5} +// /> +//
+//
+// { +// const disabledFields = usePurpose ? disableRules[usePurpose] : []; +// const isDisabled = disabledFields +// ? disabledFields.includes(field.name) +// : true; +// return ( +// +//
+//
+// { +// const inputValue = e.target.value.replace( +// /[^0-9]/g, +// "" +// ); // 정수만 +// field.onChange( +// inputValue === "" ? null : Number(inputValue) +// ); +// }} +// value={ +// field.value !== undefined && field.value !== null +// ? `${field.value}` +// : "" +// } +// maxLength={6} +// disabled={isDisabled} +// onBlur={field.onBlur} +// name={field.name} +// ref={field.ref} +// /> +// +// 이하 +// +//
+//
+//
+// ); +// }} +// /> +// { +// const disabledFields = usePurpose ? disableRules[usePurpose] : []; +// const isDisabled = disabledFields +// ? disabledFields.includes(field.name) +// : true; +// return ( +// +//
+//
+// { +// const inputValue = e.target.value.replace( +// /[^0-9]/g, +// "" +// ); // 정수만 +// field.onChange( +// inputValue === "" ? null : Number(inputValue) +// ); +// }} +// value={ +// field.value !== undefined && field.value !== null +// ? `${field.value}` +// : "" +// } +// maxLength={6} +// disabled={isDisabled} +// onBlur={field.onBlur} +// name={field.name} +// ref={field.ref} +// /> +// +// 이하 +// +//
+//
+//
+// ); +// }} +// /> +// { +// const disabledFields = usePurpose ? disableRules[usePurpose] : []; +// const isDisabled = disabledFields +// ? disabledFields.includes(field.name) +// : true; +// return ( +// +// { +// field.onChange(val.toString()); +// }} +// value={field.value} +// readOnly={isDisabled} +// onBlur={field.onBlur} +// ref={field.ref} +// /> +// +// ); +// }} +// /> +// { +// const disabledFields = usePurpose ? disableRules[usePurpose] : []; +// const isDisabled = disabledFields +// ? disabledFields.includes(field.name) +// : true; +// return ( +// +//
+//
+// { +// const inputValue = e.target.value.replace( +// /[^0-9]/g, +// "" +// ); // 정수만 +// field.onChange( +// inputValue === "" ? null : Number(inputValue) +// ); +// }} +// value={ +// field.value !== undefined && field.value !== null +// ? `${field.value}` +// : "" +// } +// maxLength={6} +// disabled={isDisabled} +// onBlur={field.onBlur} +// name={field.name} +// ref={field.ref} +// /> +// +// 이하 +// +//
+//
+//
+// ); +// }} +// /> +// { +// const disabledFields = usePurpose ? disableRules[usePurpose] : []; +// const isDisabled = disabledFields +// ? disabledFields.includes(field.name) +// : true; +// return ( +// +//
+//
+// { +// const inputValue = e.target.value.replace( +// /[^0-9]/g, +// "" +// ); // 정수만 +// field.onChange( +// inputValue === "" ? null : Number(inputValue) +// ); +// }} +// value={ +// field.value !== undefined && field.value !== null +// ? `${field.value}` +// : "" +// } +// maxLength={6} +// disabled={isDisabled} +// onBlur={field.onBlur} +// name={field.name} +// ref={field.ref} +// /> +// +// 이하 +// +//
+//
+//
+// ); +// }} +// /> +// { +// return ( +// +//
+//
+// { +// field.onChange(e.target.value); +// }} +// value={ +// field.value !== undefined && field.value !== "" +// ? `${field.value}` +// : "" +// } +// onBlur={field.onBlur} +// name={field.name} +// ref={field.ref} +// /> +//
+//
+//
+// ); +// }} +// /> +//
+//
- {candidateFields.map(({ name, label, component, required }, index) => - component ? ( - ( - // - // {component(field)} - // - - )} - /> - ) : null - )} +// {candidateFields.map(({ name, label, component, required }, index) => +// component ? ( +// ( +// // +// // {component(field)} +// // +// +// )} +// /> +// ) : null +// )} - {isSimilarCase && ( - - } - bodyClass="sm:max-w-[100vw] w-[1400px] h-[100dvh] max-h-[900px] overflow-y-auto overflow-x-hidden" - open={isSimilarCase} - onOpenChange={(open) => !open && setIsSimilarCase(false)} - noHeaderYn="Y" - noFooterYn="Y" - /> - )} - - ); -} +// {isSimilarCase && ( +// +// } +// bodyClass="sm:max-w-[100vw] w-[1400px] h-[100dvh] max-h-[900px] overflow-y-auto overflow-x-hidden" +// open={isSimilarCase} +// onOpenChange={(open) => !open && setIsSimilarCase(false)} +// noHeaderYn="Y" +// noFooterYn="Y" +// /> +// )} +// +// ); +// } diff --git a/apps/dm/eslint.config.mjs b/apps/dm/eslint.config.mjs index f477f55e1..7de132089 100644 --- a/apps/dm/eslint.config.mjs +++ b/apps/dm/eslint.config.mjs @@ -12,9 +12,19 @@ const compat = new FlatCompat({ const eslintConfig = [ ...compat.extends("next/core-web-vitals", "next/typescript"), + { + files: ["**/*.{ts,tsx,mts,cts}"], + languageOptions: { + parserOptions: { + tsconfigRootDir: __dirname, + project: ["./tsconfig.json"], + }, + }, + }, {rules:{ // other rules.. "@typescript-eslint/no-explicit-any": "off", + // "@next/next/no-img-element": "off", ...(isProd ? { "react-hooks/exhaustive-deps": "off" } : {}), }}, ]; diff --git a/apps/dm/middleware.ts b/apps/dm/middleware.ts index 44d4cb390..e55f65515 100644 --- a/apps/dm/middleware.ts +++ b/apps/dm/middleware.ts @@ -8,6 +8,7 @@ const serverApiUrl = process.env.NEXT_PUBLIC_CS_SERVER_API_URL; const GEOSERVER_URL = process.env.NEXT_PUBLIC_GEOSERVER_URL || ""; const LX_GEOSERVER_URL = process.env.NEXT_PUBLIC_LX_GEOSERVER_URL || ""; const GATEWAY_URL = process.env.NEXT_PUBLIC_GATEWAY_URL || ""; +const SEWERAGE_API_URL = process.env.NEXT_PUBLIC_SEWERAGE_API_URL || ""; const BUSINESS_JUSO_API_URL = process.env.NEXT_PUBLIC_FINDADRESS_URL || ""; const AdressKey = process.env.NEXT_PRIVATE_WR_ADDRESS_KEY || ""; @@ -28,15 +29,6 @@ export function middleware(req: NextRequest) { console.log(`[Middleware] Request URL: ${req.url}`); const searchParams = req.nextUrl.searchParams; - // if (pathname.startsWith("/server")) { - // const queryParams = searchParams.toString(); - // const newUrl = `${serverApiUrl}${pathname.replace("/server", "")}${ - // queryParams ? `?${queryParams}` : "" - // }`; - // console.log(`[Middleware] Rewriting from '/server' path to: ${newUrl}`); - // return NextResponse.rewrite(new URL(newUrl)); - // } - if (pathname.startsWith("/server")) { const decodedParams = Array.from(searchParams.entries()) .map(([key, value]) => `${key}=${decodeURIComponent(value)}`) @@ -49,7 +41,7 @@ export function middleware(req: NextRequest) { if (pathname === "/") { console.log(" maim 화면이동 "); - return NextResponse.redirect(new URL("/pages/wrStatus", req.url)); + return NextResponse.redirect(new URL("/main", req.url)); } if (pathname.startsWith("/attach-service")) { @@ -81,6 +73,8 @@ export function middleware(req: NextRequest) { if (pathname.startsWith("/geoserver")) { let queryParams = searchParams.toString(); const typename = searchParams.get("TYPENAME"); + const startYmd = searchParams.get("START_YMD") ?? null; + const endYmd = searchParams.get("END_YMD") ?? null; console.log("typename ", typename); let newUrl = `${GEOSERVER_URL}${pathname.replace("/geoserver", "")}${queryParams ? `?${queryParams}` : ""}`; @@ -111,8 +105,10 @@ export function middleware(req: NextRequest) { ) { const url = req.nextUrl.clone(); url.searchParams.set("TYPENAME", typename.replace("hasudo:", "")); + if (startYmd) url.searchParams.set("startYmd", startYmd); + if (endYmd) url.searchParams.set("endYmd", endYmd); queryParams = url.searchParams.toString(); - newUrl = `${GATEWAY_URL}/api/v1/map/geometry${queryParams ? `?${queryParams}` : ""}`; + newUrl = `${GATEWAY_URL}/sewerage-service/api/v1/map/geometry${queryParams ? `?${queryParams}` : ""}`; } console.log(`[Middleware] Rewriting from '/geoserver' path to: ${newUrl}`); diff --git a/apps/dm/next.config.ts b/apps/dm/next.config.ts index 5e1533ec9..5b5bf85da 100644 --- a/apps/dm/next.config.ts +++ b/apps/dm/next.config.ts @@ -1,4 +1,5 @@ import type { NextConfig } from "next"; +// import path from "path"; const subDomain = process.env.NEXT_PUBLIC_PROXY_HOST || "http://localhost:3000"; @@ -8,6 +9,17 @@ const nextConfig: NextConfig = { experimental: { proxyTimeout: 600000, }, + + // // 🔥 반드시 필요 + // webpack(config) { + // config.resolve.alias = { + // ...(config.resolve.alias || {}), + // // monorepo 구조 기준 + // "@common": path.resolve(__dirname, "../../packages/common"), + // }; + // return config; + // }, + async rewrites() { return { beforeFiles: [ diff --git a/apps/dm/package.json b/apps/dm/package.json index 844e0b1aa..272584f3e 100644 --- a/apps/dm/package.json +++ b/apps/dm/package.json @@ -3,9 +3,9 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev -p 3005", + "dev": "next dev -p 3015", "build": "next build", - "start:dm": "next start -p 3005", + "start:dm": "next start -p 3015", "lint": "next lint" }, "dependencies": { @@ -30,7 +30,7 @@ "@types/webpack": "^5.28.5", "eslint": "^9", "eslint-config-next": "15.3.8", - "postcss": "^8", + "postcss": "^8", "tailwindcss": "^3.4.1", "typescript": "^5" } diff --git a/apps/dm/public/data/wrStatusData.json b/apps/dm/public/data/wrStatusData.json deleted file mode 100644 index 334b521c1..000000000 --- a/apps/dm/public/data/wrStatusData.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - { "region": "전국", "sewage": "717(1,137,538)", "rainwater": "3544(13,945)", "reclaimed": "1018(222,476)", "thermal": "123(492)" }, - { "region": "서울특별시", "sewage": "4(114,908)", "rainwater": "816(430)", "reclaimed": "371(341)", "thermal": "0" }, - { "region": "부산광역시", "sewage": "13(146,197)", "rainwater": "68(335)", "reclaimed": "20(512)", "thermal": "1(18)" }, - { "region": "대구광역시", "sewage": "9(102,380)", "rainwater": "294(133)", "reclaimed": "14(44)", "thermal": "2(12)" }, - { "region": "인천광역시", "sewage": "17(57,691)", "rainwater": "165(642)", "reclaimed": "35(7,859)", "thermal": "15(32)" }, - { "region": "광주광역시", "sewage": "3(28,738)", "rainwater": "74(23)", "reclaimed": "15(450)", "thermal": "15(6)" }, - { "region": "대전광역시", "sewage": "2(11,966)", "rainwater": "52(2)", "reclaimed": "11(492)", "thermal": "20(100)" }, - { "region": "울산광역시", "sewage": "8(36,076)", "rainwater": "111(39)", "reclaimed": "19(28,904)", "thermal": "30(130)" }, - { "region": "세종특별자치시", "sewage": "9(2,555)", "rainwater": "65(16)", "reclaimed": "0(0)", "thermal": "0" }, - { "region": "경기도", "sewage": "176(313,298)", "rainwater": "1009(4,735)", "reclaimed": "252(77,096)", "thermal": "40(143)" }, - { "region": "강원특별자치도", "sewage": "69(19,677)", "rainwater": "69(4)", "reclaimed": "22(447)", "thermal": "0" }, - { "region": "충청북도", "sewage": "38(15,607)", "rainwater": "17(91)", "reclaimed": "91(2,211)", "thermal": "0" }, - { "region": "충청남도", "sewage": "67(41,368)", "rainwater": "54(77)", "reclaimed": "188(50,434)", "thermal": "0" }, - { "region": "전라북도", "sewage": "55(42,671)", "rainwater": "33(199)", "reclaimed": "220(9,453)", "thermal": "0" }, - { "region": "전라남도", "sewage": "83(23,560)", "rainwater": "16(885)", "reclaimed": "75(15,412)", "thermal": "0" }, - { "region": "경상북도", "sewage": "81(129,081)", "rainwater": "37(341)", "reclaimed": "70(27,818)", "thermal": "0" }, - { "region": "경상남도", "sewage": "75(50,101)", "rainwater": "27(244)", "reclaimed": "140(343)", "thermal": "0" }, - { "region": "제주특별자치도", "sewage": "8(1,666)", "rainwater": "47(5,746)", "reclaimed": "64(660)", "thermal": "0" } - ] \ No newline at end of file diff --git a/apps/dm/public/file.svg b/apps/dm/public/file.svg deleted file mode 100644 index 004145cdd..000000000 --- a/apps/dm/public/file.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/apps/dm/public/fonts/NotoSansKR-Black.otf b/apps/dm/public/fonts/NotoSansKR-Black.otf deleted file mode 100644 index 2b54d195e..000000000 Binary files a/apps/dm/public/fonts/NotoSansKR-Black.otf and /dev/null differ diff --git a/apps/dm/public/fonts/NotoSansKR-Black.woff b/apps/dm/public/fonts/NotoSansKR-Black.woff deleted file mode 100644 index 90ef00381..000000000 Binary files a/apps/dm/public/fonts/NotoSansKR-Black.woff and /dev/null differ diff --git a/apps/dm/public/fonts/NotoSansKR-Black.woff2 b/apps/dm/public/fonts/NotoSansKR-Black.woff2 deleted file mode 100644 index 8953c8fa7..000000000 Binary files a/apps/dm/public/fonts/NotoSansKR-Black.woff2 and /dev/null differ diff --git a/apps/dm/public/fonts/NotoSansKR-Bold.otf b/apps/dm/public/fonts/NotoSansKR-Bold.otf deleted file mode 100644 index 2b78dd845..000000000 Binary files a/apps/dm/public/fonts/NotoSansKR-Bold.otf and /dev/null differ diff --git a/apps/dm/public/fonts/NotoSansKR-Bold.woff b/apps/dm/public/fonts/NotoSansKR-Bold.woff deleted file mode 100644 index 74b20d49c..000000000 Binary files a/apps/dm/public/fonts/NotoSansKR-Bold.woff and /dev/null differ diff --git a/apps/dm/public/fonts/NotoSansKR-Bold.woff2 b/apps/dm/public/fonts/NotoSansKR-Bold.woff2 deleted file mode 100644 index 216f94dad..000000000 Binary files a/apps/dm/public/fonts/NotoSansKR-Bold.woff2 and /dev/null differ diff --git a/apps/dm/public/fonts/NotoSansKR-Light.otf b/apps/dm/public/fonts/NotoSansKR-Light.otf deleted file mode 100644 index ecab31abc..000000000 Binary files a/apps/dm/public/fonts/NotoSansKR-Light.otf and /dev/null differ diff --git a/apps/dm/public/fonts/NotoSansKR-Light.woff b/apps/dm/public/fonts/NotoSansKR-Light.woff deleted file mode 100644 index 40aabd2a4..000000000 Binary files a/apps/dm/public/fonts/NotoSansKR-Light.woff and /dev/null differ diff --git a/apps/dm/public/fonts/NotoSansKR-Light.woff2 b/apps/dm/public/fonts/NotoSansKR-Light.woff2 deleted file mode 100644 index 6b7cd1307..000000000 Binary files a/apps/dm/public/fonts/NotoSansKR-Light.woff2 and /dev/null differ diff --git a/apps/dm/public/fonts/NotoSansKR-Medium.otf b/apps/dm/public/fonts/NotoSansKR-Medium.otf deleted file mode 100644 index 371959d51..000000000 Binary files a/apps/dm/public/fonts/NotoSansKR-Medium.otf and /dev/null differ diff --git a/apps/dm/public/fonts/NotoSansKR-Medium.woff b/apps/dm/public/fonts/NotoSansKR-Medium.woff deleted file mode 100644 index e15aae09e..000000000 Binary files a/apps/dm/public/fonts/NotoSansKR-Medium.woff and /dev/null differ diff --git a/apps/dm/public/fonts/NotoSansKR-Medium.woff2 b/apps/dm/public/fonts/NotoSansKR-Medium.woff2 deleted file mode 100644 index b97668034..000000000 Binary files a/apps/dm/public/fonts/NotoSansKR-Medium.woff2 and /dev/null differ diff --git a/apps/dm/public/fonts/NotoSansKR-Regular.otf b/apps/dm/public/fonts/NotoSansKR-Regular.otf deleted file mode 100644 index 7ba76b49c..000000000 Binary files a/apps/dm/public/fonts/NotoSansKR-Regular.otf and /dev/null differ diff --git a/apps/dm/public/fonts/NotoSansKR-Regular.woff b/apps/dm/public/fonts/NotoSansKR-Regular.woff deleted file mode 100644 index 40fab257c..000000000 Binary files a/apps/dm/public/fonts/NotoSansKR-Regular.woff and /dev/null differ diff --git a/apps/dm/public/fonts/NotoSansKR-Thin.otf b/apps/dm/public/fonts/NotoSansKR-Thin.otf deleted file mode 100644 index 06c566278..000000000 Binary files a/apps/dm/public/fonts/NotoSansKR-Thin.otf and /dev/null differ diff --git a/apps/dm/public/fonts/NotoSansKR-Thin.woff b/apps/dm/public/fonts/NotoSansKR-Thin.woff deleted file mode 100644 index 40723731f..000000000 Binary files a/apps/dm/public/fonts/NotoSansKR-Thin.woff and /dev/null differ diff --git a/apps/dm/public/fonts/NotoSansKR-Thin.woff2 b/apps/dm/public/fonts/NotoSansKR-Thin.woff2 deleted file mode 100644 index 7835c23ed..000000000 Binary files a/apps/dm/public/fonts/NotoSansKR-Thin.woff2 and /dev/null differ diff --git a/apps/dm/public/globe.svg b/apps/dm/public/globe.svg deleted file mode 100644 index 567f17b0d..000000000 --- a/apps/dm/public/globe.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/apps/dm/public/images/help.png b/apps/dm/public/images/help.png deleted file mode 100644 index e872802e4..000000000 Binary files a/apps/dm/public/images/help.png and /dev/null differ diff --git a/apps/dm_new/public/images/landing/australia_01.png b/apps/dm/public/images/landing/australia_01.png similarity index 100% rename from apps/dm_new/public/images/landing/australia_01.png rename to apps/dm/public/images/landing/australia_01.png diff --git a/apps/dm_new/public/images/landing/business/globalCase/australia_01.png b/apps/dm/public/images/landing/business/globalCase/australia_01.png similarity index 100% rename from apps/dm_new/public/images/landing/business/globalCase/australia_01.png rename to apps/dm/public/images/landing/business/globalCase/australia_01.png diff --git a/apps/dm_new/public/images/landing/business/globalCase/eu_01.png b/apps/dm/public/images/landing/business/globalCase/eu_01.png similarity index 100% rename from apps/dm_new/public/images/landing/business/globalCase/eu_01.png rename to apps/dm/public/images/landing/business/globalCase/eu_01.png diff --git a/apps/dm_new/public/images/landing/business/globalCase/overview_01.png b/apps/dm/public/images/landing/business/globalCase/overview_01.png similarity index 100% rename from apps/dm_new/public/images/landing/business/globalCase/overview_01.png rename to apps/dm/public/images/landing/business/globalCase/overview_01.png diff --git a/apps/dm_new/public/images/landing/business/globalCase/singapore_01.png b/apps/dm/public/images/landing/business/globalCase/singapore_01.png similarity index 100% rename from apps/dm_new/public/images/landing/business/globalCase/singapore_01.png rename to apps/dm/public/images/landing/business/globalCase/singapore_01.png diff --git a/apps/dm_new/public/images/landing/business/globalCase/taiwan_01.png b/apps/dm/public/images/landing/business/globalCase/taiwan_01.png similarity index 100% rename from apps/dm_new/public/images/landing/business/globalCase/taiwan_01.png rename to apps/dm/public/images/landing/business/globalCase/taiwan_01.png diff --git a/apps/dm_new/public/images/landing/business/rain/rain_01.png b/apps/dm/public/images/landing/business/rain/rain_01.png similarity index 100% rename from apps/dm_new/public/images/landing/business/rain/rain_01.png rename to apps/dm/public/images/landing/business/rain/rain_01.png diff --git a/apps/dm_new/public/images/landing/business/rain/rain_02.png b/apps/dm/public/images/landing/business/rain/rain_02.png similarity index 100% rename from apps/dm_new/public/images/landing/business/rain/rain_02.png rename to apps/dm/public/images/landing/business/rain/rain_02.png diff --git a/apps/dm_new/public/images/landing/business/rain/rain_03.png b/apps/dm/public/images/landing/business/rain/rain_03.png similarity index 100% rename from apps/dm_new/public/images/landing/business/rain/rain_03.png rename to apps/dm/public/images/landing/business/rain/rain_03.png diff --git a/apps/dm_new/public/images/landing/business/rain/rain_04.png b/apps/dm/public/images/landing/business/rain/rain_04.png similarity index 100% rename from apps/dm_new/public/images/landing/business/rain/rain_04.png rename to apps/dm/public/images/landing/business/rain/rain_04.png diff --git a/apps/dm_new/public/images/landing/business/sewage/bolyeong_01.png b/apps/dm/public/images/landing/business/sewage/bolyeong_01.png similarity index 100% rename from apps/dm_new/public/images/landing/business/sewage/bolyeong_01.png rename to apps/dm/public/images/landing/business/sewage/bolyeong_01.png diff --git a/apps/dm_new/public/images/landing/business/sewage/cheongju_01.png b/apps/dm/public/images/landing/business/sewage/cheongju_01.png similarity index 100% rename from apps/dm_new/public/images/landing/business/sewage/cheongju_01.png rename to apps/dm/public/images/landing/business/sewage/cheongju_01.png diff --git a/apps/dm_new/public/images/landing/business/sewage/guri_01.png b/apps/dm/public/images/landing/business/sewage/guri_01.png similarity index 100% rename from apps/dm_new/public/images/landing/business/sewage/guri_01.png rename to apps/dm/public/images/landing/business/sewage/guri_01.png diff --git a/apps/dm_new/public/images/landing/business/sewage/guri_02.png b/apps/dm/public/images/landing/business/sewage/guri_02.png similarity index 100% rename from apps/dm_new/public/images/landing/business/sewage/guri_02.png rename to apps/dm/public/images/landing/business/sewage/guri_02.png diff --git a/apps/dm_new/public/images/landing/business/sewage/hwanggu_01.png b/apps/dm/public/images/landing/business/sewage/hwanggu_01.png similarity index 100% rename from apps/dm_new/public/images/landing/business/sewage/hwanggu_01.png rename to apps/dm/public/images/landing/business/sewage/hwanggu_01.png diff --git a/apps/dm_new/public/images/landing/business/sewage/hwanggu_02.png b/apps/dm/public/images/landing/business/sewage/hwanggu_02.png similarity index 100% rename from apps/dm_new/public/images/landing/business/sewage/hwanggu_02.png rename to apps/dm/public/images/landing/business/sewage/hwanggu_02.png diff --git a/apps/dm_new/public/images/landing/business/sewage/hwanggu_03.png b/apps/dm/public/images/landing/business/sewage/hwanggu_03.png similarity index 100% rename from apps/dm_new/public/images/landing/business/sewage/hwanggu_03.png rename to apps/dm/public/images/landing/business/sewage/hwanggu_03.png diff --git a/apps/dm_new/public/images/landing/business/sewage/paju_01.png b/apps/dm/public/images/landing/business/sewage/paju_01.png similarity index 100% rename from apps/dm_new/public/images/landing/business/sewage/paju_01.png rename to apps/dm/public/images/landing/business/sewage/paju_01.png diff --git a/apps/dm_new/public/images/landing/business/sewage/yeosu_01.png b/apps/dm/public/images/landing/business/sewage/yeosu_01.png similarity index 100% rename from apps/dm_new/public/images/landing/business/sewage/yeosu_01.png rename to apps/dm/public/images/landing/business/sewage/yeosu_01.png diff --git a/apps/dm_new/public/images/landing/calendar.svg b/apps/dm/public/images/landing/calendar.svg similarity index 100% rename from apps/dm_new/public/images/landing/calendar.svg rename to apps/dm/public/images/landing/calendar.svg diff --git a/apps/dm_new/public/images/landing/card_01.jpg b/apps/dm/public/images/landing/card_01.jpg similarity index 100% rename from apps/dm_new/public/images/landing/card_01.jpg rename to apps/dm/public/images/landing/card_01.jpg diff --git a/apps/dm_new/public/images/landing/card_02.jpg b/apps/dm/public/images/landing/card_02.jpg similarity index 100% rename from apps/dm_new/public/images/landing/card_02.jpg rename to apps/dm/public/images/landing/card_02.jpg diff --git a/apps/dm_new/public/images/landing/card_03.jpg b/apps/dm/public/images/landing/card_03.jpg similarity index 100% rename from apps/dm_new/public/images/landing/card_03.jpg rename to apps/dm/public/images/landing/card_03.jpg diff --git a/apps/dm_new/public/images/landing/card_04.jpg b/apps/dm/public/images/landing/card_04.jpg similarity index 100% rename from apps/dm_new/public/images/landing/card_04.jpg rename to apps/dm/public/images/landing/card_04.jpg diff --git a/apps/dm_new/public/images/landing/cases/greywater_building.png b/apps/dm/public/images/landing/cases/greywater_building.png similarity index 100% rename from apps/dm_new/public/images/landing/cases/greywater_building.png rename to apps/dm/public/images/landing/cases/greywater_building.png diff --git a/apps/dm_new/public/images/landing/cases/greywater_factory.png b/apps/dm/public/images/landing/cases/greywater_factory.png similarity index 100% rename from apps/dm_new/public/images/landing/cases/greywater_factory.png rename to apps/dm/public/images/landing/cases/greywater_factory.png diff --git a/apps/dm_new/public/images/landing/cases/greywater_overall.png b/apps/dm/public/images/landing/cases/greywater_overall.png similarity index 100% rename from apps/dm_new/public/images/landing/cases/greywater_overall.png rename to apps/dm/public/images/landing/cases/greywater_overall.png diff --git a/apps/dm_new/public/images/landing/cases/greywater_usage.png b/apps/dm/public/images/landing/cases/greywater_usage.png similarity index 100% rename from apps/dm_new/public/images/landing/cases/greywater_usage.png rename to apps/dm/public/images/landing/cases/greywater_usage.png diff --git a/apps/dm_new/public/images/landing/cases/rainwater_building.png b/apps/dm/public/images/landing/cases/rainwater_building.png similarity index 100% rename from apps/dm_new/public/images/landing/cases/rainwater_building.png rename to apps/dm/public/images/landing/cases/rainwater_building.png diff --git a/apps/dm_new/public/images/landing/cases/rainwater_usage.png b/apps/dm/public/images/landing/cases/rainwater_usage.png similarity index 100% rename from apps/dm_new/public/images/landing/cases/rainwater_usage.png rename to apps/dm/public/images/landing/cases/rainwater_usage.png diff --git a/apps/dm_new/public/images/landing/cases/rainwater_usage_amount.png b/apps/dm/public/images/landing/cases/rainwater_usage_amount.png similarity index 100% rename from apps/dm_new/public/images/landing/cases/rainwater_usage_amount.png rename to apps/dm/public/images/landing/cases/rainwater_usage_amount.png diff --git a/apps/dm_new/public/images/landing/cases/treated_water_facility.png b/apps/dm/public/images/landing/cases/treated_water_facility.png similarity index 100% rename from apps/dm_new/public/images/landing/cases/treated_water_facility.png rename to apps/dm/public/images/landing/cases/treated_water_facility.png diff --git a/apps/dm_new/public/images/landing/cases/treated_water_region.png b/apps/dm/public/images/landing/cases/treated_water_region.png similarity index 100% rename from apps/dm_new/public/images/landing/cases/treated_water_region.png rename to apps/dm/public/images/landing/cases/treated_water_region.png diff --git a/apps/dm_new/public/images/landing/cases/treated_water_usage.png b/apps/dm/public/images/landing/cases/treated_water_usage.png similarity index 100% rename from apps/dm_new/public/images/landing/cases/treated_water_usage.png rename to apps/dm/public/images/landing/cases/treated_water_usage.png diff --git a/apps/dm_new/public/images/landing/cases/treated_water_year.png b/apps/dm/public/images/landing/cases/treated_water_year.png similarity index 100% rename from apps/dm_new/public/images/landing/cases/treated_water_year.png rename to apps/dm/public/images/landing/cases/treated_water_year.png diff --git a/apps/dm_new/public/images/landing/drop_arrow.svg b/apps/dm/public/images/landing/drop_arrow.svg similarity index 100% rename from apps/dm_new/public/images/landing/drop_arrow.svg rename to apps/dm/public/images/landing/drop_arrow.svg diff --git a/apps/dm_new/public/images/landing/eu_01.png b/apps/dm/public/images/landing/eu_01.png similarity index 100% rename from apps/dm_new/public/images/landing/eu_01.png rename to apps/dm/public/images/landing/eu_01.png diff --git a/apps/dm_new/public/images/landing/hero_bg.jpg b/apps/dm/public/images/landing/hero_bg.jpg similarity index 100% rename from apps/dm_new/public/images/landing/hero_bg.jpg rename to apps/dm/public/images/landing/hero_bg.jpg diff --git a/apps/dm_new/public/images/landing/icon_left_arrow.png b/apps/dm/public/images/landing/icon_left_arrow.png similarity index 100% rename from apps/dm_new/public/images/landing/icon_left_arrow.png rename to apps/dm/public/images/landing/icon_left_arrow.png diff --git a/apps/dm_new/public/images/landing/icon_login.png b/apps/dm/public/images/landing/icon_login.png similarity index 100% rename from apps/dm_new/public/images/landing/icon_login.png rename to apps/dm/public/images/landing/icon_login.png diff --git a/apps/dm_new/public/images/landing/icon_logout.png b/apps/dm/public/images/landing/icon_logout.png similarity index 100% rename from apps/dm_new/public/images/landing/icon_logout.png rename to apps/dm/public/images/landing/icon_logout.png diff --git a/apps/dm_new/public/images/landing/icon_right_arrow.png b/apps/dm/public/images/landing/icon_right_arrow.png similarity index 100% rename from apps/dm_new/public/images/landing/icon_right_arrow.png rename to apps/dm/public/images/landing/icon_right_arrow.png diff --git a/apps/dm_new/public/images/landing/intro/domestic_textbox.png b/apps/dm/public/images/landing/intro/domestic_textbox.png similarity index 100% rename from apps/dm_new/public/images/landing/intro/domestic_textbox.png rename to apps/dm/public/images/landing/intro/domestic_textbox.png diff --git a/apps/dm_new/public/images/landing/intro/greywater_intro.png b/apps/dm/public/images/landing/intro/greywater_intro.png similarity index 100% rename from apps/dm_new/public/images/landing/intro/greywater_intro.png rename to apps/dm/public/images/landing/intro/greywater_intro.png diff --git a/apps/dm_new/public/images/landing/intro/greywater_mandatory.png b/apps/dm/public/images/landing/intro/greywater_mandatory.png similarity index 100% rename from apps/dm_new/public/images/landing/intro/greywater_mandatory.png rename to apps/dm/public/images/landing/intro/greywater_mandatory.png diff --git a/apps/dm_new/public/images/landing/intro/greywater_standard.png b/apps/dm/public/images/landing/intro/greywater_standard.png similarity index 100% rename from apps/dm_new/public/images/landing/intro/greywater_standard.png rename to apps/dm/public/images/landing/intro/greywater_standard.png diff --git a/apps/dm_new/public/images/landing/intro/law_timeline.png b/apps/dm/public/images/landing/intro/law_timeline.png similarity index 100% rename from apps/dm_new/public/images/landing/intro/law_timeline.png rename to apps/dm/public/images/landing/intro/law_timeline.png diff --git a/apps/dm_new/public/images/landing/intro/linkage.png b/apps/dm/public/images/landing/intro/linkage.png similarity index 100% rename from apps/dm_new/public/images/landing/intro/linkage.png rename to apps/dm/public/images/landing/intro/linkage.png diff --git a/apps/dm_new/public/images/landing/intro/performance_left.png b/apps/dm/public/images/landing/intro/performance_left.png similarity index 100% rename from apps/dm_new/public/images/landing/intro/performance_left.png rename to apps/dm/public/images/landing/intro/performance_left.png diff --git a/apps/dm_new/public/images/landing/intro/policy_timeline.png b/apps/dm/public/images/landing/intro/policy_timeline.png similarity index 100% rename from apps/dm_new/public/images/landing/intro/policy_timeline.png rename to apps/dm/public/images/landing/intro/policy_timeline.png diff --git a/apps/dm_new/public/images/landing/intro/rainreuse_intro.png b/apps/dm/public/images/landing/intro/rainreuse_intro.png similarity index 100% rename from apps/dm_new/public/images/landing/intro/rainreuse_intro.png rename to apps/dm/public/images/landing/intro/rainreuse_intro.png diff --git a/apps/dm_new/public/images/landing/intro/rainreuse_mandatory.png b/apps/dm/public/images/landing/intro/rainreuse_mandatory.png similarity index 100% rename from apps/dm_new/public/images/landing/intro/rainreuse_mandatory.png rename to apps/dm/public/images/landing/intro/rainreuse_mandatory.png diff --git a/apps/dm_new/public/images/landing/intro/rainwater_design.png b/apps/dm/public/images/landing/intro/rainwater_design.png similarity index 100% rename from apps/dm_new/public/images/landing/intro/rainwater_design.png rename to apps/dm/public/images/landing/intro/rainwater_design.png diff --git a/apps/dm_new/public/images/landing/intro/rainwater_standards.png b/apps/dm/public/images/landing/intro/rainwater_standards.png similarity index 100% rename from apps/dm_new/public/images/landing/intro/rainwater_standards.png rename to apps/dm/public/images/landing/intro/rainwater_standards.png diff --git a/apps/dm_new/public/images/landing/intro/rel_note.png b/apps/dm/public/images/landing/intro/rel_note.png similarity index 100% rename from apps/dm_new/public/images/landing/intro/rel_note.png rename to apps/dm/public/images/landing/intro/rel_note.png diff --git a/apps/dm_new/public/images/landing/intro/treatedwater_intro.png b/apps/dm/public/images/landing/intro/treatedwater_intro.png similarity index 100% rename from apps/dm_new/public/images/landing/intro/treatedwater_intro.png rename to apps/dm/public/images/landing/intro/treatedwater_intro.png diff --git a/apps/dm_new/public/images/landing/intro/treatedwater_mandatory.png b/apps/dm/public/images/landing/intro/treatedwater_mandatory.png similarity index 100% rename from apps/dm_new/public/images/landing/intro/treatedwater_mandatory.png rename to apps/dm/public/images/landing/intro/treatedwater_mandatory.png diff --git a/apps/dm_new/public/images/landing/logo.png b/apps/dm/public/images/landing/logo.png similarity index 100% rename from apps/dm_new/public/images/landing/logo.png rename to apps/dm/public/images/landing/logo.png diff --git a/apps/dm_new/public/images/landing/overview_01.png b/apps/dm/public/images/landing/overview_01.png similarity index 100% rename from apps/dm_new/public/images/landing/overview_01.png rename to apps/dm/public/images/landing/overview_01.png diff --git a/apps/dm_new/public/images/landing/rain_01.png b/apps/dm/public/images/landing/rain_01.png similarity index 100% rename from apps/dm_new/public/images/landing/rain_01.png rename to apps/dm/public/images/landing/rain_01.png diff --git a/apps/dm_new/public/images/landing/scroll_down.svg b/apps/dm/public/images/landing/scroll_down.svg similarity index 100% rename from apps/dm_new/public/images/landing/scroll_down.svg rename to apps/dm/public/images/landing/scroll_down.svg diff --git a/apps/dm_new/public/images/landing/section_03.png b/apps/dm/public/images/landing/section_03.png similarity index 100% rename from apps/dm_new/public/images/landing/section_03.png rename to apps/dm/public/images/landing/section_03.png diff --git a/apps/dm_new/public/images/landing/sewage_01.png b/apps/dm/public/images/landing/sewage_01.png similarity index 100% rename from apps/dm_new/public/images/landing/sewage_01.png rename to apps/dm/public/images/landing/sewage_01.png diff --git a/apps/dm_new/public/images/landing/sewage_02.png b/apps/dm/public/images/landing/sewage_02.png similarity index 100% rename from apps/dm_new/public/images/landing/sewage_02.png rename to apps/dm/public/images/landing/sewage_02.png diff --git a/apps/dm_new/public/images/landing/sewage_03.png b/apps/dm/public/images/landing/sewage_03.png similarity index 100% rename from apps/dm_new/public/images/landing/sewage_03.png rename to apps/dm/public/images/landing/sewage_03.png diff --git a/apps/dm_new/public/images/landing/sewage_04.png b/apps/dm/public/images/landing/sewage_04.png similarity index 100% rename from apps/dm_new/public/images/landing/sewage_04.png rename to apps/dm/public/images/landing/sewage_04.png diff --git a/apps/dm_new/public/images/landing/sewage_05.png b/apps/dm/public/images/landing/sewage_05.png similarity index 100% rename from apps/dm_new/public/images/landing/sewage_05.png rename to apps/dm/public/images/landing/sewage_05.png diff --git a/apps/dm_new/public/images/landing/sewage_06.png b/apps/dm/public/images/landing/sewage_06.png similarity index 100% rename from apps/dm_new/public/images/landing/sewage_06.png rename to apps/dm/public/images/landing/sewage_06.png diff --git a/apps/dm_new/public/images/landing/singapore_01.png b/apps/dm/public/images/landing/singapore_01.png similarity index 100% rename from apps/dm_new/public/images/landing/singapore_01.png rename to apps/dm/public/images/landing/singapore_01.png diff --git a/apps/dm_new/public/images/landing/taiwan_01.png b/apps/dm/public/images/landing/taiwan_01.png similarity index 100% rename from apps/dm_new/public/images/landing/taiwan_01.png rename to apps/dm/public/images/landing/taiwan_01.png diff --git a/apps/dm_new/public/images/landing/water_quality_ref_1.png b/apps/dm/public/images/landing/water_quality_ref_1.png similarity index 100% rename from apps/dm_new/public/images/landing/water_quality_ref_1.png rename to apps/dm/public/images/landing/water_quality_ref_1.png diff --git a/apps/dm/public/img/wrAbout/icon_01.png b/apps/dm/public/img/wrAbout/icon_01.png deleted file mode 100644 index 30eff5745..000000000 Binary files a/apps/dm/public/img/wrAbout/icon_01.png and /dev/null differ diff --git a/apps/dm/public/img/wrAbout/icon_02.png b/apps/dm/public/img/wrAbout/icon_02.png deleted file mode 100644 index 36401729f..000000000 Binary files a/apps/dm/public/img/wrAbout/icon_02.png and /dev/null differ diff --git a/apps/dm/public/img/wrAbout/icon_03.png b/apps/dm/public/img/wrAbout/icon_03.png deleted file mode 100644 index 87f48c444..000000000 Binary files a/apps/dm/public/img/wrAbout/icon_03.png and /dev/null differ diff --git a/apps/dm/public/img/wrAbout/img_01_1.png b/apps/dm/public/img/wrAbout/img_01_1.png deleted file mode 100644 index 9aab4e824..000000000 Binary files a/apps/dm/public/img/wrAbout/img_01_1.png and /dev/null differ diff --git a/apps/dm/public/img/wrAbout/img_02_1.png b/apps/dm/public/img/wrAbout/img_02_1.png deleted file mode 100644 index aa1c8ee5a..000000000 Binary files a/apps/dm/public/img/wrAbout/img_02_1.png and /dev/null differ diff --git a/apps/dm/public/img/wrAbout/img_02_2.png b/apps/dm/public/img/wrAbout/img_02_2.png deleted file mode 100644 index c8283053e..000000000 Binary files a/apps/dm/public/img/wrAbout/img_02_2.png and /dev/null differ diff --git a/apps/dm/public/img/wrAbout/img_02_3.png b/apps/dm/public/img/wrAbout/img_02_3.png deleted file mode 100644 index f5ba9d81e..000000000 Binary files a/apps/dm/public/img/wrAbout/img_02_3.png and /dev/null differ diff --git a/apps/dm/public/img/wrAbout/img_03_1.png b/apps/dm/public/img/wrAbout/img_03_1.png deleted file mode 100644 index a7534ae68..000000000 Binary files a/apps/dm/public/img/wrAbout/img_03_1.png and /dev/null differ diff --git a/apps/dm/public/img/wrAbout/img_03_2.png b/apps/dm/public/img/wrAbout/img_03_2.png deleted file mode 100644 index 6b4faca7d..000000000 Binary files a/apps/dm/public/img/wrAbout/img_03_2.png and /dev/null differ diff --git a/apps/dm/public/img/wrAbout/img_04_1.png b/apps/dm/public/img/wrAbout/img_04_1.png deleted file mode 100644 index a160072bd..000000000 Binary files a/apps/dm/public/img/wrAbout/img_04_1.png and /dev/null differ diff --git a/apps/dm/public/img/wrAbout/img_04_2.png b/apps/dm/public/img/wrAbout/img_04_2.png deleted file mode 100644 index 374fc55bf..000000000 Binary files a/apps/dm/public/img/wrAbout/img_04_2.png and /dev/null differ diff --git a/apps/dm/public/img/wrAbout/img_05_1.png b/apps/dm/public/img/wrAbout/img_05_1.png deleted file mode 100644 index 1418fa92d..000000000 Binary files a/apps/dm/public/img/wrAbout/img_05_1.png and /dev/null differ diff --git a/apps/dm/public/img/wrAbout/img_05_2.png b/apps/dm/public/img/wrAbout/img_05_2.png deleted file mode 100644 index 0c2f92396..000000000 Binary files a/apps/dm/public/img/wrAbout/img_05_2.png and /dev/null differ diff --git a/apps/dm/public/img/wrAbout/img_06_1.png b/apps/dm/public/img/wrAbout/img_06_1.png deleted file mode 100644 index 08acf4971..000000000 Binary files a/apps/dm/public/img/wrAbout/img_06_1.png and /dev/null differ diff --git a/apps/dm/public/img/wrAbout/img_06_2.png b/apps/dm/public/img/wrAbout/img_06_2.png deleted file mode 100644 index 19b150b7c..000000000 Binary files a/apps/dm/public/img/wrAbout/img_06_2.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/icon_01.png b/apps/dm/public/img/wrExample/icon_01.png deleted file mode 100644 index 30eff5745..000000000 Binary files a/apps/dm/public/img/wrExample/icon_01.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/icon_02.png b/apps/dm/public/img/wrExample/icon_02.png deleted file mode 100644 index 36401729f..000000000 Binary files a/apps/dm/public/img/wrExample/icon_02.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/icon_03.png b/apps/dm/public/img/wrExample/icon_03.png deleted file mode 100644 index 87f48c444..000000000 Binary files a/apps/dm/public/img/wrExample/icon_03.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_01_1.png b/apps/dm/public/img/wrExample/img_01_1.png deleted file mode 100644 index 9aab4e824..000000000 Binary files a/apps/dm/public/img/wrExample/img_01_1.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_02_1.png b/apps/dm/public/img/wrExample/img_02_1.png deleted file mode 100644 index 3d61c6e5d..000000000 Binary files a/apps/dm/public/img/wrExample/img_02_1.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_02_2.png b/apps/dm/public/img/wrExample/img_02_2.png deleted file mode 100644 index c8283053e..000000000 Binary files a/apps/dm/public/img/wrExample/img_02_2.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_02_3.png b/apps/dm/public/img/wrExample/img_02_3.png deleted file mode 100644 index f5ba9d81e..000000000 Binary files a/apps/dm/public/img/wrExample/img_02_3.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_03_1.png b/apps/dm/public/img/wrExample/img_03_1.png deleted file mode 100644 index a7534ae68..000000000 Binary files a/apps/dm/public/img/wrExample/img_03_1.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_03_2.png b/apps/dm/public/img/wrExample/img_03_2.png deleted file mode 100644 index 6b4faca7d..000000000 Binary files a/apps/dm/public/img/wrExample/img_03_2.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_04_1.png b/apps/dm/public/img/wrExample/img_04_1.png deleted file mode 100644 index a160072bd..000000000 Binary files a/apps/dm/public/img/wrExample/img_04_1.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_04_2.png b/apps/dm/public/img/wrExample/img_04_2.png deleted file mode 100644 index 374fc55bf..000000000 Binary files a/apps/dm/public/img/wrExample/img_04_2.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_05_1.png b/apps/dm/public/img/wrExample/img_05_1.png deleted file mode 100644 index 1418fa92d..000000000 Binary files a/apps/dm/public/img/wrExample/img_05_1.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_05_2.png b/apps/dm/public/img/wrExample/img_05_2.png deleted file mode 100644 index 0c2f92396..000000000 Binary files a/apps/dm/public/img/wrExample/img_05_2.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_06_1.png b/apps/dm/public/img/wrExample/img_06_1.png deleted file mode 100644 index 08acf4971..000000000 Binary files a/apps/dm/public/img/wrExample/img_06_1.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_06_2.png b/apps/dm/public/img/wrExample/img_06_2.png deleted file mode 100644 index 19b150b7c..000000000 Binary files a/apps/dm/public/img/wrExample/img_06_2.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_arrow_down_1.png b/apps/dm/public/img/wrExample/img_arrow_down_1.png deleted file mode 100644 index 9e8fb76c6..000000000 Binary files a/apps/dm/public/img/wrExample/img_arrow_down_1.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_arrow_down_2.png b/apps/dm/public/img/wrExample/img_arrow_down_2.png deleted file mode 100644 index 2002bb607..000000000 Binary files a/apps/dm/public/img/wrExample/img_arrow_down_2.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_ex_01_1.png b/apps/dm/public/img/wrExample/img_ex_01_1.png deleted file mode 100644 index 9d6bfb002..000000000 Binary files a/apps/dm/public/img/wrExample/img_ex_01_1.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_ex_02_1.png b/apps/dm/public/img/wrExample/img_ex_02_1.png deleted file mode 100644 index 70c1f8ed2..000000000 Binary files a/apps/dm/public/img/wrExample/img_ex_02_1.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_ex_03_1.png b/apps/dm/public/img/wrExample/img_ex_03_1.png deleted file mode 100644 index c981fa9fb..000000000 Binary files a/apps/dm/public/img/wrExample/img_ex_03_1.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_ex_04_1.png b/apps/dm/public/img/wrExample/img_ex_04_1.png deleted file mode 100644 index f5547820e..000000000 Binary files a/apps/dm/public/img/wrExample/img_ex_04_1.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_ex_04_2.png b/apps/dm/public/img/wrExample/img_ex_04_2.png deleted file mode 100644 index b102942ee..000000000 Binary files a/apps/dm/public/img/wrExample/img_ex_04_2.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_ex_04_3.png b/apps/dm/public/img/wrExample/img_ex_04_3.png deleted file mode 100644 index 50ca8045f..000000000 Binary files a/apps/dm/public/img/wrExample/img_ex_04_3.png and /dev/null differ diff --git a/apps/dm/public/img/wrExample/img_ex_04_4.png b/apps/dm/public/img/wrExample/img_ex_04_4.png deleted file mode 100644 index 6e6d0c294..000000000 Binary files a/apps/dm/public/img/wrExample/img_ex_04_4.png and /dev/null differ diff --git a/apps/dm/public/img/wrOverview/img_ov_01_1.png b/apps/dm/public/img/wrOverview/img_ov_01_1.png deleted file mode 100644 index e59a10192..000000000 Binary files a/apps/dm/public/img/wrOverview/img_ov_01_1.png and /dev/null differ diff --git a/apps/dm/public/img/wrStatus/icon_favorit_off.png b/apps/dm/public/img/wrStatus/icon_favorit_off.png deleted file mode 100644 index 4de0b3ebc..000000000 Binary files a/apps/dm/public/img/wrStatus/icon_favorit_off.png and /dev/null differ diff --git a/apps/dm/public/img/wrStatus/icon_favorit_on.png b/apps/dm/public/img/wrStatus/icon_favorit_on.png deleted file mode 100644 index f2edfa4e9..000000000 Binary files a/apps/dm/public/img/wrStatus/icon_favorit_on.png and /dev/null differ diff --git a/apps/dm/public/img/wrStatus/icon_right.png b/apps/dm/public/img/wrStatus/icon_right.png deleted file mode 100644 index fef56226c..000000000 Binary files a/apps/dm/public/img/wrStatus/icon_right.png and /dev/null differ diff --git a/apps/dm/public/img/wrStatus/southKoreaMap.svg b/apps/dm/public/img/wrStatus/southKoreaMap.svg deleted file mode 100644 index 7b3c170e3..000000000 --- a/apps/dm/public/img/wrStatus/southKoreaMap.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/apps/dm/public/next.svg b/apps/dm/public/next.svg deleted file mode 100644 index 5174b28c5..000000000 --- a/apps/dm/public/next.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/apps/dm/public/vercel.svg b/apps/dm/public/vercel.svg deleted file mode 100644 index 770539603..000000000 --- a/apps/dm/public/vercel.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/apps/dm/public/window.svg b/apps/dm/public/window.svg deleted file mode 100644 index b2b2a44f6..000000000 --- a/apps/dm/public/window.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/apps/dm/src/shared/lib/index.ts b/apps/dm/src/shared/lib/index.ts index a5679f1b5..c9cff1a80 100644 --- a/apps/dm/src/shared/lib/index.ts +++ b/apps/dm/src/shared/lib/index.ts @@ -2,7 +2,7 @@ export { getCookie, setCookie, removeCookie } from "./cookie"; // export { useMutationWrapper } from "./use-mutation-wrapper"; // export { useAlertStore } from "./use-alert-store"; // export { useDataTable } from "./use-data-table"; -// export { useMenuStore } from "./use-menu-store"; +export { useMenuStore } from "./use-menu-store"; // export { useUserStore } from "./use-user-store"; // export { usePrompt } from "./use-prompt"; // export { useSelectPrompt } from "./use-select-prompt"; diff --git a/apps/dm_new/src/shared/lib/use-menu-store.ts b/apps/dm/src/shared/lib/use-menu-store.ts similarity index 100% rename from apps/dm_new/src/shared/lib/use-menu-store.ts rename to apps/dm/src/shared/lib/use-menu-store.ts diff --git a/apps/dm_new/src/shared/providers/index.ts b/apps/dm/src/shared/providers/index.ts similarity index 100% rename from apps/dm_new/src/shared/providers/index.ts rename to apps/dm/src/shared/providers/index.ts diff --git a/apps/dm_new/src/shared/providers/prompt-provider.tsx b/apps/dm/src/shared/providers/prompt-provider.tsx similarity index 100% rename from apps/dm_new/src/shared/providers/prompt-provider.tsx rename to apps/dm/src/shared/providers/prompt-provider.tsx diff --git a/apps/dm_new/src/shared/providers/store-provider.tsx b/apps/dm/src/shared/providers/store-provider.tsx similarity index 100% rename from apps/dm_new/src/shared/providers/store-provider.tsx rename to apps/dm/src/shared/providers/store-provider.tsx diff --git a/apps/dm_new/src/shared/store/alert-store.ts b/apps/dm/src/shared/store/alert-store.ts similarity index 100% rename from apps/dm_new/src/shared/store/alert-store.ts rename to apps/dm/src/shared/store/alert-store.ts diff --git a/apps/dm_new/src/shared/store/attachment-store.ts b/apps/dm/src/shared/store/attachment-store.ts similarity index 100% rename from apps/dm_new/src/shared/store/attachment-store.ts rename to apps/dm/src/shared/store/attachment-store.ts diff --git a/apps/dm_new/src/shared/store/index.ts b/apps/dm/src/shared/store/index.ts similarity index 100% rename from apps/dm_new/src/shared/store/index.ts rename to apps/dm/src/shared/store/index.ts diff --git a/apps/dm_new/src/shared/store/menu-store.ts b/apps/dm/src/shared/store/menu-store.ts similarity index 100% rename from apps/dm_new/src/shared/store/menu-store.ts rename to apps/dm/src/shared/store/menu-store.ts diff --git a/apps/dm_new/src/shared/store/user-store.ts b/apps/dm/src/shared/store/user-store.ts similarity index 100% rename from apps/dm_new/src/shared/store/user-store.ts rename to apps/dm/src/shared/store/user-store.ts diff --git a/apps/dm/tsconfig.json b/apps/dm/tsconfig.json index 493584782..ba8cd2c2f 100644 --- a/apps/dm/tsconfig.json +++ b/apps/dm/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/types/style.d.ts similarity index 100% rename from apps/dm_new/types/style.d.ts rename to apps/dm/types/style.d.ts diff --git a/apps/dm_new/.env.local b/apps/dm_new/.env.local deleted file mode 100644 index 58001643c..000000000 --- a/apps/dm_new/.env.local +++ /dev/null @@ -1,26 +0,0 @@ -NEXT_PUBLIC_SITE_ID = DN -NEXT_PUBLIC_PORT = 3015 -NEXT_PUBLIC_CLAIM_NAME = Authorization -NEXT_PUBLIC_AUTH_USER_ID = token-id -NEXT_PUBLIC_ACCESS_TOKEN = access-token -NEXT_PUBLIC_REFRESH_TOKEN = refresh-token -NEXT_PUBLIC_PROXY_HOST = http://localhost:3005 -NEXT_PUBLIC_CM_LOGIN_PAGE_URL = http://dev.onasys.co.kr:3000/auth/login -NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000 -NEXT_PUBLIC_CS_SERVER_API_URL = http://dev.onasys.co.kr:8000 -NEXT_PUBLIC_DM_SERVER_API_URL = http://con.mind-one.co.kr:11083/reuse-service/api/v1 -# NEXT_PUBLIC_FO_SERVER_API_URL = http://192.168.1.222:8883/operation-service/api/v1 -NEXT_PUBLIC_FO_SERVER_API_URL = http://con.mind-one.co.kr:11083/operation-service/api/v1 -NEXT_PUBLIC_WR_SERVER_API_URL = http://con.mind-one.co.kr:11083/reuse-service/api/v1 -NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver -NEXT_PUBLIC_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver -NEXT_PUBLIC_CS_TUS_UPLOAD = /attach-service/api/v1/tus/upload -NEXT_PUBLIC_NGII_URL = https://map.ngii.go.kr -NEXT_PUBLIC_NGII_PARAM = 04trYP9_xwLAfALjwZ-B8g&service=WMTS&request=GetTile&version=1.0.0&format=image/png&layer=korean_map&style=korean&tilematrixset=korean&tilematrix={z}&tilecol={x}&tilerow={y} -NEXT_PUBLIC_GATEWAY_URL=http://con.mind-one.co.kr:11083 # 개발 서버 API -#NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.128:8883/sewerage-service/api # 최용성 -#NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.66:8883/sewerage-service/api # 박이정 - - -NEXT_PUBLIC_FINDADRESS_URL=https://business.juso.go.kr/addrlink/addrLinkApi.do -NEXT_PRIVATE_WR_ADDRESS_KEY = devU01TX0FVVEgyMDI1MDgyNTEwMzkwNDExNjEwNTM= diff --git a/apps/dm_new/.env.mindone b/apps/dm_new/.env.mindone deleted file mode 100644 index 9a5005d2b..000000000 --- a/apps/dm_new/.env.mindone +++ /dev/null @@ -1,26 +0,0 @@ -NEXT_PUBLIC_SITE_ID = DN -NEXT_PUBLIC_PORT = 11315 -NEXT_PUBLIC_CLAIM_NAME = Authorization -NEXT_PUBLIC_AUTH_USER_ID = token-id -NEXT_PUBLIC_ACCESS_TOKEN = access-token -NEXT_PUBLIC_REFRESH_TOKEN = refresh-token -NEXT_PUBLIC_PROXY_HOST = http://con.mind-one.co.kr:11315 -NEXT_PUBLIC_CM_LOGIN_PAGE_URL = http://dev.onasys.co.kr:3000/auth/login -NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000 -NEXT_PUBLIC_CS_SERVER_API_URL = http://dev.onasys.co.kr:8000 -NEXT_PUBLIC_DM_SERVER_API_URL = http://con.mind-one.co.kr:11083/reuse-service/api/v1 -NEXT_PUBLIC_FO_SERVER_API_URL = http://con.mind-one.co.kr:11083/operation-service/api/v1 -NEXT_PUBLIC_WR_SERVER_API_URL = http://con.mind-one.co.kr:11083/reuse-service/api/v1 -#NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver -#NEXT_PUBLIC_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver -NEXT_PUBLIC_CS_TUS_UPLOAD = /attach-service/api/v1/tus/upload -NEXT_PUBLIC_NGII_URL = https://map.ngii.go.kr -NEXT_PUBLIC_NGII_PARAM = 04trYP9_xwLAfALjwZ-B8g&service=WMTS&request=GetTile&version=1.0.0&format=image/png&layer=korean_map&style=korean&tilematrixset=korean&tilematrix={z}&tilecol={x}&tilerow={y} -NEXT_PUBLIC_SEWERAGE_API_URL=http://con.mind-one.co.kr:11083/sewerage-service # 개발 서버 API -NEXT_PUBLIC_GATEWAY_URL=http://con.mind-one.co.kr:11083 # 개발 서버 API -# NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.128:8883/sewerage-service/api # 최용성 -#NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.66:8883/sewerage-service/api # 박이정 - - -NEXT_PUBLIC_FINDADRESS_URL=https://business.juso.go.kr/addrlink/addrLinkApi.do -NEXT_PRIVATE_WR_ADDRESS_KEY = devU01TX0FVVEgyMDI1MDgyNTEwMzkwNDExNjEwNTM= diff --git a/apps/dm_new/.env.production b/apps/dm_new/.env.production deleted file mode 100644 index b413d1312..000000000 --- a/apps/dm_new/.env.production +++ /dev/null @@ -1,24 +0,0 @@ -# 공단 운영 -NEXT_PUBLIC_SITE_ID = DN -NEXT_PUBLIC_PORT = 3000 -NEXT_PUBLIC_CLAIM_NAME = Authorization -NEXT_PUBLIC_AUTH_USER_ID = token-id -NEXT_PUBLIC_ACCESS_TOKEN = access-token -NEXT_PUBLIC_REFRESH_TOKEN = refresh-token -#NEXT_PUBLIC_PROXY_HOST = https://devreuse.hasuon.or.kr -#NEXT_PUBLIC_CM_LOGIN_PAGE_URL = https://devqueen.hasuon.or.kr/auth/login -NEXT_PUBLIC_SERVER_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000 -NEXT_PUBLIC_CS_SERVER_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000 -NEXT_PUBLIC_FO_SERVER_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000/operation-service/api/v1 -NEXT_PUBLIC_WR_SERVER_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000/reuse-service/api/v1 -NEXT_PUBLIC_GEOSERVER_URL = http://172.29.143.87:8080/geoserver -NEXT_PUBLIC_LX_GEOSERVER_URL = http://172.29.143.87:8080/geoserver_swl -NEXT_PUBLIC_CS_TUS_UPLOAD = /attach-service/api/v1/tus/upload -NEXT_PUBLIC_SEWERAGE_API_URL = http://apigateway.iipbs-was.svc.cluster.local:8000/sewerage-service -NEXT_PUBLIC_NGII_URL = http://172.29.143.87/poiact -NEXT_PUBLIC_NGII_PARAM = BDE2BEF39DAFEC293AB6730150F222AC&service=WMTS&request=GetTile&version=1.0.0&format=image/png&layer=korean_map&style=korean&tilematrixset=korean&tilematrix={z}&tilecol={y}&tilerow={x} -NEXT_PUBLIC_GATEWAY_URL = http://apigateway.iipbs-was.svc.cluster.local:8000 - - -NEXT_PUBLIC_FINDADRESS_URL=https://business.juso.go.kr/addrlink/addrLinkApi.do -NEXT_PRIVATE_WR_ADDRESS_KEY = U01TXOFVVEgyMDI1MDgyODE0MTAxNzExNjEyMjA= diff --git a/apps/dm_new/AGENTS.md b/apps/dm_new/AGENTS.md deleted file mode 100644 index 7eefb1676..000000000 --- a/apps/dm_new/AGENTS.md +++ /dev/null @@ -1,38 +0,0 @@ -## Project -This repository contains a Next.js web application. - -Main technologies: -- Next.js -- TypeScript -- pnpm workspace -- turborepo - -이 저장소는 pnpm workspace + Turborepo 기반 monorepo이다. - -- 워크스페이스 범위는 `apps/*`, `apps/common/*`, `packages/*`, `packages/common/*` -- 루트 스크립트는 `turbo run build`, `turbo run dev` 를 사용한다 -- `build` 작업은 의존 패키지의 `build` 를 먼저 수행한다 (`dependsOn: ["^build"]`) -- `dev` 는 캐시하지 않는 지속 실행 작업이다 -- 변경 범위만 선택 실행할 수 있으므로, 전체 빌드보다 `--filter` 사용을 우선한다 - -## Encoding -- UTF-8 -- 한글이 깨지지 않도록 주의할 것 - -## 주석 comment -- 한글 주석을 삭제하지 말 것 - -## Monorepo structure -apps/ - _template - as - cm - cs - dc - dm - dm_new - fo - sn - st - wr - diff --git a/apps/dm_new/app/(popup-layout)/layout.tsx b/apps/dm_new/app/(popup-layout)/layout.tsx deleted file mode 100644 index 742519a66..000000000 --- a/apps/dm_new/app/(popup-layout)/layout.tsx +++ /dev/null @@ -1,11 +0,0 @@ -"use client"; -import "../globals.css"; -import { StoreProvider } from "../store"; - -export default function PopupLayout({ - children, -}: Readonly<{ - children: React.ReactNode; -}>) { - return {children}; -} diff --git a/apps/dm_new/app/(popup-layout)/map/popup/page.tsx b/apps/dm_new/app/(popup-layout)/map/popup/page.tsx deleted file mode 100644 index 1c625bcac..000000000 --- a/apps/dm_new/app/(popup-layout)/map/popup/page.tsx +++ /dev/null @@ -1,352 +0,0 @@ -"use client"; - -import Gis from "@common/business_components/ui/map/Gis"; -import { useEffect, useRef, useState } from "react"; -import { mapService } from "../service"; -import GisApp from "@common/business_components/ui/map/lib/gis.core"; -import { SearchBar } from "@/components/ui/map/searchBar/searchBar"; -import SelectedFcltList from "./selectedFcltList"; -import type { SubsInfo } from "@/app/store/map/type"; - -const Map = () => { - const [treeData, setTreeData] = useState([]); // 초기값을 객체 또는 null로 설정 - const gisMaps = useRef(null); - const [isOpen, setIsOpen] = useState(false); // 팝업 열기/닫기 상태 - const [isSearchModalOpen, setIsSearchModalOpen] = useState(true); // SearchModal 열림 상태 - const [featureData, setFeatureData] = useState(null); // 선택된 피쳐 데이터 - const [selectDataPk, setSelectDataPk] = useState>({}); - const [selectedFclts, setSelectedFclts] = useState([]); - - //적용 버튼 클릭 이벤트 - const onApply = () => { - if (selectedFclts.length > 3) { - alert("재이용시설 후보지는 최대 3개까지만 선택할 수 있습니다."); - return; - } - - const subsInfoList: SubsInfo[] = selectedFclts.map((fclt) => ({ - ruseUtztnFcltNm: fclt.ruseUtztnFcltNm, - ruseUtztnFcltCd: fclt.pbnstRuseFcltId, - })); - - if (!window.opener || typeof window.opener.postMessage !== "function") { - alert("부모 창을 찾을 수 없습니다. 팝업이 'noopener'로 열렸거나, 보안 정책으로 차단되었을 수 있어요."); - return; - } - - window.opener.postMessage( - { - type: "SET_SUBS_INFO", - payload: subsInfoList, // 배열로 전송 (최대 3개) - }, - "*" - ); - - window.close(); - }; - - //트리 레이어 데이터 조회 - const fetchData = async () => { - try { - const response = await mapService.getLyrStngs(); - setTreeData(response); // API 응답 저장 - } catch (error) { - console.error("데이터 불러오기 실패:", error); - } - }; - - //하수처리시설코드로 재이용시설 목록 조회 - const reuseData = async (ruseFcltPk: any) => { - if (!ruseFcltPk) { - console.warn("[reuseData] ruseFcltPk가 없습니다."); - return; - } - try { - console.log("[reuseData] API 호출 - ruseFcltPk:", ruseFcltPk); - const response = await mapService.getPbnstRuseFclts(ruseFcltPk); - console.log("[reuseData] API 응답 전체:", response); - // 응답이 배열이면 바로 사용, 객체면 .data 추출 - const data = Array.isArray(response) - ? response - : Array.isArray(response?.data) - ? response.data - : response?.data - ? [response.data] - : []; - console.log("[reuseData] 파싱된 data:", data); - setSelectedFclts((prev) => { - const newItems = data.filter( - (item: any) => - item && - Object.keys(item).length > 0 && - !prev.some((f) => f.pbnstRuseFcltId === item.pbnstRuseFcltId) - ); - console.log("[reuseData] 추가될 newItems:", newItems); - return [...prev, ...newItems]; - }); - } catch (error) { - console.error("데이터 불러오기 실패:", error); - } - }; - - // 컴포넌트 마운트 시 1회 실행 - useEffect(() => { - fetchData(); - }, []); - - // 부모창에 초기 선택값 요청 (팝업 열릴 때 기존 선택 목록 받아오기) - useEffect(() => { - const origin = window.location.origin; - if (window.opener) { - window.opener.postMessage({ type: "REQUEST_INIT_SUBS_INFO" }, origin); - } - }, []); - - // 부모창에서 초기 선택값 수신 - useEffect(() => { - const origin = window.location.origin; - - const handler = (event: MessageEvent) => { - if (event.origin !== origin) return; - - const data = event.data; - if (!data || typeof data !== "object") return; - - if (data.type === "INIT_SUBS_INFO") { - const list = Array.isArray(data.payload) ? data.payload : []; - setSelectedFclts( - list.map((x) => ({ - ruseUtztnFcltNm: x.ruseUtztnFcltNm ?? "", - pbnstRuseFcltId: x.ruseUtztnFcltCd ?? "", - })) - ); - } - }; - - window.addEventListener("message", handler); - return () => window.removeEventListener("message", handler); - }, []); - - // 레이어 생성 후 초기화 처리 - const onCheckedLayersChange = () => { - //수요처 ID - const urlParams = new URLSearchParams(window.location.search); - const dmdInfoId = urlParams.get("dmdInfoId"); - console.log("[하이라이트] dmdInfoId:", dmdInfoId); - - //수요처 위치로 화면 이동 - const maps = gisMaps.current; - const layer = GisApp.Module.layer as any; - const layerNm = "tb_wr_ruse_fclt_dmd_co"; - const featureId = `${layerNm}.${dmdInfoId}`; - let foundFeature: any = null; - - // 현재 로드된 레이어 목록 출력 - const allLayerNames = maps - .getLayers() - .getArray() - .map((l: any) => l.get("lyrTyNm") || l.get("name") || "(unnamed)"); - console.log("[하이라이트] 전체 레이어 목록:", allLayerNames); - console.log("[하이라이트] 탐색 대상 레이어:", layerNm); - console.log("[하이라이트] 탐색 대상 featureId:", featureId); - - maps - .getLayers() - .getArray() - .forEach((layer: any) => { - if (layer.get("lyrTyNm") == layerNm) { - console.log("[하이라이트] 레이어 발견:", layerNm); - const source = layer.getSource?.(); - if (source?.getFeatureById) { - const feature = source.getFeatureById(String(featureId).trim()); - console.log("[하이라이트] feature 탐색결과:", feature); - if (feature) { - foundFeature = feature; - return; - } - // feature 못 찾을 때 소스 내 전체 feature ID 출력 - if (source?.getFeatures) { - const allIds = source.getFeatures().map((f: any) => f.getId()); - console.log("[하이라이트] 소스 내 전체 feature ID:", allIds); - } - } - } - }); - - if (!foundFeature) { - console.warn("[하이라이트] feature를 찾지 못했습니다. 위 레이어 목록/ID를 확인하세요."); - } - - if (foundFeature) { - const geometry = foundFeature.getGeometry(); - - if (geometry) { - const extent = geometry.getExtent(); - - if (geometry.getType() === "Point") { - maps.getView().setCenter(geometry.getCoordinates()); - maps.getView().setZoom(11); - } else { - maps.getView().fit(extent, { - duration: 300, - padding: [30, 30, 30, 30], - maxZoom: 16, - }); - } - } - - layer.highLightFeature( - [foundFeature], - { - id: GisApp.hlLayerId, - zIndex: 10, - opacity: 1, - selectable: true, - }, - { width: 30 } - ); - } else { - console.warn("수요처의 좌표정보를 찾을 수 없습니다. dmdInfoId:", dmdInfoId); - } - - const formatNumber = (val: any) => { - const num = Number(val); - return isNaN(num) ? "-" : num.toLocaleString(); - }; - - // 재이용시설 오버레이 - maps - .getLayers() - .getArray() - .forEach((layer: any) => { - if (layer.get("lyrTyNm") === "tb_wr_bdst_ruse_fclt") { - const source = layer.getSource?.(); - if (source?.getFeatures) { - const features = source.getFeatures(); - - features.forEach((feature: any) => { - // 필요한 고유 ID 또는 속성 가져오기 (예: ftrIdn 또는 feature.getId()) - const featureId = - feature.getId() || feature.get("ftrIdn") || Math.random(); - - // HTML 또는 React 오버레이 컴포넌트 구성 - const overlayContent = ` -
- -
- ${feature.get("swtrmt_fclt_nm") || "-"} -
- - - - - - - - - -
용량(m³/일)${formatNumber(feature.get("fclt_cpct"))}
-
- `; - feature.set("html", overlayContent); - feature.set("overLayId", `overLay.${featureId}`); - }); - } - } - }); - }; - - // 검색해서 재이용시설 선택하면 해당 시설로 화면 이동 처리 - useEffect(() => { - console.warn(selectDataPk); - if (!selectDataPk || Object.keys(selectDataPk).length === 0) return; - const maps = gisMaps.current; - let foundFeature: any = null; - const layerNm = "tb_wr_bdst_ruse_fclt"; - const featureId = `${layerNm}.${selectDataPk.bscFctCd}`; - maps - .getLayers() - .getArray() - .forEach((layer: any) => { - if (layer.get("lyrTyNm") == layerNm) { - const source = layer.getSource?.(); - if (source?.getFeatureById) { - const feature = source.getFeatureById(String(featureId).trim()); - if (feature) { - foundFeature = feature; - return; - } - } - } - }); - - if (foundFeature) { - const geometry = foundFeature.getGeometry(); - if (geometry) { - const extent = geometry.getExtent(); - - maps.getView().fit(extent, { - duration: 300, - padding: [50, 50, 50, 50], - maxZoom: 16, - constrainResolution: true, - nearest: true, - }); - } - } else { - console.warn("OpenLayers Feature를 찾을 수 없습니다:", selectDataPk); - } - }, [selectDataPk]); - - // 재이용시설 클릭 시 선택 시설목록에 추가 - const onFeatureSelect = (data: any) => { - // feature의 모든 속성 출력 (어떤 키가 있는지 확인) - const properties = data.getProperties?.() ?? {}; - console.log("[onFeatureSelect] feature 속성 전체:", properties); - // 처리시설코드 - const swtrmtFcltCd = data.get("swtrmt_fclt_cd"); - console.log("[onFeatureSelect] swtrmt_fclt_cd:", swtrmtFcltCd); - reuseData(swtrmtFcltCd); - }; - - return ( - <> -
- { - if (hasuPk) setSelectDataPk(hasuPk); - }} - onApply={onApply} - /> - } - waterDepth={undefined} - /> -
- setSelectedFclts(updatedList)} - /> - - ); -}; - -export default Map; diff --git a/apps/dm_new/app/(popup-layout)/map/popup/selectedFcltList.tsx b/apps/dm_new/app/(popup-layout)/map/popup/selectedFcltList.tsx deleted file mode 100644 index 5c742684f..000000000 --- a/apps/dm_new/app/(popup-layout)/map/popup/selectedFcltList.tsx +++ /dev/null @@ -1,75 +0,0 @@ -import React from "react"; - -type FcltItem = { - pbnstRuseFcltId: string; - ruseUtztnFcltNm: string; - splyExtraCpct?: number; - ruseCpct?: number; - [key: string]: any; -}; - -export default function SelectedFcltList({ - data = [], - onRemove, -}: { - data: FcltItem[]; - onRemove: (updatedList: FcltItem[]) => void; -}) { - const handleDelete = (code: string) => { - const updatedList = data.filter((item) => item.pbnstRuseFcltId !== code); - onRemove(updatedList); - }; - - const TableContent = ( - <> - - - 시설명 - - 처리량(㎥/일) - - - 재이용량(㎥/일) - - 삭제 - - - - {data.map((item) => ( - - {item.ruseUtztnFcltNm} - - {Number(item.splyExtraCpct || 0).toLocaleString()} - - - {Number(item.ruseCpct || 0).toLocaleString()} - - - - - - ))} - - - ); - - return ( -
-

- 선택된 시설 -

-
- - {TableContent} -
-
-
- ); -} diff --git a/apps/dm_new/app/(popup-layout)/map/service/index.ts b/apps/dm_new/app/(popup-layout)/map/service/index.ts deleted file mode 100644 index c6bfcff72..000000000 --- a/apps/dm_new/app/(popup-layout)/map/service/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './map' diff --git a/apps/dm_new/app/(popup-layout)/map/service/map.ts b/apps/dm_new/app/(popup-layout)/map/service/map.ts deleted file mode 100644 index dea14f0d0..000000000 --- a/apps/dm_new/app/(popup-layout)/map/service/map.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * 관망도 API - */ -import { DEV_URL_WR, DEV_URL_SN } from "@/components/ui/config"; - -export type LyrStngProps = { - lyr_sn: string - lyr_nm: string - upper_lyr_sn: string - drawOrdr: string - flterSql: string - gobjTy: string - lyrTpNm: string - useYn: string - minViewSize: string - iconNm: string - lblAtrbNm: string - fontNm: string - fontIntnColor: string - fontExtnColor: string - fontExtnWdth: string - lnWdth: string - lnColor: string - polgnColor: string - initEprssYn: string - clickPsblYn: string -} - -export const mapService = { - //레이어 설정 조회 - getLyrStngs: async () => { - const response = await fetch(`${DEV_URL_SN}/map/lyrStngs/DM_NETWORK`, { - method: 'GET', - headers: { - 'Accept': 'application/json', - }, - }); - - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - - return response.json(); - }, - getPbnstRuseFclts: async (ruseFcltPk: any) => { - const response = await fetch(`${DEV_URL_WR}/reuseFc/pubFc/${ruseFcltPk}`, { - method: 'GET', - headers: { - 'Accept': 'application/json', - }, - }); - - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - - return response.json(); - } -} diff --git a/apps/dm_new/app/common/comFunction.ts b/apps/dm_new/app/common/comFunction.ts deleted file mode 100644 index ec4894d49..000000000 --- a/apps/dm_new/app/common/comFunction.ts +++ /dev/null @@ -1,65 +0,0 @@ -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 deleted file mode 100644 index 4d76d84e0..000000000 --- a/apps/dm_new/app/common/transValueFormat.tsx +++ /dev/null @@ -1,26 +0,0 @@ -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/app/globals.css b/apps/dm_new/app/globals.css deleted file mode 100644 index 2fee793a1..000000000 --- a/apps/dm_new/app/globals.css +++ /dev/null @@ -1,83 +0,0 @@ -/* @import "../../../packages/common/components/src/base.css"; */ -/* @import "../../../packages/common/components/src/base.css"; */ - -@tailwind base; -@tailwind components; -@tailwind utilities; - -@layer base { - :root { - --background: 0 0% 100%; - --foreground: 0 0% 3.9%; - --card: 0 0% 100%; - --card-foreground: 0 0% 3.9%; - --popover: 0 0% 100%; - --popover-foreground: 0 0% 3.9%; - --primary: 0 0% 9%; - --primary-foreground: 0 0% 98%; - --secondary: 0 0% 96.1%; - --secondary-foreground: 0 0% 9%; - --muted: 0 0% 96.1%; - --muted-foreground: 0 0% 45.1%; - --accent: 0 0% 96.1%; - --accent-foreground: 0 0% 9%; - --destructive: 0 84.2% 60.2%; - --destructive-foreground: 0 0% 98%; - --border: 0 0% 89.8%; - --input: 0 0% 89.8%; - --ring: 0 0% 3.9%; - --chart-1: 12 76% 61%; - --chart-2: 173 58% 39%; - --chart-3: 197 37% 24%; - --chart-4: 43 74% 66%; - --chart-5: 27 87% 67%; - --radius: 0.5rem - } - .dark { - --background: 0 0% 3.9%; - --foreground: 0 0% 98%; - --card: 0 0% 3.9%; - --card-foreground: 0 0% 98%; - --popover: 0 0% 3.9%; - --popover-foreground: 0 0% 98%; - --primary: 0 0% 98%; - --primary-foreground: 0 0% 9%; - --secondary: 0 0% 14.9%; - --secondary-foreground: 0 0% 98%; - --muted: 0 0% 14.9%; - --muted-foreground: 0 0% 63.9%; - --accent: 0 0% 14.9%; - --accent-foreground: 0 0% 98%; - --destructive: 0 62.8% 30.6%; - --destructive-foreground: 0 0% 98%; - --border: 0 0% 14.9%; - --input: 0 0% 14.9%; - --ring: 0 0% 83.1%; - --chart-1: 220 70% 50%; - --chart-2: 160 60% 45%; - --chart-3: 30 80% 55%; - --chart-4: 280 65% 60%; - --chart-5: 340 75% 55% - } -} - -@layer base { - * { - @apply border-border; - } - body { - @apply bg-background text-foreground; - } -} - -@font-face { - font-family: "NotoSansKR"; - src: url("/fonts/NotoSansKR-Regular.woff2") format("woff2"); - font-weight: 400; - font-style: normal; - font-display: swap; -} - -body { - font-family: "NotoSansKR", sans-serif; -} diff --git a/apps/dm_new/app/layout.tsx b/apps/dm_new/app/layout.tsx deleted file mode 100644 index 0e45865e7..000000000 --- a/apps/dm_new/app/layout.tsx +++ /dev/null @@ -1,25 +0,0 @@ -"use client"; -import "./globals.css"; -import { setCookie } from "../src/shared/lib"; - -setCookie("site-id-key", process.env.NEXT_PUBLIC_SITE_ID || "DM"); - -export default function RootLayout({ - children, -}: Readonly<{ - children: React.ReactNode; -}>) { - - return ( - - - 물재이용 대민 - - -
- {children} -
- - - ); -} diff --git a/apps/dm_new/app/store/common/index.tsx b/apps/dm_new/app/store/common/index.tsx deleted file mode 100644 index e875c2eca..000000000 --- a/apps/dm_new/app/store/common/index.tsx +++ /dev/null @@ -1,502 +0,0 @@ -/**==================================== - * 보편적으로 쓰는 store 공간 - ====================================**/ - -import { fetchType, getFetch } from '@/components/ui/api'; - -/** - * STORE - TYPE - */ - -// selectBox -export type SelectDataType = { - text: string; - val: string; -} - -export interface MenuItem { - menuCd: number; - menuKornNm: string; - menuEngNm: string; - parentId: number | null; - sortSeq: number; - iconNm?: string; - children: MenuItem[] | null; - levelNo: number; - urlPath: string; - menuLnkgTypeCd: string; - menuLnkgSn: number; - menuPath: string; - qrcd: string; - useYn: string; - otptYn: string; - newWndwYn: string; - requiredUrlPath: boolean; -} - -// grid header -export type TableUpperProps = { - id: string; - title: string; - upName?: string; - upSequnce?: number; - align? : string; - row? : number; - rowSpan?: number; - colSpan?: number; -} - -// 시도 데이터 -export type sidoDataType = { - adstDstrCd: number, - sido: string, -} - -// 시군구 데이터 -export type sigunDataType = { - adstDstrCd: number, - gugun: string -} - -// 권역 데이터 -export type regionDataType = { - rvbsnCd: string, - rvbsn: string, -} - -// 단위유역 데이터 -export type unitWaterShedDataType = { - rvbsnCd: string, - lgbsn: string, -} - -// 중권역 데이터 -export type middleRegionDataType = { - rvbsnCd: string, - mdmbsn: string, -} - -// 환경청 데이터 -export type envPartDataType = { - lclgvrnmntCd: string, - lclgvrnmntNm: string, - adstDliStrCd: string, - adstDstrCd: string, -} - -export type envPartSelectDataType = SelectDataType & { - adstDliStrCd: string, -} - -/** - * STORE - DATA - */ - -// 시도 데이터 -let selectSidoData: SelectDataType[] = [ - { text: "전체", val: '0' } -]; - -// 시군구 데이터 -let selectSigunData: SelectDataType[] = [ - { text: "전체", val: '0' } -]; - -// 권역 데이터 -const selectRegionData: SelectDataType[] = [ - { text: "전체", val: '0' } -]; - -// 단위유역 데이터 -const selectUnitWaterShedData: SelectDataType[] = [ -]; - -// 환경청 데이터 -let selectEnvPartData: envPartSelectDataType[] = [ - { text: "전체", val: '0', adstDliStrCd: '' } -]; - -// 환경청 내 시도 데이터 -const selectEnvPartSidoData: SelectDataType[] = [ - { text: "전체", val: '0' } -]; - -// 환경청 내 시군구 데이터 -const selectEnvPartSigunData: SelectDataType[] = [ - { text: "전체", val: '0' } -]; - -// 구분 데이터 -// const selectPartData:SelectDataType[] = [ -// { text: "행정별", val: '0' }, -// { text: "유역별", val: '01' }, -// { text: "환경청별", val: '02' }, -// ]; - -// 상향 하향 데이터 -const selectUpdownData:SelectDataType[] = [ - { text: "전체", val: '0' }, - { text: "500이하", val: '499' }, - { text: "500이상", val: '500' }, -]; - -// 운영 상태 데이터 -const selectOperationData:SelectDataType[] = [ - { text: "전체", val: '0' }, - { text: "가동중", val: '1' }, - { text: "재가동", val: '2' }, - { text: "가동중지", val: '3' }, - { text: "시설폐쇄", val: '4' }, -]; - -// 시설 구분 데이터 -const selectFacilityPartData:SelectDataType[] = [ - { text: "전체", val: '0' }, - { text: "공공하수처리시설", val: 'SW' }, - { text: "오수처리장", val: 'SS' }, - { text: "개인하수처리시설", val: 'PB' }, - { text: "분뇨처리장", val: 'NS' }, - { text: "폐수처리장", val: 'LW' }, - { text: "침출수처리장", val: 'LC' }, - { text: "기타기초시설", val: 'ET' }, -]; - -// 년도 데이터 -const getYearData = () => { - const year = new Date().getFullYear(); - const year1 = year - 1; - const year2 = year - 2; - const year3 = year - 3; - const year4 = year - 4; - const year5 = year - 5; - return [ - { text: year1 + "년", val: year1.toString() }, - { text: year2 + "년", val: year2.toString() }, - { text: year3 + "년", val: year3.toString() }, - { text: year4 + "년", val: year4.toString() }, - { text: year5 + "년", val: year5.toString() }, - ] -} - -const selectSearchYear:SelectDataType[] = getYearData(); - -// 유량 기간 구분 -const selectFlowTerm : SelectDataType[] = [ - { text: "연간", val: '0' }, - { text: "하절기", val: '01' }, - { text: "동절기", val: '02' }, - { text: "청천시", val: '03' }, - { text: "강우시", val: '04' }, -]; - -// 유량 기간 구분 -const selectFlowPanel : SelectDataType[] = [ - { text: "전체", val: '0'}, - { text: "3mm미만", val: '1'}, - { text: "3~10mm미만", val: '2'}, - { text: "10~20mm미만", val: '3'}, - { text: "20~30mm미만", val: '4'}, - { text: "30~40mm미만", val: '5'}, - { text: "40~50mm미만", val: '6'}, - { text: "50~60mm미만", val: '7'}, - { text: "60mm이상", val: '8'}, -]; - -// 중권역 데이터 -const selectMiddleRegionData: SelectDataType[] = [ - { text: "전체", val: '0' } -]; - -/** - * STORE - API - */ - -// 시도 API 호출 함수 추가 -const fetchSidoData = async (): Promise => { - try { - const res = await getFetch(fetchType.FO, '/addr/city'); - const data = res.data; - selectSidoData = [ - { text: "전체", val: '0'}, - ...data.map((item: sidoDataType) => ({ - text: item.sido || '', - val: String(item.adstDstrCd) || '' - })) - ]; - return selectSidoData; - } catch (error) { - console.error('시도 데이터를 가져오는데 실패했습니다:', error); - return selectSidoData; - } -}; - -// 시군구 API 호출 함수 추가 -const fetchSigunData = async (): Promise => { - try { - const res = await getFetch(fetchType.FO, '/addr/sgg'); - const data = res.data; - selectSigunData = [ - { text: "전체", val: '0' }, - ...data - .map((item: sigunDataType) => ({ - text: item.gugun || '', - val: String(item.adstDstrCd) || '' - })) - ]; - return selectSigunData; - } catch (error) { - console.error('시군구 데이터를 가져오는데 실패했습니다:', error); - return selectSigunData; - } -}; - -// 권역 API 호출 함수 추가 -const fetchRegionData = async (): Promise => { - try { - const res = await getFetch(fetchType.FO, '/addr/sarea'); - const data = res.data; - return [ - { text: "전체", val: '0'}, - ...data.map((item: regionDataType) => ({ - text: item.rvbsn || '', - val: String(item.rvbsnCd) || '' - })) - ]; - } catch (error) { - console.error('권역 데이터를 가져오는데 실패했습니다:', error); - return selectRegionData; - } -}; - -// 중권역 API 호출 함수 추가 -const fetchMiddleRegionData = async (): Promise => { - try { - const res = await getFetch(fetchType.FO, '/addr/midArea'); - const data = res.data; - return [ - { text: "전체", val: '0' }, - ...data - .map((item: middleRegionDataType) => ({ - text: item.mdmbsn || '', - val: String(item.rvbsnCd) || '' - })) - ]; - } catch (error) { - console.error('중권역 데이터를 가져오는데 실패했습니다:', error); - return selectMiddleRegionData; - } -}; - -// 단위유역 API 호출 함수 추가 -const fetchUnitWaterShedData = async (): Promise => { - try { - const res = await getFetch(fetchType.FO, '/addr/largeArea'); - const data = res.data; - return [ - { text: "전체", val: '0' }, - ...data - .map((item: unitWaterShedDataType) => ({ - text: item.lgbsn || '', - val: String(item.rvbsnCd) || '' - })) - ]; - } catch (error) { - console.error('단위유역 데이터를 가져오는데 실패했습니다:', error); - return selectUnitWaterShedData; - } -}; - -// 환경청 데이터 -const fetchEnvPartData = async (): Promise => { - try { - const res = await getFetch(fetchType.FO, '/addr/govArea'); - const data = res.data; - selectEnvPartData = [ - { text: "전체", val: '0', adstDliStrCd: '' }, - ...data - .map((item: envPartDataType) => ({ - text: item.lclgvrnmntNm || '', - val: String(item.lclgvrnmntCd) || '', - adstDliStrCd: item.adstDliStrCd || '' - })) - ]; - return selectEnvPartData; - } catch (error) { - console.error('환경청 데이터를 가져오는데 실패했습니다:', error); - return selectEnvPartData; - } -}; - -function sortMenus(items: MenuItem[]): MenuItem[] { - return [...items] - .sort((a, b) => a.sortSeq - b.sortSeq) - .map((item) => ({ - ...item, - children: item.children ? sortMenus(item.children) : [], - })); -} - -function isVisible(item: MenuItem): boolean { - return item.useYn !== "N" && item.otptYn !== "N"; -} - -function normalizeMenus(items: MenuItem[]): MenuItem[] { - return sortMenus(items) - .filter(isVisible) - .map((item) => ({ - ...item, - children: item.children ? normalizeMenus(item.children) : [], - })); -} - -export const REUSE_SITE_ID = process.env.NEXT_PUBLIC_SITE_ID || "DM"; -const anonymousMenuCache = new Map(); -const anonymousMenuInFlight = new Map>(); - -export async function fetchAnonymousMenu(siteId = REUSE_SITE_ID): Promise { - const cached = anonymousMenuCache.get(siteId); - if (cached) return cached; - - const inFlight = anonymousMenuInFlight.get(siteId); - if (inFlight) return inFlight; - - const request = (async () => { - const response = await fetch(`/cms-service/api/v1/menu/anonymous/user/${siteId}`, { - method: "GET", - headers: { "Content-Type": "application/json" }, - cache: "no-store", - }); - - if (!response.ok) { - throw new Error(`Failed to load menu: ${response.status}`); - } - - const data = (await response.json()) as MenuItem[]; - const normalized = Array.isArray(data) ? normalizeMenus(data) : []; - anonymousMenuCache.set(siteId, normalized); - return normalized; - })(); - - anonymousMenuInFlight.set(siteId, request); - try { - return await request; - } finally { - anonymousMenuInFlight.delete(siteId); - } -} - -function isPathMatched(pathname: string, urlPath: string) { - if (!urlPath) return false; - return pathname === urlPath || pathname.startsWith(`${urlPath}/`); -} - -function hasMatchedPathInTree(menu: MenuItem, pathname: string): boolean { - if (isPathMatched(pathname, menu.urlPath)) return true; - return (menu.children ?? []).some((child) => hasMatchedPathInTree(child, pathname)); -} - -export function findActiveTopMenu(menus: MenuItem[], pathname: string): MenuItem | null { - const level1Menus = menus.filter((menu) => menu.levelNo === 1 || menu.parentId === null); - const matched = level1Menus.filter((menu) => hasMatchedPathInTree(menu, pathname)); - - return matched[0] ?? level1Menus[0] ?? null; -} - -export function hasAnyChild(item: MenuItem): boolean { - return Array.isArray(item.children) && item.children.length > 0; -} - -export function isMenuActive(pathname: string, menu: MenuItem): boolean { - return isPathMatched(pathname, menu.urlPath); -} -/**==================================== - * Store - expaort - ====================================*/ -export type CommonAction = { - initializeCommonData: () => Promise; - getMenuAuth: (menuCd:number) => Promise; - fetchAnonymousMenu: (siteId?: string) => Promise; -} - -export type CommonType = { - Common: { - isInit: boolean; - selectSidoData: SelectDataType[]; - selectSigunData: SelectDataType[]; - selectUpdownData: SelectDataType[]; - selectOperationData: SelectDataType[]; - selectFacilityPartData: SelectDataType[]; - selectSearchYear: SelectDataType[]; - selectUnitWaterShedData: SelectDataType[]; - selectRegionData: SelectDataType[]; - selectMiddleRegionData: SelectDataType[]; - selectEnvPartSidoData: SelectDataType[]; - selectEnvPartSigunData: SelectDataType[]; - selectFlowTerm: SelectDataType[]; - selectFlowPanel: SelectDataType[]; - selectEnvPartData: envPartSelectDataType[]; - btnClass: string; - } -} - -export const CommonState:CommonType = { - Common: { - isInit: false, - selectSidoData: selectSidoData, - selectSigunData: selectSigunData, - selectUpdownData: selectUpdownData, - selectOperationData: selectOperationData, - selectFacilityPartData: selectFacilityPartData, - selectSearchYear: selectSearchYear, - selectRegionData: selectRegionData, - selectUnitWaterShedData: selectUnitWaterShedData, - selectMiddleRegionData: selectMiddleRegionData, - selectEnvPartSidoData : selectEnvPartSidoData, - selectEnvPartSigunData : selectEnvPartSigunData, - selectFlowTerm: selectFlowTerm, - selectFlowPanel: selectFlowPanel, - selectEnvPartData : selectEnvPartData, - btnClass: "p-4 m-2 text-white rounded-sm text-lg font-medium" - } -} - -export const CommonReducer:(set:any)=>CommonAction=(set: any) => { - return { - getMenuAuth : async (menuCd : number) =>{ - const response = await getFetch( - "local", - `/cms-service/api/v1/menu-authrts/pageinfo/${menuCd}` - ); - set((state: CommonType) => { - return { - ...state, - auth: { - mngAuthrtYn: response[0].mngAuthrtYn, - inqAuthrtYn: response[0].mngAuthrtYn, - regAuthrtYn: response[0].mngAuthrtYn, - mdfcnAuthrtYn: response[0].mngAuthrtYn, - delAuthrtYn: response[0].mngAuthrtYn, - }, - }; - }); - }, - // 시도 변경 이벤트 - initializeCommonData: async () => { - const promiseSet = await Promise.all([fetchSidoData(), fetchSigunData(), fetchRegionData(), fetchUnitWaterShedData(), fetchMiddleRegionData(), fetchEnvPartData()]); - const [sidoData, sggData, regionData, unitData, midData, envData] = promiseSet; - set((state: CommonType) => ({ - Common: { - ...state.Common, - selectSidoData: sidoData, - selectSigunData: sggData, - selectRegionData: regionData, - selectMiddleRegionData: midData, - selectUnitWaterShedData: unitData, - selectEnvPartData: envData - } - }) - )}, - fetchAnonymousMenu: async (siteId = REUSE_SITE_ID) => fetchAnonymousMenu(siteId) - } -} -export type CommonStore = CommonType & CommonAction; diff --git a/apps/dm_new/app/store/index.tsx b/apps/dm_new/app/store/index.tsx deleted file mode 100644 index 47170b3db..000000000 --- a/apps/dm_new/app/store/index.tsx +++ /dev/null @@ -1,42 +0,0 @@ -'use client' - -import { type ReactNode, createContext, useContext, useRef } from 'react' -import { useStore } from 'zustand' -import { type DmStore, StoreZus } from './store' - - -export type StoreApi = ReturnType - -export const StoreContext = createContext( - undefined, -) - -export interface StoreProviderProps { - children: ReactNode -} - -export const StoreProvider = ({ - children, -}: StoreProviderProps) => { - const storeRef = useRef(null) - if (!storeRef.current) { - // Create store instance if not initialized - storeRef.current = StoreZus() as StoreApi - } - return ( - - {children} - - ) -} - -export const useDmStore = ( - selector: (store: DmStore) => T, -): T => { - const storeContext = useContext(StoreContext) - if (!storeContext) { - throw new Error(`useStore must be used within StoreProvider`) - } - - return useStore(storeContext, selector) -} \ No newline at end of file diff --git a/apps/dm_new/app/store/map/index.tsx b/apps/dm_new/app/store/map/index.tsx deleted file mode 100644 index f5b44c891..000000000 --- a/apps/dm_new/app/store/map/index.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import { AUTH_USER_ID, CLAIM_NAME } from "@/src/shared/config"; -import { fetchType, getFetch } from "@/components/ui/api"; -import { DEV_URL_FO } from "@/components/ui/config"; -import { getCookie } from "@common/components/lib/cookie"; -import type { FacilityInfo, SubsInfo } from "./type"; - -const tokenId = getCookie(AUTH_USER_ID); -const Authorization = getCookie(CLAIM_NAME); - -const checkWrRegList = async () => { - const wrRegList = await getFetch(fetchType.WR, `/reuseFc/pubFc`); - return wrRegList; -}; - -const getRuseFclt = async ( - page: string, - sggOrCity: string, - searchTxt?: string -) => { - const checkWrRegListRes = await checkWrRegList(); - - let url = `/prcsFclt/ruseInfo/${page ? page : 1}/5/A/${sggOrCity ? sggOrCity : "0"}/0/1/SW`; - - const ruseList = checkWrRegListRes.data.filter((item: string) => item !== ""); - - if (searchTxt) { - url = url + `/${searchTxt}`; - } - - const response = await fetch(DEV_URL_FO + url, { - method: "POST", - headers: { - "Content-Type": "application/json", - [AUTH_USER_ID]: tokenId ?? "", - [CLAIM_NAME]: Authorization ?? "", - }, - body: JSON.stringify(ruseList), - }); - - const hasuList = await response.json().then((res: any) => { - const data = res.data - .map((item: any) => { - return { - ...item, - fctCpc: Number(item.fctCpc) || 0, - searchNm: item.fctNm, - searchPk: item.bscFctNm, - }; - }) - .filter((hasu:any) => ruseList.find((ruse:any) => hasu.bscFctCd === ruse)); - return { data: data, count: res.count }; - }); - - return hasuList; -}; - -export type DmMapActions = { - findRuseFclt(sggOrCity: string, searchTxt: string): void; - setSubsInfo(subsInfo: SubsInfo[]): void; -}; - -export type DmMapType = { - map: { - ruseFcltList: FacilityInfo[]; - subsInfo: SubsInfo[]; - }; -}; - -export const dmMapState: DmMapType = { - map: { - ruseFcltList: [], - // subsInfo: [ - // { - // ruseUtztnFcltNm: "수원제1,2 재이용1", // 재이용시설명 - // ruseUtztnFcltCd: "41110PB001R1", - // }, - // { - // ruseUtztnFcltNm: "낙양 재이용1", // 재이용시설명 - // ruseUtztnFcltCd: "41150SW001R1", - // }, - // { - // ruseUtztnFcltNm: "서남 재이용1", // 재이용시설명 - // ruseUtztnFcltCd: "11500PB001R1", - // }, - // ], - subsInfo:[] - }, -}; -export type DmMapStore = DmMapType & DmMapActions; - -export const DmMapReducer = (set: any): DmMapActions => { - return { - findRuseFclt: async (sggOrCity: string, searchTxt: string) => { - const ruseFcltList = await getRuseFclt("1", sggOrCity, searchTxt); - - set((state: DmMapType) => ({ - ...state, - map: { - ...state.map, - ruseFcltList: ruseFcltList.data, - }, - })); - }, - setSubsInfo: async (subsInfo: SubsInfo[]) => { - set((state: DmMapType) => ({ - ...state, - map: { - ...state.map, - subsInfo: subsInfo, - }, - })); - }, - }; -}; diff --git a/apps/dm_new/app/store/map/type.tsx b/apps/dm_new/app/store/map/type.tsx deleted file mode 100644 index adcaf7f37..000000000 --- a/apps/dm_new/app/store/map/type.tsx +++ /dev/null @@ -1,39 +0,0 @@ -export type FacilityInfo= { - bscFctCd: string; // 기본시설 코드 - bscFctNm: string; // 기본시설명 - rvbsnCd: string; // 유역 코드 - rvbsn: string; // 유역명 - lgbsn: string; // 대권역명 - mdmbsn: string; // 중권역명 - rgnCd: string; // 관할청 코드 - rgnNm: string; // 관할청 명칭 - adstDstrCd: string; // 행정구역 코드 - sido: string; // 시도 - gugun: string; // 구군 - addr: string; // 주소 - fctCpc: string; // 시설용량 - efflWqltStndrdCd: string; // 방류수 수질기준 코드 - efflWqltStndrdNm: string; // 방류수 수질기준명 - trtFrfNm: string; // 처리공법명 - trtDstr: string; // 처리구역 - rnDt: string; // 사용개시일 (예: YYYYMMDD) - cmplDt: string; // 준공일자 (예: YYYYMMDD) - trstOprEtpNm: string; // 위탁운영기관명 - bscFctClsNm: string; // 기본시설 구분명 - sitArea: string; // 부지면적 - trtDstrArea: string; // 처리구역 면적 - swrTrtPopl: string; // 하수처리 인구 - mnstr: string; // 총괄 유역 - efflWtrrgn: string; // 방류수역 - rvNm: string; // 하천명 - bscFctClsCd: string; // 기본시설 구분 코드 - rvbsnNm: string; // 유역명 - tel: string; // 전화번호 - rswtrYn: string; // 재이용수 여부 ("Y" 또는 "N") - ruse: boolean; // 재이용 여부 (boolean) - } - - export type SubsInfo={ - ruseUtztnFcltNm: string; // 재이용시설명 - ruseUtztnFcltCd: string; // 재이용시설 코드 - } \ No newline at end of file diff --git a/apps/dm_new/app/store/readme.md b/apps/dm_new/app/store/readme.md deleted file mode 100644 index 0710aa69b..000000000 --- a/apps/dm_new/app/store/readme.md +++ /dev/null @@ -1,121 +0,0 @@ -# Zustand store -## Zustand 등록방법 -**-- index.tsx --** -### context 등록 -기본적으로 createContext를 통해 react에 context를 생성해서 react에서 사용할 수 있도록 해야함. -``` js -//StoreZus는 내부적으로 사용하기 위한 store파일에서 따로 생성함. -export type StoreApi = ReturnType -//react에서 사용하기 위한 context 생성. -export const StoreContext = createContext( - undefined, -) -``` - -### component로 작성 -등록된 context를 component화 시키기 위한 작업 -```js -//외부에서 호출시 형태로 호출. -//app이나 home에서 전체적인 사용이 되도록 작성해야함. -export const StoreProvider = ({ - children, -}: StoreProviderProps) => { - const storeRef = useRef(null) - if (!storeRef.current) { - //StoreZus는 store.tsx를 봐야함. - storeRef.current = StoreZus() - } - return ( - - {children} - - ) -} -``` - -### store 등록 -react에서 사용하는 store에 현재 context 등록 -```js -export const useWrStore = ( - selector: (store: WrStore) => T, -): T => { - const storeContext = useContext(StoreContext) - if (!storeContext) { - throw new Error(`useStore must be used within StoreProvider`) - } - - return useStore(storeContext, selector) -} -``` - -## Zustand 사용방법 -**-- store.tsx, 폴더별 index.tsx --** -### 기본 store 생성 -index.tsx의 context에 사용되는 StoreZus를 추가하여 사용됨. - -외부에서 생성된 state, actions를 사용 가능한 구조 -```js -import { createStore } from 'zustand/vanilla'; -import { tableActionsExport, tableStateExport, type tableState, type tableType } from './publicReuseFaciltyInsert/index';//외부 파일 위치. -export type WrStore = tableType;//typescript이므로 사용되는 스크립트를 type1 & type2 형식으로 넣어야함. -//index.tsx에서 사용하는 store 생성. -export const StoreZus = (initState: tableState = tableStateExport) => { - return createStore()((set) => { - return { - //아래에서 사용하는 state & actions은 외부 폴더에서 가져다가 사용. - ...initState,//외부에 있는 기본 초기값 state - ...tableActionsExport(set)//외부에 있는 actions - } - }) -} -``` -### 외부 스토어 작성 방법 -외부 스토어는 export를 어떻게 할건지만 정하면됨. - -사용하는 store.tsx에서 import를 받기만 하면 사용가능. -#### 타입을 외부로 빼는 방법 -```js -export type tableState = { - isInit: boolean; - upHeadList: TableUpperProps[]; - publicReuseFacilityUper: PublicReuseFacility[]; -} -type tableActions = { - decrementList: () => void -} - -export type tableType = tableState & tableActions; -``` -#### 초기값 state를 외부로 빼는 방법 -```js -export const tableStateExport:tableState= { - isInit:false, - upHeadList: upHeadList, - publicReuseFacilityUper: publicReuseFacilityUper, -} -``` -#### actions를 외부로 빼는 방법 -```js -//tableActionsExport를 import 받아서 실행하여 return 된 값을 사용 -export const tableActionsExport:(set:any)=>tableActions= -//set을 통해 react store에 등록 -(set: any) => { - return { - //decrementList Object 형태로 전달 - decrementList: - //set 함수를 실행해서 react store에 등록 - ()=>set( - // store에 등록되는 함수 구조를 가지고 있음. - (state:tableState) => { - //actions 실질적인 로직 작성하는 곳. - return ( - { - upHeadList: state.upHeadList, - publicReuseFacilityUper: - state.publicReuseFacilityUper.slice(0, state.publicReuseFacilityUper.length - 1) - })} - ) - } -} -``` - diff --git a/apps/dm_new/app/store/sdmMng/index.tsx b/apps/dm_new/app/store/sdmMng/index.tsx deleted file mode 100644 index 1f4bfa572..000000000 --- a/apps/dm_new/app/store/sdmMng/index.tsx +++ /dev/null @@ -1,782 +0,0 @@ -import { fetchType, getFetch, postFetch, getFetchWithCount } from "@/components/ui/api"; -import type { SelectDataType } from "@common/business_components/ui"; -import type { TableUpperProps } from "../common"; -import toast from "react-hot-toast"; -import type { DemandCompType } from "@common/business_components/ui/sdmInsertForm/form"; -import { z } from "zod"; - -/**==================================== - * Store - 타입 -=====================================*/ - -export const sdmInfoFormSchema = z.object({ - dmdInfoId: z.string().optional(), - dmndTmng: z.date().optional(), - dmndQty: z.number().min(1, "요구수량을 입력해주세요"), - wntUntprc: z.number().min(1, "희망단가를 입력해주세요"), - useUsgCd: z.string().min(1, "사용용도를 선택해주세요"), - /** 수질 */ - grssClfg: z.number().nullish(), - tn: z.number().nullish(), - combResdch: z.number().nullish(), - tph: z.number().nullish(), - trbt: z.number().nullish(), - ph: z.string().nullish(), - blgcOxygDmndQnt: z.number().nullish(), - clIonQnt: z.number().nullish(), - smll: z.string(), - cdtnv: z.number().nullish(), - crmty: z.number().nullish(), - - rmrk: z.string().optional(), - - splyCndtList: z - .array( - z.object({ - ruseUtztnFcltNm: z.string(), - ruseUtztnFcltCd: z.string(), - }) - ) - .optional(), -}); - -export type SdmInfoFormData = z.infer; - - -// 수요처 정보 -export type DemandCompBizType = { - index: number | ''; - dmdInfoId: string | ''; - dmdInfoFk: string | ''; - bzmnNo: string | ''; - dmdCoNm: string | ''; - zip: string | ''; - daddr: string | ''; - telno: string | ''; - rgtr: string | ''; - useUsgCd: string | ''; - ctpvCd: string | ''; - sggCd: string | ''; - dmdAplyPswd: string | ''; - wntUntprc: number | ''; - dmndTmng: Date | ''; - dmndQty: number | ''; - grssClfg: number | null //총대장균군수 - tn: number | null //총질소 - combResdch: number | null //결합잔류염소 - tph: number | null //총인 - trbt: number | null //탁도 - ph: string | ''; //수소이온농 - blgcOxygDmndQnt: number | null //생물학적산소요구량 - clIonQnt: number | null //염화물 - smll: string | ''; //냄새 - cdtnv: number | null; //전기전도도 - crmty: number | null //색도 - rmrk: string | ''; - reqDt: string | ''; - dmdInfoSn: number | ''; - status: string | ''; - splyCndtList: SupplyCandidate[] | [], - ruseUtztnFcltNm?: string | ''; - regDt: string | ''; - mdfcnDt : string | ''; -} - -// 공급 후보자 타입 정의 -export type SupplyCandidate = { - ruseUtztnFcltNm: string; - ruseUtztnFcltCd: string; -}; - - -export type DemandMatchings = { - splyFcltFk: string | ''; - splyFcltFlg: string | ''; - pbnstRuseFcltBizFk: number | ''; - splyBgngDay: string | ''; - splyEndDay: string | ''; - splyCpct: number | ''; - splyFmYn: string | ''; - useUsgCd: string | ''; - dmdInfoSn: number | ''; - splyCndtList: string | ''; - mtchnCmptnYmd: string | ''; - rvwCmptnYmd: string | ''; - regDt: string | ''; - rgtr: string | ''; - mdfcnDt: string | ''; - mdfr: string | ''; -} - -// 유사사례 -export type SimilarCaseType = { - ruseBizNm: string | ''; // 사업명 - bizBgngDate: string | ''; - bizEndDate: string | ''; - splyFcltKnd: string | ''; - splyFcltNm: string | ''; - splyFcltCpct: string | ''; - dmdFcltNm: string | ''; - dmdFcltAddr: string | ''; - ruseFcltCpct: string | ''; - ruseFcltPplLen: string | ''; - ruseFcltUsg: string | ''; - ruseFcltSplyCpct: string | ''; - ruseFcltPrcsMsrc: string | ''; - grnteWqUsg: string | ''; - grnteWqGrssClfg: string | ''; - grnteWqCombResdch: string | ''; - grnteWqTrbt: string | ''; - grnteWqBod: string | ''; - grnteWqSmll: string | ''; - grnteWqCrmty: string | ''; - grnteWqTn: string | ''; - grnteWqTp: string | ''; - grnteWqPh: string | ''; - grnteWqClIonQnt: string | ''; - grnteWqCndctStat: string | ''; - grnteWqRmrk: string | ''; - reqBizReuseFcltCst: string | ''; - reqBizPplCst: string | ''; - reqBizArchCst: string | ''; - reqBizMchnCst: string | ''; - reqBizMtrngCst: string | ''; - reqBizGisCst: string | ''; - reqBizCctvCst: string | ''; - reqBizCmcnCst: string | ''; - reqBizWstCst: string | ''; - reqBizDesignCst: string | ''; - reqBizSpvsCst: string | ''; - reqBizSbsdCst: string | ''; - reqBizEtc: string | ''; - reqBizGrssCst: string | ''; - prcmPlanNlep: string | ''; - prcmPlanLcep: string | ''; - prcmPlanBrdnCst: string | ''; - prcmPlanEcqrRt: string | ''; - prcmPlanGrssCst: string | ''; - clclnNlep: string | ''; - clclnLcep: string | ''; - clclnBrdnCst: string | ''; - clclnEcqrRt: string | ''; - clclnGrssCst: string | ''; -} - -// 사업비 상세정보 -export type MoneyDetailType = { - reqBizGrssCst: string | ''; - reqBizReuseFcltCst: string | ''; - reqBizPplCst: string | ''; - reqBizArchCst: string | ''; - reqBizMchnCst: string | ''; - reqBizMtrngCst: string | ''; - reqBizGisCst: string | ''; - reqBizCctvCst: string | ''; - reqBizCmcnCst: string | ''; - reqBizWstCst: string | ''; - reqBizDesignCst: string | ''; - reqBizSpvsCst: string | ''; - reqBizSbsdCst: string | ''; - reqBizEtc: string | ''; - - /** 재원조달계획(백만원원) */ - prcmPlanGrssCst: string | ''; - prcmPlanNlep: string | ''; - prcmPlanLcep: string | ''; - prcmPlanBrdnCst: string | ''; - prcmPlanEcqrRt: string | ''; - /** 사업비 정산(백만원) */ - clclnGrssCst: string | ''; - clclnNlep: string | ''; - clclnLcep: string | ''; - clclnBrdnCst: string | ''; - clclnEcqrRt: string | ''; -} -// 규칙 타입 선언 -export type DisableRulesType = Record; -/**==================================== - * Store - 데이터 - ====================================*/ -// 수요처 정보 -const demandCompList: DemandCompType[] = [ -] - - -const disableRules: DisableRulesType = { - "청소": ["tn", 'tph', "clIonQnt", 'cdtnv'], - "화장실용수": ["tn", 'tph', "clIonQnt", 'cdtnv'], - "세척": ["combResdch", "crmty", 'tph', 'tn', "clIonQnt", 'cdtnv'], - "살수": ["combResdch", "crmty", 'tph', 'tn', "clIonQnt", 'cdtnv'], - "조경": ["combResdch", "crmty", 'tph', 'cdtnv'], - "농업_간접용수": ["combResdch", "crmty", 'tn', 'tph', 'clIonQnt'], - "농업_직접용수": ["combResdch", "crmty", 'tn', 'tph', 'clIonQnt'], - "하천": ["combResdch", "trbt", "crmty", 'clIonQnt', 'cdtnv'], - '공업': [] -}; - -const defaultRules: Record = { - "청소": { - grssClfg: null, - combResdch: 0.2, - trbt: 2, - bod: 5, - crmty: 20, - ph: "5.8~8.5", - smll: '불쾌하지않을것', - tn: null, - tph: null, - clIonQnt: null, - cdtnv: null, - - }, - "화장실용수": { - grssClfg: null, - combResdch: 0.2, - trbt: 2, - bod: 5, - crmty: 20, - smll: '불쾌하지않을것', - ph: "5.8~8.5", - tn: null, - tph: null, - clIonQnt: null, - cdtnv: null, - }, - "세척": { - grssClfg: null, - trbt: 2, - bod: 5, - ph: "5.8~8.5", - combResdch: null, - smll: '불쾌하지않을것', - crmty: null, - tn: null, - tph: null, - clIonQnt: null, - cdtnv: null, - }, - "살수": { - grssClfg: null, - trbt: 2, - bod: 5, - ph: "5.8~8.5", - smll: '불쾌하지않을것', - combResdch: null, - crmty: null, - tn: null, - tph: null, - clIonQnt: null, - cdtnv: null, - }, - "조경": { - grssClfg: null, - trbt: 2, - bod: 5, - ph: "5.8~8.5", - smll: '불쾌하지않을것', - clIonQnt: 250, - combResdch: null, - crmty: null, - tn: null, - tph: null, - cdtnv: null, - }, - "농업_간접용수": { - grssClfg: null, - trbt: 5, - bod: 8, - ph: "5.8~8.5", - cdtnv: 2000, - combResdch: null, - crmty: null, - tn: null, - tph: null, - clIonQnt: null, - }, - "농업_직접용수": { - grssClfg: null, - trbt: 2, - bod: 8, - smll: '불쾌하지않을것', - ph: "5.8~8.5", - cdtnv: 700, - combResdch: null, - crmty: null, - tn: null, - tph: null, - clIonQnt: null, - }, - "하천": { - grssClfg: 1000, - bod: 5, - tn: 10, - tph: 0.5, - smll: '불쾌하지않을것', - ph: "5.8~8.5", - combResdch: null, - trbt: null, - crmty: null, - clIonQnt: null, - cdtnv: null - }, - '공업': { - grssClfg: null, - bod: null, - tn: null, - tph: null, - ph: "~", - combResdch: null, - smll: '불쾌하지않을것', - trbt: null, - crmty: null, - clIonQnt: null, - cdtnv: null - } -}; - -// 사용용도 -const useTypesData: SelectDataType[] = [ -/* { text: '청소', val: "청소" }, - { text: "화장실용수", val: "화장실용수" }, - { text: "세척", val: "세척" }, - { text: "살수", val: "살수" }, - { text: "조경", val: "조경" }, - { text: "농업_간접용수", val: "농업_간접용수" }, - { text: "농업_직접용수", val: "농업_직접용수" }, - { text: "하천", val: "하천" }, - { text: "공업", val: "공업" }, */ -]; - -// 유사사례 모달 헤더 -export const similarCaseModalHeader: TableUpperProps[] = [ - { id: "ruseBizNm", title: "사업명", row: 0, rowSpan: 2 }, - { id: "bizBgngDate", title: "사업시작일", row: 0, rowSpan: 2 }, - { id: "bizEndDate", title: "사업종료일", row: 0, rowSpan: 2 }, - { id: "A", title: "공급처", row: 0, colSpan: 3 }, - { id: "splyFcltKnd", title: "시설종류", row: 1 }, - { id: "splyFcltNm", title: "공급처명", row: 1 }, - { id: "splyFcltCpct", title: "시설용량\n(㎥/일)", row: 1 }, - { id: "B", title: "수요처", row: 0, colSpan: 2 }, - { id: "dmdFcltNm", title: "수요처명", row: 1 }, - { id: "dmdFcltAddr", title: "주소", row: 1 }, - { id: "C", title: "재이용시설", row: 0, colSpan: 5 }, - { id: "ruseFcltCpct", title: "시설용량\n(㎥/일)", row: 1 }, - { id: "ruseFcltPplLen", title: "관로\n(km)", row: 1 }, - { id: "ruseFcltUsg", title: "용도", row: 1 }, - { id: "ruseFcltSplyCpct", title: "공급량\n(㎥/일)", row: 1 }, - { id: "ruseFcltPrcsMsrc", title: "처리공법", row: 1 }, - { id: "D", title: "보증수질", row: 0, colSpan: 13 }, - { id: "grnteWqUsg", title: "용도별", row: 1 }, - { id: "grnteWqGrssClfg", title: "총대장균군수\n(개/100ml)", row: 1 }, - { id: "grnteWqCombResdch", title: "결합잔류염소\n(mg/L)", row: 1 }, - { id: "grnteWqTrbt", title: "탁도\n(NTU)", row: 1 }, - { id: "grnteWqBod", title: "생물학적산소요구량\n(BOD)\n(mg/L)", row: 1 }, - { id: "grnteWqSmll", title: "냄새\n(개/100ml)", row: 1 }, - { id: "grnteWqCrmty", title: "색도\n(도)", row: 1 }, - { id: "grnteWqTn", title: "총질소\n(T-N)\n(mg/L)", row: 1 }, - { id: "grnteWqTp", title: "총인\n(T-P)\n(mg/L)", row: 1 }, - { id: "grnteWqPh", title: "수소이온농도\n(pH)", row: 1 }, - { id: "grnteWqClIonQnt", title: "염화물\n(mgCL/L)", row: 1 }, - { id: "grnteWqCndctStat", title: "전기전도도\n(μS/cm)", row: 1 }, - { id: "grnteWqRmrk", title: "비고", row: 1 }, - { id: "reqBizGrssCst", title: "소요사업비\n(백만원)", row: 0, rowSpan: 2 }, -] - -// 유사사례 데이터 -const similarCaseList: SimilarCaseType[] = [ - -] - -// 사업비 상세정보 모달 헤더 -export const moneyDetailModalHeader: TableUpperProps[] = [ - { id: "A", title: "소요사업비(백만원)", row: 0, colSpan: 14 }, - { id: "reqBizGrssCst", title: "총", row: 1, rowSpan: 2 }, - { id: "B", title: "토목", row: 1, colSpan: 2 }, - { id: "reqBizReuseFcltCst", title: "재이용시설", row: 2 }, - { id: "reqBizPplCst", title: "관로", row: 2 }, - { id: "reqBizArchCst", title: "건축", row: 1, rowSpan: 2 }, - { id: "reqBizMchnCst", title: "기계", row: 1, rowSpan: 2 }, - { id: "reqBizMtrngCst", title: "전기,계측", row: 1, rowSpan: 2 }, - { id: "reqBizGisCst", title: "GIS/DB", row: 1, rowSpan: 2 }, - { id: "reqBizCctvCst", title: "CCTV", row: 1, rowSpan: 2 }, - { id: "reqBizCmcnCst", title: "시공 및 준공", row: 1, rowSpan: 2 }, - { id: "reqBizWstCst", title: "폐기물", row: 1, rowSpan: 2 }, - { id: "reqBizDesignCst", title: "설계비", row: 1, rowSpan: 2 }, - { id: "reqBizSpvsCst", title: "감리비", row: 1, rowSpan: 2 }, - { id: "reqBizSbsdCst", title: "시설 부대비", row: 1, rowSpan: 2 }, - { id: "reqBizEtc", title: "기타", row: 1, rowSpan: 2 }, - { id: "C", title: "재원조달계획(백만원)", row: 0, colSpan: 5 }, - { id: "prcmPlanGrssCst", title: "총", row: 1, rowSpan: 2 }, - { id: "prcmPlanNlep", title: "국비", row: 1, rowSpan: 2 }, - { id: "prcmPlanLcep", title: "지방비", row: 1, rowSpan: 2 }, - { id: "prcmPlanBrdnCst", title: "원인자부담", row: 1, rowSpan: 2 }, - { id: "prcmPlanEcqrRt", title: "국고비율", row: 1, rowSpan: 2 }, - { id: "D", title: "사업비 정산(백만원)", row: 0, colSpan: 5 }, - { id: "clclnGrssCst", title: "총", row: 1, rowSpan: 2 }, - { id: "clclnNlep", title: "국비", row: 1, rowSpan: 2 }, - { id: "clclnLcep", title: "지방비", row: 1, rowSpan: 2 }, - { id: "clclnBrdnCst", title: "원인자부담", row: 1, rowSpan: 2 }, - { id: "clclnEcqrRt", title: "국고비율", row: 1, rowSpan: 2 }, -] - -// 사업비 상세정보 -const moneyDetailList: MoneyDetailType[] = [ -] - -// 수요정보 신청현황 헤더 -export const upHeadSdmInfoStatus: TableUpperProps[] = [ - { id: "index", title: "No." }, - { id: "ctpvCd", title: "시도", row: 0, rowSpan: 2 }, - { id: "sggCd", title: "시군구", row: 0, rowSpan: 2 }, - { id: "dmdCoNm", title: "회사명", row: 0, rowSpan: 2 }, - { id: "daddr", title: "공장주소", row: 0, rowSpan: 2 }, - { id: "telno", title: "전화번호", row: 0, rowSpan: 2 }, - { id: "dmndTmng", title: "신청일자", row: 0, rowSpan: 2 }, - { id: "status", title: "진행상태", row: 0, rowSpan: 2 }, -] - -// 수요정보 신청현황 데이터 - -/**==================================== - * Store - Api -=====================================*/ -// 수요처 등록 -const postSdmData = async (data: DemandCompType) => { - try { - await postFetch("/reuseFc/request", data); - sessionStorage.setItem("user", JSON.stringify(data)); - toast.success("수요처 등록에 성공하였습니다."); - return true; - } catch (error) { - console.log(error); - toast.error("수요처 등록에 실패하였습니다."); - return false; - } -} - -// 수요정보 등록 -const postSdmInfoData = async (data: SdmInfoFormData): Promise => { - try { - await postFetch("/reuseFc/request/demandInfo", data); - alert('수요 정보 등록에 성공하였습니다.'); - return true; - } catch (error) { - console.log(error); - alert('수요 정보 등록에 실패하였습니다.'); - return false; - } -} - -// 수요정보 수정 -const fetchUpdateSdmInfoData = async (data: SdmInfoFormData): Promise => { - try { - await postFetch("/reuseFc/request/updateDemandInfo", data); - alert('수요 정보 수정에 성공하였습니다.'); - return true; - } catch (error) { - console.log(error); - alert('수요 정보 수정에 실패하였습니다.'); - return false; - } -} - -const postSdmLoginData = async (data: DemandCompType) => { - try { - const res = await postFetch("/reuseFc/request/login", data); - const jsonData = await res.json(); - - const status = jsonData.status; - const loginData = jsonData.data; - let loginSuccess = false; - if (status === 200 && loginData != null) { - alert("수요처 로그인에 성공하였습니다."); - delete loginData.dmdAplyPswd; - delete loginData.rgtr; - sessionStorage.setItem("user", JSON.stringify(loginData)); - loginSuccess = true; - } else if (status === 401) { - alert("패스워드가 일치하지 않습니다."); - loginSuccess = false; - } else { - alert("등록된 수요처가 없습니다."); - loginSuccess = false; - } - - return loginSuccess; - } catch (error) { - console.log(error); - alert("수요처 로그인에 실패하였습니다."); - } -} - -const getDemandCompList = async (searchText: string, pageCnt: number) => { - try { - const url = '/reuseFc/request/' + (searchText ? searchText : '') + '/' + pageCnt; - const res = await getFetch(fetchType.WR, url); - return { - data: res?.data || [], - count: res?.count || 0 - } - } catch (error) { - console.error(error + ' 수요처 정보를 불러오지 못했습니다.'); - return { data: [], count: 0 }; - } -} - -const getSdmInfoStatusList = async (dmdInfoId: string) => { - try { - const url = '/reuseFc/request/' + dmdInfoId; - const res = await getFetch(fetchType.WR, url); - return res?.data || []; - } catch (error) { - console.error(error + ' 수요정보 신청현황을 불러오지 못했습니다.'); - return []; - } -} - -// 유사사례 조회 -const fetchGetSimilarCaseList = async (part: string, value: number | string) => { - try { - const url = '/reuseFc/pubFcRuseCase/dm/' + part + '/' + (value ? value : 0); - const res = await getFetch(fetchType.WR, url); - return res?.data || []; - } catch (error) { - console.error(error + ' 유사사례 조회에 실패하였습니다.'); - return []; - } -} - -/**==================================== - * Store - expaort - ====================================*/ -export type SdmActions = { - initializeSdmData: () => void; - insertSdmData: (data: DemandCompType) => Promise; - insertSdmInfoData: (data: SdmInfoFormData) => Promise; - updateSdmInfoData: (data: SdmInfoFormData) => Promise; - getDemandCompList: (searchText: string, pageCnt: number) => Promise; - actionLogin: (data: DemandCompType) => Promise; - getSdmInfoStatusList: (dmdInfoId: string) => Promise; - getSimilarCaseList: (part: string, value: number | string) => Promise; - actionLogout: () => Promise; - - getUseTypesData: () => Promise; -} - -export type SdmType = { - Sdm: { - isInit: boolean; - useTypesData: SelectDataType[]; - demandCompList: DemandCompType[]; - upHeadSimilarCaseList: TableUpperProps[]; - similarCaseList: SimilarCaseType[]; - upHeadMoneyDetailList: TableUpperProps[]; - moneyDetailList: MoneyDetailType[]; - - // 수요정보 신청현황 - sdmInfoStatusList: DemandCompBizType[]; - upHeadSdmInfoStatus: TableUpperProps[]; - defaultRules: Record - disableRules: DisableRulesType; - // 로그인관련 - successNextPage: boolean; - successLogin: boolean; - } -} - -export const SdmState: SdmType = { - Sdm: { - isInit: false, - useTypesData: useTypesData, - demandCompList: demandCompList, - upHeadSimilarCaseList: similarCaseModalHeader, - similarCaseList: similarCaseList, - upHeadMoneyDetailList: moneyDetailModalHeader, - moneyDetailList: moneyDetailList, - // 수요정보 신청현황 - sdmInfoStatusList: [], - defaultRules: defaultRules, - disableRules: disableRules, - upHeadSdmInfoStatus: upHeadSdmInfoStatus, - - // 로그인관련 - successNextPage: false, - successLogin: false, - } -} - -export const SdmReducer = (set: any): SdmActions => { - return { - initializeSdmData: async () => { - }, - - insertSdmData: async (data: DemandCompType) => { - const preRes = await getSdmInfoStatusList(data.dmdInfoId); - if (preRes?.dmdInfoId) { - toast.error('이미 등록된 수요처입니다.'); - return; - } - - const res = await postSdmData(data); - if (res) { - set((state: SdmType) => ({ - Sdm: { - ...state.Sdm, - successNextPage: true, - } - })) - } - }, - - insertSdmInfoData: async (data: SdmInfoFormData): Promise => { - return await postSdmInfoData(data); - }, - - updateSdmInfoData: async (data: SdmInfoFormData): Promise => { - return await fetchUpdateSdmInfoData(data); - }, - - // 수요처 정보 - getDemandCompList: async (searchText: string, pageCnt: number) => { - const res = await getDemandCompList(searchText, pageCnt); - if (res.data.length === 0) { - set((state: SdmType) => ({ - Sdm: { - ...state.Sdm, - demandCompList: [], - } - })) - return; - } else { - set((state: SdmType) => ({ - Sdm: { - ...state.Sdm, - demandCompList: res.data, - } - })) - } - }, - - // 수요정보 신청현황 - getSdmInfoStatusList: async (dmdInfoId: string) => { - const res = await getSdmInfoStatusList(dmdInfoId); - - if (res.length === 0) { - set((state: SdmType) => ({ - Sdm: { - ...state.Sdm, - sdmInfoStatusList: [], - } - })) - return; - } - //const sdmInfoStatusList : DemandCompBizType[] = []; - - const sdmInfoStatusList: DemandCompBizType[] = res.demandInfo.map((el: DemandCompBizType, index: number) => { - const matchingInfo = res.demandMatchings.find((matching: DemandMatchings) => matching.dmdInfoSn === el.dmdInfoSn); - const status = matchingInfo?.splyFcltFlg?.trim() === 'Sub' ? '검토' : matchingInfo?.splyFcltFlg?.trim() === 'matched' ? '매칭완료' : '신청'; - const ruseUtztnFcltNm = matchingInfo?.ruseUtztnFcltNm ? matchingInfo.ruseUtztnFcltNm : ''; - - - return ({ - ...el, - index: ++index, - bzmnNo: res.bzmnNo, - dmdCoNm: res.dmdCoNm, - dmdInfoId: res.dmdInfoId, - zip: res.zip || '', - daddr: res.daddr, - telno: res.telno.replace(/(\d{3})(\d{4})(\d{4})/, '$1-$2-$3'), - rgtr: res.rgtr, - ctpvCd: res.ctpvCd, - sggCd: res.sggCd, - useUsgCd: el.useUsgCd, - dmndTmng: el.dmndTmng, - dmdInfoSn: el.dmdInfoSn, - status: status, - splyCndtList: el.splyCndtList, - ruseUtztnFcltNm: ruseUtztnFcltNm || '' - }) - }) - - set((state: SdmType) => ({ - Sdm: { - ...state.Sdm, - sdmInfoStatusList: sdmInfoStatusList, - } - })) - }, - - actionLogin: async (data: DemandCompType) => { - const loginSuccess = await postSdmLoginData(data); - set((state: SdmType) => ({ - Sdm: { - ...state.Sdm, - successLogin: loginSuccess, - } - })) - }, - - // 유사사례 조회 - getSimilarCaseList: async (part: string, value: number | string) => { - const res = await fetchGetSimilarCaseList(part, value); - const similarCaseList = res.map((el: SimilarCaseType) => { - const maskedBizNm = el.ruseBizNm - ? el.ruseBizNm.replace(/^(\s*)^\S+/, "***") // 첫 단어(공백 전까지) 치환 - : el.ruseBizNm; - - return { - ...el, - ruseBizNm: maskedBizNm, - }; - }); - - if (similarCaseList && similarCaseList.length !== 0) { - set((state: SdmType) => ({ - Sdm: { - ...state.Sdm, - similarCaseList: similarCaseList, - } - })) - return; - } else { - set((state: SdmType) => ({ - Sdm: { - ...state.Sdm, - similarCaseList: [], - } - })) - return; - } - }, - - actionLogout: async () => { - sessionStorage.removeItem("user"); - set((state: SdmType) => ({ - Sdm: { - ...state.Sdm, - successLogin: false, - } - })) - }, - - getUseTypesData: async () => { - //http://dev.onasys.co.kr:3000/server/cms-service/api/v1/lwpo-cds?lwpoCdNm=&sort=regDt,desc&upCd=WR018&page=0&size=10 - - const upCd = await getFetchWithCount( - fetchType.CS, - "/cms-service/api/v1/lwpo-cds/?lwpoCdNm=&sort=regDt,desc&upCd=WR018&page=0&size=100" - ); - - const comUseTypes = upCd.content.filter(el=>el.lwpoCdNm != '친수용수').map((el: any) => ({ text: el.lwpoCdNm, val: el.lwpoCd })); - - set((state: SdmType) => ({ - Sdm: { - ...state.Sdm, - useTypesData: comUseTypes, - } - })); - } - } -} -export type SdmStore = SdmType & SdmActions; diff --git a/apps/dm_new/app/store/store.tsx b/apps/dm_new/app/store/store.tsx deleted file mode 100644 index 25508bae2..000000000 --- a/apps/dm_new/app/store/store.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { createStore } from "zustand/vanilla"; -import { - CommonReducer, - CommonState, - type CommonStore, - type CommonType, -} from "./common"; -import { SdmReducer, SdmState, type SdmStore, type SdmType } from "./sdmMng"; -import { - dmMapState, - type DmMapType, - type DmMapStore, - DmMapReducer, -} from "./map"; -import { tokenManager } from "@/src/entities/auth/lib/token-manager"; -import { - DmStatusReducer, - dmStatusState, - type DmStatusStore, - type DmStatusType, -} from "./wrStatus"; - -export type DmStore = CommonStore & SdmStore & DmMapStore & DmStatusStore; -export type DmState = CommonType & SdmType & DmMapType & DmStatusType; - -export const StoreZus = ( - initState: DmState = { - ...CommonState, - ...SdmState, - ...dmMapState, - ...dmStatusState, - } -) => { - return createStore()((set) => { - if (typeof window !== "undefined") { - tokenManager.setToken("site-id-key", process.env.NEXT_PUBLIC_SITE_ID||"DM"); - tokenManager.setToken("site-theme-key", "green"); - } - - return { - ...initState, - ...CommonReducer(set), - ...SdmReducer(set), - ...DmMapReducer(set), - ...DmStatusReducer(set), - }; - }); -}; diff --git a/apps/dm_new/app/store/wrStatus/index.tsx b/apps/dm_new/app/store/wrStatus/index.tsx deleted file mode 100644 index d3cc61cc4..000000000 --- a/apps/dm_new/app/store/wrStatus/index.tsx +++ /dev/null @@ -1,129 +0,0 @@ -import { fetchType, getFetch } from "@/components/ui/api"; -import type { - DmStatusDataType, - DmStatusChartType, - DmStatusBoardType, -} from "./type"; -import type { SelectDataType } from "../common"; -import { makeRegion } from "@/app/common/comFunction"; - -export type DmStatusActions = { - getDmStatusData(cityCd: SelectDataType[]): void; // 데이터의 연도 반환 -}; - -export type DmStatusType = { - dmStatus: { - year : string; - statusData: DmStatusDataType[]; - facilityTotals: string[]; - chartData: DmStatusChartType[]; - }; -}; - -export const dmStatusState: DmStatusType = { - dmStatus: { - year : '', - statusData: [], - facilityTotals: [], - chartData: [], - }, -}; -export type DmStatusStore = DmStatusType & DmStatusActions; - -export const DmStatusReducer = (set: any): DmStatusActions => { - return { - getDmStatusData: async (cityCd: SelectDataType[]) => { - const data = await getFetch(fetchType.FO, "/dashBoard/daemin"); - const year = data.data[0]?.year; // API 응답에서 year 값을 할당합니다. - console.log('cityCd ', cityCd) - const dataSum = data.data.reduce( - (acc: DmStatusDataType, item: DmStatusDataType) => { - acc.sewage = ( - parseInt(acc.sewage.replaceAll(",", "")) + - parseInt(item.sewage.replaceAll(",", "")) - ).toLocaleString(); - acc.rainwater = ( - parseInt(acc.rainwater.replaceAll(",", "")) + - parseInt(item.rainwater.replaceAll(",", "")) - ).toLocaleString(); - acc.reclaimed = ( - parseInt(acc.reclaimed.replaceAll(",", "")) + - parseInt(item.reclaimed.replaceAll(",", "")) - ).toLocaleString(); - acc.sewageCnt = ( - parseInt(acc.sewageCnt.replaceAll(",", "")) + - parseInt(item.sewageCnt.replaceAll(",", "")) - ).toLocaleString(); - acc.rainwaterCnt = ( - parseInt(acc.rainwaterCnt.replaceAll(",", "")) + - parseInt(item.rainwaterCnt.replaceAll(",", "")) - ).toLocaleString(); - acc.reclaimedCnt = ( - parseInt(acc.reclaimedCnt.replaceAll(",", "")) + - parseInt(item.reclaimedCnt.replaceAll(",", "")) - ).toLocaleString(); - return acc; - }, - { - region: "합계", - sewage: "0", - rainwater: "0", - reclaimed: "0", - sewageCnt: "0", - rainwaterCnt: "0", - reclaimedCnt: "0", - } - ); - data.data.unshift(dataSum); - - //console.log("dataSum ", dataSum); - const facilityTotals = [ - "하수재이용시설" + "(총" + dataSum?.sewageCnt + "개소)", - "빗물재이용시설" + "(총" + dataSum?.rainwaterCnt + "개소)", - "중수도재이용시설" + "(총" + dataSum?.reclaimedCnt + "개소)", - ]; - - const boardData: DmStatusBoardType[] = data.data.map( - (item: DmStatusDataType) => { - const regionText = item.sidoNm; //cityCd.find((city) => item.region === city.val); - const sewage = item.sewage; - const rainwater = item.rainwater; - const reclaimed = item.reclaimed; - const sewageCnt = item.sewageCnt; - const rainwaterCnt = item.rainwaterCnt; - const reclaimedCnt = item.reclaimedCnt; - - return { - region: regionText ? regionText : item.region, - sewage: sewageCnt + "(" + sewage.toLocaleString() + ")", - rainwater: rainwaterCnt + "(" + rainwater.toLocaleString() + ")", - reclaimed: reclaimedCnt + "(" + reclaimed.toLocaleString() + ")", - }; - } - ).filter((item): item is DmStatusBoardType => item !== undefined); - - //console.log("boardData ", boardData); - - const chartData = data.data.map((item) => ({ - label: makeRegion( - cityCd.find((city) => item.region === city.val)?.text ?? "" - ), - 하수: item.sewage, - 빗물: item.rainwater, - 중수도: item.reclaimed, - })); - - set((state: DmStatusType) => ({ - ...state, - dmStatus: { - ...state.dmStatus, - year : year, - statusData: boardData, - chartData: chartData, - facilityTotals: facilityTotals, - }, - })); - - }, - }; -}; diff --git a/apps/dm_new/app/store/wrStatus/type.ts b/apps/dm_new/app/store/wrStatus/type.ts deleted file mode 100644 index 2cf1b36f0..000000000 --- a/apps/dm_new/app/store/wrStatus/type.ts +++ /dev/null @@ -1,41 +0,0 @@ -export type DmStatusDataType = { - sidoNm: string; // 시도명 - region: string; // 시도코드 - sewage: string; - rainwater: string; - reclaimed: string; - sewageCnt:string; - rainwaterCnt:string; - reclaimedCnt:string; -}; - -export type DmStatusBoardType = { - sidoNm: string; // 시도명 - region: string; - sewage: string; - rainwater: string; - reclaimed: string; -}; - -export type DmStatusFcltType = { - sewageFclt: string; - rainwaterFclt: string; - reclaimedFclt: string; - thermalFclt: string; - }; - - - -export type DmStatusChartType = { - label: string, - 하수: string, - 빗물: string, - 중수도: string, -} - -export type RegionData = { - name: string; - x: number; - y: number; - values: number[]; - } \ No newline at end of file diff --git a/apps/dm_new/components.json b/apps/dm_new/components.json deleted file mode 100644 index d9ef0ae53..000000000 --- a/apps/dm_new/components.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema.json", - "style": "default", - "rsc": true, - "tsx": true, - "tailwind": { - "config": "tailwind.config.ts", - "css": "app/globals.css", - "baseColor": "neutral", - "cssVariables": true, - "prefix": "" - }, - "aliases": { - "components": "@/components", - "utils": "@/lib/utils", - "ui": "@/components/ui", - "lib": "@/lib", - "hooks": "@/hooks" - }, - "iconLibrary": "lucide" -} \ No newline at end of file diff --git a/apps/dm_new/components/ui/api/index.ts b/apps/dm_new/components/ui/api/index.ts deleted file mode 100644 index 49d244d25..000000000 --- a/apps/dm_new/components/ui/api/index.ts +++ /dev/null @@ -1,151 +0,0 @@ -//8880 -import { AUTH_USER_ID, CLAIM_NAME } from "@/src/shared/config"; -import { getCookie } from "@common/components/lib/cookie"; -import { DEV_URL_FO, DEV_URL_WR, LOCAL_URL } from "../config/"; - - -const tokenId = getCookie(AUTH_USER_ID); -const Authorization = getCookie(CLAIM_NAME); - -export const fetchType = { - COMMON: "common", - WR: "wr", - FO: "fo", - SN: "sn", - LOCAL: "LOCAL", - CS: "CS", -}; - -const API_VERSION = "/api/v1" -const servers = { - common: "", - local: "", - fo: "/operation-service" + API_VERSION, - wr: "/reuse-service" + API_VERSION, - sn: "/sewerage-service" + API_VERSION, -} - -interface RequestParams { - [key: string]: unknown; -} - -export const getFetch = async (type: string, url: string) => { - const baseUrl = servers[type]; - const response = await fetch(baseUrl + url, { - method: "GET", - headers: { - accept: "application/json", - [AUTH_USER_ID]: tokenId ?? "", - [CLAIM_NAME]: Authorization ?? "", - }, - }); - - if (!response.ok) { - throw new Error(`오류 발생: ${response.status}`); - } - const res = await response.json(); - return res; -}; - -export const getFetchWithCount = async (type: string, url: string) => { - const div = - type === fetchType.COMMON - ? DEV_URL_FO - : type === fetchType.LOCAL - ? LOCAL_URL - : type === fetchType.CS - ? "" - : DEV_URL_WR; - const apiUrl = div + url; - - const response = await fetch(apiUrl, { - method: "GET", - headers: { - accept: "application/json", - }, - }); - - if (!response.ok) { - console.log(`오류 발생: ${response.status}`); - } - - const contentType = response.headers.get("content-type") ?? ""; - - if (contentType.includes("application/json")) { - // JSON 응답 처리 - const res = await response.json(); - - return res; - } else if(contentType.includes('application/octet-stream')) { - // 파일 응답 처리 (ex. PDF, Excel 등) - - console.log('contentType ' ,contentType) - const blob = await response.blob(); - const blobUrl = window.URL.createObjectURL(blob); - const a = document.createElement("a"); - const filename = "downloaded_file.PDF"; - - a.href = blobUrl; - a.download = filename; - a.click(); - window.URL.revokeObjectURL(blobUrl); - - return null; // 다운로드이므로 반환값 없음 - }else{ - throw Error('오류 발생') - } -}; - -export const postFetch = async (url: string, params: RequestParams) => { - const baseUrl = servers[fetchType.WR]; - const response = await fetch(baseUrl + url, { - method: "POST", - headers: { - "Content-Type": "application/json", - [AUTH_USER_ID]: tokenId ?? "", - [CLAIM_NAME]: Authorization ?? "", - }, - body: JSON.stringify(params), - }); - - if (!response.ok) { - throw new Error(`오류 발생: ${response.status}`); - } - return response; -}; - -export const putFetch = async (url: string, params: RequestParams) => { - const baseUrl = servers[fetchType.WR]; - const response = await fetch(baseUrl + url, { - method: "PUT", - headers: { - "Content-Type": "application/json", - [AUTH_USER_ID]: tokenId ?? "", - [CLAIM_NAME]: Authorization ?? "", - }, - body: JSON.stringify(params), - }); - - if (!response.ok) { - throw new Error(`오류 발생: ${response.status}`); - } - return response; -}; - -export const deleteFetch = async (url: string, params: RequestParams) => { - const baseUrl = servers[fetchType.WR]; - const response = await fetch(baseUrl + url, { - method: "DELETE", - headers: { - "Content-Type": "application/json", - [AUTH_USER_ID]: tokenId ?? "", - [CLAIM_NAME]: Authorization ?? "", - }, - body: JSON.stringify(params), - }); - - if (!response.ok) { - throw new Error(`오류 발생: ${response.status}`); - } - return response; -}; \ No newline at end of file diff --git a/apps/dm_new/components/ui/common/searhDemandInput/component.tsx b/apps/dm_new/components/ui/common/searhDemandInput/component.tsx deleted file mode 100644 index 70ccf9efc..000000000 --- a/apps/dm_new/components/ui/common/searhDemandInput/component.tsx +++ /dev/null @@ -1,103 +0,0 @@ -import { useDmStore } from '@/app/store'; -import type { DemandCompType } from '@common/business_components/ui/sdmInsertForm/form'; -import React, { useCallback, useEffect, useRef, useState } from 'react'; - -type thisProps = { - label: string | undefined; - initValue: string | undefined; - setValue : (dmdCoNm?: string) => void; - setRtnData : (rtnData: DemandCompType[]) => void; -} - -export default function SearchInputText({label=undefined, initValue=undefined, setValue=()=>{}, setRtnData=()=>{}} :thisProps) { - - const { getDemandCompList, Sdm } = useDmStore((state) => state); - - const { - demandCompList - } = Sdm; - - const [isOpen, setIsOpen] = useState(false); - const [textValue, setTextValue] = useState(initValue || ''); - const wrapperRef = useRef(null); - const handleInputChange = useCallback((e: React.ChangeEvent) => { - const value = e.target.value; - setTextValue(value); - setValue(value); - if (value) { - setIsOpen(true); - getDemandCompList(value, 20); - } else { - setIsOpen(false); - } - }, [getDemandCompList, setValue]); - - const handleSuggestionClick = useCallback((dmdCoNm: string) => { - setTextValue(dmdCoNm); - setValue(dmdCoNm); - setIsOpen(false); - setRtnData(demandCompList); - }, [demandCompList, setRtnData, setValue]); - - useEffect(() => { - const handleClickOutside = (event: MouseEvent) => { - if (wrapperRef.current && !wrapperRef.current.contains(event.target as Node)) { - setIsOpen(false); - } - }; - - document.addEventListener('mousedown', handleClickOutside); - return () => { - document.removeEventListener('mousedown', handleClickOutside); - }; - }, []); - - 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" - placeholder={`${label}을(를) 입력하세요`} - /> - {isOpen && ( -
-
- {demandCompList && demandCompList.length > 0 ? demandCompList.map((item : DemandCompType, index : number) => ( -
handleSuggestionClick(item.dmdCoNm)} - role="button" - tabIndex={0} - onKeyDown={(e) => { - if (e.key === 'Enter' || e.key === ' ') { - handleSuggestionClick(item.dmdCoNm); - } - }} - > - {item.dmdInfoId.substring(10,14) !== '0000' ? ( - <> - 사업자번호 : {item.dmdInfoId.substring(0,10)}  - 종사업자번호 : {item.dmdInfoId.substring(10,14)}  - - ) : ( - <> - 사업자번호 : {item.dmdInfoId.substring(0,10)}  - - )} - {item.dmdCoNm} -
- )) : ( -
- 검색 결과가 없습니다. -
- )} -
-
- )} -
- ) -} \ No newline at end of file diff --git a/apps/dm_new/components/ui/common/utils/utils.ts b/apps/dm_new/components/ui/common/utils/utils.ts deleted file mode 100644 index 19c92bff2..000000000 --- a/apps/dm_new/components/ui/common/utils/utils.ts +++ /dev/null @@ -1,54 +0,0 @@ -export const sanitizeInput = (val: string, allowDecimal = false) => { - if (val === "") return ""; // 빈 값 허용 - - // 소숫점 허용 - if (allowDecimal) { - // 숫자와 점만 허용 - let cleaned = val.replace(/[^0-9.]/g, ""); - // 소숫점 여러 개일 경우 첫 번째만 유지 - const parts = cleaned.split("."); - if (parts.length > 2) { - cleaned = parts[0] + "." + parts.slice(1).join(""); - } - return cleaned; - } - - // 정수만 허용 - return val.replace(/[^0-9]/g, ""); -}; - - - -// utils: format Date <-> "YYYY-MM-DD" without moment -export const formatDateToYMD=(value: Date): string => { - if (!value) return ""; - // value can be Date | string ("YYYY-MM-DD") - if (typeof value === "string") { - // assume already in yyyy-mm-dd - if (/^\d{4}-\d{2}-\d{2}$/.test(value)) return value; - const d = new Date(value); - if (isNaN(d.getTime())) return ""; - return toYMD(d); - } - if (value instanceof Date) { - if (isNaN(value.getTime())) return ""; - return toYMD(value); - } - return ""; -} - -const toYMD=(date: Date): string => { - // avoid timezone shift by normalizing to local date parts - const y = date.getFullYear(); - const m = String(date.getMonth() + 1).padStart(2, "0"); - const day = String(date.getDate()).padStart(2, "0"); - return `${y}-${m}-${day}`; -} - -// const parseYMDToDate=(ymd: string): Date | null => { -// if (!/^\d{4}-\d{2}-\d{2}$/.test(ymd)) return null; -// const [y, m, d] = ymd.split("-").map(Number); -// const date = new Date(y, (m - 1), d); -// // validate round-trip -// return (date.getFullYear() === y && date.getMonth() === m - 1 && date.getDate() === d) ? date : null; -// } \ No newline at end of file diff --git a/apps/dm_new/components/ui/config/index.ts b/apps/dm_new/components/ui/config/index.ts deleted file mode 100644 index 8dc7bdb50..000000000 --- a/apps/dm_new/components/ui/config/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { PROXY_HOST } from "@/src/shared/config/env"; - -export const LOCAL_URL = PROXY_HOST; -export const DEV_URL_FO = "/operation-service/api/v1"; -export const DEV_URL_WR = "/reuse-service/api/v1"; -export const DEV_URL_SN = "/sewerage-service/api/v1"; diff --git a/apps/dm_new/components/ui/map/SearchInputText/SearchInputText.tsx b/apps/dm_new/components/ui/map/SearchInputText/SearchInputText.tsx deleted file mode 100644 index b37fdb788..000000000 --- a/apps/dm_new/components/ui/map/SearchInputText/SearchInputText.tsx +++ /dev/null @@ -1,139 +0,0 @@ -import React, { useCallback, useEffect, useRef, useState } from "react"; - -type SearchType = { - bscFctNm: string; - bscFctCd: string; -}; - -type thisProps = { - label: string | undefined; - initValue: string | undefined; - setValue: (searchNm?: string) => void; - setRtnData: (rtnData: any) => void; - searchList?: SearchType[]; -}; - -export default function SearchInputText({ - label = undefined, - initValue = undefined, - setValue = () => {}, - setRtnData = () => {}, - searchList = [], -}: thisProps) { - const [isOpen, setIsOpen] = useState(false); - const [textValue, setTextValue] = useState(initValue || ""); - const [highlightIndex, setHighlightIndex] = useState(-1); - - const wrapperRef = useRef(null); - - const handleInputChange = useCallback( - (e: React.ChangeEvent) => { - const value = e.target.value; - setTextValue(value); - setValue(value); - setHighlightIndex(-1); - setIsOpen(value !== ""); - }, - [setValue] - ); - - const handleSuggestionClick = useCallback( - (searchNm: string) => { - setValue(searchNm); - setTextValue(searchNm); - setIsOpen(false); - setRtnData(searchList?.find((item) => item.bscFctNm === searchNm) || {}); - }, - [searchList, setRtnData, setValue] - ); - - const handleKeyDown = useCallback( - (e: React.KeyboardEvent) => { - if (!isOpen || searchList.length === 0) return; - - if (e.key === "ArrowDown") { - e.preventDefault(); - setHighlightIndex((prev) => (prev + 1) % searchList.length); - } else if (e.key === "ArrowUp") { - e.preventDefault(); - setHighlightIndex((prev) => - prev <= 0 ? searchList.length - 1 : prev - 1 - ); - } else if (e.key === "Enter") { - e.preventDefault(); - if (searchList.length === 1 && searchList[0]) { - handleSuggestionClick(searchList[0].bscFctNm); - } else if (highlightIndex >= 0 && highlightIndex < searchList.length && searchList[highlightIndex]) { - handleSuggestionClick(searchList[highlightIndex].bscFctNm); - } - } - }, - [highlightIndex, isOpen, searchList, handleSuggestionClick] - ); - - useEffect(() => { - const handleClickOutside = (event: MouseEvent) => { - if ( - wrapperRef.current && - !wrapperRef.current.contains(event.target as Node) - ) { - setIsOpen(false); - } - }; - - document.addEventListener("mousedown", handleClickOutside); - return () => { - document.removeEventListener("mousedown", handleClickOutside); - }; - }, []); - - return ( -
- { - setTextValue(""); - setValue(""); - setIsOpen(false); - }} - /> - {isOpen && ( -
-
- {searchList.length > 0 ? ( - searchList.map((item, index) => ( -
handleSuggestionClick(item.bscFctNm)} - role="button" - tabIndex={0} - onKeyDown={(e) => { - if (e.key === "Enter" || e.key === " ") { - handleSuggestionClick(item.bscFctNm); - } - }} - > - {item.bscFctNm} -
- )) - ) : ( -
- 검색 결과가 없습니다. -
- )} -
-
- )} -
- ); -} diff --git a/apps/dm_new/components/ui/map/searchBar/searchBar.tsx b/apps/dm_new/components/ui/map/searchBar/searchBar.tsx deleted file mode 100644 index c52b85b0a..000000000 --- a/apps/dm_new/components/ui/map/searchBar/searchBar.tsx +++ /dev/null @@ -1,119 +0,0 @@ -"use client"; -import { useDmStore } from "@/app/store"; -import { - SelectBox, - type SelectDataType, -} from "@common/business_components/ui"; -import { Button, Label } from "@common/components/ui"; -import { useCallback, useEffect, useState } from "react"; -import SearchInputText from "../SearchInputText/SearchInputText"; - -export function SearchBar({ - setHasuPk, - onApply, -}: { - setHasuPk: (hasuPk: any) => void; - onApply: () => void; -}) { - const { map, Common, initializeCommonData, findRuseFclt } = useDmStore( - (state) => state - ); - const [sidoValue, setSidoValue] = useState(""); - const [sigunValue, setSigunValue] = useState(""); - const [filteredSigunData, setFilteredSigunData] = useState([ - { text: "전체", val: "0" }, - ]); - - useEffect(() => { - initializeCommonData(); - }, [initializeCommonData]); - - const initializeSigunData = useCallback( - (sidoCd: string) => { - if (sidoCd === "0") { - setSigunValue("0"); - setFilteredSigunData([{ text: "전체", val: "0" }]); - } else { - const newFilteredData = [ - { text: "전체", val: "0" }, - ...Common.selectSigunData.filter( - (item: SelectDataType) => item.val.substring(0, 2) === sidoCd - ), - ]; - setSigunValue("0"); - setFilteredSigunData(newFilteredData); - } - }, - [Common.selectSigunData] - ); - - const onSelectValue = useCallback( - (val: string, type: string) => { - switch (type) { - case "ctpvCd": - initializeSigunData(val); - setSidoValue(val); - break; - case "sggCd": - setSigunValue(val); - } - }, - [initializeSigunData] - ); - - return ( -
-
- onSelectValue(val.toString(), "ctpvCd")} - value={sidoValue || Common.selectSidoData[0]?.val || ""} - /> - onSelectValue(val.toString(), "sggCd")} - value={sigunValue} - /> - -
- { - let sggOrCity = ""; - if (searchNm) { - if (sigunValue === "0" || sigunValue === "") { - sggOrCity = sidoValue; - } else { - sggOrCity = sigunValue; - } - findRuseFclt(sggOrCity, searchNm); - } - }} - setRtnData={(rtnData: any) => { - setHasuPk(rtnData); - }} - searchList={map.ruseFcltList || []} - /> -
- -
-
- ); -} diff --git a/apps/dm_new/components/ui/sdmInfoInsertForm/AccessibleFormField.tsx b/apps/dm_new/components/ui/sdmInfoInsertForm/AccessibleFormField.tsx deleted file mode 100644 index c37270df8..000000000 --- a/apps/dm_new/components/ui/sdmInfoInsertForm/AccessibleFormField.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { FormUi } from "@common/business_components/ui"; -import type { ControllerRenderProps, FieldError, FieldValues, Path } from "react-hook-form"; -import { cloneElement, isValidElement } from "react"; -interface AccessibleFormFieldProps { - field: ControllerRenderProps>; - label: string; - required?: boolean; - error?: FieldError; - isDisabled?: boolean; - inputComponent: React.ReactElement<{ disabled?: boolean }>; -} - -export function AccessibleFormField({ - label, - required = false, - inputComponent, - isDisabled = false, -}: AccessibleFormFieldProps) { - const labelText = required ? `${label} *` : label; - - return ( - -
- {isValidElement(inputComponent) - ? cloneElement(inputComponent, { disabled: isDisabled } as Partial) - : inputComponent} - {/* {error?.message && Array.from(new Set(error.message.split('\n'))).map((msg, idx) => ( -

- {msg} -

- ))} */} -
-
- ); -} diff --git a/apps/dm_new/components/ui/sdmInfoInsertForm/component.tsx b/apps/dm_new/components/ui/sdmInfoInsertForm/component.tsx deleted file mode 100644 index 44c6d3f82..000000000 --- a/apps/dm_new/components/ui/sdmInfoInsertForm/component.tsx +++ /dev/null @@ -1,962 +0,0 @@ -// import ModalSimilarPage from "@/app/(base-layout)/pages/sdmMng/sdmInfoInsert/modalSimilar/page"; -// import { useDmStore } from "@/app/store"; -// import { -// CANDIDATE, -// // DatePicker, -// FormField, -// FormLabel, -// FormUi, -// SelectBox, -// UiModal, -// } from "@common/business_components"; -// import { Input } from "@common/components"; -// import { Button, Label } from "@common/components/ui"; -// import { useSearchParams } from "next/navigation"; -// import { useCallback, useEffect, useState } from "react"; -// import { AccessibleFormField } from "./AccessibleFormField"; -// import { -// type ControllerRenderProps, -// type UseFormReturn, -// type FieldError, -// useWatch, -// } from "react-hook-form"; -// import SearchInputText from "../common/searhDemandInput/component"; -// import React from "react"; -// import { formatDateToYMD, sanitizeInput } from "../common/utils/utils"; -// import type { DemandCompType } from "@common/business_components/ui/sdmInsertForm/form"; -// import type { SdmInfoFormData } from "@/app/store/sdmMng"; - -// export interface SdmInfoRegFormProps { -// form: UseFormReturn; -// onCheckboxChange?: (checked: boolean) => void; -// facilityName?: string; -// } - -// type FieldComponent = ( -// field: ControllerRenderProps -// ) => React.ReactElement<{ disabled?: boolean }>; - -// export function SdmInfoRegForm({ -// form, -// onCheckboxChange, -// facilityName, -// }: SdmInfoRegFormProps) { -// const { initializeCommonData, Sdm } = useDmStore((state) => state); -// const { useTypesData, defaultRules, disableRules } = Sdm; -// const searchParams = useSearchParams(); - -// const [sdmNmValue, setSdmNmValue] = useState( -// searchParams.get("dmdCoNm") || "" -// ); - -// const [frontPHdata, setFrontPHdata] = useState("0"); -// const [backPHdata, setBackPHdata] = useState("0"); -// const [isBznmTotNoDisabled, setIsBznmTotNoDisabled] = useState(false); -// const [isSimilarCase, setIsSimilarCase] = useState(false); -// const [key, setKey] = useState(0); -// // 후보지 팝업 오픈 상태 - -// //모달 조회에 필요한 데이터 -// const [sply, setSply] = useState(0); -// const [usageCd, setUsageCd] = useState("청소"); -// const [money, setMoney] = useState(0); - -// useEffect(() => { -// initializeCommonData(); -// }, [initializeCommonData]); - -// useEffect(() => { -// console.log("candidateTitle ", form.getValues("candidateTitle")); -// }, [form.getValues]); - -// useEffect(() => { -// if (useTypesData && useTypesData.length > 0) { -// setTimeout(() => { -// form.setValue("usePurpose", useTypesData[0]?.val?.toString() || ""); -// }, 500); -// } -// }, [useTypesData, form.setValue, form]); - -// useEffect(() => { -// if (facilityName) { -// setSdmNmValue(facilityName); -// form.setValue("sdmNm", facilityName); -// setKey((prev) => prev + 1); -// } -// }, [facilityName, form.setValue, form]); - -// useEffect(() => { -// if (searchParams.get("dmdCoNm")) { -// form.setValue("sdmNm", searchParams.get("dmdCoNm") || ""); -// setSdmNmValue(searchParams.get("dmdCoNm") || ""); -// setKey((prev) => prev + 1); -// } -// }, [searchParams, form.setValue, form]); - -// const searchCandidate = (e: React.MouseEvent) => { -// e.preventDefault(); -// e.stopPropagation(); -// const dmdInfoId = JSON.parse( -// sessionStorage.getItem("user") || "{}" -// )?.dmdInfoId?.toString(); - -// const url = `/map/popup?dmdInfoId=${encodeURIComponent(dmdInfoId)}`; -// const width = window.screen.availWidth; -// const height = window.screen.availHeight; -// const left = 0; -// const top = 0; -// const popupOptions = `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes`; -// window.open(url, "candidatePopup", popupOptions); -// }; - -// const searchSimilarCase = (e: React.MouseEvent) => { -// e.preventDefault(); -// e.stopPropagation(); -// setIsSimilarCase(true); -// }; - -// const handleCheckboxChange = (checked: boolean) => { -// setIsBznmTotNoDisabled(checked); -// onCheckboxChange?.(checked); -// }; - -// useEffect(() => { -// const watchPH = form.getValues(`ph`); -// if (watchPH && watchPH !== undefined) { -// const [frontPH, backPH] = watchPH.split("~"); -// if (frontPH) { -// setFrontPHdata(frontPH); -// } -// if (backPH) { -// setBackPHdata(backPH); -// } -// } else { -// setFrontPHdata("0"); -// setBackPHdata("0"); -// } -// }, [form.getValues(`ph`)]); - -// const isSetPh = useCallback( -// (typePHdata: string, index: number) => { -// const PHdata = form.getValues("ph"); -// const isPH = PHdata?.split("~")[index] || ""; -// if (index == 0) { -// form.setValue("ph", `${isPH}~${typePHdata}`); -// setBackPHdata(typePHdata); -// } else if (index == 1) { -// form.setValue("ph", `${typePHdata}~${isPH}`); -// setFrontPHdata(typePHdata); -// } -// }, -// [form] -// ); - -// const usePurpose = useWatch({ control: form.control, name: "usePurpose" }); - -// useEffect(() => { -// if (!usePurpose) return; - -// // Apply default values -// const defaults = defaultRules[usePurpose]; - -// if (defaults) { -// Object.entries(defaults).forEach(([field, value]) => { -// form.setValue(field as keyof SdmInfoFormData, value, { -// shouldDirty: true, -// }); -// }); -// } -// }, [form.getValues("usePurpose")]); - -// // 시설 선택시 이벤트 -// const selectComp = useCallback( -// (rtnData: DemandCompType[]) => { -// const rtnCompData = rtnData?.[0]; -// form.setValue("sdmNm", rtnCompData?.dmdCoNm || ""); -// }, -// [form] -// ); - -// const formFields: Array<{ -// name: keyof SdmInfoFormData; -// label: string; -// component: FieldComponent | undefined; -// formIndex: number; -// required?: boolean; -// }> = [ -// { -// name: "sdmNm", -// label: "수요처선택", -// formIndex: 0, -// required: true, -// component: (field) => ( -//
-// { -// setSdmNmValue(val || ""); -// field.onChange(val || ""); -// }} -// setRtnData={selectComp} -// initValue={facilityName || sdmNmValue} -// {...field} -// /> -//
-// ), -// }, -// { -// name: "demandYmd", -// label: "요구시기", -// formIndex: 0, -// required: true, -// component: (field) => ( -//
-// {/* { -// field.onChange(date as Date); -// }} -// className="" -// //defaultMonth={field.value as Date} -// field={{ -// value: field.value as Date, -// onChange: (date: Date | undefined) => { -// field.onChange(date as Date); -// }, -// }} -// showOutsideDays={true} -// selectClass={undefined} -// /> */} -// {/* 네이티브 input */} -// { -// const selectedDate = e.target.value ? new Date(e.target.value) : null; -// field.onChange(selectedDate); -// }} -// value={ formatDateToYMD(field.value as Date) } -// /> -//
-// ), -// }, -// { -// name: "demandQnty", -// label: "요구수량(㎥/d)", -// formIndex: 0, -// required: true, -// component: (field) => ( -// { -// field.onChange(e); -// setSply(Number(e.target.value)); -// }} -// onBlur={field.onBlur} -// name={field.name} -// ref={field.ref} -// /> -// ), -// }, -// { -// name: "usePurpose", -// label: "사용용도", -// formIndex: 0, -// required: true, -// component: (field) => ( -// { -// field.onChange(val.toString()); -// setUsageCd(val.toString()); -// }} -// className="" -// value={field.value as string} -// /> -// ), -// }, -// { -// name: "money", -// label: "희망단가(원)", -// formIndex: 0, -// required: true, -// component: (field) => ( -// -// { -// field.onChange(e); -// setMoney(Number(e.target.value)); -// }} -// onBlur={field.onBlur} -// name={field.name} -// ref={field.ref} -// /> -// -// ), -// }, -// { -// name: "reqWaterQlty", -// label: "요구수질", -// formIndex: 0, -// required: true, -// component: undefined, -// }, - -// { -// name: "candidateTitle", -// label: CANDIDATE || "공급처 후보지 선택(필수아님)", -// formIndex: 2, -// component: () => ( -//
-//
-// -// -//
-//
-// {(form.getValues("candidateTitle") || []).map( -// (candidate: any, index: number) => ( -// -// ) -// )} -//
-//
-// ), -// }, -// ]; - -// const normalFields = formFields.filter( -// (f) => f.formIndex === 0 && f.component -// ); - -// const candidateFields = formFields.filter( -// (f) => f.formIndex === 2 && f.component -// ); - -// return ( -// <> -// {normalFields.map(({ name, label, component, required }) => -// component ? ( -// -// name === "money" ? ( -//
-// -// {component(field)} -//
-// ) : ( -// // {component(field)} -// -// ) -// } -// /> -// ) : null -// )} - -//
-// 요구수질 -//
-// { -// const disabledFields = usePurpose ? disableRules[usePurpose] : []; -// const isDisabled = disabledFields -// ? disabledFields.includes(field.name) -// : true; -// return ( -// -//
-//
-// { -// const inputValue = e.target.value.replace( -// /[^0-9]/g, -// "" -// ); // 정수만 -// field.onChange( -// inputValue === "" ? null : Number(inputValue) -// ); -// }} -// value={ -// field.value !== undefined && field.value !== null -// ? `${field.value}` -// : "불검출" -// } -// maxLength={6} -// disabled={isDisabled} -// onBlur={field.onBlur} -// name={field.name} -// ref={field.ref} -// /> -// {/* TODO: 총대장균군수 확인 필요*/} -// {field.value !== null ? ( -// -// 이하 -// -// ) : ( -// <> -// )} -//
-//
-//
-// ); -// }} -// /> -// { -// const disabledFields = usePurpose ? disableRules[usePurpose] : []; -// const isDisabled = disabledFields -// ? disabledFields.includes(field.name) -// : true; -// return ( -// -//
-//
-// { -// const inputValue = e.target.value.replace( -// /[^0-9]/g, -// "" -// ); // 정수만 -// field.onChange( -// inputValue === "" ? null : Number(inputValue) -// ); -// }} -// value={ -// field.value !== undefined && field.value !== null -// ? `${field.value}` -// : "" -// } -// maxLength={6} -// disabled={isDisabled} -// onBlur={field.onBlur} -// name={field.name} -// ref={field.ref} -// /> -// -// 이하 -// -//
-//
-//
-// ); -// }} -// /> -// { -// const disabledFields = usePurpose ? disableRules[usePurpose] : []; -// const isDisabled = disabledFields -// ? disabledFields.includes(field.name) -// : true; -// return ( -// -//
-//
-// { -// const cleanValue = sanitizeInput( -// e.target.value, -// true -// ); -// field.onChange( -// cleanValue === "" ? null : Number(cleanValue) -// ); -// }} -// value={field.value ?? ""} -// maxLength={6} -// disabled={isDisabled} -// onBlur={field.onBlur} -// name={field.name} -// ref={field.ref} -// /> -// -// 이상 -// -//
-//
-//
-// ); -// }} -// /> -// { -// const disabledFields = usePurpose ? disableRules[usePurpose] : []; -// const isDisabled = disabledFields -// ? disabledFields.includes(field.name) -// : true; -// return ( -// -//
-//
-// { -// const cleanValue = sanitizeInput( -// e.target.value, -// true -// ); -// field.onChange( -// cleanValue === "" ? null : Number(cleanValue) -// ); -// }} -// value={field.value ?? ""} -// maxLength={6} -// disabled={isDisabled} -// onBlur={field.onBlur} -// name={field.name} -// ref={field.ref} -// /> -// -// 이하 -// -//
-//
-//
-// ); -// }} -// /> -// { -// const disabledFields = usePurpose ? disableRules[usePurpose] : []; -// const isDisabled = disabledFields -// ? disabledFields.includes(field.name) -// : true; -// return ( -// -//
-//
-// { -// const inputValue = e.target.value.replace( -// /[^0-9]/g, -// "" -// ); // 정수만 -// field.onChange( -// inputValue === "" ? null : Number(inputValue) -// ); -// }} -// value={ -// field.value !== undefined && field.value !== null -// ? `${field.value}` -// : "" -// } -// maxLength={6} -// disabled={isDisabled} -// onBlur={field.onBlur} -// name={field.name} -// ref={field.ref} -// /> -// -// 이하 -// -//
-//
-//
-// ); -// }} -// /> -//
-// -//
-// { -// const cleanValue = sanitizeInput(e.target.value, true); -// isSetPh(cleanValue, 1); -// }} -// value={frontPHdata ?? ""} -// maxLength={5} -// /> -// ~ -// { -// const cleanValue = sanitizeInput(e.target.value, true); -// isSetPh(cleanValue, 0); -// }} -// value={backPHdata ?? ""} -// maxLength={5} -// /> -//
-//
-// { -// const disabledFields = usePurpose ? disableRules[usePurpose] : []; -// const isDisabled = disabledFields -// ? disabledFields.includes(field.name) -// : true; -// return ( -// -//
-//
-// { -// const inputValue = e.target.value.replace( -// /[^0-9]/g, -// "" -// ); // 정수만 -// field.onChange( -// inputValue === "" ? null : Number(inputValue) -// ); -// }} -// value={ -// field.value !== undefined && field.value !== null -// ? `${field.value}` -// : "" -// } -// maxLength={6} -// disabled={isDisabled} -// onBlur={field.onBlur} -// name={field.name} -// ref={field.ref} -// /> -// -// 이하 -// -//
-//
-//
-// ); -// }} -// /> -// { -// const disabledFields = usePurpose ? disableRules[usePurpose] : []; -// const isDisabled = disabledFields -// ? disabledFields.includes(field.name) -// : true; -// return ( -// -//
-//
-// { -// const inputValue = e.target.value.replace( -// /[^0-9]/g, -// "" -// ); // 정수만 -// field.onChange( -// inputValue === "" ? null : Number(inputValue) -// ); -// }} -// value={ -// field.value !== undefined && field.value !== null -// ? `${field.value}` -// : "" -// } -// maxLength={6} -// disabled={isDisabled} -// onBlur={field.onBlur} -// name={field.name} -// ref={field.ref} -// /> -// -// 이하 -// -//
-//
-//
-// ); -// }} -// /> -// { -// const disabledFields = usePurpose ? disableRules[usePurpose] : []; -// const isDisabled = disabledFields -// ? disabledFields.includes(field.name) -// : true; -// return ( -// -// { -// field.onChange(val.toString()); -// }} -// value={field.value} -// readOnly={isDisabled} -// onBlur={field.onBlur} -// ref={field.ref} -// /> -// -// ); -// }} -// /> -// { -// const disabledFields = usePurpose ? disableRules[usePurpose] : []; -// const isDisabled = disabledFields -// ? disabledFields.includes(field.name) -// : true; -// return ( -// -//
-//
-// { -// const inputValue = e.target.value.replace( -// /[^0-9]/g, -// "" -// ); // 정수만 -// field.onChange( -// inputValue === "" ? null : Number(inputValue) -// ); -// }} -// value={ -// field.value !== undefined && field.value !== null -// ? `${field.value}` -// : "" -// } -// maxLength={6} -// disabled={isDisabled} -// onBlur={field.onBlur} -// name={field.name} -// ref={field.ref} -// /> -// -// 이하 -// -//
-//
-//
-// ); -// }} -// /> -// { -// const disabledFields = usePurpose ? disableRules[usePurpose] : []; -// const isDisabled = disabledFields -// ? disabledFields.includes(field.name) -// : true; -// return ( -// -//
-//
-// { -// const inputValue = e.target.value.replace( -// /[^0-9]/g, -// "" -// ); // 정수만 -// field.onChange( -// inputValue === "" ? null : Number(inputValue) -// ); -// }} -// value={ -// field.value !== undefined && field.value !== null -// ? `${field.value}` -// : "" -// } -// maxLength={6} -// disabled={isDisabled} -// onBlur={field.onBlur} -// name={field.name} -// ref={field.ref} -// /> -// -// 이하 -// -//
-//
-//
-// ); -// }} -// /> -// { -// return ( -// -//
-//
-// { -// field.onChange(e.target.value); -// }} -// value={ -// field.value !== undefined && field.value !== "" -// ? `${field.value}` -// : "" -// } -// onBlur={field.onBlur} -// name={field.name} -// ref={field.ref} -// /> -//
-//
-//
-// ); -// }} -// /> -//
-//
- -// {candidateFields.map(({ name, label, component, required }, index) => -// component ? ( -// ( -// // -// // {component(field)} -// // -// -// )} -// /> -// ) : null -// )} - -// {isSimilarCase && ( -// -// } -// bodyClass="sm:max-w-[100vw] w-[1400px] h-[100dvh] max-h-[900px] overflow-y-auto overflow-x-hidden" -// open={isSimilarCase} -// onOpenChange={(open) => !open && setIsSimilarCase(false)} -// noHeaderYn="Y" -// noFooterYn="Y" -// /> -// )} -// -// ); -// } diff --git a/apps/dm_new/components/ui/sdmLoginForm/component.tsx b/apps/dm_new/components/ui/sdmLoginForm/component.tsx deleted file mode 100644 index 7ec417c71..000000000 --- a/apps/dm_new/components/ui/sdmLoginForm/component.tsx +++ /dev/null @@ -1,197 +0,0 @@ -import { useDmStore } from "@/app/store"; -import { BZNM_TOT_NO, FormField, FormUi } from "@common/business_components"; -import type { DemandCompType } from "@common/business_components/ui/sdmInsertForm/form"; -import { Button, Input } from "@common/components"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { sha512 } from 'js-sha512'; -import React, { useEffect, useMemo, useState } from "react"; -import { FormProvider, useForm, type ControllerRenderProps } from "react-hook-form"; -import toast from "react-hot-toast"; -import * as z from "zod"; - -export function SdmLoginForm() { - const { actionLogin, initializeCommonData } = useDmStore((state) => state); - const [isBznmTotNoDisabled, setIsBznmTotNoDisabled] = useState(true); - - const formatBusinessNumber = (value: string) => { - // 숫자만 추출 - const digitsOnly = value.replace(/\D/g, ""); - - // 10자리까지만 처리 - const limitedDigits = digitsOnly.slice(0, 10); - - // 3-2-5 형식으로 포맷팅 - if (limitedDigits.length <= 3) { - return limitedDigits; - } else if (limitedDigits.length <= 5) { - return `${limitedDigits.slice(0, 3)}-${limitedDigits.slice(3)}`; - } else { - return `${limitedDigits.slice(0, 3)}-${limitedDigits.slice(3, 5)}-${limitedDigits.slice(5)}`; - } - }; - - // 스키마를 useMemo로 최적화 - const sdmLoginFormSchema = useMemo(() => z.object({ - dmdInfoId: z.string() - .min(1, "사업자등록번호를 입력해주세요") - .regex(/^\d{10}$/, "사업자등록번호는 10자리 숫자만 입력 가능합니다"), - bznmTotNo: isBznmTotNoDisabled - ? z.string().optional() - : z.string().length(4, "종사업자등록번호는 4자리 숫자만 입력 가능합니다"), - password: z.string() - .min(1, "비밀번호를 입력해주세요") - .min(8, "비밀번호는 8자 이상 입력해주세요") - .max(16, "비밀번호는 16자 이내로 입력해주세요"), - rgtr: z.string().optional(), - dmdAplyPswd: z.string().optional(), - }), [isBznmTotNoDisabled]); - - type SdmLoginForm = z.infer; - type FieldComponent = (field: ControllerRenderProps) => React.ReactElement; - - const formSchema = sdmLoginFormSchema; - - useEffect(() => { - initializeCommonData(); - }, [initializeCommonData]); - - const defaultValues: SdmLoginForm = { - dmdInfoId: '', - bznmTotNo: '', - password: '', - rgtr: '', - dmdAplyPswd: '', - }; - - const form = useForm({ - resolver: zodResolver(formSchema), - defaultValues, - mode: "onChange", - }); - - const handleCheckboxChange = (checked: boolean) => { - setIsBznmTotNoDisabled(checked); - }; - - const initPassword = () => { - toast( - (t) => ( -
-
- 관리자(031-0000-0000)에게 비밀번호 초기화 요청을 유선으로 하시기 바랍니다. -
- -
- ), - { - id: "pwd-reset", - duration: Infinity, - position: "top-center", - } - ); - } - - const handleLogin = () => { - const data = form.getValues(); - const passwordStr = sha512.hex(data.password) - data.dmdAplyPswd = passwordStr; - const param = { - dmdInfoId: data.dmdInfoId + (isBznmTotNoDisabled ? '0000' : data.bznmTotNo), - dmdAplyPswd: data.dmdAplyPswd, - } - actionLogin(param as unknown as DemandCompType); - }; - - const formFields: Array<{ - name: keyof SdmLoginForm; - label: string; - component: FieldComponent | undefined; - }> = [ - { - name: "dmdInfoId", - label: "사업자등록번호", - component: (field) => ( - { - const dmdId = e.target.value.replace(/\D/g, "").slice(0, 10); - field.onChange(dmdId); - }} - /> - ) - }, - { - name: "bznmTotNo", - label: BZNM_TOT_NO || "종사업자등록번호", - component: (field) => ( - - - - ) - }, - { - name: "password", - label: "비밀번호", - component: (field) => ( - - ) - } - ]; - - return ( - <> -
- - {formFields.map(({ name, label, component }) => ( - ( - label === '종사업자등록번호' ? - <> - {component && component(field)} - - : - {component && component(field)} - - )} - /> - ))} - -
-
- -
비밀번호 초기화 요청
-
-
-
- - ); -} \ No newline at end of file diff --git a/apps/dm_new/eslint.config.mjs b/apps/dm_new/eslint.config.mjs deleted file mode 100644 index 7de132089..000000000 --- a/apps/dm_new/eslint.config.mjs +++ /dev/null @@ -1,32 +0,0 @@ -import { dirname } from "path"; -import { fileURLToPath } from "url"; -import { FlatCompat } from "@eslint/eslintrc"; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); -const isProd = process.env.NODE_ENV === "production"; - -const compat = new FlatCompat({ - baseDirectory: __dirname, -}); - -const eslintConfig = [ - ...compat.extends("next/core-web-vitals", "next/typescript"), - { - files: ["**/*.{ts,tsx,mts,cts}"], - languageOptions: { - parserOptions: { - tsconfigRootDir: __dirname, - project: ["./tsconfig.json"], - }, - }, - }, - {rules:{ - // other rules.. - "@typescript-eslint/no-explicit-any": "off", - // "@next/next/no-img-element": "off", - ...(isProd ? { "react-hooks/exhaustive-deps": "off" } : {}), - }}, -]; - -export default eslintConfig; diff --git a/apps/dm_new/middleware.ts b/apps/dm_new/middleware.ts deleted file mode 100644 index e55f65515..000000000 --- a/apps/dm_new/middleware.ts +++ /dev/null @@ -1,175 +0,0 @@ -import { NextRequest, NextResponse } from "next/server"; -import { CLAIM_NAME, AUTH_USER_ID } from "./src/shared/config"; -// import { SERVER_API_FO_URL, SERVER_API_WR_URL } from "./src/shared/config/env"; - -// const CLAIM_NAME = "Authorization"; -// const AUTH_USER_ID = "token-id"; -const serverApiUrl = process.env.NEXT_PUBLIC_CS_SERVER_API_URL; -const GEOSERVER_URL = process.env.NEXT_PUBLIC_GEOSERVER_URL || ""; -const LX_GEOSERVER_URL = process.env.NEXT_PUBLIC_LX_GEOSERVER_URL || ""; -const GATEWAY_URL = process.env.NEXT_PUBLIC_GATEWAY_URL || ""; -const SEWERAGE_API_URL = process.env.NEXT_PUBLIC_SEWERAGE_API_URL || ""; -const BUSINESS_JUSO_API_URL = process.env.NEXT_PUBLIC_FINDADRESS_URL || ""; -const AdressKey = process.env.NEXT_PRIVATE_WR_ADDRESS_KEY || ""; - -/** 공통: URLSearchParams의 값을 decodeURIComponent 적용하여 querystring 생성 */ -function toDecodedQueryString(params: URLSearchParams): string { - const entries: string[][] = Array.from(params.entries()).map(([k, v]) => { - try { - return [k, decodeURIComponent(v)] as string[]; - } catch { - return [k, v] as string[]; - } - }); - return new URLSearchParams(entries).toString(); -} - -export function middleware(req: NextRequest) { - const pathname = req.nextUrl.pathname; - console.log(`[Middleware] Request URL: ${req.url}`); - const searchParams = req.nextUrl.searchParams; - - if (pathname.startsWith("/server")) { - const decodedParams = Array.from(searchParams.entries()) - .map(([key, value]) => `${key}=${decodeURIComponent(value)}`) - .join("&"); - - const newUrl = `${serverApiUrl}${pathname.replace("/server", "")}${decodedParams ? `?${decodedParams}` : "" - }`; - return NextResponse.rewrite(new URL(newUrl)); - } - - if (pathname === "/") { - console.log(" maim 화면이동 "); - return NextResponse.redirect(new URL("/main", req.url)); - } - - if (pathname.startsWith("/attach-service")) { - const requestHeaders = new Headers(req.headers); - const token = req.cookies.get(CLAIM_NAME)?.value; - const userId = req.cookies.get(AUTH_USER_ID)?.value; - const newUrl = `${serverApiUrl}${pathname}`; - if (token) requestHeaders.set(CLAIM_NAME, token); - if (userId) requestHeaders.set(AUTH_USER_ID, userId); - - console.log(`[Middleware] Rewriting from '/attach-service' path to: ${newUrl}`); - return NextResponse.rewrite(new URL(newUrl), { - headers: requestHeaders, - }); - } - - if (pathname.startsWith("/user-service") - || pathname.startsWith("/cms-service")) { - let queryParams = searchParams.toString(); - const requestHeaders = new Headers(req.headers); - const newUrl = `${serverApiUrl}${pathname}${queryParams ? `?${queryParams}` : ""}`; - - console.log(`[Middleware] Rewriting from '/user-service' path to: ${newUrl}`); - return NextResponse.rewrite(new URL(newUrl), { - headers: requestHeaders, - }); - } - - if (pathname.startsWith("/geoserver")) { - let queryParams = searchParams.toString(); - const typename = searchParams.get("TYPENAME"); - const startYmd = searchParams.get("START_YMD") ?? null; - const endYmd = searchParams.get("END_YMD") ?? null; - console.log("typename ", typename); - - let newUrl = `${GEOSERVER_URL}${pathname.replace("/geoserver", "")}${queryParams ? `?${queryParams}` : ""}`; - - if ( - typename == "hasudo:tb_il_swage_prcs_fclt" || //하수처리시설 - typename == "hasudo:tb_ms_swage_prcs_zone" || //하수처리구역 - typename == "hasudo:tb_ms_sbmrg_dngr_map" || //침수위험지도 - typename == "hasudo:tb_ms_flood_dngr_map" //도시침수지도 - ) { - newUrl = `${GEOSERVER_URL}${pathname.replace("/geoserver", "")}${queryParams ? `?${queryParams}` : ""}`; - } else if ( - typename == "hasudo:tb_ms_swage_ppl" || //관로 - typename == "hasudo:tb_ms_swage_mhl" || //맨홀 - typename == "hasudo:tb_ms_swage_pmstn" || //펌프장 - typename == "hasudo:tb_ms_stofcbr" //우수토실 - ) { - newUrl = `${LX_GEOSERVER_URL}${pathname.replace("/geoserver", "")}${queryParams ? `?${queryParams}` : ""}`; - } else if ( - typename == "hasudo:om_dt_untrt_swg_rain" || //중점우수토실 - typename == "hasudo:om_wqlt_station" || //관측소 - typename == "hasudo:tb_wr_bdst_ruse_fclt" || //재이용시설 - typename == "hasudo:tb_wr_rnwtr_utztn_fclt" || //빗물이용시설 - typename == "hasudo:tb_wr_rswtr_fclt" || //중수도시설 - typename == "hasudo:tb_wr_htdfl_fclt" || //온배수시설 - typename == "hasudo:tb_wr_ruse_fclt_dmd_co" || //수요처 - typename == "hasudo:tb_wr_tmpr_dmd_co" //잠재수요처 - ) { - const url = req.nextUrl.clone(); - url.searchParams.set("TYPENAME", typename.replace("hasudo:", "")); - if (startYmd) url.searchParams.set("startYmd", startYmd); - if (endYmd) url.searchParams.set("endYmd", endYmd); - queryParams = url.searchParams.toString(); - newUrl = `${GATEWAY_URL}/sewerage-service/api/v1/map/geometry${queryParams ? `?${queryParams}` : ""}`; - } - - console.log(`[Middleware] Rewriting from '/geoserver' path to: ${newUrl}`); - return NextResponse.rewrite(new URL(newUrl)); - } - - if (pathname.startsWith("/reuse-service")) { - const queryParams = searchParams.toString(); - const newUrl = `${GATEWAY_URL}${pathname}${queryParams ? `?${queryParams}` : ""}`; - console.log(`[Middleware] Rewriting from '/reuse-service' path to: ${newUrl}`); - return NextResponse.rewrite(new URL(newUrl)); - } else if (pathname.startsWith("/operation-service")) { - const queryParams = searchParams.toString(); - const newUrl = `${GATEWAY_URL}${pathname}${queryParams ? `?${queryParams}` : ""}`; - console.log(`[Middleware] Rewriting from '/operation-service' path to: ${newUrl}`); - return NextResponse.rewrite(new URL(newUrl)); - } else if (pathname.startsWith("/sewerage-service")) { - const queryParams = searchParams.toString(); - const newUrl = `${GATEWAY_URL}${pathname}${queryParams ? `?${queryParams}` : ""}`; - console.log(`[Middleware] Rewriting from '/sewerage-service' path to: ${newUrl}`); - return NextResponse.rewrite(new URL(newUrl)); - } - - if (pathname.startsWith("/ngii-server")) { - const decodedQuery = toDecodedQueryString(searchParams); - const newUrl = `${process.env.NEXT_PUBLIC_NGII_URL}${pathname.replace("/ngii-server", "")}${decodedQuery ? `?${decodedQuery}` : ""}`; - console.log(`[Middleware] Rewriting from '${pathname}' path to: ${newUrl}`); - return NextResponse.rewrite(new URL(newUrl)); - } - - if (pathname.startsWith("/bussiness-juso-service")) { - console.log("AdressKey ", AdressKey); - const params = new URLSearchParams({ - currentPage: "1", // 원하는 페이지 - countPerPage: "5", // 페이지당 결과 수 - keyword: searchParams.get("keyword") || "", // 검색어(주소) - confmKey: AdressKey, // 인증키 인터넷용 패쇄망용은 따로 발급 필요 즉 middleware에서 치환해서 사용해야할듯 - resultType: "json", // 결과 형식 기본은 xml - }); - const newUrl = `${BUSINESS_JUSO_API_URL}?${params.toString()}`; - console.log(`[Middleware] Request to business.juso.go.kr`); - console.log(req.url); - console.log(`[Middleware] Rewriting from '/business.juso.go.kr' path to: ${newUrl}`); - return NextResponse.rewrite(new URL(newUrl)); - } - - return NextResponse.next(); -} - -export const config = { - matcher: [ - "/server/:path*", - "/user-service/:path*", - "/cms-service/:path*", - "/attach-service/:path*", - "/geoserver/:path*", - "/operation-service/:path*", - "/reuse-service/:path*", - "/sewerage-service/:path*", - "/bussiness-juso-service/:path*", - "/ngii-server/:path*", - "/", - ], -}; diff --git a/apps/dm_new/next-env.d.ts b/apps/dm_new/next-env.d.ts deleted file mode 100644 index 1b3be0840..000000000 --- a/apps/dm_new/next-env.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/// -/// - -// NOTE: This file should not be edited -// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/apps/dm_new/next.config.ts b/apps/dm_new/next.config.ts deleted file mode 100644 index 5b5bf85da..000000000 --- a/apps/dm_new/next.config.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { NextConfig } from "next"; -// import path from "path"; - -const subDomain = - process.env.NEXT_PUBLIC_PROXY_HOST || "http://localhost:3000"; - -const nextConfig: NextConfig = { - output: "standalone", - experimental: { - proxyTimeout: 600000, - }, - - // // 🔥 반드시 필요 - // webpack(config) { - // config.resolve.alias = { - // ...(config.resolve.alias || {}), - // // monorepo 구조 기준 - // "@common": path.resolve(__dirname, "../../packages/common"), - // }; - // return config; - // }, - - async rewrites() { - return { - beforeFiles: [ - { - source: "/_next/static/:path*", - destination: `${subDomain}/_next/static/:path*`, - has: [ - { - type: "header", - key: "referer", - value: "(.*)/pst(.*)", - }, - ], - }, - ], - afterFiles: [ - { - source: "/sewerage-service/:path*", - destination: `${subDomain}/sewerage-service/:path*`, - }, - { - source: "/reuse-service/:path*", - destination: `${subDomain}/reuse-service/:path*`, - }, - { - source: "/operation-service/:path*", - destination: `${subDomain}/operation-service/:path*`, - }, - ], - fallback: [], - }; - }, -}; - -export default nextConfig; diff --git a/apps/dm_new/package.json b/apps/dm_new/package.json deleted file mode 100644 index 3df43f28e..000000000 --- a/apps/dm_new/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "dm_new", - "version": "0.1.0", - "private": true, - "scripts": { - "dev": "next dev -p 3015", - "build": "next build", - "start:dm_new": "next start -p 3015", - "lint": "next lint" - }, - "dependencies": { - "@common/assets": "workspace:*", - "@common/business_components": "workspace:*", - "@common/components": "workspace:*", - "@hookform/resolvers": "^4.1.3", - "class-variance-authority": "^0.7.1", - "clsx": "^2.1.1", - "js-cookie": "^3.0.5", - "js-sha512": "^0.9.0", - "lucide-react": "^0.474.0", - "next": "15.3.8", - "react-hook-form": "^7.54.2", - "react-hot-toast": "^2.5.2", - "tailwind-merge": "^3.0.1", - "tailwindcss-animate": "^1.0.7", - "zod": "^3.24.2" - }, - "devDependencies": { - "@eslint/eslintrc": "^3", - "@types/webpack": "^5.28.5", - "eslint": "^9", - "eslint-config-next": "15.3.8", - "postcss": "^8", - "tailwindcss": "^3.4.1", - "typescript": "^5" - } -} diff --git a/apps/dm_new/postcss.config.mjs b/apps/dm_new/postcss.config.mjs deleted file mode 100644 index 1a69fd2a4..000000000 --- a/apps/dm_new/postcss.config.mjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('postcss-load-config').Config} */ -const config = { - plugins: { - tailwindcss: {}, - }, -}; - -export default config; diff --git a/apps/dm_new/public/favicon.ico b/apps/dm_new/public/favicon.ico deleted file mode 100644 index d304b6981..000000000 Binary files a/apps/dm_new/public/favicon.ico and /dev/null differ diff --git a/apps/dm_new/public/fonts/NotoSansKR-Regular.woff2 b/apps/dm_new/public/fonts/NotoSansKR-Regular.woff2 deleted file mode 100644 index 61d064695..000000000 Binary files a/apps/dm_new/public/fonts/NotoSansKR-Regular.woff2 and /dev/null differ diff --git a/apps/dm_new/public/images/map/help.png b/apps/dm_new/public/images/map/help.png deleted file mode 100644 index e872802e4..000000000 Binary files a/apps/dm_new/public/images/map/help.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/BML_CBAS_PS.png b/apps/dm_new/public/images/map/layericon/BML_CBAS_PS.png deleted file mode 100644 index 0e70939ba..000000000 Binary files a/apps/dm_new/public/images/map/layericon/BML_CBAS_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/BML_ELEV_PS.png b/apps/dm_new/public/images/map/layericon/BML_ELEV_PS.png deleted file mode 100644 index 83970a331..000000000 Binary files a/apps/dm_new/public/images/map/layericon/BML_ELEV_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/BML_ETCP_PS.png b/apps/dm_new/public/images/map/layericon/BML_ETCP_PS.png deleted file mode 100644 index df9e4957b..000000000 Binary files a/apps/dm_new/public/images/map/layericon/BML_ETCP_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/BML_STMS_PS.png b/apps/dm_new/public/images/map/layericon/BML_STMS_PS.png deleted file mode 100644 index bf4357181..000000000 Binary files a/apps/dm_new/public/images/map/layericon/BML_STMS_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/BML_SYMB_PS.png b/apps/dm_new/public/images/map/layericon/BML_SYMB_PS.png deleted file mode 100644 index 497589bea..000000000 Binary files a/apps/dm_new/public/images/map/layericon/BML_SYMB_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/RDL_BYST_PS.png b/apps/dm_new/public/images/map/layericon/RDL_BYST_PS.png deleted file mode 100644 index 1e78cba68..000000000 Binary files a/apps/dm_new/public/images/map/layericon/RDL_BYST_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/RDL_CROS_PS.png b/apps/dm_new/public/images/map/layericon/RDL_CROS_PS.png deleted file mode 100644 index 57b5f2ca5..000000000 Binary files a/apps/dm_new/public/images/map/layericon/RDL_CROS_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/RDL_ETCT_PS.png b/apps/dm_new/public/images/map/layericon/RDL_ETCT_PS.png deleted file mode 100644 index e5a83f998..000000000 Binary files a/apps/dm_new/public/images/map/layericon/RDL_ETCT_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/RDL_OCUP_PS.png b/apps/dm_new/public/images/map/layericon/RDL_OCUP_PS.png deleted file mode 100644 index aeae3e266..000000000 Binary files a/apps/dm_new/public/images/map/layericon/RDL_OCUP_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/RDL_RDSN_PS.png b/apps/dm_new/public/images/map/layericon/RDL_RDSN_PS.png deleted file mode 100644 index 5629de9fb..000000000 Binary files a/apps/dm_new/public/images/map/layericon/RDL_RDSN_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/RDL_SCLT_PS.png b/apps/dm_new/public/images/map/layericon/RDL_SCLT_PS.png deleted file mode 100644 index 7281dc61d..000000000 Binary files a/apps/dm_new/public/images/map/layericon/RDL_SCLT_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/RDL_SEPC_PS.png b/apps/dm_new/public/images/map/layericon/RDL_SEPC_PS.png deleted file mode 100644 index b3db8e0a4..000000000 Binary files a/apps/dm_new/public/images/map/layericon/RDL_SEPC_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/RDL_STAT_PS.png b/apps/dm_new/public/images/map/layericon/RDL_STAT_PS.png deleted file mode 100644 index 9a0b11673..000000000 Binary files a/apps/dm_new/public/images/map/layericon/RDL_STAT_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/RDL_STLT_PS.png b/apps/dm_new/public/images/map/layericon/RDL_STLT_PS.png deleted file mode 100644 index 489524b5c..000000000 Binary files a/apps/dm_new/public/images/map/layericon/RDL_STLT_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/RDL_TFSN_PS.png b/apps/dm_new/public/images/map/layericon/RDL_TFSN_PS.png deleted file mode 100644 index 6dfff6696..000000000 Binary files a/apps/dm_new/public/images/map/layericon/RDL_TFSN_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/RDL_TRCT_PS.png b/apps/dm_new/public/images/map/layericon/RDL_TRCT_PS.png deleted file mode 100644 index ed1a72d8a..000000000 Binary files a/apps/dm_new/public/images/map/layericon/RDL_TRCT_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/RDL_TREE_PS.png b/apps/dm_new/public/images/map/layericon/RDL_TREE_PS.png deleted file mode 100644 index 0ee84dedc..000000000 Binary files a/apps/dm_new/public/images/map/layericon/RDL_TREE_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/RDL_TRSN_PS.png b/apps/dm_new/public/images/map/layericon/RDL_TRSN_PS.png deleted file mode 100644 index 15675cb31..000000000 Binary files a/apps/dm_new/public/images/map/layericon/RDL_TRSN_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/RDL_TSCT_PS.png b/apps/dm_new/public/images/map/layericon/RDL_TSCT_PS.png deleted file mode 100644 index 3776f6c04..000000000 Binary files a/apps/dm_new/public/images/map/layericon/RDL_TSCT_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/RDL_TSCT_PS500.png b/apps/dm_new/public/images/map/layericon/RDL_TSCT_PS500.png deleted file mode 100644 index b82e2ff89..000000000 Binary files a/apps/dm_new/public/images/map/layericon/RDL_TSCT_PS500.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_CLAY_PS.png b/apps/dm_new/public/images/map/layericon/SWL_CLAY_PS.png deleted file mode 100644 index e603ffa9c..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_CLAY_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_CLAY_PS_RED.png b/apps/dm_new/public/images/map/layericon/SWL_CLAY_PS_RED.png deleted file mode 100644 index 0e5450688..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_CLAY_PS_RED.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_DEPT_PS.png b/apps/dm_new/public/images/map/layericon/SWL_DEPT_PS.png deleted file mode 100644 index fede6c304..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_DEPT_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_MANH_PS.png b/apps/dm_new/public/images/map/layericon/SWL_MANH_PS.png deleted file mode 100644 index 75217f494..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_MANH_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_BLACK.png b/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_BLACK.png deleted file mode 100644 index 5d2e8a70a..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_BLACK.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_BLUE.png b/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_BLUE.png deleted file mode 100644 index e521cb84a..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_BLUE.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_GRAY.png b/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_GRAY.png deleted file mode 100644 index e19f3d8b3..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_GRAY.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_GREEN.png b/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_GREEN.png deleted file mode 100644 index 4503c13c6..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_GREEN.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_ORANGE.png b/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_ORANGE.png deleted file mode 100644 index 288d1afa8..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_ORANGE.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_RED.png b/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_RED.png deleted file mode 100644 index b8fa45f9c..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_RED.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_YELLOW.png b/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_YELLOW.png deleted file mode 100644 index b7de1fbfd..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_MANH_PS_YELLOW.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_SPEW_PS.png b/apps/dm_new/public/images/map/layericon/SWL_SPEW_PS.png deleted file mode 100644 index d260ea3a6..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_SPEW_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_SPOT_PS.png b/apps/dm_new/public/images/map/layericon/SWL_SPOT_PS.png deleted file mode 100644 index 84c7992e4..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_SPOT_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_SPOT_PS_BLACK.png b/apps/dm_new/public/images/map/layericon/SWL_SPOT_PS_BLACK.png deleted file mode 100644 index fe67f8f98..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_SPOT_PS_BLACK.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_SPOT_PS_BLUE.png b/apps/dm_new/public/images/map/layericon/SWL_SPOT_PS_BLUE.png deleted file mode 100644 index 691f2f45e..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_SPOT_PS_BLUE.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_SPOT_PS_GREEN.png b/apps/dm_new/public/images/map/layericon/SWL_SPOT_PS_GREEN.png deleted file mode 100644 index d09c4bd97..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_SPOT_PS_GREEN.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_SPOT_PS_GREY.png b/apps/dm_new/public/images/map/layericon/SWL_SPOT_PS_GREY.png deleted file mode 100644 index 32d0bf519..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_SPOT_PS_GREY.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_SPOT_PS_RED.png b/apps/dm_new/public/images/map/layericon/SWL_SPOT_PS_RED.png deleted file mode 100644 index a2da36f9b..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_SPOT_PS_RED.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/SWL_VENT_PS.png b/apps/dm_new/public/images/map/layericon/SWL_VENT_PS.png deleted file mode 100644 index 834eeec21..000000000 Binary files a/apps/dm_new/public/images/map/layericon/SWL_VENT_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/TL_SPBD_ENTRC.png b/apps/dm_new/public/images/map/layericon/TL_SPBD_ENTRC.png deleted file mode 100644 index 8e7de8593..000000000 Binary files a/apps/dm_new/public/images/map/layericon/TL_SPBD_ENTRC.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/TL_SPGF_LOC.png b/apps/dm_new/public/images/map/layericon/TL_SPGF_LOC.png deleted file mode 100644 index 74b0adac3..000000000 Binary files a/apps/dm_new/public/images/map/layericon/TL_SPGF_LOC.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/TL_SPOT_NOIN.png b/apps/dm_new/public/images/map/layericon/TL_SPOT_NOIN.png deleted file mode 100644 index 4800beaeb..000000000 Binary files a/apps/dm_new/public/images/map/layericon/TL_SPOT_NOIN.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/TL_SPRD_BANO.png b/apps/dm_new/public/images/map/layericon/TL_SPRD_BANO.png deleted file mode 100644 index 8d08dca29..000000000 Binary files a/apps/dm_new/public/images/map/layericon/TL_SPRD_BANO.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/TL_SPRD_CRSRD.png b/apps/dm_new/public/images/map/layericon/TL_SPRD_CRSRD.png deleted file mode 100644 index 57b5f2ca5..000000000 Binary files a/apps/dm_new/public/images/map/layericon/TL_SPRD_CRSRD.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/TL_SPRD_NONM.png b/apps/dm_new/public/images/map/layericon/TL_SPRD_NONM.png deleted file mode 100644 index e68c05ab6..000000000 Binary files a/apps/dm_new/public/images/map/layericon/TL_SPRD_NONM.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/TL_SPRD_RENM.png b/apps/dm_new/public/images/map/layericon/TL_SPRD_RENM.png deleted file mode 100644 index 4800beaeb..000000000 Binary files a/apps/dm_new/public/images/map/layericon/TL_SPRD_RENM.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/TL_SPRD_RWNM.png b/apps/dm_new/public/images/map/layericon/TL_SPRD_RWNM.png deleted file mode 100644 index e68c05ab6..000000000 Binary files a/apps/dm_new/public/images/map/layericon/TL_SPRD_RWNM.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/UFL_BMAN_PS.png b/apps/dm_new/public/images/map/layericon/UFL_BMAN_PS.png deleted file mode 100644 index f2f64a641..000000000 Binary files a/apps/dm_new/public/images/map/layericon/UFL_BMAN_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/UFL_BOPC_PS.png b/apps/dm_new/public/images/map/layericon/UFL_BOPC_PS.png deleted file mode 100644 index 0f8e99f45..000000000 Binary files a/apps/dm_new/public/images/map/layericon/UFL_BOPC_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/UFL_BPIP_PS.png b/apps/dm_new/public/images/map/layericon/UFL_BPIP_PS.png deleted file mode 100644 index dcc3622a7..000000000 Binary files a/apps/dm_new/public/images/map/layericon/UFL_BPIP_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/UFL_BPOL_PS.png b/apps/dm_new/public/images/map/layericon/UFL_BPOL_PS.png deleted file mode 100644 index 4f1102989..000000000 Binary files a/apps/dm_new/public/images/map/layericon/UFL_BPOL_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/UFL_BTRS_PS.png b/apps/dm_new/public/images/map/layericon/UFL_BTRS_PS.png deleted file mode 100644 index 557c17089..000000000 Binary files a/apps/dm_new/public/images/map/layericon/UFL_BTRS_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/UFL_GMNT_PS.png b/apps/dm_new/public/images/map/layericon/UFL_GMNT_PS.png deleted file mode 100644 index 6081d8b00..000000000 Binary files a/apps/dm_new/public/images/map/layericon/UFL_GMNT_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/UFL_GPIP_PS.png b/apps/dm_new/public/images/map/layericon/UFL_GPIP_PS.png deleted file mode 100644 index 5d7e86fd2..000000000 Binary files a/apps/dm_new/public/images/map/layericon/UFL_GPIP_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/UFL_GPRS_PS.png b/apps/dm_new/public/images/map/layericon/UFL_GPRS_PS.png deleted file mode 100644 index 79c120f20..000000000 Binary files a/apps/dm_new/public/images/map/layericon/UFL_GPRS_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/UFL_GVAL_PS.png b/apps/dm_new/public/images/map/layericon/UFL_GVAL_PS.png deleted file mode 100644 index e8f7cde2e..000000000 Binary files a/apps/dm_new/public/images/map/layericon/UFL_GVAL_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/UFL_KMAN_PS.png b/apps/dm_new/public/images/map/layericon/UFL_KMAN_PS.png deleted file mode 100644 index 764ce8ba5..000000000 Binary files a/apps/dm_new/public/images/map/layericon/UFL_KMAN_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/UFL_KPOL_PS.png b/apps/dm_new/public/images/map/layericon/UFL_KPOL_PS.png deleted file mode 100644 index d9fa712cf..000000000 Binary files a/apps/dm_new/public/images/map/layericon/UFL_KPOL_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/UFL_VALV_PS.png b/apps/dm_new/public/images/map/layericon/UFL_VALV_PS.png deleted file mode 100644 index 1b5d70178..000000000 Binary files a/apps/dm_new/public/images/map/layericon/UFL_VALV_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/WTL_FIRE_PS.png b/apps/dm_new/public/images/map/layericon/WTL_FIRE_PS.png deleted file mode 100644 index 4137a3f74..000000000 Binary files a/apps/dm_new/public/images/map/layericon/WTL_FIRE_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/WTL_FLOW_PS.png b/apps/dm_new/public/images/map/layericon/WTL_FLOW_PS.png deleted file mode 100644 index 285f7edfa..000000000 Binary files a/apps/dm_new/public/images/map/layericon/WTL_FLOW_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/WTL_MANH_PS.png b/apps/dm_new/public/images/map/layericon/WTL_MANH_PS.png deleted file mode 100644 index 5f2a57cfe..000000000 Binary files a/apps/dm_new/public/images/map/layericon/WTL_MANH_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/WTL_META_PS.png b/apps/dm_new/public/images/map/layericon/WTL_META_PS.png deleted file mode 100644 index 22c7af31b..000000000 Binary files a/apps/dm_new/public/images/map/layericon/WTL_META_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/WTL_PIPE_PS.png b/apps/dm_new/public/images/map/layericon/WTL_PIPE_PS.png deleted file mode 100644 index c9c6863f6..000000000 Binary files a/apps/dm_new/public/images/map/layericon/WTL_PIPE_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS.png b/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS.png deleted file mode 100644 index d7b307a61..000000000 Binary files a/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_BLACK.png b/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_BLACK.png deleted file mode 100644 index 395abeb78..000000000 Binary files a/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_BLACK.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_GRAY.png b/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_GRAY.png deleted file mode 100644 index 33a667a1e..000000000 Binary files a/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_GRAY.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_GREEN.png b/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_GREEN.png deleted file mode 100644 index 33933b9e0..000000000 Binary files a/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_GREEN.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_ORANGE.png b/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_ORANGE.png deleted file mode 100644 index 7a78c3466..000000000 Binary files a/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_ORANGE.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_PURPLE.png b/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_PURPLE.png deleted file mode 100644 index ef25607cf..000000000 Binary files a/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_PURPLE.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_RED.png b/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_RED.png deleted file mode 100644 index 26fd5f68e..000000000 Binary files a/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_RED.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_YELLOW.png b/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_YELLOW.png deleted file mode 100644 index 76718e865..000000000 Binary files a/apps/dm_new/public/images/map/layericon/WTL_RSRV_PS_YELLOW.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/WTL_VALV_PS.png b/apps/dm_new/public/images/map/layericon/WTL_VALV_PS.png deleted file mode 100644 index ca2b4788b..000000000 Binary files a/apps/dm_new/public/images/map/layericon/WTL_VALV_PS.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/default.png b/apps/dm_new/public/images/map/layericon/default.png deleted file mode 100644 index 92bf1f587..000000000 Binary files a/apps/dm_new/public/images/map/layericon/default.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/layericon/reset.png b/apps/dm_new/public/images/map/layericon/reset.png deleted file mode 100644 index 45f889206..000000000 Binary files a/apps/dm_new/public/images/map/layericon/reset.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/arrow_down.png b/apps/dm_new/public/images/map/toolbar/arrow_down.png deleted file mode 100644 index 88590ecaf..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/arrow_down.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/arrow_right.png b/apps/dm_new/public/images/map/toolbar/arrow_right.png deleted file mode 100644 index 7090c37dd..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/arrow_right.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/backward_icon.png b/apps/dm_new/public/images/map/toolbar/backward_icon.png deleted file mode 100644 index 3a853475e..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/backward_icon.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_cont_area.png b/apps/dm_new/public/images/map/toolbar/btn_cont_area.png deleted file mode 100644 index 044562b55..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_cont_area.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_cont_area_on.png b/apps/dm_new/public/images/map/toolbar/btn_cont_area_on.png deleted file mode 100644 index 0129ff1bd..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_cont_area_on.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_cont_next.png b/apps/dm_new/public/images/map/toolbar/btn_cont_next.png deleted file mode 100644 index 075111dcf..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_cont_next.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_cont_next_on.png b/apps/dm_new/public/images/map/toolbar/btn_cont_next_on.png deleted file mode 100644 index 4fdbe3a00..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_cont_next_on.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_cont_prev.png b/apps/dm_new/public/images/map/toolbar/btn_cont_prev.png deleted file mode 100644 index 7e3fae7d2..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_cont_prev.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_cont_prev_on.png b/apps/dm_new/public/images/map/toolbar/btn_cont_prev_on.png deleted file mode 100644 index fb2d55cfd..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_cont_prev_on.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_cont_print.png b/apps/dm_new/public/images/map/toolbar/btn_cont_print.png deleted file mode 100644 index 82596b83d..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_cont_print.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_cont_print_on.png b/apps/dm_new/public/images/map/toolbar/btn_cont_print_on.png deleted file mode 100644 index bb7f27334..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_cont_print_on.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_cont_ruler.png b/apps/dm_new/public/images/map/toolbar/btn_cont_ruler.png deleted file mode 100644 index 501e460a4..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_cont_ruler.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_cont_ruler_on.png b/apps/dm_new/public/images/map/toolbar/btn_cont_ruler_on.png deleted file mode 100644 index 676a81bcc..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_cont_ruler_on.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_cont_save.png b/apps/dm_new/public/images/map/toolbar/btn_cont_save.png deleted file mode 100644 index c057b9377..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_cont_save.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_cont_save_on.png b/apps/dm_new/public/images/map/toolbar/btn_cont_save_on.png deleted file mode 100644 index bf8e6d623..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_cont_save_on.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_cont_sketch.png b/apps/dm_new/public/images/map/toolbar/btn_cont_sketch.png deleted file mode 100644 index 38a5f507f..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_cont_sketch.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_cont_sketch_on.png b/apps/dm_new/public/images/map/toolbar/btn_cont_sketch_on.png deleted file mode 100644 index 79fb54e03..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_cont_sketch_on.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_cont_zoomin.png b/apps/dm_new/public/images/map/toolbar/btn_cont_zoomin.png deleted file mode 100644 index ac32fbab0..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_cont_zoomin.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_cont_zoomin_on.png b/apps/dm_new/public/images/map/toolbar/btn_cont_zoomin_on.png deleted file mode 100644 index f258a965f..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_cont_zoomin_on.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_cont_zoomout.png b/apps/dm_new/public/images/map/toolbar/btn_cont_zoomout.png deleted file mode 100644 index 2ee0b5161..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_cont_zoomout.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_cont_zoomout_on.png b/apps/dm_new/public/images/map/toolbar/btn_cont_zoomout_on.png deleted file mode 100644 index 58dcbfdae..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_cont_zoomout_on.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_edit_add.png b/apps/dm_new/public/images/map/toolbar/btn_edit_add.png deleted file mode 100644 index fe4f0993f..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_edit_add.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_edit_add_on.png b/apps/dm_new/public/images/map/toolbar/btn_edit_add_on.png deleted file mode 100644 index 37a836298..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_edit_add_on.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_edit_del.png b/apps/dm_new/public/images/map/toolbar/btn_edit_del.png deleted file mode 100644 index 3bb372ab9..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_edit_del.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_edit_del_on.png b/apps/dm_new/public/images/map/toolbar/btn_edit_del_on.png deleted file mode 100644 index 89e558739..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_edit_del_on.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_edit_next.png b/apps/dm_new/public/images/map/toolbar/btn_edit_next.png deleted file mode 100644 index df4913c90..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_edit_next.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_edit_next_on.png b/apps/dm_new/public/images/map/toolbar/btn_edit_next_on.png deleted file mode 100644 index 4e5540b55..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_edit_next_on.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_edit_prev.png b/apps/dm_new/public/images/map/toolbar/btn_edit_prev.png deleted file mode 100644 index e94bf6d42..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_edit_prev.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_edit_prev_on.png b/apps/dm_new/public/images/map/toolbar/btn_edit_prev_on.png deleted file mode 100644 index 8645dedfa..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_edit_prev_on.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_edit_save.png b/apps/dm_new/public/images/map/toolbar/btn_edit_save.png deleted file mode 100644 index 5f01dd55c..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_edit_save.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_edit_save_on.png b/apps/dm_new/public/images/map/toolbar/btn_edit_save_on.png deleted file mode 100644 index b035687d6..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_edit_save_on.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_edit_slt.png b/apps/dm_new/public/images/map/toolbar/btn_edit_slt.png deleted file mode 100644 index aaf2bbd08..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_edit_slt.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_edit_slt_on.png b/apps/dm_new/public/images/map/toolbar/btn_edit_slt_on.png deleted file mode 100644 index 02d035a74..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_edit_slt_on.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_edit_snap.png b/apps/dm_new/public/images/map/toolbar/btn_edit_snap.png deleted file mode 100644 index fc91d4304..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_edit_snap.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/btn_edit_snap_on.png b/apps/dm_new/public/images/map/toolbar/btn_edit_snap_on.png deleted file mode 100644 index f856d8fbe..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/btn_edit_snap_on.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/close_icon.png b/apps/dm_new/public/images/map/toolbar/close_icon.png deleted file mode 100644 index e8e76d5d7..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/close_icon.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/ico_gis_sprite.png b/apps/dm_new/public/images/map/toolbar/ico_gis_sprite.png deleted file mode 100644 index 0ee4b5985..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/ico_gis_sprite.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/icon-viewclose.png b/apps/dm_new/public/images/map/toolbar/icon-viewclose.png deleted file mode 100644 index d93ce9c05..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/icon-viewclose.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/img_base_map.png b/apps/dm_new/public/images/map/toolbar/img_base_map.png deleted file mode 100644 index 7f96fcf5e..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/img_base_map.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/img_network_map.png b/apps/dm_new/public/images/map/toolbar/img_network_map.png deleted file mode 100644 index df80af6dc..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/img_network_map.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/img_road_map.png b/apps/dm_new/public/images/map/toolbar/img_road_map.png deleted file mode 100644 index 02d015d12..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/img_road_map.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/img_settle_map.png b/apps/dm_new/public/images/map/toolbar/img_settle_map.png deleted file mode 100644 index 1a93f50e8..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/img_settle_map.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/loading.gif b/apps/dm_new/public/images/map/toolbar/loading.gif deleted file mode 100644 index 7c3683bb4..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/loading.gif and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/map_pin.png b/apps/dm_new/public/images/map/toolbar/map_pin.png deleted file mode 100644 index b6cc2f6aa..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/map_pin.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/toggle_off.png b/apps/dm_new/public/images/map/toolbar/toggle_off.png deleted file mode 100644 index d5dea9f67..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/toggle_off.png and /dev/null differ diff --git a/apps/dm_new/public/images/map/toolbar/toggle_on.png b/apps/dm_new/public/images/map/toolbar/toggle_on.png deleted file mode 100644 index 9cb573875..000000000 Binary files a/apps/dm_new/public/images/map/toolbar/toggle_on.png and /dev/null differ diff --git a/apps/dm_new/src/entities/auth/api/login-service.ts b/apps/dm_new/src/entities/auth/api/login-service.ts deleted file mode 100644 index 43ea1c33d..000000000 --- a/apps/dm_new/src/entities/auth/api/login-service.ts +++ /dev/null @@ -1,78 +0,0 @@ -import type { LoginService, ILogin } from "../model/login-interface"; -import { tokenManager } from "../lib/token-manager"; -import {PROXY_HOST, ACCESS_TOKEN, AUTH_USER_ID,SITE_ID, CLAIM_NAME, ENDPOINT, JWT_EXPIRATION_TIME } from "../../../shared/config"; - -export class LoginApiService implements LoginService { - private static instance: LoginApiService; - - private constructor() {} - - public static getInstance(): LoginApiService { - if (!LoginApiService.instance) { - LoginApiService.instance = new LoginApiService(); - } - return LoginApiService.instance; - } - - public async login(payload: ILogin): Promise { - try { - const response = await fetch( PROXY_HOST+ ENDPOINT.USER_SERVICE.LOGIN, { - method: "POST", - body: JSON.stringify({ - userId: payload.userId, - password: payload.password, - }), - }); - // const data = response.headers.get(ACCESS_TOKEN); - const accessToken = response.headers.get(ACCESS_TOKEN); - const tokenId = response.headers.get(AUTH_USER_ID); - - console.log('accessToken ', accessToken) - console.log('tokenId ', tokenId) - - if (!accessToken || !tokenId) { - throw new Error("Missing required authentication tokens"); - } - - tokenManager.setToken(CLAIM_NAME, accessToken); - tokenManager.setToken(AUTH_USER_ID, tokenId); - tokenManager.setToken("site-id-key", SITE_ID); - tokenManager.setupRefreshTimer( - () => this.silentRefresh(), - JWT_EXPIRATION_TIME, - ); - } catch (error) { - - console.log(' login err ' , error) - throw new Error(`Login failed: ${error}`); - } - } - - - public async silentRefresh(): Promise { - console.log(' silentRefresh ') - - try { - const response = await fetch(PROXY_HOST+ - `${ENDPOINT.USER_SERVICE.SILENT_REFRESH}`, - { method: "PUT" }, - ); - - const data = await response.json(); - const accessToken = data[ACCESS_TOKEN]; - const tokenId = data[AUTH_USER_ID]; - - if (!accessToken || !tokenId) { - throw new Error("Missing required authentication tokens"); - } - - tokenManager.setToken(CLAIM_NAME, accessToken); - tokenManager.setToken(AUTH_USER_ID, tokenId); - } catch (error) { - tokenManager.clearAuthToken(); - throw new Error(`Silent refresh failed: ${error}`); - } - } -} - -export const LoginApi = LoginApiService.getInstance(); diff --git a/apps/dm_new/src/entities/auth/index.ts b/apps/dm_new/src/entities/auth/index.ts deleted file mode 100644 index 9dc9dd368..000000000 --- a/apps/dm_new/src/entities/auth/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { LoginApi } from "./api/login-service"; -//export { AuthWrapper } from "./lib/auth-wrapper"; diff --git a/apps/dm_new/src/entities/auth/lib/auth-wrapper.tsx b/apps/dm_new/src/entities/auth/lib/auth-wrapper.tsx deleted file mode 100644 index 678ff50d5..000000000 --- a/apps/dm_new/src/entities/auth/lib/auth-wrapper.tsx +++ /dev/null @@ -1,45 +0,0 @@ -// "use client"; - -// import { useEffect } from "react"; -// import { useRouter } from "next/navigation"; -// import { LoginApi } from "../api/login-service"; - -// const AuthWrapper = ({ children }: { children: React.ReactNode }) => { -// const router = useRouter(); -// const { userInfo, setUserInfo } = useUserStore((state) => state); - -// async function authCheck() { -// const userId = getCookie(AUTH_USER_ID); -// if (!userId) { -// throw new Error("Missing required authentication tokens"); -// } - -// const response = await client.get( -// `${ENDPOINT.USER_SERVICE.USERS}/info/me`, -// ); -// if (!userInfo) setUserInfo(response.data); -// } - -// useEffect(() => { -// (async () => { -// try { -// await authCheck(); -// } catch (error) { -// console.error(error); - -// try { -// await LoginApi.silentRefresh(); -// await authCheck(); -// } catch (refreshError) { -// console.error("Token refresh failed:", refreshError); -// setUserInfo(null); -// router.push("/auth/login"); -// } -// } -// })(); -// }, []); - -// return <>{children}; -// }; - -// export { AuthWrapper }; diff --git a/apps/dm_new/src/entities/auth/lib/token-manager.ts b/apps/dm_new/src/entities/auth/lib/token-manager.ts deleted file mode 100644 index 40d32f33e..000000000 --- a/apps/dm_new/src/entities/auth/lib/token-manager.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { AUTH_USER_ID, CLAIM_NAME } from "@/src/shared/config"; -import { getCookie, removeCookie, setCookie } from "@/src/shared/lib/cookie"; - -export class TokenManager { - private static instance: TokenManager; - private refreshTimer: NodeJS.Timeout | null = null; - - private constructor() {} - - public static getInstance(): TokenManager { - if (!TokenManager.instance) { - TokenManager.instance = new TokenManager(); - } - return TokenManager.instance; - } - - public getToken(key: string): string | undefined { - return getCookie(key); - } - - public setToken(key: string, value: string): void { - setCookie(key, value, { - secure: window.location.protocol === "https:", - sameSite: "lax", - }); - } - - public removeToken(key: string): void { - removeCookie(key); - } - - public setupRefreshTimer( - callback: () => Promise, - expirationTime: number, - ): void { - if (this.refreshTimer) { - clearTimeout(this.refreshTimer); - } - - this.refreshTimer = setTimeout(() => { - callback().catch((error) => { - console.error("Silent refresh failed:", error); - this.clearAuthToken(); - }); - }, expirationTime - 60000); - } - - public clearAuthToken(): void { - if (this.refreshTimer) { - clearTimeout(this.refreshTimer); - this.refreshTimer = null; - } - - this.removeToken(CLAIM_NAME); - this.removeToken(AUTH_USER_ID); - } -} - -export const tokenManager = TokenManager.getInstance(); diff --git a/apps/dm_new/src/entities/auth/model/login-interface.ts b/apps/dm_new/src/entities/auth/model/login-interface.ts deleted file mode 100644 index 5aaf53044..000000000 --- a/apps/dm_new/src/entities/auth/model/login-interface.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface ILogin { - userId: string; - password: string; -} - -export interface LoginService { - login(payload: ILogin): Promise; - silentRefresh(): Promise; -} diff --git a/apps/dm_new/src/shared/api/client.ts b/apps/dm_new/src/shared/api/client.ts deleted file mode 100644 index cf37e6671..000000000 --- a/apps/dm_new/src/shared/api/client.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Client } from "@common/network"; -import { BASE_URL } from "../config/api"; -import { SITE_ID } from "../config/env"; -import { setCookie } from "../lib"; - -setCookie("site-id-key", SITE_ID); - -export const client = Client.getInstance({ - baseURL: BASE_URL, - siteId: SITE_ID, -}); diff --git a/apps/dm_new/src/shared/api/index.ts b/apps/dm_new/src/shared/api/index.ts deleted file mode 100644 index b7b9d6121..000000000 --- a/apps/dm_new/src/shared/api/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { client } from "./client"; diff --git a/apps/dm_new/src/shared/config/api.ts b/apps/dm_new/src/shared/config/api.ts deleted file mode 100644 index a531bed85..000000000 --- a/apps/dm_new/src/shared/config/api.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { PROXY_HOST } from "./env"; - -export const BASE_URL = `${PROXY_HOST}/server`; - -export const ENDPOINT = { - ATTACH_SERVICE: { - TUS_UPLOAD: "/attach-service/api/v1/tus/upload", - EDITOR_UPLOAD: "/attach-service/api/v1/upload/editor", - IMAGES: "/attach-service/api/v1/images", - MOVIE_THUMBNAIL: "/attach-service/api/v1/movie/thumbnail", - ATTACHMENTS: "/attach-service/api/v1/atfl/attachments", - DOWNLOAD: "/attach-service/api/v1/atflcd/download", - STREAM_VIDEO: "/attach-service/api/v1/stream/video", - }, - USER_SERVICE: { - LOGIN: "/user-service/login", - USERS: "/user-service/api/v1/users", - SILENT_REFRESH: "/user-service/api/v1/users/token/refresh", - AUTHORIZATIONS: "/user-service/api/v1/authorizations", - ROLE_AUTHORIZATIONS: "/user-service/api/v1/role-authorizations", - ROLES: "/user-service/api/v1/roles", - - }, - CMS_SERVICE: { - DMSITES:'cms-service/api/v1/menu/anonymous/user/DM', - SITES: "/cms-service/api/v1/sites", - IPS: "/cms-service/api/v1/site-ips", - DOMAINS: "/cms-service/api/v1/site-dmns", - POSTINGS: "/cms-service/api/v1/site-pstgs", - CODE: "/cms-service/api/v1/code/cache", - MENUS: "/cms-service/api/v1/menus", - MENU_ROLES: "/cms-service/api/v1/menu-roles", - MENU_AUTHRTS: "/cms-service/api/v1/menu-authrts", - CONTENTS: "/cms-service/api/v1/contents", - CONTENTS_DETAILS: "/cms-service/api/v1/contents-details", - ORGANIZATIONS: "/cms-service/api/v1/ognzs", - USER_ORGANIZATION: "/cms-service/api/v1/user-ognz", - IMAGES: "/cms-service/api/v1/images", - BANNERS: "/cms-service/api/v1/bnrs", - TEMPLATE: "/cms-service/api/v1/tmplt", - TERMS: "/cms-service/api/v1/trms", - LWPO_CODE: "/cms-service/api/v1/lwpo-cds", - UP_CODE: "/cms-service/api/v1/up-codes", - POPUPS: "/cms-service/api/v1/popups", - SCHEDULES: "/cms-service/api/v1/schdls", - SURVEY: "/cms-service/api/v1/srvy", - SURVEY_QUESTION: "/cms-service/api/v1/srvy-qitem", - SURVEY_ARTICLE: "/cms-service/api/v1/srvy-artcl", - }, - BOARD_SERVICE: { - BBS: "/board-service/api/v1/bbs", - BBS_TEMPLATES: "/board-service/api/v1/bbsTmplt", - POSTS: "/board-service/api/v1/posts", - POSTS_COMMENTS: "/board-service/api/v1/posts-cmnts", - }, -}; - -export const JWT_EXPIRATION_TIME = 1800000; diff --git a/apps/dm_new/src/shared/config/env.ts b/apps/dm_new/src/shared/config/env.ts deleted file mode 100644 index a9011b90e..000000000 --- a/apps/dm_new/src/shared/config/env.ts +++ /dev/null @@ -1,13 +0,0 @@ -export const SITE_ID = process.env.NEXT_PUBLIC_SITE_ID || "DM"; -export const PORT = process.env.NEXT_PUBLIC_PORT || "3000"; -export const PROXY_HOST = process.env.NEXT_PUBLIC_PROXY_HOST || `http://localhost:${PORT}`; -export const SERVER_API_DM_URL = process.env.NEXT_PUBLIC_DM_SERVER_API_URL ||'http://con.mind-one.co.kr:11035/api/v1'; -export const SERVER_API_FO_URL = process.env.NEXT_PUBLIC_FO_SERVER_API_URL||' http://con.mind-one.co.kr:11082/api/v1'; -export const SERVER_API_WR_URL = process.env.NEXT_PUBLIC_WR_SERVER_API_URL||' http://con.mind-one.co.kr:11080/api/v1'; -export const SERVER_API_CS_URL = process.env.NEXT_PUBLIC_CS_SERVER_API_URL||'http://dev.onasys.co.kr:8000'; -export const SERVER_API_CS_TUS_URL = process.env.NEXT_PUBLIC_CS_TUS_UPLOAD ||'/attach-service/api/v1/tus/upload' -export const CLAIM_NAME = process.env.NEXT_PUBLIC_CLAIM_NAME || "Authorization"; -export const ACCESS_TOKEN = process.env.NEXT_PUBLIC_ACCESS_TOKEN || "access-token"; -export const REFRESH_TOKEN =process.env.NEXT_PUBLIC_REFRESH_TOKEN || "refresh-token"; -export const AUTH_USER_ID = process.env.NEXT_PUBLIC_AUTH_USER_ID || "token-id"; -export const SERVER_SEWERAGE_API_URL = process.env.NEXT_PUBLIC_SEWERAGE_API_URL; \ No newline at end of file diff --git a/apps/dm_new/src/shared/config/index.ts b/apps/dm_new/src/shared/config/index.ts deleted file mode 100644 index 3ac40ddb4..000000000 --- a/apps/dm_new/src/shared/config/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./api"; -export * from "./env"; \ No newline at end of file diff --git a/apps/dm_new/src/shared/lib/cookie.ts b/apps/dm_new/src/shared/lib/cookie.ts deleted file mode 100644 index 48254bb18..000000000 --- a/apps/dm_new/src/shared/lib/cookie.ts +++ /dev/null @@ -1,30 +0,0 @@ -import Cookies from "js-cookie"; - - -export function getCookie(name: string): string | undefined { - if (typeof window === "undefined") { - return undefined; - } - return Cookies.get(name); -} - -export function setCookie( - name: string, - value: string, - options?: Cookies.CookieAttributes, -): void { - if (typeof window === "undefined") { - return; - } - Cookies.set(name, value, options); -} - -export function removeCookie( - name: string, - options?: Cookies.CookieAttributes, -): void { - if (typeof window === "undefined") { - return; - } - Cookies.remove(name, options); -} diff --git a/apps/dm_new/src/shared/lib/index.ts b/apps/dm_new/src/shared/lib/index.ts deleted file mode 100644 index c9cff1a80..000000000 --- a/apps/dm_new/src/shared/lib/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -export { getCookie, setCookie, removeCookie } from "./cookie"; -// export { useMutationWrapper } from "./use-mutation-wrapper"; -// export { useAlertStore } from "./use-alert-store"; -// export { useDataTable } from "./use-data-table"; -export { useMenuStore } from "./use-menu-store"; -// export { useUserStore } from "./use-user-store"; -// export { usePrompt } from "./use-prompt"; -// export { useSelectPrompt } from "./use-select-prompt"; diff --git a/apps/dm_new/tailwind.config.ts b/apps/dm_new/tailwind.config.ts deleted file mode 100644 index 42cfc69f5..000000000 --- a/apps/dm_new/tailwind.config.ts +++ /dev/null @@ -1,69 +0,0 @@ -import baseConfig from "../../packages/common/components/tailwind.config"; - -import type { Config } from "tailwindcss"; - -export default { - darkMode: ["class"], - presets: [baseConfig], - content: [ - "./app/**/*.{js,ts,jsx,tsx,mdx}", - "./components/**/*.{js,ts,jsx,tsx,mdx}", - "../../packages/common/components/src/ui/**/*.{js,ts,jsx,tsx,mdx}", - "../../packages/common/business_components/src/ui/**/*.{js,ts,jsx,tsx,mdx}", - ], - plugins: [require("tailwindcss-animate")], - theme: { - extend: { - fontFamily: { - NotoSansKR: ['NotoSansKR'], - }, - borderRadius: { - lg: 'var(--radius)', - md: 'calc(var(--radius) - 2px)', - sm: 'calc(var(--radius) - 4px)' - }, - colors: { - background: 'hsl(var(--background))', - foreground: 'hsl(var(--foreground))', - card: { - DEFAULT: 'hsl(var(--card))', - foreground: 'hsl(var(--card-foreground))' - }, - popover: { - DEFAULT: 'hsl(var(--popover))', - foreground: 'hsl(var(--popover-foreground))' - }, - primary: { - DEFAULT: 'hsl(var(--primary))', - foreground: 'hsl(var(--primary-foreground))' - }, - secondary: { - DEFAULT: 'hsl(var(--secondary))', - foreground: 'hsl(var(--secondary-foreground))' - }, - muted: { - DEFAULT: 'hsl(var(--muted))', - foreground: 'hsl(var(--muted-foreground))' - }, - accent: { - DEFAULT: 'hsl(var(--accent))', - foreground: 'hsl(var(--accent-foreground))' - }, - destructive: { - DEFAULT: 'hsl(var(--destructive))', - foreground: 'hsl(var(--destructive-foreground))' - }, - border: 'hsl(var(--border))', - input: 'hsl(var(--input))', - ring: 'hsl(var(--ring))', - chart: { - '1': 'hsl(var(--chart-1))', - '2': 'hsl(var(--chart-2))', - '3': 'hsl(var(--chart-3))', - '4': 'hsl(var(--chart-4))', - '5': 'hsl(var(--chart-5))' - } - } - } - } -} satisfies Config; diff --git a/apps/dm_new/tsconfig.json b/apps/dm_new/tsconfig.json deleted file mode 100644 index ba8cd2c2f..000000000 --- a/apps/dm_new/tsconfig.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "noImplicitAny": false, - "baseUrl": ".", - "target": "ES2017", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "strict": true, - "noEmit": true, - "esModuleInterop": true, - "module": "esnext", - "moduleResolution": "bundler", - "verbatimModuleSyntax": true, - "strictNullChecks": true, - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "preserve", - "incremental": true, - "plugins": [ - { - "name": "next" - } - ], - "paths": { - "@/*": ["./*"], - "@common/components/*": ["../../packages/common/components/src/*"], - "@common/components": ["../../packages/common/components/src/index"], - "@common/business_components/*": [ - "../../packages/common/business_components/src/*" - ], - "@common/business_components": [ - "../../packages/common/business_components/src/index" - ], - "@common/network": ["../../packages/common/network"] - } - }, - "include": [ - ".eslintrc.*", - "next-env.d.ts", - "**/*.d.ts", - "**/*.ts", - "**/*.tsx", - "**/*.mts", - "**/*.js", - "**/*.cjs", - "**/*.mjs", - "**/*.jsx", - "**/*.json", - ".next/types/**/*.ts" - ], - "exclude": ["**/node_modules", "**/.*/*"] -} diff --git a/package.json b/package.json index fc236f021..c6d70dedf 100644 --- a/package.json +++ b/package.json @@ -18,14 +18,12 @@ "build:wr": "turbo run build --filter=wr", "build:fo": "turbo run build --filter=fo", "build:dm": "turbo run build --filter=dm", - "build:dm_new": "turbo run build --filter=dm_new", "dev:cm": "turbo run dev --filter=cm", "dev:cs": "turbo run dev --filter=cs", "dev:sn": "turbo run dev --filter=sn", "dev:wr": "turbo run dev --filter=wr", "dev:fo": "turbo run dev --filter=fo", "dev:dm": "turbo run dev --filter=dm", - "dev:dm_new": "turbo run dev --filter=dm_new", "preview:components": "turbo run storybook --filter=@common/components", "preinstall": "npx only-allow pnpm", "prepare": "husky"