diff --git a/apps/common/features/.gitignore b/apps/common/features/.gitignore
index b660a552e..e8d8437ee 100644
--- a/apps/common/features/.gitignore
+++ b/apps/common/features/.gitignore
@@ -37,5 +37,4 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts
-.env*
-__ENV__.js
\ No newline at end of file
+.env*
\ No newline at end of file
diff --git a/apps/common/features/cli.js b/apps/common/features/cli.js
deleted file mode 100644
index 9f165f497..000000000
--- a/apps/common/features/cli.js
+++ /dev/null
@@ -1,44 +0,0 @@
-import { findUp } from "find-up";
-import { config } from "dotenv";
-import fs from "fs";
-import yargs from "yargs";
-import { hideBin } from "yargs/helpers";
-
-async function parseDotenv(nodeEnv) {
- const envFilePath = await findUp(`.env.${nodeEnv}`);
-
- const parsedEnv = config({ path: envFilePath }).parsed || {};
-
- return parsedEnv;
-}
-
-function writeEnv(parsedEnv) {
- const scriptFilePath = `${fs.realpathSync(process.cwd())}/public/__ENV__.js`;
-
- fs.writeFileSync(
- scriptFilePath,
- `window.__ENV__ = ${JSON.stringify(parsedEnv)}`,
- );
-}
-
-yargs(hideBin(process.argv))
- .command(
- "next-env",
- "Create Next.js runtime environment js",
- function builder(y) {
- return y.option("env", {
- alias: "e",
- type: "string",
- description: "Environment name(ex: development, production)",
- });
- },
- async function handler(args) {
- const nodeEnv = args.e || args.env || "development";
-
- const parsedEnv = await parseDotenv(nodeEnv); // dotenv 파싱
- writeEnv(parsedEnv); // 환경 변수 스크립트 파일 생성
-
- return parsedEnv;
- },
- )
- .parse();
diff --git a/apps/common/features/package.json b/apps/common/features/package.json
index bfa43377e..304e88bae 100644
--- a/apps/common/features/package.json
+++ b/apps/common/features/package.json
@@ -1,12 +1,11 @@
{
"name": "features",
"version": "0.1.0",
- "type": "module",
"private": true,
"scripts": {
- "dev": "node cli.js next-env -e ${NODE_ENV:-development} && next dev -p 13000",
+ "dev": "next dev -p 13000",
"build": "next build",
- "start": "node cli.js next-env -e ${NODE_ENV:-production} && next start -p 13000",
+ "start": "next start -p 13000",
"lint": "next lint"
},
"dependencies": {
@@ -28,8 +27,6 @@
"axios": "^1.8.1",
"chart.js": "^4.4.8",
"dayjs": "^1.11.13",
- "dotenv": "^17.2.1",
- "find-up": "^7.0.0",
"js-cookie": "^3.0.5",
"next": "15.3.0",
"next-themes": "^0.4.6",
@@ -48,7 +45,6 @@
"@types/js-cookie": "^3.0.6",
"@types/node": "^22.13.1",
"@types/webpack": "^5.28.5",
- "@types/yargs": "^17.0.33",
"eslint": "^9",
"eslint-config-next": "15.1.7",
"postcss": "^8",
diff --git a/apps/common/features/src/app/index.tsx b/apps/common/features/src/app/index.tsx
index eb6e75d00..692b55ef0 100644
--- a/apps/common/features/src/app/index.tsx
+++ b/apps/common/features/src/app/index.tsx
@@ -4,16 +4,12 @@ import "@fontsource-variable/noto-sans-kr";
import { AppProvider } from "./providers";
import { cookies } from "next/headers";
-import Script from "next/script";
const App = async ({ children }: Readonly<{ children: React.ReactNode }>) => {
const theme = (await cookies()).get("site-theme-key");
return (
-
-
-
{children}
diff --git a/apps/common/features/src/shared/config/api.ts b/apps/common/features/src/shared/config/api.ts
index df4c0da7d..67b8948d7 100644
--- a/apps/common/features/src/shared/config/api.ts
+++ b/apps/common/features/src/shared/config/api.ts
@@ -1,10 +1,6 @@
-"use client";
+import { PROXY_HOST } from "./env";
-import { getCookie, getEnv } from "../lib";
-
-const SITE_ID = getCookie("site-id-key") ?? "";
-const PROXY_HOST_KEY = `NEXT_PUBLIC_PROXY_HOST_${SITE_ID}`;
-export const BASE_URL = `${getEnv(PROXY_HOST_KEY)}/server`;
+export const BASE_URL = `${PROXY_HOST}/server`;
export const ENDPOINT = {
ATTACH_SERVICE: {
diff --git a/apps/common/features/src/shared/lib/env.ts b/apps/common/features/src/shared/lib/env.ts
deleted file mode 100644
index 4ad7ad5a2..000000000
--- a/apps/common/features/src/shared/lib/env.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-declare global {
- interface Window {
- __ENV__?: Record;
- }
-}
-
-export function getEnvConfig(): Record {
- if (typeof window === "undefined") return {};
- return window.__ENV__ ?? {};
-}
-
-export function getEnv(key: string): string | undefined {
- return getEnvConfig()[key];
-}
diff --git a/apps/common/features/src/shared/lib/index.ts b/apps/common/features/src/shared/lib/index.ts
index 82bb6c8b7..42ec7d509 100644
--- a/apps/common/features/src/shared/lib/index.ts
+++ b/apps/common/features/src/shared/lib/index.ts
@@ -3,4 +3,3 @@ export { useAlertStore } from "./use-alert-store";
export { useMenuStore } from "./use-menu-store";
export { useUserStore } from "./use-user-store";
export { usePrompt } from "./use-prompt";
-export { getEnv } from "./env";
diff --git a/apps/common/features/tsconfig.json b/apps/common/features/tsconfig.json
index f0333a1b7..f12491cae 100644
--- a/apps/common/features/tsconfig.json
+++ b/apps/common/features/tsconfig.json
@@ -27,7 +27,6 @@
"@/*": ["./*"],
"@common/assets": ["../../../../packages/common/assets/dist/"],
"@common/components": ["../../../../packages/common/components/dist/"],
- "@common/config": ["../../../../packages/common/config/dist/"],
"@common/network": ["../../../../packages/common/network/"]
}
},
diff --git a/apps/cs/src/entities/link/model/link-interface.ts b/apps/cs/src/entities/link/model/link-interface.ts
index 86960f195..f8cf82016 100644
--- a/apps/cs/src/entities/link/model/link-interface.ts
+++ b/apps/cs/src/entities/link/model/link-interface.ts
@@ -191,6 +191,7 @@ export interface LinkSearchParam extends PageableParams {
startDate?: string;
endDate?: string;
isSucc?: string;
+ linkClfsCd?: string;
}
export type LinkFormData = z.infer;
diff --git a/apps/cs/src/pages/image/ui/image-form.tsx b/apps/cs/src/pages/image/ui/image-form.tsx
index d4d213875..1de9a46a9 100644
--- a/apps/cs/src/pages/image/ui/image-form.tsx
+++ b/apps/cs/src/pages/image/ui/image-form.tsx
@@ -104,6 +104,7 @@ function ImageForm({ form, imgSn, ...props }: ImageFormProps) {
value={field.value ?? ""}
className="!text-[1.3rem]"
placeholder="이미지명을 입력해주세요"
+ maxLength={100}
/>
@@ -126,11 +127,17 @@ function ImageForm({ form, imgSn, ...props }: ImageFormProps) {
min={0}
max={9999}
value={field.value ?? ""}
- onChange={(e) =>
- field.onChange(parseInt(e.target.value))
- }
+ onChange={(e) => {
+ const value = parseInt(e.target.value);
+ if (value > 9999) {
+ field.onChange(9999);
+ } else {
+ field.onChange(value);
+ }
+ }}
className="w-[12rem] !text-[1.3rem]"
placeholder="정렬순서 입력"
+ maxLength={4}
/>
diff --git a/apps/cs/src/pages/link/ui/link-form.tsx b/apps/cs/src/pages/link/ui/link-form.tsx
index 41f125335..d46696d88 100644
--- a/apps/cs/src/pages/link/ui/link-form.tsx
+++ b/apps/cs/src/pages/link/ui/link-form.tsx
@@ -195,7 +195,13 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
- * 연계 URL
+
+ {['link0001', 'link0002'].includes(form.watch('link_clsf_cd') as string) ? '* 연계 데이터베이스 URL' :
+ (form.watch('link_clsf_cd') === 'link0007' ? '* 연계 파일 경로'
+ : '* 연계 URL'
+ )
+ }
+
- * 연계 KEY
+
+ {['link0001', 'link0002'].includes(form.watch('link_clsf_cd') as string) ? '* 연계 데이터베이스 DRIVER' :
+ (form.watch('link_clsf_cd') === 'link0007' ? '* 연계 파일 확장자'
+ : '* 연계 KEY'
+ )
+ }
+
('');
const [linkNm, setLinkNm] = useState('');
+ const [linkClfsCd, setLinkClfsCd] = useState('');
const [linkSearchParam, setLinkSearchParam] = useState({
linkSn: '',
- linkNm: ''
+ linkNm: '',
+ linkClfsCd: '',
});
const query = useQuery({
@@ -32,10 +34,12 @@ function LinkPage() {
const handleResetSearchParam = () => {
setLinkSn('');
setLinkNm('');
+ setLinkClfsCd('ALL');
setLinkSearchParam({
...linkSearchParam,
linkSn: '',
linkNm: '',
+ linkClfsCd: 'ALL',
});
};
@@ -44,7 +48,8 @@ function LinkPage() {
setLinkSearchParam({
...linkSearchParam,
linkSn,
- linkNm
+ linkNm,
+ linkClfsCd,
});
};
@@ -100,6 +105,24 @@ function LinkPage() {
onChange={(e) => setLinkNm(e.target.value)}
autoComplete="off"
/>
+
+
diff --git a/apps/cs/src/pages/site/ui/modify-page.tsx b/apps/cs/src/pages/site/ui/modify-page.tsx
index fdc40c477..87bf2a9a5 100644
--- a/apps/cs/src/pages/site/ui/modify-page.tsx
+++ b/apps/cs/src/pages/site/ui/modify-page.tsx
@@ -4,6 +4,7 @@ import { useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { useQuery, useQueryClient } from "@tanstack/react-query";
+import { useEffect } from "react";
import { SiteApi, siteFormSchema, type SiteFormData } from "@/entities/site";
import { useAlertStore, useMutationWrapper } from "@/shared/lib";
import { ENDPOINT } from "@/shared/config";
@@ -14,7 +15,7 @@ function ModifyPage({ siteId }: { siteId: string }) {
const queryClient = useQueryClient();
const alert = useAlertStore((state) => state.setMessage);
- const { data: siteDetail } = useQuery({
+ const { data: siteDetail, error } = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.SITES, siteId],
queryFn: () => SiteApi.siteDetail(siteId),
select: (data) => {
@@ -25,8 +26,15 @@ function ModifyPage({ siteId }: { siteId: string }) {
};
},
enabled: !!siteId,
+ retry: false,
});
+ useEffect(() => {
+ if (error && siteId) {
+ alert("사이트 정보를 찾을 수 없습니다.", () => router.push("/site"));
+ }
+ }, [error, siteId]);
+
const { mutateAsync: updateSite } = useMutationWrapper({
mutationFn: (data: SiteFormData) => SiteApi.updateSite(siteId, data),
onSuccess: () => {
diff --git a/apps/sn/.env.development b/apps/sn/.env.development
index f08d2b517..0fffc4f89 100644
--- a/apps/sn/.env.development
+++ b/apps/sn/.env.development
@@ -3,7 +3,8 @@ NEXT_PUBLIC_PORT = 11302
NEXT_PUBLIC_PROXY_HOST = http://con.mind-one.co.kr:11302
NEXT_PUBLIC_ADDR_URL = http://con.mind-one.co.kr:11082
NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000
-NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver
+NEXT_PUBLIC_GEOSERVER_URL = https://hasudo.geo.rsonesoft.com/geoserver
+# 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_DC_URL = https://apigateway.apps.rsonesoft.com
NEXT_PUBLIC_CLAIM_NAME = Authorization
diff --git a/apps/sn/.env.local b/apps/sn/.env.local
index 232412579..35701bd81 100644
--- a/apps/sn/.env.local
+++ b/apps/sn/.env.local
@@ -3,7 +3,8 @@ NEXT_PUBLIC_PORT = 3002
NEXT_PUBLIC_PROXY_HOST = http://localhost:3002
NEXT_PUBLIC_ADDR_URL = http://con.mind-one.co.kr:11082
NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000
-NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver
+NEXT_PUBLIC_GEOSERVER_URL = https://hasudo.geo.rsonesoft.com/geoserver
+# 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_DC_URL = https://apigateway.apps.rsonesoft.com
NEXT_PUBLIC_CLAIM_NAME = Authorization
diff --git a/apps/sn/.env.production b/apps/sn/.env.production
index 946499394..3fb05262e 100644
--- a/apps/sn/.env.production
+++ b/apps/sn/.env.production
@@ -7,7 +7,8 @@ NEXT_PUBLIC_PORT = 3000
NEXT_PUBLIC_PROXY_HOST = https://sn.hasuon.or.kr
NEXT_PUBLIC_SERVER_API_URL = http://apigateway.iipbs-dev.svc.cluster.local:8000
NEXT_PUBLIC_ADDR_URL = http://con.mind-one.co.kr:11082
-NEXT_PUBLIC_GEOSERVER_URL = http://172.29.143.87:8080/geoserver
+NEXT_PUBLIC_GEOSERVER_URL = https://hasudo.geo.rsonesoft.com/geoserver
+# 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_DC_URL = https://apigateway.apps.rsonesoft.com
NEXT_PUBLIC_NGII_URL = http://10.98.25.94:18080/openapi/Gettile.do?apiKey=BDE2BEF39DAFEC293AB6730150F222AC
diff --git a/apps/wr/.env.development b/apps/wr/.env.development
index da82fd281..ceaf190df 100644
--- a/apps/wr/.env.development
+++ b/apps/wr/.env.development
@@ -18,7 +18,8 @@ NEXT_PUBLIC_WR_SERVER_API_URL = http://con.mind-one.co.kr:11080/api/v1
NEXT_PUBLIC_FO_SERVER_API_URL = http://con.mind-one.co.kr:11082/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_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver
+NEXT_PUBLIC_GEOSERVER_URL = https://hasudo.geo.rsonesoft.com/geoserver
+# 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_CLAIM_NAME = Authorization
NEXT_PUBLIC_AUTH_USER_ID = token-id
diff --git a/apps/wr/.env.local b/apps/wr/.env.local
index 24fd548a8..4d8937ea6 100644
--- a/apps/wr/.env.local
+++ b/apps/wr/.env.local
@@ -10,7 +10,8 @@ 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_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver
+NEXT_PUBLIC_GEOSERVER_URL = https://hasudo.geo.rsonesoft.com/geoserver
+# 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_NGII_URL = https://map.ngii.go.kr/openapi/Gettile.do?apiKey=04trYP9_xwLAfALjwZ-B8g
diff --git a/apps/wr/.env.production b/apps/wr/.env.production
index e29f3cec6..4a0754665 100644
--- a/apps/wr/.env.production
+++ b/apps/wr/.env.production
@@ -5,7 +5,8 @@ NEXT_PUBLIC_SERVER_API_URL = http://apigateway.iipbs-dev.svc.cluster.local:8000/
NEXT_PUBLIC_FO_SERVER_API_URL = http://apigateway.iipbs-dev.svc.cluster.local:8000/operation-service/api/v1
NEXT_PUBLIC_CS_SERVER_API_URL = http://apigateway.iipbs-dev.svc.cluster.local:8000
NEXT_PUBLIC_CS_TUS_UPLOAD = /attach-service/api/v1/tus/upload
-NEXT_PUBLIC_GEOSERVER_URL = http://172.29.143.87:8080/geoserver
+NEXT_PUBLIC_GEOSERVER_URL = https://hasudo.geo.rsonesoft.com/geoserver
+# NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver
NEXT_PUBLIC_LX_GEOSERVER_URL = http://172.29.143.87:8080/geoserver_swl
NEXT_PUBLIC_CLAIM_NAME = Authorization
NEXT_PUBLIC_AUTH_USER_ID = token-id
diff --git a/apps/wr/app/(map-layout)/map/mainMap/page.tsx b/apps/wr/app/(map-layout)/map/mainMap/page.tsx
index 1922a8a3f..0006631d3 100644
--- a/apps/wr/app/(map-layout)/map/mainMap/page.tsx
+++ b/apps/wr/app/(map-layout)/map/mainMap/page.tsx
@@ -6,7 +6,14 @@ import { mapService } from "../../service";
import GisApp from "@common/business_components/ui/map/lib/gis.core";
import { SearchBar } from "@common/business_components/ui/map/searchBar/searchBar";
import { useWrStore } from "@/app/store";
-import { getFeatureCd } from "@/components/lib/func/mapUtil";
+import {
+ featurePopUpOpen,
+ getClickFeatureId,
+ getFeatureCd,
+ getSelectedLayers,
+ getWrFeaturePk,
+ getWrLayerNm,
+} from "@/components/lib/func/mapUtil";
import toast, { Toaster } from "react-hot-toast";
const Map = () => {
@@ -24,7 +31,7 @@ const Map = () => {
const fetchData = async () => {
try {
- const response = await mapService.getLyrStngs('WR_NETWORK');
+ const response = await mapService.getLyrStngs("WR_NETWORK");
setTreeData(response); // API 응답 저장
} catch (error) {
console.error("데이터 불러오기 실패:", error);
@@ -71,11 +78,11 @@ const Map = () => {
};
// SearchModal, GisContent 등에서 호출
- const onFeatureFocus = () => {
- console.log("onFeatureFocus");
+ const onFeatureFocus = (data: any) => {
+ console.log('data',data)
};
- const onFeatureSelect = (data: any) => {
+ const onFeatureSelect = (data: any ,popUpClick?:boolean) => {
const map = gisMaps.current;
if (!map) {
@@ -93,27 +100,21 @@ const Map = () => {
// 2. data가 OpenLayers Feature 인스턴스인지 확인
let foundFeature: any = null;
let featureId = data.fid;
- const layerName = data.layerNm;
- if (layerName === "하수재이용시설") {
+
+ if(popUpClick){
+ const layerName = getWrLayerNm(data);
+ const featurePk = getWrFeaturePk(layerName ?? "");
// 재이용시설
- featureId = `${layerName}.${data.searchPk}`;
- } else if (
- //빗물이용시설, 중수도시설
- layerName === "빗물이용시설" ||
- layerName == "중수도시설"
- ) {
- featureId = `${layerName}.${data.bdstInfoSn}`;
- } else if (layerName === "하수처리시설") {
- //하수처리시설
- featureId = `${layerName}.${data.bscFctCd}`;
- } else if (layerName === "온배수시설") {
- //온배수시설
- featureId = `${layerName}.${data.bdstRuseFcltSn}`;
- } else if (layerName == "수요처") {
- //수요처
- featureId = `${layerName}.${data.dmdInfoId.replaceAll("-", "")}`;
- } else {
- featureId = `${layerName}.${data.fid || data.id || data.ftrIdn}`;
+ if (featurePk) {
+
+ const lastPk = layerName==='tb_wr_ruse_fclt_dmd_co'? data[featurePk].replaceAll("-", "") : data[featurePk]
+ featureId = `${layerName}.${lastPk}`;
+ } else {
+ console.warn("해당 피처는 선택된 레이어에서 찾을수 없습니다.");
+ }
+ }else{
+ featureId=getClickFeatureId(data)
+
}
map
.getLayers()
@@ -143,6 +144,10 @@ const Map = () => {
select.selectFeature(foundFeature, true);
} else {
console.warn("OpenLayers Feature를 찾을 수 없습니다:");
+ console.log("foundFeature :", foundFeature );
+ console.warn("featureId : ", featureId);
+ console.warn("data : ", data);
+ console.warn(": 끝");
}
const currentId = data?.fid || data?.id || data?.ftrIdn;
const lastId = featureData?.fid || featureData?.id || featureData?.ftrIdn;
@@ -150,10 +155,19 @@ const Map = () => {
setFeatureData(data);
setIsOpen(true);
setIsSearchModalOpen(false);
+
+ if (popUpClick && foundFeature&&!(
+ Object.keys(foundFeature?.getProperties()).length === 0 &&
+ foundFeature.constructor === Object
+ )){
+ const layerName = getWrLayerNm(data);
+ const isColumn = getFeatureCd(foundFeature.getProperties(), String(layerName));
+ if(layerName&&isColumn)
+ featurePopUpOpen(layerName,isColumn,popupDetailRef)
+ }
};
useEffect(() => {
-
if (isFeatured) {
onFeatureSelect(isFeatured);
}
@@ -163,41 +177,13 @@ const Map = () => {
const bc = new BroadcastChannel("mapDetailPopUp");
bc.onmessage = (event) => {
if (event.data.type === "SELECT_FEATURE") {
- onFeatureSelect(event.data.feature);
+ onFeatureSelect(event.data.feature,true);
closePopup();
}
};
}, []);
- const getSelectedLayers = (isFeature: any) => {
- const map = gisMaps.current;
- if (!map) {
- console.warn("지도가 초기화되지 않았습니다.");
- return;
- }
- let result = null;
- const layers = map
- ? map
- .getLayers()
- .getArray()
- .filter((l: any) => l.getVisible())
- : []; // gisMap이 null인지 확인 후 레이어 가져오기
- let featureLayer: { get: (key: string) => any } = { get: () => null };
- layers.forEach((layer: any) => {
- const source = layer.getSource();
- if (
- source &&
- source.hasFeature &&
- isFeature &&
- typeof isFeature.getId === "function" &&
- source.hasFeature(isFeature)
- ) {
- featureLayer = layer; // 피처가 속한 레이어 찾기)
- }
- });
- result = featureLayer.get("lyrNm");
- return result;
- };
+
const renderDetailView = useCallback(
(props: any) => {
@@ -208,44 +194,21 @@ const Map = () => {
}
const isFeature = props?.featureData;
-
- if( typeof isFeature.getProperties === "function" ){
-
+ if (typeof isFeature.getProperties === "function") {
if (
- Object.keys(isFeature?.getProperties()).length === 0 &&
- isFeature.constructor === Object
+ !(
+ Object.keys(isFeature?.getProperties()).length === 0 &&
+ isFeature.constructor === Object
+ )
) {
- const url = `/mapDetailPopUp?layerNm=${encodeURIComponent(props.seletectedLayerNm)}`;
- 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=no`;
- popupRef.current = window.open(url, "지도 레이어 팝업", popupOptions);
- } else {
- const layerNm = getSelectedLayers(isFeature);
- const safeProps = isFeature.getProperties();
- const featureCd = getFeatureCd(safeProps, String(layerNm));
- const url = `/mapFeaturePopup?layerNm=${encodeURIComponent(String(layerNm))}&featureCd=${encodeURIComponent(featureCd)} `;
- const width =
- String(layerNm) === "하수재이용시설"
- ? Math.floor(window.innerWidth * 0.8)
- : Math.floor(window.innerWidth * 0.4); // 화면 폭의 40%
- const height =
- String(layerNm) === "하수재이용시설"
- ? Math.floor(window.innerHeight - 150)
- : Math.floor(window.innerHeight - 450); // 150px 여백 확보; // calc(100% - 70px)
- const left = (window.screen.availWidth - width) / 2;
- const top = (window.screen.availHeight - height) / 2;
- const popupOptions = `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes`;
- popupDetailRef.current = window.open(
- url,
- "지도 시설 상세정보 팝업",
- popupOptions
- );
+ const layerNm = getSelectedLayers(isFeature,gisMaps);
+ const safeProps = isFeature.getProperties();
+ const featureCd = getFeatureCd(safeProps, String(layerNm));
+ if(layerNm)
+ featurePopUpOpen(layerNm,featureCd,popupDetailRef)
}
- }else{
- console.log(' data확인 필요')
+ } else {
+ console.log(" data확인 필요");
}
},
[checkedLayers, checkedLayersData, featureData] // 필요 시 의존성 넣기
@@ -259,9 +222,10 @@ const Map = () => {
}
};
- const onOpenPopup = (data:any) => {
- if(data){
-
+ const onOpenPopup = (data: any) => {
+ if (data) {
+ setIsOpen(true);
+ setFeatureData(null);
const url = `/mapDetailPopUp?layerNm=${encodeURIComponent(data)}`;
const width = window.screen.availWidth;
const height = window.screen.availHeight;
@@ -269,12 +233,10 @@ const Map = () => {
const top = 0;
const popupOptions = `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=no`;
popupRef.current = window.open(url, "지도 레이어 팝업", popupOptions);
- }else{
- toast.error('시설 및 수요처가 선택되지 않았습니다.')
+ } else {
+ toast.error("시설 및 수요처가 선택되지 않았습니다.");
}
-
-
- }
+ };
return (
@@ -310,12 +272,12 @@ const Map = () => {
/>
}
waterDepth={undefined}
- onOpenPopup={(data:any) =>{
- onOpenPopup(data)
+ onOpenPopup={(data: any) => {
+ onOpenPopup(data);
}}
/>
-
+
);
};
diff --git a/apps/wr/app/(popUp-layout)/mapDetailPopUp/page.tsx b/apps/wr/app/(popUp-layout)/mapDetailPopUp/page.tsx
index d8e93c567..8da833282 100644
--- a/apps/wr/app/(popUp-layout)/mapDetailPopUp/page.tsx
+++ b/apps/wr/app/(popUp-layout)/mapDetailPopUp/page.tsx
@@ -44,6 +44,7 @@ export default function MapDetailPopUp() {
return (
{
+
bc.postMessage({ type: "SELECT_FEATURE", feature });
}}
/>
diff --git a/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx b/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx
index 94c1411f3..a660e5e6b 100644
--- a/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx
+++ b/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx
@@ -1,5 +1,6 @@
"use client";
import { useWrStore } from "@/app/store";
+import CoSttnDetailPopup from "@/components/ui/map/detailPopup/coSttnDetailPopup/coSttnDetailPopup";
import { RuseDetailPopup } from "@/components/ui/map/detailPopup/ruseDetailPopup";
import CoDetailModal from "@/components/ui/modal/sttn/sttnDetailModal/coDatailModal";
import SttnDetailModal from "@/components/ui/modal/sttn/sttnDetailModal/sttnDetailModal";
@@ -7,95 +8,6 @@ import { Title, UiTable } from "@common/business_components/ui";
import { useSearchParams } from "next/navigation";
import { useEffect, useState } from "react";
-
-export const htdflData ={
- "bdstInfoSn": 54,
- "ctpvCd": 11,
- "sggCd": 11110,
- "daddr": "청라동 100-80",
- "bdstNm": "한국중부발전(주)",
- "frstArchPrmsnDt": "2013-01-01",
- "archArea": "-1.000000000",
- "ctpvNm": null,
- "sggNm": null,
- "lat": 37.57096,
- "lot": 126.98143,
- "regDt": "2025-04-16",
- "rgtr": null,
- "mdfcnDt": "2025-04-16",
- "mdfr": null,
- "reuseBuilding": [
- {
- "bdstRuseFcltSn": 4881,
- "bdstInfoSn": 54,
- "instlCmptnDt": "2025-06-20",
- "instlCst": 300,
- "operMngCd": null,
- "anlOperCst": 400,
- "instlCstSprtYn": null,
- "instlCstSprtAmt": 0,
- "grntchBdstCertYn": null,
- "grntchBdstCertYr": null,
- "grntchBdstCertNo": "",
- "grntchBdstCertGrd": "",
- "crgRdctYn": null,
- "crgRdctBss": null,
- "crgRdctAmt": 0,
- "ruseFcltFlg": "HTB",
- "bdstUsgCd": 2,
- "lawTrgtYn": "N",
- "regDt": "2025-04-16",
- "rgtr": null,
- "mdfcnDt": "2025-04-16",
- "mdfr": null,
- "htdflObj": {
- "bdstRuseFcltSn": 4881,
- "etgtType": "",
- "fclCpct": 400,
- "plwtYn": "Y",
- "orgwtWtritSpt": "공장내",
- "orgwtOcrnProcs": "1",
- "wtritEntrcTp": 3,
- "amtgnr": 1,
- "prcsProcsYn": "Y",
- "prcsFcltCpct": 14,
- "regDt": "2025-04-16",
- "rgtr": null,
- "mdfcnDt": "2025-04-16",
- "mdfr": null,
- "fmYn": "Y",
- "utztnCpct": 1,
- "utztnUsg": "1",
- "grssClfg": 0,
- "combResdch": 0,
- "trbt": 4,
- "bod": 4,
- "smll": "불쾌하지않을것",
- "crmty": 4,
- "tn": 10,
- "tph": 10,
- "ph": '1~3',
- "clIonQnt": 1,
- "cdtnv": 0,
- "emsnExitTp": 5
- }
- }
- ],
- "chgBuilding": [
- {
- "bdstInfoSn": 54,
- "archChgPrmsnDt": null,
- "archChgArea": null,
- "bdstChgNm": null,
- "regDt": "2025-04-16",
- "rgtr": null,
- "mdfcnDt": "2025-04-16",
- "mdfr": null
- }
- ]
-}
-
-
export default function MapFeaturePopup() {
const [isFeatureCd, setIsFeatureCd] = useState(null);
const {
@@ -105,6 +17,7 @@ export default function MapFeaturePopup() {
htdfMapDetile,
pbnMapDetaile,
ldrmntMapDetile,
+ coSttnMapDetail
} = useWrStore((state) => state);
const { pbnMapHeadList } = pbnMap;
const [isDetail, setIsDetail] = useState(null);
@@ -134,27 +47,30 @@ export default function MapFeaturePopup() {
useEffect(() => {
if (isFeatureCd && layerNm) {
- if (layerNm === "하수재이용시설") {
- setIsDetail(isFeatureCd);
- } else if (layerNm === "하수처리시설") {
+ if (layerNm === "tb_wr_bdst_ruse_fclt") {
+ setIsDetail(isFeatureCd);
+ } else if (layerNm === "tb_il_swage_prcs_fclt") {
pbnMapDetaile(isFeatureCd, isFeatureCd).then((res) => {
setIsDetail(res);
});
- } else if (layerNm === "빗물이용시설") {
+ } else if (layerNm === "tb_wr_rnwtr_utztn_fclt") {
rainMapDetile(isFeatureCd).then((res) => {
setIsDetail(res);
});
- } else if (layerNm === "중수도시설") {
+ } else if (layerNm === "tb_wr_rswtr_fclt") {
rswtMapDetile(isFeatureCd).then((res) => {
setIsDetail(res);
});
- } else if (layerNm === "온배수시설") {
+ } else if (layerNm === "tb_wr_htdfl_fclt") {
htdfMapDetile(isFeatureCd).then((res) => {
-//가짜데이터로 하였음!!!!!!!!! 기능 수정시 res를 넣어야함
- console.log(res)
- setIsDetail(htdflData);
+ setIsDetail(res);
});
- } else if (layerNm === "잠재수요처") {
+ }else if(layerNm ==='tb_wr_ruse_fclt_dmd_co'){
+ coSttnMapDetail(isFeatureCd).then((res) => {
+ console.log('tb_wr_ruse_fclt_dmd_co ', res)
+ setIsDetail(res);
+ });
+ } else if (layerNm === "tb_wr_tmpr_dmd_co") {
ldrmntMapDetile(isFeatureCd).then((res) => {
setIsDetail(res);
});
@@ -167,9 +83,9 @@ export default function MapFeaturePopup() {
<>
{isDetail ? (
- {layerNm === "하수재이용시설" ? (
+ {layerNm === "tb_wr_bdst_ruse_fclt" ? (
- ) : layerNm === "하수처리시설" ? (
+ ) : layerNm === "tb_il_swage_prcs_fclt" ? (
@@ -194,21 +110,26 @@ export default function MapFeaturePopup() {
onPageChange={() => {}}
/>
- ) : layerNm === "잠재수요처" ? (
+ ) : layerNm === "tb_wr_tmpr_dmd_co" ? (
{
- console.log(value)
+ console.log(value);
}}
isMap={true}
/>
- ) : (
+ ) :layerNm === "tb_wr_ruse_fclt_dmd_co" ? (
+
+ )
+ : (
void;
coSttnMapSearch: (pageNo: number, pageCnt: number, con: string) => void;
- coSttnMapTxtSearch: (pageNo: number, pageCnt: number, con: string, txt: string) => void;
+ coSttnMapTxtSearch: (
+ pageNo: number,
+ pageCnt: number,
+ con: string,
+ txt: string
+ ) => void;
+ coSttnMapDetail: (dmdInfoId: string) => Promise;
};
export type coSttnMapType = coSttnMapState & coSttnMapActions;
@@ -37,7 +46,6 @@ export const coSttnMapStateExport: coSttnMapState = {
},
};
-
export const coSttnMapActionsExport: (set: any) => coSttnMapActions = (
set: any
) => {
@@ -60,7 +68,7 @@ export const coSttnMapActionsExport: (set: any) => coSttnMapActions = (
};
});
} catch (e) {
- console.log(e)
+ console.log(e);
}
},
coSttnMapSearch: async (pageNo: number, pageCnt: number, con: string) => {
@@ -96,11 +104,17 @@ export const coSttnMapActionsExport: (set: any) => coSttnMapActions = (
console.log("error", erTxt);
}
},
- coSttnMapTxtSearch: async (pageNo: number, pageCnt: number, con: string, txt: string) => {
+ coSttnMapTxtSearch: async (
+ pageNo: number,
+ pageCnt: number,
+ con: string,
+ txt: string
+ ) => {
try {
const coSttnMapRes = await getFetchWithCount(
fetchType.WR,
- `/reuseFc/request/${pageNo}/${pageCnt}/${con}/${txt}`)
+ `/reuseFc/request/${pageNo}/${pageCnt}/${con}/${txt}`
+ );
set((state: coSttnMapState) => {
return {
...state,
@@ -109,12 +123,23 @@ export const coSttnMapActionsExport: (set: any) => coSttnMapActions = (
coSttnMapRes: coSttnMapRes.data,
coSttnMapResCount: coSttnMapRes.count,
isInit: false,
- }
- }
- })
+ },
+ };
+ });
} catch (erTxt) {
console.log("error", erTxt);
}
},
- }
-}
\ No newline at end of file
+ coSttnMapDetail: async (dmdInfoId: string) => {
+ try {
+ const coSttnMapDetail = await getFetch(
+ fetchType.WR,
+ `/reuseFc/request/${dmdInfoId}`
+ );
+ return coSttnMapDetail;
+ } catch (erTxt) {
+ console.log("error", erTxt);
+ }
+ },
+ };
+};
diff --git a/apps/wr/components/lib/func/mapUtil.ts b/apps/wr/components/lib/func/mapUtil.ts
index f3925c413..78aa71427 100644
--- a/apps/wr/components/lib/func/mapUtil.ts
+++ b/apps/wr/components/lib/func/mapUtil.ts
@@ -1,21 +1,142 @@
+const wrLayerList = [
+ { text: "tb_il_swage_prcs_fclt", val: "bscFctCd" },
+ { text: "tb_wr_bdst_ruse_fclt", val: "pbnstRuseFcltId" },
+ { text: "tb_wr_rnwtr_utztn_fclt", val: "rainyObj" },
+ { text: "tb_wr_rswtr_fclt", val: "rswtrObj" },
+ { text: "tb_wr_htdfl_fclt", val: "htdflObj" },
+ { text: "tb_wr_ruse_fclt_dmd_co", val: "dmdInfoId" },
+ { text: "tb_wr_tmpr_dmd_co", val: "fctryMngSn" },
+];
+const wrFeaturePK = [
+ { text: "bscFctCd", val: "tb_il_swage_prcs_fclt" },
+ { text: "pbnstRuseFcltId", val: "tb_wr_bdst_ruse_fclt" },
+ { text: "bdstInfoSn", val: "tb_wr_rnwtr_utztn_fclt" },
+ { text: "bdstInfoSn", val: "tb_wr_rswtr_fclt" },
+ { text: "bdstInfoSn", val: "tb_wr_htdfl_fclt" },
+ { text: "dmdInfoId", val: "tb_wr_ruse_fclt_dmd_co" },
+ { text: "fctryMngSn", val: "tb_wr_tmpr_dmd_co" },
+];
+// { text: "하수처리시설", val: "tb_il_swage_prcs_fclt" },
+// { text: "하수재이용시설", val: "tb_wr_bdst_ruse_fclt" },
+// { text: "빗물이용시설", val: "tb_wr_rnwtr_utztn_fclt" },
+// { text: "중수도시설", val: "tb_wr_rswtr_fclt" },
+// { text: "온배수시설", val: "tb_wr_htdfl_fclt" },
+// { text: "수요처", val: "tb_wr_ruse_fclt_dmd_co" },
+// { text: "잠재수요처", val: "tb_wr_tmpr_dmd_co" },
-
- export const getFeatureCd = (featurePropertise:any, layerNm:string) => {
- console.log('layerNm ', layerNm )
- console.log('featurePropertise ', featurePropertise )
-
- const featureCd =
- layerNm === "하수재이용시설"
+export const getFeatureCd = (featurePropertise: any, layerNm: string) => {
+ const featureCd =
+ layerNm === "tb_wr_bdst_ruse_fclt"
? featurePropertise?.swtrmt_fclt_cd
- : ["빗물이용시설", "중수도시설", "온배수시설", "수요처" ,'잠재수요처'].includes(
- layerNm
- )
+ : [
+ "tb_wr_ruse_fclt_dmd_co",
+ "tb_wr_rswtr_fclt",
+ "tb_wr_htdfl_fclt",
+ "tb_wr_rnwtr_utztn_fclt",
+ "tb_wr_tmpr_dmd_co",
+ ].includes(layerNm)
? featurePropertise?.bdst_nm
- : layerNm === "하수처리시설"
+ : layerNm === "tb_il_swage_prcs_fclt"
? featurePropertise?.swtrmt_fclt_nm
: null;
- console.log('featureCd ', featureCd)
- return featureCd;
- };
\ No newline at end of file
+ return featureCd;
+};
+
+export const getWrLayerNm = (featurePropertise: any) => {
+ const result = wrLayerList
+ .filter(item => item.val in featurePropertise) // 키 존재 여부 체크
+ .map(item => item.text);
+
+
+ return result[0];
+};
+
+
+export const getWrFeaturePk = (layerName :string) => {
+ const result = wrFeaturePK
+ .filter(item => item.val === layerName) // 키 존재 여부 체크
+ .map(item => item.text);
+ return result[0];
+};
+
+export const getSelectedLayers = (isFeature: any, gisMaps:any) => {
+ const map = gisMaps.current;
+ if (!map) {
+ console.warn("지도가 초기화되지 않았습니다.");
+ return;
+ }
+ let result = null;
+ const layers = map
+ ? map
+ .getLayers()
+ .getArray()
+ .filter((l: any) => l.getVisible())
+ : []; // gisMap이 null인지 확인 후 레이어 가져오기
+ let featureLayer: { get: (key: string) => any } = { get: () => null };
+
+ layers.forEach((layer: any) => {
+ const source = layer.getSource();
+ if (
+ source &&
+ source.hasFeature &&
+ isFeature &&
+ typeof isFeature.getId === "function" &&
+ source.hasFeature(isFeature)
+ ) {
+ featureLayer = layer; // 피처가 속한 레이어 찾기)
+ }
+ });
+
+ result = featureLayer.get("lyrTyNm");
+
+ return result;
+};
+
+export const getClickFeatureId = (data: any) => {
+ let featureId =''
+ const layerName = data.layerNm;
+ if (layerName === "하수재이용시설") {
+ // 재이용시설
+ featureId = `${layerName}.${data.searchPk}`;
+ } else if (
+ //빗물이용시설, 중수도시설
+ layerName === "빗물이용시설" ||
+ layerName == "중수도시설"
+ ) {
+ featureId = `${layerName}.${data.bdstInfoSn}`;
+ } else if (layerName === "하수처리시설") {
+ //하수처리시설
+ featureId = `${layerName}.${data.bscFctCd}`;
+ } else if (layerName === "온배수시설") {
+ //온배수시설
+ featureId = `${layerName}.${data.bdstRuseFcltSn}`;
+ } else if (layerName == "수요처") {
+ //수요처
+ featureId = `${layerName}.${data.dmdInfoId.replaceAll("-", "")}`;
+ } else {
+ featureId = `${layerName}.${data.fid || data.id || data.ftrIdn}`;
+ }
+ return featureId;
+};
+
+export function featurePopUpOpen(layerNm:string,featureCd:string,popupDetailRef){
+ const url = `/mapFeaturePopup?layerNm=${encodeURIComponent(String(layerNm))}&featureCd=${encodeURIComponent(featureCd)} `;
+ const width =
+ String(layerNm) === "tb_wr_bdst_ruse_fclt"
+ ? Math.floor(window.innerWidth * 0.8)
+ : Math.floor(window.innerWidth * 0.4); // 화면 폭의 40%
+ const height =
+ String(layerNm) === "tb_wr_bdst_ruse_fclt"
+ ? Math.floor(window.innerHeight - 150)
+ : Math.floor(window.innerHeight - 450); // 150px 여백 확보; // calc(100% - 70px)
+ const left = (window.screen.availWidth - width) / 2;
+ const top = (window.screen.availHeight - height) / 2;
+ const popupOptions = `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes`;
+ popupDetailRef.current = window.open(
+ url,
+ "지도 시설 상세정보 팝업",
+ popupOptions
+ );
+}
\ No newline at end of file
diff --git a/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup.tsx b/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup.tsx
deleted file mode 100644
index dbd30a89d..000000000
--- a/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-export default function coSttnDetailPopup(){
-
-
- return(
- <>
-
-
- >
- )
-}
\ No newline at end of file
diff --git a/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup/coSttnDetailPopup.tsx b/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup/coSttnDetailPopup.tsx
new file mode 100644
index 000000000..26c586561
--- /dev/null
+++ b/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup/coSttnDetailPopup.tsx
@@ -0,0 +1,30 @@
+import { useWrStore } from "@/app/store";
+import SdmInsertForm from "@common/business_components/ui/sdmInsertForm";
+import type { DemandCompType } from "@common/business_components/ui/sdmInsertForm/form";
+
+export default function CoSttnDetailPopup({isDetail} :{isDetail:DemandCompType}){
+ const {
+ code
+ } = useWrStore((state) => state);
+
+
+ return(
+
+ {
+ console.log(searchText, pageCnt);
+ }}
+ rtnInputData={async (data) => {
+ console.log(data)
+ }}
+ bodyClassNm={"w-full mx-auto bg-white rounded-lg shadow-md p-6"}
+ updateList={isDetail}
+ readOnly={true}
+ >
+
+
+ )
+}
\ No newline at end of file
diff --git a/apps/wr/middleware.ts b/apps/wr/middleware.ts
index e47a2a8f5..7758ec5ec 100644
--- a/apps/wr/middleware.ts
+++ b/apps/wr/middleware.ts
@@ -28,7 +28,6 @@ export function middleware(req: NextRequest) {
}
if (pathname === "/") {
- console.log(" maim 화면이동 ");
return NextResponse.redirect(new URL("/map/mainMap", req.url));
}
diff --git a/packages/common/business_components/src/ui/sdmInsertForm/form.tsx b/packages/common/business_components/src/ui/sdmInsertForm/form.tsx
index 09dd10525..20a2050bc 100644
--- a/packages/common/business_components/src/ui/sdmInsertForm/form.tsx
+++ b/packages/common/business_components/src/ui/sdmInsertForm/form.tsx
@@ -66,11 +66,12 @@ interface SdmRegFormProps {
rtnValue: (searchText: string, pageCnt: number) => void;
setIsDuplicate: (value: boolean) => void;
updateList?:DemandCompType
+ readOnly?:boolean
}
type FieldComponent = (field: ControllerRenderProps) => JSX.Element;
-export function SdmRegForm({ form, onCheckboxChange, selectSidoData, selectSigunData, dataList, rtnValue, setIsDuplicate ,updateList}: SdmRegFormProps) {
+export function SdmRegForm({ form, onCheckboxChange, selectSidoData, selectSigunData, dataList, rtnValue, setIsDuplicate ,updateList,readOnly}: SdmRegFormProps) {
const [sidoValue, setSidoValue] = useState('');
const [sigunValue, setSigunValue] = useState('');
const [filteredSigunData, setFilteredSigunData] = useState([{ text: "전체", val: '0' }]);
@@ -304,6 +305,7 @@ export function SdmRegForm({ form, onCheckboxChange, selectSidoData, selectSigun
dataList={dataList}
rtnValue={setRtnValue}
rtnText={setRtnText}
+ readOnly={readOnly}
{...field}
/>
)
@@ -352,6 +354,7 @@ export function SdmRegForm({ form, onCheckboxChange, selectSidoData, selectSigun
placeholder="주소를 입력하세요"
type="text"
className="!text-xl text-gray-600"
+ readOnly={readOnly}
{...field}
/>
)
@@ -370,6 +373,7 @@ export function SdmRegForm({ form, onCheckboxChange, selectSidoData, selectSigun
type="text"
className="!text-xl text-gray-600"
value={formattedValue}
+ readOnly={readOnly}
onChange={(e) => {
const value = e.target.value.replace(/\D/g, ''); // 숫자만 저장
field.onChange(value);
@@ -386,6 +390,7 @@ export function SdmRegForm({ form, onCheckboxChange, selectSidoData, selectSigun
placeholder="패스워드를 입력하세요"
type="password"
className="!text-xl text-gray-600"
+ readOnly={readOnly}
{...field}
/>
)
@@ -398,6 +403,7 @@ export function SdmRegForm({ form, onCheckboxChange, selectSidoData, selectSigun
placeholder="패스워드를 입력하세요"
type="password"
className="!text-xl text-gray-600"
+ readOnly={readOnly}
{...field}
/>
)
diff --git a/packages/common/business_components/src/ui/sdmInsertForm/index.tsx b/packages/common/business_components/src/ui/sdmInsertForm/index.tsx
index 4091139b9..d88b72e4b 100644
--- a/packages/common/business_components/src/ui/sdmInsertForm/index.tsx
+++ b/packages/common/business_components/src/ui/sdmInsertForm/index.tsx
@@ -17,6 +17,7 @@ type thisProps = {
rtnInputData: (data: DemandCompType) => void;
bodyClassNm?: string;
updateList?:DemandCompType
+ readOnly?:boolean
}
const createFormSchema = (isBznmTotNoDisabled: boolean, isDuplicate: boolean ,updateList?:DemandCompType) => z.object({
@@ -87,35 +88,7 @@ const defaultValues: FormSchema = {
* @returns
*/
-/**
- * 페이지에서 작업
- const {Common, initializeCommonData, getDemandCompList, insertSdmData, Sdm} = useDmStore((state) => state);
- const { selectSidoData, selectSigunData } = Common;
- const { demandCompList } = Sdm;
-
- // 공통데이터 (시도, 시군구 데이터 호출)
- useEffect(() => {
- initializeCommonData();
- }, [initializeCommonData]);
-
- // 컴포넌트에서 텍스트 검색 호출
- const callback = useCallback((searchText: string, pageCnt: number) => {
- searchText = searchText.trim();
- if(searchText.length > 0) {
- getDemandCompList(searchText, pageCnt);
- }
- }, [getDemandCompList]);
-
- // 컴포넌트에서 수요처 등록 호출
- const handleInsertSdmData = useCallback((data: DemandCompType) => {
- insertSdmData(data);
-
- }, [insertSdmData]);
- */
-
-export default function SdmInsertForm({selectSidoData, selectSigunData, dataList, rtnValue, rtnInputData,bodyClassNm, updateList}: thisProps) {
- /* const { insertSdmData } = useDmStore((state) => state);
- const router = useRouter(); */
+export default function SdmInsertForm({selectSidoData, selectSigunData, dataList, rtnValue, rtnInputData,bodyClassNm, updateList,readOnly}: thisProps) {
const [isBznmTotNoDisabled, setIsBznmTotNoDisabled] = useState(false);
const [isDuplicate, setIsDuplicate] = useState(false);
@@ -191,14 +164,19 @@ export default function SdmInsertForm({selectSidoData, selectSigunData, dataList
rtnValue={setRtnValue}
setIsDuplicate={setIsDuplicate}
updateList={updateList}
+ readOnly={readOnly}
/>
-
+ {readOnly==true?<>
+ >:
+
+ }
+
diff --git a/packages/common/business_components/src/ui/sdmInsertForm/sdmNameBox.tsx b/packages/common/business_components/src/ui/sdmInsertForm/sdmNameBox.tsx
index 59800b31e..94edc3836 100644
--- a/packages/common/business_components/src/ui/sdmInsertForm/sdmNameBox.tsx
+++ b/packages/common/business_components/src/ui/sdmInsertForm/sdmNameBox.tsx
@@ -8,6 +8,7 @@ export type thisProps = {
rtnValue: (searchText: string, pageCnt: number) => void;
rtnData: (item: DemandCompType) => void;
rtnText: (text: string) => void;
+ readOnly?:boolean
};
/**
@@ -25,6 +26,7 @@ export const SdmSearchForm = ({
dataList = [],
rtnData = () => {},
rtnText = () => {},
+ readOnly
}: thisProps) => {
const [isOpen, setIsOpen] = useState(false);
const [textValue, setTextValue] = useState(initValue || "");
@@ -84,6 +86,7 @@ export const SdmSearchForm = ({
/* onFocus={() => setIsOpen(true)} */
className="h-[3.2rem] w-full rounded-md border border-gray-300 pl-3 !text-xl text-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder={`${label}을(를) 입력하세요`}
+ readOnly={readOnly}
/>
{isOpen && (
diff --git a/packages/common/components/src/ui/footer/index.tsx b/packages/common/components/src/ui/footer/index.tsx
index 8bb6e0c90..34b2e46e9 100644
--- a/packages/common/components/src/ui/footer/index.tsx
+++ b/packages/common/components/src/ui/footer/index.tsx
@@ -1,8 +1,9 @@
-import { useQuery } from "@tanstack/react-query";
+import { useRef } from "react";
import Autoplay from "embla-carousel-autoplay";
-import { getConfig } from "@common/config";
+import { useQuery } from "@tanstack/react-query";
import { ENDPOINT } from "../../config";
import { getSiteInfo } from "../../api";
+import { getCookie } from "../../lib";
import {
Carousel,
CarouselContent,
@@ -10,10 +11,8 @@ import {
CarouselNext,
CarouselPrevious,
} from "../carousel";
-import { useRef } from "react";
-const appConfig = getConfig();
-const siteId = appConfig.SITE_ID ?? "";
+const siteId = getCookie("site-id-key") ?? "";
export function Footer() {
const { data: siteInfo } = useQuery({
diff --git a/packages/common/components/src/ui/header/index.tsx b/packages/common/components/src/ui/header/index.tsx
index eaf8cc8e5..22e0a0d56 100644
--- a/packages/common/components/src/ui/header/index.tsx
+++ b/packages/common/components/src/ui/header/index.tsx
@@ -21,8 +21,8 @@ import { SearchForm } from "./search-form";
import { NoticePopover } from "./notice-popover";
const appConfig = getConfig();
-const siteId = appConfig.SITE_ID ?? "";
const userId = getCookie(appConfig.AUTH_USER_ID ?? "");
+const siteId = getCookie("site-id-key") ?? "";
const isLoggedIn = !!userId;
export function Header({ viewOnly }: { viewOnly?: boolean }) {
diff --git a/packages/common/components/src/ui/lnb/index.tsx b/packages/common/components/src/ui/lnb/index.tsx
index b7ce9c6fa..07733dbed 100644
--- a/packages/common/components/src/ui/lnb/index.tsx
+++ b/packages/common/components/src/ui/lnb/index.tsx
@@ -40,8 +40,8 @@ import {
} from "../../api";
const appConfig = getConfig();
-const appSiteId = appConfig.SITE_ID ?? "";
const userId = getCookie(appConfig.AUTH_USER_ID ?? "");
+const appSiteId = getCookie("site-id-key") ?? "";
const isLoggedIn = !!userId;
export function LNB({
@@ -201,7 +201,7 @@ export function LNB({
/>
{item.menuKornNm}
-
+
);
@@ -282,9 +282,11 @@ export function LNB({
>
- {menuList?.map((item) => )}
+ {menuList?.map((item) => (
+
+ ))}
-
+
{/* 도움말 아이콘 */}