diff --git a/apps/sn/.gitignore b/apps/sn/.gitignore
index 5ef6a5207..4d31f9af6 100644
--- a/apps/sn/.gitignore
+++ b/apps/sn/.gitignore
@@ -16,6 +16,7 @@
# next.js
/.next/
/out/
+.next/
# production
/build
@@ -39,3 +40,5 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts
+
+pnpm-lock.yaml
\ No newline at end of file
diff --git a/apps/sn/app/oper/diag/page.tsx b/apps/sn/app/oper/diag/page.tsx
index e34cedf76..5f67400ed 100644
--- a/apps/sn/app/oper/diag/page.tsx
+++ b/apps/sn/app/oper/diag/page.tsx
@@ -4,7 +4,7 @@ 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/oper/pplines';
+import type { TableUpperProps } from '../../store/table';
const headMakeColSpan = (upHeadList: TableUpperProps[]) => {
return ( <>
diff --git a/apps/sn/app/oper/pplines/page.tsx b/apps/sn/app/oper/pplines/page.tsx
index fa28bce41..822dad8ae 100644
--- a/apps/sn/app/oper/pplines/page.tsx
+++ b/apps/sn/app/oper/pplines/page.tsx
@@ -1,43 +1,74 @@
'use client'
+import { useEffect, useState } from "react";
import { SearchDiv, SelectBox, UiTable } from '@common/business_components';
import { Button } from '@common/components';
-import { useSnStore } from '../../store';
+import { useRouter } from "next/navigation";
+import { pplinesService } from "@service";
- export default function PublicReuseFaciltyInsert() {
- const { upHeadList, publicReuseFacilityUper} = useSnStore((state) => state);
- const total = 100;
- const headName= ()=>{
- return(
-
현황정보
- )
+const tableHeadlist = [
+ { id: "ftreSmbol", title: "지형지물부호"},
+ { id: "swageLnkgPplPk", title: "하수연결관로기본키"},
+ { id: "pbadmsEmd", title: "행정읍면동"},
+ { id: "sttyEmd", title: "법정읍면동"}
+];
+
+export default function Pplines() {
+
+ const router = useRouter()
+ const total = 100
+ const pageSize = 20
+
+ const headName = () => {
+ return(
+ 현황정보
+ )
+ }
+
+ 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);
}
- return (
+ };
+
+ // 컴포넌트 마운트 시 1회 실행
+ useEffect(() => {
+ fetchData();
+ }, []);
+
+ return (
현황정보 조회
-
+
-
-
-
-
-
-
-
- {/* */}
+ {}}/>
+ {}}/>
+ {}}/>
+ {}}/>
+ {}}/>
+ {}}/>
+ {}}/>
+ {}}/>
-
+
- {/* */}
-
- );
+
+
+
+
+ );
}
-
-
-
diff --git a/apps/sn/app/oper/soil/page.tsx b/apps/sn/app/oper/soil/page.tsx
index 66f51e184..47f369c77 100644
--- a/apps/sn/app/oper/soil/page.tsx
+++ b/apps/sn/app/oper/soil/page.tsx
@@ -1,59 +1,125 @@
'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/oper';
+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 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))}
-
- > )
- }
+ 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: "오수관",
+ }]);
+
+
+ };
- export default function PublicReuseFaciltyInsert() {
- const { upHeadList, publicReuseFacilityUper} = useSnStore((state) => state);
- const nodeList= headMakeColSpan(upHeadList);
const total = 100;
const headName= ()=>{
return(
현황정보
)
}
- return ( <>
+
+ const router = useRouter();
+
+ return (
현황정보 조회
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ {/* */}
+
+
+
-
+ {/* */}
+
+
+
+
+
+ );
}
diff --git a/apps/sn/app/service/index.ts b/apps/sn/app/service/index.ts
new file mode 100644
index 000000000..5052b7321
--- /dev/null
+++ b/apps/sn/app/service/index.ts
@@ -0,0 +1 @@
+export * from './ppline'
diff --git a/apps/sn/app/service/ppline.ts b/apps/sn/app/service/ppline.ts
new file mode 100644
index 000000000..999d736d5
--- /dev/null
+++ b/apps/sn/app/service/ppline.ts
@@ -0,0 +1,38 @@
+
+import axios from 'axios'
+
+/**
+ * 하수관로 API URL
+ */
+const API_URL = process.env.NEXT_PUBLIC_API_URL
+const PPLINES_URL = `${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(`${PPLINES_URL}`)
+ },
+ getPpline: (swageLnkgPplPk: string) => {
+ return axios.get(`${PPLINES_URL}/${swageLnkgPplPk}`)
+ },
+ savePpline: (swageLnkgPplPk: string) => {
+ return axios.post(`${PPLINES_URL}`)
+ },
+ updatePpline: (swageLnkgPplPk: string) => {
+ return axios.put(`${PPLINES_URL}/${swageLnkgPplPk}`)
+ },
+ removePpline: (swageLnkgPplPk: string) => {
+ return axios.delete(`${PPLINES_URL}/${swageLnkgPplPk}`)
+ }
+}
diff --git a/apps/sn/app/store/index.tsx b/apps/sn/app/store/index.tsx
index 0ec18eeee..844678100 100644
--- a/apps/sn/app/store/index.tsx
+++ b/apps/sn/app/store/index.tsx
@@ -19,8 +19,7 @@ export const StoreProvider = ({
children,
}: StoreProviderProps) => {
const storeRef = useRef(null)
- console.log("StoreProvider");
-
+
if (!storeRef.current) {
storeRef.current = StoreZus()
}
@@ -33,6 +32,7 @@ export const StoreProvider = ({
}
export const useSnStore = (
+ //selector: (store: ReturnType) => T,
selector: (store: SnStore) => T,
): T => {
const storeContext = useContext(StoreContext)
diff --git a/apps/sn/app/store/oper/index.tsx b/apps/sn/app/store/oper/index.tsx
index 76f045aef..7fef98463 100644
--- a/apps/sn/app/store/oper/index.tsx
+++ b/apps/sn/app/store/oper/index.tsx
@@ -41,163 +41,7 @@ const publicReuseFacilityUper:PublicReuseFacility[] = [
authoDay: "양평하수처리구역",
area: "30",
reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
+ }
]
@@ -225,8 +69,7 @@ export const tableActionsExport:(set:any)=>tableActions=(set: any) => {
return (
{
upHeadList: state.upHeadList,
- publicReuseFacilityUper:
- state.publicReuseFacilityUper.slice(0, state.publicReuseFacilityUper.length - 1)
+ publicReuseFacilityUper: state.publicReuseFacilityUper.slice(0, state.publicReuseFacilityUper.length - 1)
})}
)
}
diff --git a/apps/sn/app/store/oper/pplines.tsx b/apps/sn/app/store/oper/pplines.tsx
deleted file mode 100644
index b9515ba22..000000000
--- a/apps/sn/app/store/oper/pplines.tsx
+++ /dev/null
@@ -1,233 +0,0 @@
-export type TableUpperProps = {
- id: string;
- title: string;
- upName?: string;
- upSequnce?: number;
-}
-type PublicReuseFacility = {
- sido: string,
- sigungo: string,
- facilityName: string,
- location: string,
- locationgubun: string,
- facilityCapacity: string,
- yn?: string,
- authoDay?: string,
- area?: string,
- reuse?: string
-}
-const upHeadList:TableUpperProps[] = [
- { id: "sido", title: "자산ID121212"},
- { 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 publicReuseFacilityUper:PublicReuseFacility[] = [
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
- {
- sido: "1048967",
- sigungo: "관로",
- facilityName: "양평군 양평읍 백안리 25-5전",
- location: "S-T-S-2018000675",
- locationgubun: "2018000675",
- facilityCapacity: "오수관",
- yn: "신설",
- authoDay: "양평하수처리구역",
- area: "30",
- reuse: "28,313,220"
- },
-
-
-]
-
-export type tableState = {
- isInit: boolean;
- upHeadList: TableUpperProps[];
- publicReuseFacilityUper: PublicReuseFacility[];
-}
-type tableActions = {
- decrementList: () => void
-}
-
-export type tableType = tableState & tableActions;
-
-export const tableStateExport:tableState= {
- isInit:false,
- upHeadList: upHeadList,
- publicReuseFacilityUper: publicReuseFacilityUper,
-}
-export const tableActionsExport:(set:any)=>tableActions=(set: any) => {
- return {
- decrementList:()=>set(
- (state:tableState) => {
- return (
- {
- upHeadList: state.upHeadList,
- publicReuseFacilityUper:
- state.publicReuseFacilityUper.slice(0, state.publicReuseFacilityUper.length - 1)
- })}
- )
- }
-}
diff --git a/apps/sn/app/store/store.tsx b/apps/sn/app/store/store.tsx
index c6fd46f02..9b489fabf 100644
--- a/apps/sn/app/store/store.tsx
+++ b/apps/sn/app/store/store.tsx
@@ -1,7 +1,8 @@
import { createStore } from 'zustand/vanilla';
-import { tableActionsExport, tableStateExport, type tableState, type tableType } from './oper/index';
-//import { upHeadList as pplinesUpHeadList, publicReuseFacilityUper as pplinesData } from './oper/pplines';
+import { tableActionsExport, tableStateExport, type tableState, type tableType } from './table';
+
export type SnStore = tableType;
+//export type SnStore = ReturnType["getState"];
export const StoreZus = (initState: tableState = tableStateExport) => {
return createStore()((set) => {
return {
diff --git a/apps/sn/app/store/table.tsx b/apps/sn/app/store/table.tsx
new file mode 100644
index 000000000..369638fc5
--- /dev/null
+++ b/apps/sn/app/store/table.tsx
@@ -0,0 +1,114 @@
+export type TableUpperProps = {
+ id: string,
+ title: string
+}
+type PublicReuseFacility = {
+ sido: string,
+ sigungo: string,
+ facilityName: string,
+ location: string,
+ locationgubun: string,
+ facilityCapacity: string,
+ yn?: string,
+ authoDay?: string,
+ area?: string,
+ reuse?: string
+}
+const upHeadList:TableUpperProps[] = [
+ { id: "sido", title: "자산ID"},
+ { 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 publicReuseFacilityUper:PublicReuseFacility[] = [
+ {
+ sido: "1048967",
+ sigungo: "관로",
+ facilityName: "양평군 양평읍 백안리 25-5전",
+ location: "S-T-S-2018000675",
+ locationgubun: "2018000675",
+ facilityCapacity: "오수관",
+ yn: "신설",
+ authoDay: "양평하수처리구역",
+ area: "30",
+ reuse: "28,313,220"
+ }
+
+]
+
+export type tableState = {
+ isInit: boolean;
+ upHeadList: TableUpperProps[];
+ publicReuseFacilityUper: PublicReuseFacility[];
+}
+type tableActions = {
+ setHeadList: (newHeadList: TableUpperProps[]) => void
+ setTableData: (newTableDataList: PublicReuseFacility[]) => void
+ decrementList: () => void
+ addRow: (newTableData: PublicReuseFacility) => void
+}
+
+export type tableType = tableState & tableActions;
+
+export const tableStateExport:tableState= {
+ isInit:false,
+ upHeadList: [
+ { id: "sido", title: "자산ID"},
+ { 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: '취득금액' },
+ ],
+ publicReuseFacilityUper: publicReuseFacilityUper,
+}
+export const tableActionsExport:(set:any)=>tableActions=(set: any) => {
+ return {
+ // 마지막 데이터 삭제
+ decrementList: ()=>set(
+ (state: tableState) => {
+ return (
+ {
+ ...state,
+ upHeadList: state.upHeadList,
+ publicReuseFacilityUper: state.publicReuseFacilityUper.slice(0, state.publicReuseFacilityUper.length - 1)
+ })}
+ ),
+ // 데이터 추가
+ addRow: (newTableData: PublicReuseFacility)=>set(
+ (state: tableState) => {
+ console.log('asdfasdfadsf')
+ return (
+ {
+ ...state,
+ upHeadList: state.upHeadList,
+ publicReuseFacilityUper: [...state.publicReuseFacilityUper, newTableData]
+ })}
+ ),
+ // 테이블 헤더 변경
+ setHeadList: (newHeadList: TableUpperProps[]) => set(
+ (state: tableState) => ({
+ ...state,
+ upHeadList: newHeadList
+ })
+ ),
+ // 시설 목록 데이터 변경
+ setTableData: (newTableData: PublicReuseFacility[]) => set(
+ (state: tableState) => ({
+ ...state,
+ publicReuseFacilityUper: newTableData
+ })
+ ),
+ }
+}
diff --git a/apps/sn/next.config.ts b/apps/sn/next.config.ts
index cb651cdc0..05fcbe93f 100644
--- a/apps/sn/next.config.ts
+++ b/apps/sn/next.config.ts
@@ -1,5 +1,14 @@
import type { NextConfig } from "next";
-const nextConfig: NextConfig = {};
+const nextConfig: NextConfig = {
+ async rewrites() {
+ return [
+ {
+ source: "/sewerage-service/api/:path*", // 프론트엔드에서 호출할 API URL
+ destination: "http://localhost:8000/sewerage-service/api/:path*", // 백엔드의 실제 API URL
+ },
+ ];
+ }
+};
export default nextConfig;
diff --git a/apps/sn/package.json b/apps/sn/package.json
index 5414d5b13..65f19b671 100644
--- a/apps/sn/package.json
+++ b/apps/sn/package.json
@@ -13,6 +13,7 @@
"@common/business_components": "workspace:*",
"@common/components": "workspace:*",
"@hookform/resolvers": "^4.1.3",
+ "axios": "^1.8.3",
"next": "15.1.7",
"react-hook-form": "^7.54.2",
"zod": "^3.24.2",
diff --git a/apps/sn/tsconfig.json b/apps/sn/tsconfig.json
index 5d0dbd101..592e3a2c0 100644
--- a/apps/sn/tsconfig.json
+++ b/apps/sn/tsconfig.json
@@ -26,7 +26,9 @@
"paths": {
"@/*": ["./*"],
"@common/components": ["../../../packages/common/components/src"],
- "@common/business_components": ["../../../packages/common/business_components/src"]
+ "@common/business_components": ["../../../packages/common/business_components/src"],
+ "@store": ["./store"],
+ "@service": ["./service"]
}
},
"include": [