Merge remote-tracking branch 'origin/main' into iipbs/fo/dev
This commit is contained in:
@@ -37,5 +37,4 @@ yarn-error.log*
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
|
||||
.env*
|
||||
__ENV__.js
|
||||
.env*
|
||||
@@ -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();
|
||||
@@ -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",
|
||||
|
||||
@@ -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 (
|
||||
<html lang="ko" data-theme={theme?.value}>
|
||||
<head>
|
||||
<Script src="/__ENV__.js" strategy="beforeInteractive" />
|
||||
</head>
|
||||
<body>
|
||||
<AppProvider>{children}</AppProvider>
|
||||
</body>
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
declare global {
|
||||
interface Window {
|
||||
__ENV__?: Record<string, string>;
|
||||
}
|
||||
}
|
||||
|
||||
export function getEnvConfig(): Record<string, string> {
|
||||
if (typeof window === "undefined") return {};
|
||||
return window.__ENV__ ?? {};
|
||||
}
|
||||
|
||||
export function getEnv(key: string): string | undefined {
|
||||
return getEnvConfig()[key];
|
||||
}
|
||||
@@ -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";
|
||||
|
||||
@@ -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/"]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -191,6 +191,7 @@ export interface LinkSearchParam extends PageableParams {
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
isSucc?: string;
|
||||
linkClfsCd?: string;
|
||||
}
|
||||
|
||||
export type LinkFormData = z.infer<typeof linkFormSchema>;
|
||||
|
||||
@@ -104,6 +104,7 @@ function ImageForm({ form, imgSn, ...props }: ImageFormProps) {
|
||||
value={field.value ?? ""}
|
||||
className="!text-[1.3rem]"
|
||||
placeholder="이미지명을 입력해주세요"
|
||||
maxLength={100}
|
||||
/>
|
||||
</FormControl>
|
||||
</FormItem>
|
||||
@@ -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}
|
||||
/>
|
||||
</FormControl>
|
||||
</FormItem>
|
||||
|
||||
@@ -195,7 +195,13 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableHead>* 연계 URL</TableHead>
|
||||
<TableHead>
|
||||
{['link0001', 'link0002'].includes(form.watch('link_clsf_cd') as string) ? '* 연계 데이터베이스 URL' :
|
||||
(form.watch('link_clsf_cd') === 'link0007' ? '* 연계 파일 경로'
|
||||
: '* 연계 URL'
|
||||
)
|
||||
}
|
||||
</TableHead>
|
||||
<TableCell>
|
||||
<FormField
|
||||
control={form.control}
|
||||
@@ -242,7 +248,13 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableHead>* 연계 KEY</TableHead>
|
||||
<TableHead>
|
||||
{['link0001', 'link0002'].includes(form.watch('link_clsf_cd') as string) ? '* 연계 데이터베이스 DRIVER' :
|
||||
(form.watch('link_clsf_cd') === 'link0007' ? '* 연계 파일 확장자'
|
||||
: '* 연계 KEY'
|
||||
)
|
||||
}
|
||||
</TableHead>
|
||||
<TableCell>
|
||||
<FormField
|
||||
control={form.control}
|
||||
|
||||
@@ -4,7 +4,7 @@ import "@common/assets/styles/grid.css";
|
||||
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Button, Input, Label, LoadingWithAnimation } from "@common/components";
|
||||
import { Button, Input, Label, LoadingWithAnimation, Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from "@common/components";
|
||||
import { getCoreRowModel } from "@tanstack/react-table";
|
||||
import { LinkApi, type Link, type LinkSearchParam } from "@/entities/link";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
@@ -18,10 +18,12 @@ function LinkPage() {
|
||||
|
||||
const [linkSn, setLinkSn] = useState<string>('');
|
||||
const [linkNm, setLinkNm] = useState<string>('');
|
||||
const [linkClfsCd, setLinkClfsCd] = useState<string>('');
|
||||
|
||||
const [linkSearchParam, setLinkSearchParam] = useState<LinkSearchParam>({
|
||||
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"
|
||||
/>
|
||||
<Label htmlFor="linkClfsCd" className="mr-2 text-label">
|
||||
연계 분류
|
||||
</Label>
|
||||
<Select onValueChange={(e) => setLinkClfsCd(e)} value={linkClfsCd}>
|
||||
<SelectTrigger id="linkClfsCd" className="w-[20rem] mr-4">
|
||||
<SelectValue placeholder="전체"></SelectValue>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="ALL">전체</SelectItem>
|
||||
<SelectItem value="link0001">TIBERO 데이터베이스</SelectItem>
|
||||
<SelectItem value="link0002">ORACLE 데이터베이스</SelectItem>
|
||||
<SelectItem value="link0003">공공데이터 포털 API</SelectItem>
|
||||
<SelectItem value="link0004">한강홍수통제소 API</SelectItem>
|
||||
<SelectItem value="link0005">기상청 API</SelectItem>
|
||||
<SelectItem value="link0006">국가지하수정보센터 API</SelectItem>
|
||||
<SelectItem value="link0007">행정정보공동이용센터 연계</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<Button color="green" className="h-[3.2rem]" type="button" onClick={handleResetSearchParam}>
|
||||
초기화
|
||||
</Button>
|
||||
|
||||
@@ -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: () => {
|
||||
|
||||
@@ -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
|
||||
|
||||
+2
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
+2
-1
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 (
|
||||
<div className="bg-container">
|
||||
@@ -310,12 +272,12 @@ const Map = () => {
|
||||
/>
|
||||
}
|
||||
waterDepth={undefined}
|
||||
onOpenPopup={(data:any) =>{
|
||||
onOpenPopup(data)
|
||||
onOpenPopup={(data: any) => {
|
||||
onOpenPopup(data);
|
||||
}}
|
||||
/>
|
||||
<Toaster position="top-center" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ export default function MapDetailPopUp() {
|
||||
return (
|
||||
<RswtFacility
|
||||
rtnFeature={(feature) => {
|
||||
|
||||
bc.postMessage({ type: "SELECT_FEATURE", feature });
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -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<any>(null);
|
||||
const {
|
||||
@@ -105,6 +17,7 @@ export default function MapFeaturePopup() {
|
||||
htdfMapDetile,
|
||||
pbnMapDetaile,
|
||||
ldrmntMapDetile,
|
||||
coSttnMapDetail
|
||||
} = useWrStore((state) => state);
|
||||
const { pbnMapHeadList } = pbnMap;
|
||||
const [isDetail, setIsDetail] = useState<any>(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 ? (
|
||||
<div className="fixed inset-0 w-screen h-screen m-0 p-0 bg-white">
|
||||
{layerNm === "하수재이용시설" ? (
|
||||
{layerNm === "tb_wr_bdst_ruse_fclt" ? (
|
||||
<RuseDetailPopup bscFctCd={isDetail} />
|
||||
) : layerNm === "하수처리시설" ? (
|
||||
) : layerNm === "tb_il_swage_prcs_fclt" ? (
|
||||
<div style={{ overflowX: "hidden" }}>
|
||||
<div className="flex justify-between items-center mb-4">
|
||||
<Title title="하수처리시설 상세정보" />
|
||||
@@ -194,21 +110,26 @@ export default function MapFeaturePopup() {
|
||||
onPageChange={() => {}}
|
||||
/>
|
||||
</div>
|
||||
) : layerNm === "잠재수요처" ? (
|
||||
) : layerNm === "tb_wr_tmpr_dmd_co" ? (
|
||||
<CoDetailModal
|
||||
formObj={isDetail}
|
||||
readonly={false}
|
||||
onFormSubmit={async (value) => {
|
||||
console.log(value)
|
||||
console.log(value);
|
||||
}}
|
||||
isMap={true}
|
||||
/>
|
||||
) : (
|
||||
) :layerNm === "tb_wr_ruse_fclt_dmd_co" ? (
|
||||
<CoSttnDetailPopup
|
||||
isDetail={isDetail}
|
||||
/>
|
||||
)
|
||||
: (
|
||||
<SttnDetailModal
|
||||
type={
|
||||
layerNm === "빗물이용시설"
|
||||
layerNm === "tb_wr_rnwtr_utztn_fclt"
|
||||
? "RNB"
|
||||
: layerNm === "중수도시설"
|
||||
: layerNm === "tb_wr_rswtr_fclt"
|
||||
? "RST"
|
||||
: "HTB"
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import type { DemandCompType } from "@common/business_components/ui/sdmInsertForm/form";
|
||||
import type { CommonTableProps } from "../../common/type/header";
|
||||
import { coSttHeadListExport, coSttNodeListExport } from "../../matDmd/coSttn/headList";
|
||||
import { fetchType, getFetchWithCount } from "@/components/lib/api";
|
||||
import {
|
||||
coSttHeadListExport,
|
||||
coSttNodeListExport,
|
||||
} from "../../matDmd/coSttn/headList";
|
||||
import { fetchType, getFetch, getFetchWithCount } from "@/components/lib/api";
|
||||
|
||||
const coSttnMapRes: DemandCompType[] = [];
|
||||
|
||||
export const costtnMapSize =20
|
||||
export const costtnMapSize = 20;
|
||||
|
||||
export type coSttnMapState = {
|
||||
coSttnMap: {
|
||||
@@ -21,7 +24,13 @@ export type coSttnMapState = {
|
||||
type coSttnMapActions = {
|
||||
coSttnMapInit: (pageNo: number, pageCnt: number, con: string) => 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<DemandCompType | undefined>;
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
coSttnMapDetail: async (dmdInfoId: string) => {
|
||||
try {
|
||||
const coSttnMapDetail = await getFetch(
|
||||
fetchType.WR,
|
||||
`/reuseFc/request/${dmdInfoId}`
|
||||
);
|
||||
return coSttnMapDetail;
|
||||
} catch (erTxt) {
|
||||
console.log("error", erTxt);
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
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
|
||||
);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
export default function coSttnDetailPopup(){
|
||||
|
||||
|
||||
return(
|
||||
<>
|
||||
|
||||
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -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(
|
||||
<div>
|
||||
<SdmInsertForm
|
||||
selectSidoData={code.cityCd}
|
||||
selectSigunData={code.sggCd}
|
||||
dataList={[]}
|
||||
rtnValue={(searchText: string, pageCnt: number) => {
|
||||
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}
|
||||
></SdmInsertForm>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -28,7 +28,6 @@ export function middleware(req: NextRequest) {
|
||||
}
|
||||
|
||||
if (pathname === "/") {
|
||||
console.log(" maim 화면이동 ");
|
||||
return NextResponse.redirect(new URL("/map/mainMap", req.url));
|
||||
}
|
||||
|
||||
|
||||
@@ -66,11 +66,12 @@ interface SdmRegFormProps {
|
||||
rtnValue: (searchText: string, pageCnt: number) => void;
|
||||
setIsDuplicate: (value: boolean) => void;
|
||||
updateList?:DemandCompType
|
||||
readOnly?:boolean
|
||||
}
|
||||
|
||||
type FieldComponent = (field: ControllerRenderProps<FormSchema, keyof FormSchema>) => 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<string>('');
|
||||
const [sigunValue, setSigunValue] = useState<string>('');
|
||||
const [filteredSigunData, setFilteredSigunData] = useState<SelectDataType[]>([{ 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}
|
||||
/>
|
||||
)
|
||||
|
||||
@@ -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}
|
||||
/>
|
||||
<div className="flex justify-center pt-4">
|
||||
<Button
|
||||
type="submit"
|
||||
className="w-32 bg-blue-600 hover:bg-blue-700 text-white font-semibold py-2 px-4 rounded-md transition-colors duration-200"
|
||||
>
|
||||
수요처등록
|
||||
</Button>
|
||||
{readOnly==true?<>
|
||||
</>:
|
||||
<Button
|
||||
type="submit"
|
||||
className="w-32 bg-blue-600 hover:bg-blue-700 text-white font-semibold py-2 px-4 rounded-md transition-colors duration-200"
|
||||
>
|
||||
수요처등록
|
||||
</Button>
|
||||
}
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</FormProvider>
|
||||
|
||||
@@ -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 && (
|
||||
<div className="absolute top-full left-0 z-50 mb-2 max-h-72 w-full overflow-auto rounded-md border border-gray-300 bg-white shadow-lg">
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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 }) {
|
||||
|
||||
@@ -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({
|
||||
/>
|
||||
<span className={cn("whitespace-nowrap", !isSidebarOpen && "hidden")}>
|
||||
{item.menuKornNm}
|
||||
</span>
|
||||
</span>
|
||||
</MenuButton>
|
||||
</MenuItem>
|
||||
);
|
||||
@@ -282,9 +282,11 @@ export function LNB({
|
||||
>
|
||||
<SidebarContent className="bg-background">
|
||||
<SidebarMenu className="gap-0">
|
||||
{menuList?.map((item) => <MenuItem key={item.menuCd} item={item} />)}
|
||||
{menuList?.map((item) => (
|
||||
<MenuItem key={item.menuCd} item={item} />
|
||||
))}
|
||||
</SidebarMenu>
|
||||
|
||||
|
||||
{/* 도움말 아이콘 */}
|
||||
<div className="mt-auto pb-4">
|
||||
<Dialog open={isHelpModalOpen} onOpenChange={setIsHelpModalOpen}>
|
||||
@@ -292,7 +294,7 @@ export function LNB({
|
||||
<button
|
||||
className={cn(
|
||||
"flex h-12 w-full items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
||||
"focus:outline-none"
|
||||
"focus:outline-none",
|
||||
)}
|
||||
title="도움말"
|
||||
>
|
||||
@@ -300,22 +302,22 @@ export function LNB({
|
||||
<span className="ml-2">도움말</span>
|
||||
</button>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="sm:max-w-[85rem]">
|
||||
<DialogHeader>
|
||||
<DialogTitle>도움말</DialogTitle>
|
||||
</DialogHeader>
|
||||
<div className="py-4">
|
||||
{currentMenuHelp ? (
|
||||
<div
|
||||
className="text-sm leading-relaxed text-muted-foreground"
|
||||
dangerouslySetInnerHTML={{ __html: currentMenuHelp }}
|
||||
/>
|
||||
) : (
|
||||
<p className="text-sm text-muted-foreground">
|
||||
현재 페이지에 대한 도움말이 없습니다.
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<DialogContent className="sm:max-w-[85rem]">
|
||||
<DialogHeader>
|
||||
<DialogTitle>도움말</DialogTitle>
|
||||
</DialogHeader>
|
||||
<div className="py-4">
|
||||
{currentMenuHelp ? (
|
||||
<div
|
||||
className="text-sm leading-relaxed text-muted-foreground"
|
||||
dangerouslySetInnerHTML={{ __html: currentMenuHelp }}
|
||||
/>
|
||||
) : (
|
||||
<p className="text-sm text-muted-foreground">
|
||||
현재 페이지에 대한 도움말이 없습니다.
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user