Merge remote-tracking branch 'origin/main' into iipbs/dm/dev

This commit is contained in:
yschoi
2025-08-14 11:34:24 +09:00
46 changed files with 729 additions and 533 deletions
+1 -2
View File
@@ -37,5 +37,4 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts
.env*
__ENV__.js
.env*
-44
View File
@@ -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();
+2 -6
View File
@@ -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
View File
@@ -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";
-1
View File
@@ -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>;
+10 -3
View File
@@ -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>
+14 -2
View File
@@ -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}
+26 -3
View File
@@ -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>
+9 -1
View File
@@ -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: () => {
+2 -1
View File
@@ -5,7 +5,8 @@ NEXT_PUBLIC_SERVER_API_URL = http://con.mind-one.co.kr:11082/api/v1
#NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000
NEXT_PUBLIC_WR_SERVER_API_URL = http://con.mind-one.co.kr:11080/api/v1
NEXT_PUBLIC_CS_SERVER_API_URL = http://dev.onasys.co.kr:8000
NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver
#NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver
NEXT_PUBLIC_GEOSERVER_URL = https://hasudo.geo.rsonesoft.com/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
View File
@@ -5,7 +5,8 @@ NEXT_PUBLIC_SERVER_API_URL = http://con.mind-one.co.kr:11082/api/v1
#NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000
NEXT_PUBLIC_WR_SERVER_API_URL = http://con.mind-one.co.kr:11080/api/v1
NEXT_PUBLIC_CS_SERVER_API_URL = http://dev.onasys.co.kr:8000
NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver
#NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver
NEXT_PUBLIC_GEOSERVER_URL = https://hasudo.geo.rsonesoft.com/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
View File
@@ -18,7 +18,8 @@ NEXT_PUBLIC_SERVER_API_URL = http://con.mind-one.co.kr:11082/api/v1
#NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000
NEXT_PUBLIC_WR_SERVER_API_URL = http://con.mind-one.co.kr:11080/api/v1
NEXT_PUBLIC_CS_SERVER_API_URL = http://dev.onasys.co.kr:8000
NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver
#NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver
NEXT_PUBLIC_GEOSERVER_URL = https://hasudo.geo.rsonesoft.com/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
+33 -11
View File
@@ -3,7 +3,7 @@
import Gis from "@common/business_components/ui/map/Gis";
import GisApp from "@common/business_components/ui/map/lib/gis.core";
import { useEffect, useRef, useState } from "react";
import { ProcSearchBar } from "@common/business_components/ui/map/searchBar";
import { SearchBar } from "@common/business_components/ui/map/searchBar";
// OpenLayers overlay/extent 유틸
import Overlay from "ol/Overlay";
@@ -73,6 +73,18 @@ const Map = () => {
fetchData();
}, []);
function formatWithCommas(value: any) {
if (value === null || value === undefined) return value;
const num = Number(value);
return isNaN(num) ? value : num.toLocaleString();
}
function formatDateString(dateStr: string) {
dateStr = dateStr.trim();
if (typeof dateStr !== "string" || dateStr.length !== 8) return dateStr;
return `${dateStr.slice(0, 4)}-${dateStr.slice(4, 6)}-${dateStr.slice(6)}`;
}
// ===== 오버레이 콘텐츠 빌더 =====
const buildOverlayContent = (layerType: string, feature: FeatureData) => {
const props: Record<string, any> = {};
@@ -80,15 +92,13 @@ const Map = () => {
const mayGet = (k: string) => (feature.get ? feature.get(k) : undefined);
const safe = (v: any) => (v === undefined || v === null ? "-" : String(v));
console.log(feature);
// 레이어 유형별 대표 필드 추출(없으면 "-")
if (layerType === "tb_il_swage_prcs_fclt") {
// 하수처리시설
props["하수처리시설명"] = mayGet("swtrmt_fclt_nm");
props["시설용량(m³/d)"] = mayGet("fclt_cpct");
props["시설용량(m³/d)"] = formatWithCommas(mayGet("fclt_cpct"));
props["주소"] = mayGet("rdnm_addr");
props["가동개시일"] = mayGet("oprtng_strt_ymd");
props["가동개시일"] = formatDateString(mayGet("oprtng_strt_ymd"));
props["공법"] = mayGet("rprs_msrc_cn");
} else if (layerType === "tb_ms_swage_prcs_zone") {
// 처리구역(존)
@@ -118,14 +128,14 @@ const Map = () => {
<div class="font-semibold text-lg text-gray-800 mb-2 text-center bg-green-400">${title}</div>
<table class="w-full text-base text-gray-800">
${Object.entries(props)
.map(
([k, v]) => `
.map(
([k, v]) => `
<tr>
<td class="py-1 pr-2 text-gray-500 whitespace-nowrap">${k}</td>
<td class="py-1 font-medium">${safe(v)}</td>
</tr>`
)
.join("")}
)
.join("")}
</table>
`;
return el;
@@ -268,7 +278,19 @@ const Map = () => {
setIsSearchModalOpen(false);
};
// (선택) 다른 위치 클릭 시 오버레이 닫고 싶다면 Gis 쪽에서 지도 클릭 이벤트 받아 여기서 제거하는 훅을 연결하면 됨.
const onInit = () => {
const map = gisMaps.current;
if (!map) {
console.warn("지도가 초기화되지 않았습니다.");
return;
}
if (overlayRef.current) {
map.removeOverlay?.(overlayRef.current);
overlayRef.current = null;
}
}
return (
<div className="bg-container">
@@ -289,7 +311,7 @@ const Map = () => {
onCheckedLayersChange={undefined}
imgVisble={false}
searchBar={
<ProcSearchBar gisMaps={gisMaps} facilityTypes={facilityTypes} />
<SearchBar gisMaps={gisMaps} facilityTypes={facilityTypes} onFeatureFocus={undefined} onInit={onInit} />
}
waterDepth={undefined}
/>
@@ -6,17 +6,21 @@ import ListDiv from "@common/business_components/ui/list_div";
import { Table, TableCell, TableHead, TableRow } from "@common/components/ui";
import { useEffect, useState } from "react";
export default function SewageOccurModal(props: { fcltyName: string; facilityCd : string; searchYear : string}) {
// 그리드 관련
const {SewageOccurDetail, searchSewageOccurDetailList} = useFoStore((state) => state);
// searchYear 유효성 검사 및 기본값 설정
const validSearchYear = props.searchYear && /^\d{4}$/.test(props.searchYear) ? props.searchYear : new Date().getFullYear().toString();
const [startYearMonth, setStartYearMonth] = useState(validSearchYear+'01');
const [endYearMonth, setEndYearMonth] = useState(validSearchYear+'12');
const [detailList, setDetailList] = useState<modalTableType[]>([]);
// 가능한 시작년월 설정
const [enableEndMonth, setEnableEndMonth] = useState<string[]>(['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월']);
const {
upHeadListSewageOccurDetail,
gridListSewageOccurDetail
@@ -33,7 +37,29 @@ export default function SewageOccurModal(props: { fcltyName: string; facilityCd
useEffect(() => {
searchSewageOccurDetailList(props.facilityCd, validSearchYear, startYearMonth, endYearMonth);
}, [startYearMonth, endYearMonth]);
}, [startYearMonth, endYearMonth, searchSewageOccurDetailList, props.facilityCd, validSearchYear]);
useEffect(() => {
const standdardMonthList = ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월']
setEnableEndMonth(standdardMonthList);
// 시작년월이 바뀌면 선택가능한 년월 데이터가 변경돼야 한다.
if(startYearMonth){
const startMm = startYearMonth.substring(4, 6);
if(endYearMonth < startYearMonth) {
setEndYearMonth(startYearMonth);
}
standdardMonthList.forEach((month) => {
setEnableEndMonth((prev) => {
if (parseInt(month.replaceAll('월', '')) < parseInt(startMm)) {
return prev.filter((m) => m !== month);
}
return prev;
});
});
}
}, [endYearMonth, startYearMonth]);
return (
<>
@@ -63,6 +89,7 @@ export default function SewageOccurModal(props: { fcltyName: string; facilityCd
selectClass="ml-5 w-[100px]"
startYear={1900}
yearReadOnly={true}
enableMonth={['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월']}
/>~
<DateMonthPicker
field={{
@@ -81,6 +108,7 @@ export default function SewageOccurModal(props: { fcltyName: string; facilityCd
selectClass="ml-5 w-[100px]"
startYear={1900}
yearReadOnly={true}
enableMonth={enableEndMonth}
/>
</TableCell>
</TableRow>
-1
View File
@@ -219,7 +219,6 @@ type SetStateFunction = (state: RdiType | ((state: RdiType) => RdiType)) => void
export type RdiStore = RdiType & RdiActions;
export const rdiReducer:(set:SetStateFunction)=>RdiActions=(set: SetStateFunction) => {
console.log("tableActionsExport");
return {
searchRdiList: async (pageNo: number, pageSize: number, searchYear: string, partCd?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
set((state: RdiType) => ({
+24 -1
View File
@@ -222,6 +222,7 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => {
},
}));
const res = await fetchSewageOccurList(pageNo, pageSize, searchYear, part, nameCd, fcltCpct, operationValue, fcltyNm);
const excelDownList: ExcelType[] = [];
const data = res.data;
// Promise.all을 사용하여 모든 비동기 작업이 완료될 때까지 기다림
const calData = await Promise.all(data.map(async (item: SewageOccurProps) => {
@@ -301,6 +302,28 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => {
item.estimationSewage = parseFloat((item.waterUsage * (item.swageChangePercent/100)).toFixed(2));
return item;
}));
if(pageSize>5000){
calData.forEach((item: SewageOccurProps) => {
excelDownList.push({
시설코드: item.bscFctCd,
권역: item.rvbsn,
단위유역: item.lgbsn,
중권역: item.mdmbsn,
환경청: item.rgnNm,
시설명: item.bscFctNm,
시도: item.sidoNm, // sido ?? 타입에러 나서 수정함
시군구: item.sggNm, //sgg ??
주소: item.daddr,
시설용량: item.fctCpc,
물사용량: item.waterUsage,
오수전환율: item.swageChangePercent,
오수발생량추정: item.estimationSewage,
연간하수유입량 : item.sewageInputYear,
청천시하수유입량 : item.sewageInputChungchun,
});
});
}
// 조회 데이터 설정
set((state: any) => ({
...state,
@@ -311,7 +334,7 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => {
isLoading : false,
}:{
...state.SewageOccur,
excelList: [],
excelList: excelDownList,
isLoading : false,
},
}))
@@ -28,9 +28,6 @@ export class LoginApiService implements LoginService {
const accessToken = response.headers.get(ACCESS_TOKEN);
const tokenId = response.headers.get(AUTH_USER_ID);
console.log('accessToken ', accessToken)
console.log('tokenId ', tokenId)
if (!accessToken || !tokenId) {
throw new Error("Missing required authentication tokens");
}
+2 -1
View File
@@ -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
View File
@@ -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
+2 -1
View File
@@ -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
+2 -1
View File
@@ -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
View File
@@ -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
+2 -1
View File
@@ -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
+64 -102
View File
@@ -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"
}
+38 -13
View File
@@ -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);
}
},
};
};
+135 -14
View File
@@ -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>
)
}
-1
View File
@@ -28,7 +28,6 @@ export function middleware(req: NextRequest) {
}
if (pathname === "/") {
console.log(" maim 화면이동 ");
return NextResponse.redirect(new URL("/map/mainMap", req.url));
}