) => {
+ e.currentTarget.textContent && setBtnTxt(e.currentTarget.textContent)
+ setIsModalOpen(true);
+ };
+ const closeModal = () => {
+ setIsModalOpen(false);
+ };
const [repairData, setRepairData] = useState([
{ year: "2025", type: "개대체" },
{ year: "2025", type: "보수" },
@@ -32,6 +43,20 @@ const SwtrmtFclt = ({ featureData }: { featureData: any }) => {
cleaning: { data: cleaningData, setData: setCleaningData },
inspection: { data: inspectionData, setData: setInspectionData },
};
+ const keysToExtract = [
+ "swtrmt_zone_cd",
+ "mltv_dtdv_nm",
+ "fid",
+ "lyrTypeNm",
+ "reg_dt",
+ "mdfcn_dt",
+ "rgtr",
+ "mdfr",
+ ];
+ // const filteredData = Object.entries(featureData)
+ // .filter(([key]) => keysToExtract.includes(key)) // 필요한 키만 필터링
+ // .map(([key, value]) => ({ key, value: value ?? "N/A" })); // 테이블 데이터 형식으로 변환
+
return (
{
}}>
handleInputChange(section, index, field, value, dataMap)} />
handleInputChange(section, index, field, value, dataMap)} />
- handleInputChange(section, index, field, value, dataMap)} />
+ handleInputChange(section, index, field, value, dataMap)} />
+
+
+
+
+
+
)
}
diff --git a/apps/sn/app/map/components/popupComponent/chart/infilChart.tsx b/apps/sn/app/map/components/popupComponent/chart/infilChart.tsx
new file mode 100644
index 000000000..ba0b70455
--- /dev/null
+++ b/apps/sn/app/map/components/popupComponent/chart/infilChart.tsx
@@ -0,0 +1,140 @@
+import React, { useState } from 'react'
+import { type ChartConfig, MainChart, CHART_FORM } from "@common/business_components";
+import Modal from '@/components/ui/modal';
+import { Button } from '@common/components/ui';
+type ModalOpenProp = {
+ isModalOpen: boolean,
+ setIsModalOpen: (open: boolean) => void,
+ closeModal: () => void,
+ btnTxt?: string,
+}
+const InfilChart = ({ btnTxt, isModalOpen, setIsModalOpen, closeModal }: ModalOpenProp) => {
+ const [popupOpen, setPopupOpen] = React.useState(false);
+ const buttonRef = React.useRef(null); // 버튼 참조
+ const [popupPosition, setPopupPosition] = useState<{ top: number; left: number }>({ top: 0, left: 0 }); // 팝업 위치
+ const openPopup = () => {
+ if (buttonRef.current) {
+ const rect = buttonRef.current.getBoundingClientRect(); // 버튼 위치 계산
+ setPopupPosition({
+ top: rect.bottom + window.scrollY, // 버튼 아래쪽
+ left: rect.left + window.scrollX, // 버튼 왼쪽
+ });
+ }
+ setPopupOpen(true); // 팝업 열기
+ };
+ console.log("btnTxt", btnTxt);
+ const closePopup = () => {setPopupOpen(false);}; // 팝업 닫기
+ const chartForm = CHART_FORM.LINE;
+ const chartData = {
+ chartData1: [
+ { label: "1", val: 20 },
+ { label: "3", val: 40 },
+ { label: "5", val: 60 },
+ ],
+ chartData2: [
+ { label: "1", val: 15 },
+ { label: "3", val: 35 },
+ { label: "5", val: 55 },
+ ],
+ }
+ const chartConfig = Object.values(chartData).flat().reduce((config, element) => {
+ config[element.label] = {
+ label: element.label,
+ color: "hsl(var(--chart-1))",
+ };
+ return config;
+ }, {} as Record) satisfies ChartConfig;
+ const getCurrentDate = () => {
+ const today = new Date();
+ const year = today.getFullYear();
+ const month = String(today.getMonth() + 1).padStart(2, "0"); // 월은 0부터 시작하므로 +1
+ return `${year}-${month}`;
+ };
+ return (
+
+ {/* 분석 입력현황 조회 */}
+
+
+
+
+ {/* 침입수량 분석결과 */}
+
+ 침입수량 분석결과
+
+ 120
+ m³/d
+
+
+
+ {/* 차트 */}
+
+
+
+
+ {popupOpen && (
+
+
분석 입력현황
+
+
상수사용량 정보:
+
+
+
+
오수 전환율:
+
+
+
+
수용가-맨홀 매칭:
+
+
+
+
관망도 자료:
+
+
+
+ {btnTxt === 'RDII' ? <>
강우 자료:
+
+
+
+
RTX 계수 출처:
+
+
+
+ > : null}
+
+
+
+
+
+
+ )}
+
+ )
+}
+
+export default InfilChart
\ No newline at end of file
diff --git a/apps/sn/app/map/components/popupComponent/stormWaterPump.tsx b/apps/sn/app/map/components/popupComponent/stormWaterPump.tsx
index 3a6cdee2d..eefef8b3b 100644
--- a/apps/sn/app/map/components/popupComponent/stormWaterPump.tsx
+++ b/apps/sn/app/map/components/popupComponent/stormWaterPump.tsx
@@ -1,13 +1,15 @@
import { VerticalTable } from '@/components/ui/verticalTable';
import React from 'react'
const inputColumn = [
- { id: "guyeok", title: "처리구역", type: "select", options: ["구역1", "구역2"] },
- { id: "bungu", title: "배수분구", type: "input" },
+ { id: "swtrmt_zone_cd", title: "처리구역", type: "input" },
+ { id: "mltv_dtdv_nm", title: "배수분구", type: "input" },
]
// 빗물펌프
-const StormWaterPump = ({ featureData }: { featureData: any }) => {
+const StormWaterPump = ({ featureData }: { featureData: Record }) => {
+ const validKey = inputColumn.map((item) => item.id);
+ const filteredData = featureData && Object.entries(featureData).filter(([key]) => validKey.includes(key)).reduce((obj: Record, [key, value]) => {obj[key] = value; return obj;}, {});
return (
-
diff --git a/apps/sn/app/map/featureClickEventPopup.tsx b/apps/sn/app/map/featureClickEventPopup.tsx
index 54e5b72bd..74e523d02 100644
--- a/apps/sn/app/map/featureClickEventPopup.tsx
+++ b/apps/sn/app/map/featureClickEventPopup.tsx
@@ -4,7 +4,7 @@ import { Button, Table, TableBody, TableCell, TableHead, TableHeader, TableRow }
import { useEffect, useRef, useState } from "react";
import { SwtrmtFcltCol, SwtrmtPrcsZoneCol } from "./components/common/table";
import { useGisContext } from "@common/business_components/ui/map/Gis";
-import { getData } from "@/components/lib/api";
+import { getData, putData } from "@/components/lib/api";
import { getLayerContentComponent } from "./components/common";
// TODO:
const FeatureClickEventPopup = ({ onClose, featureData }: { onClose: () => void, featureData: any }) => {
@@ -82,21 +82,34 @@ const FeatureClickEventPopup = ({ onClose, featureData }: { onClose: () => void,
fetchData();
}, [featureId]);
// TODO: api 호출작업 필요(사용자 입력부분)
- const btnClickEvent = () => {
+ const btnClickEvent = async() => {
+ const bodyData: Record = {}
if (buttonChk && contentRef.current) {
const inputElements = contentRef.current.querySelectorAll('input');
const selectElements = contentRef.current.querySelectorAll('select');
// select 태그의 값 가져오기
- console.log("Select Elements:", selectElements);
- console.log("Input Elements:", inputElements);
selectElements.forEach((select) => {
- console.log("Select Value:", select.value);
+ bodyData[select.id] = select.value;
});
-
// input 태그의 값 가져오기
inputElements.forEach((input) => {
- console.log("Input Value:", input.value);
+ bodyData[input.id] = input.value;
});
+ if (layerNm === '하수관로' || layerNm === '하수처리시설') {
+ bodyData['lyrTypeNm'] = 'tb_ms_swage_ppl'
+ } else if (layerNm === '우수토실') {
+ bodyData['lyrTypeNm'] = 'tb_ms_stofcbr'
+ } else if (layerNm === '오수펌프') {
+ bodyData['lyrTypeNm'] = 'tb_ms_swage_pmstn'
+ }
+ else if (layerNm === '빗물펌프') {
+ bodyData['lyrTypeNm'] = 'tb_ms_swage_pmstn'
+ }
+ bodyData['fid'] = featureId
+ const data = await putData(`v1/fclts/${featureId}`, bodyData);
+ if(data){
+ console.log('저장완료', data);
+ }
}
}
const ContentComponent = layerNm ? getLayerContentComponent(layerNm) : null;
diff --git a/apps/sn/app/oper/diag/page.tsx b/apps/sn/app/oper/diag/page.tsx
deleted file mode 100644
index 013d8eecc..000000000
--- a/apps/sn/app/oper/diag/page.tsx
+++ /dev/null
@@ -1,58 +0,0 @@
-'use client'
-
-import { SearchDiv, SelectBox, UiTable } from '@common/business_components';
-import { Button, TableRow, Input, Label } from '@common/components';
-import { TableHead } from '@common/components';
-import { useSnStore } from '../../store';
-import type { TableUpperProps } from '../../store/table';
-
-const headMakeColSpan = (upHeadList: TableUpperProps[]) => {
- return ( <>
- {
- upHeadList.map((head: TableUpperProps) =>
- (!head.upSequnce?{head.title}:
- head.upName === 'upChangeRe'&& head.upSequnce=== 1?{'중축 개축 증축 '}:null))}
-
-
- {upHeadList.map((head: TableUpperProps) =>
- (head.upName === 'upChangeRe'?{head.title}:null))}
-
- > )
-}
-
- export default function PublicReuseFaciltyInsert() {
- const { upHeadList, publicReuseFacilityUper} = useSnStore((state) => state);
- const nodeList= headMakeColSpan(upHeadList);
- const total = 100;
- const headName= ()=>{
- return(
- 점검 및 진단 현황
- )
- }
- return ( <>
-
-
점검 및 진단 조회
-
-
- {}} />
- {}} />
- {}} />
- {}} />
- {}} />
- {}} />
- {}} />
- {}} />
-
-
-
-
-
- > )
-}
-
-
-
diff --git a/apps/sn/app/oper/pplines/page.tsx b/apps/sn/app/oper/pplines/page.tsx
deleted file mode 100644
index 48621bddc..000000000
--- a/apps/sn/app/oper/pplines/page.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-'use client'
-import "@common/assets/styles/grid.css";
-import { useEffect, useState } from "react";
-import { SearchDiv, SelectBox, UiTable, MainDiv, Title, ContentsDiv, SearchFormLeft, SearchFormRight } from '@common/business_components';
-import ListDiv from '@common/business_components/ui/list_div';
-import { Button, Input } from '@common/components';
-import { useRouter } from "next/navigation";
-import { pplinesService } from "@service";
-
-const tableHeadlist = [
- { id: "ftreSmbol", title: "지형지물부호"},
- { id: "swageLnkgPplPk", title: "하수연결관로기본키"},
- { id: "pbadmsEmd", title: "행정읍면동"},
- { id: "sttyEmd", title: "법정읍면동"}
-];
-
-export default function Pplines() {
-
- const router = useRouter()
- const total = 20
- const pageSize = 20
-
- const [data, setData] = useState<{ content: any[] }>({ content: [] }); // 초기값을 객체 또는 null로 설정
-
- const fetchData = async () => {
-
- try {
- const response = await pplinesService.getPplines();
- setData(response.data); // API 응답 저장
- } catch (error) {
- console.error("데이터 불러오기 실패:", error);
- }
- };
-
- // 컴포넌트 마운트 시 1회 실행
- useEffect(() => {
- fetchData();
- }, []);
-
- return (
-
-
-
-
-
- {}} selectClass='w-24' />
- {}} selectClass='w-24' />
- {}} selectClass='w-24' />
- {}} selectClass='w-24' />
- {}} selectClass='w-24' />
- {}} selectClass='w-24' />
- {}} selectClass='w-24' />
- {}} selectClass='w-24' />
-
-
-
-
-
-
-
- {}} />
-
-
- );
-}
diff --git a/apps/sn/app/oper/soil/page.tsx b/apps/sn/app/oper/soil/page.tsx
deleted file mode 100644
index 75becb751..000000000
--- a/apps/sn/app/oper/soil/page.tsx
+++ /dev/null
@@ -1,126 +0,0 @@
-'use client'
-
-import { SearchDiv, SelectBox, UiTable } from '@common/business_components';
-import { Button } from '@common/components';
-import { useSnStore } from '@store';
-import { type TableUpperProps } from '@/store/table';
-import { StoreZus } from '@/store/store';
-import { useRouter } from "next/navigation";
-
- const upHeadList: TableUpperProps[] = [
- { id: "sido", title: "자산ID111"},
- { id: "sigungo", title: "설비시설"},
- { id: "facilityName", title: "주소"},
- { id: "location", title: "자산코드"},
- { id: "locationgubun", title: "자산명"},
- { id: "facilityCapacity", title: "용도"},
- { id: "yn", title: '신설/교체'},
- { id: "authoDay", title: '처리구역'},
- { id: "area", title: '내용연수' },
- { id: "reuse", title: '취득금액' },
- ]
-
- const useAStore = StoreZus();
-
- export default function PublicReuseFaciltyInsert() {
-
- //const upHeadList = useSnStore((state) => state.upHeadList)
- //const publicReuseFacilityUper = useSnStore((state) => state.publicReuseFacilityUper)
-
- //const { upHeadList, publicReuseFacilityUper, setHeadList, setTableData, decrementList, addRow } = useAStore.getState();
- const upHeadList = useSnStore(useAStore => useAStore.upHeadList);
- const publicReuseFacilityUper = useSnStore(useAStore => useAStore.publicReuseFacilityUper);
- const setHeadList = useSnStore(useAStore => useAStore.setHeadList);
- const setTableData = useSnStore(useAStore => useAStore.setTableData);
- const addRow = useSnStore(useAStore => useAStore.addRow);
- const decrementList = useSnStore(useAStore => useAStore.decrementList);
-
-
- //const { upHeadList, publicReuseFacilityUper} = useSnStore((state) => state)
-
- //const setHeadList = useSnStore((state) => state.setHeadList)
- //const setTableData = useSnStore((state) => state.setTableData)
- //const decrementList = useSnStore((state) => state.decrementList)
-
- const handleChangeHeader = () => {
- setHeadList(upHeadList)
- }
-
- const add = () => {
- console.log(11111)
- addRow({
- sido: "xxxxxxxxxx",
- sigungo: "bbbbbbbbb",
- facilityName: "newFacility",
- location: "S-T-S-000000",
- locationgubun: "000000",
- facilityCapacity: "오수관",
- });
- };
-
- const searchDataList = () => {
- //if (newFacility.trim() === "") return;
-
- setTableData([ {
- sido: "123456",
- sigungo: "관로1",
- facilityName: "newFacility",
- location: "S-T-S-000000",
- locationgubun: "000000",
- facilityCapacity: "오수관",
- }]);
-
-
- };
-
- const total = 100;
- const headName= ()=>{
- return(
- 현황정보
- )
- }
-
- const router = useRouter();
-
- return (
-
-
현황정보 조회
-
-
- {}} selectClass='w-24' />
- {}} selectClass='w-24' />
- {}} selectClass='w-24' />
- {}} selectClass='w-24' />
- {}} selectClass='w-24' />
- {}} selectClass='w-24' />
- {}} selectClass='w-24' />
- {/* */}
-
-
-
-
-
- {/*
*/}
-
-
-
-
-
-
- );
-}
-
-
-
diff --git a/apps/sn/app/service/index.ts b/apps/sn/app/service/index.ts
index fda21d232..c6bfcff72 100644
--- a/apps/sn/app/service/index.ts
+++ b/apps/sn/app/service/index.ts
@@ -1,2 +1 @@
-export * from './ppline'
export * from './map'
diff --git a/apps/sn/app/service/ppline.ts b/apps/sn/app/service/ppline.ts
deleted file mode 100644
index 33e4c9871..000000000
--- a/apps/sn/app/service/ppline.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-
-import axios from 'axios'
-
-/**
- * 하수관로 API
- */
-const API_URL = `${process.env.NEXT_PUBLIC_SEWERAGE_API_URL}/v1/pplines`
-const PAGE_NO = 1
-const PAGE_SIZE = 20
-
-export type PplineProps = {
- ftreSmbol: string
- swageLnkgPplPk: string
- pbadmsEmd: string
- sttyEmd: string
-}
-
-export const pplinesService = {
- //목록
- getPplines: (size: number = PAGE_SIZE, page: number = PAGE_NO) => {
- return axios.get(`${API_URL}`)
- },
- //상세
- getPpline: (swageLnkgPplPk: string) => {
- return axios.get(`${API_URL}/${swageLnkgPplPk}`)
- },
- //저장
- savePpline: (swageLnkgPplPk: string) => {
- return axios.post(`${API_URL}`)
- },
- //수정
- updatePpline: (swageLnkgPplPk: string) => {
- return axios.put(`${API_URL}/${swageLnkgPplPk}`)
- },
- //삭제
- removePpline: (swageLnkgPplPk: string) => {
- return axios.delete(`${API_URL}/${swageLnkgPplPk}`)
- }
-}