관로시설 데이터 조회회
This commit is contained in:
@@ -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
|
||||
@@ -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 ( <>
|
||||
|
||||
@@ -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(
|
||||
<p className="pl-3 text-xl">현황정보</p>
|
||||
)
|
||||
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(
|
||||
<p className="pl-3 text-xl">현황정보</p>
|
||||
)
|
||||
}
|
||||
|
||||
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 (
|
||||
<div>
|
||||
<p className="pl-3 text-2xl"> 현황정보 조회</p>
|
||||
<SearchDiv >
|
||||
<SearchDiv>
|
||||
<div className='grid grid-cols-12 gap-1 w-4/5'>
|
||||
<SelectBox label='시설물' selectArray={[{text:'관로', val:'1'}]} className='col-span-3'/>
|
||||
<SelectBox label='사용여부' selectArray={[{text:'사용', val:'1'}]} className='col-span-3'/>
|
||||
<SelectBox label='경과년도' selectArray={[{text:'10년', val:'1'}]} className='col-span-3'/>
|
||||
<SelectBox label='경사' selectArray={[{text:'', val:'1'}]} className='col-span-3'/>
|
||||
<SelectBox label='흐름방식' selectArray={[{text:'자연유하', val:'1'}]} className='col-span-3'/>
|
||||
<SelectBox label='용도' selectArray={[{text:'오수관', val:'1'}]} className='col-span-3'/>
|
||||
<SelectBox label='관종' selectArray={[{text:'PE관관', val:'1'}]} className='col-span-3'/>
|
||||
{/* <SelectBox label='관경' selectArray={[{text:'50', val:'1'}]} className='col-span-3'/> */}
|
||||
<SelectBox label='시설물' selectArray={[{text:'관로', val:'1'}]} className='col-span-3' onSelectValue={(val: string)=>{}}/>
|
||||
<SelectBox label='사용여부' selectArray={[{text:'사용', val:'1'}]} className='col-span-3' onSelectValue={(val: string)=>{}}/>
|
||||
<SelectBox label='경과년도' selectArray={[{text:'10년', val:'1'}]} className='col-span-3' onSelectValue={(val: string)=>{}}/>
|
||||
<SelectBox label='경사' selectArray={[{text:'', val:'1'}]} className='col-span-3' onSelectValue={(val: string)=>{}}/>
|
||||
<SelectBox label='흐름방식' selectArray={[{text:'자연유하', val:'1'}]} className='col-span-3' onSelectValue={(val: string)=>{}}/>
|
||||
<SelectBox label='용도' selectArray={[{text:'오수관', val:'1'}]} className='col-span-3' onSelectValue={(val: string)=>{}}/>
|
||||
<SelectBox label='관종' selectArray={[{text:'PE관관', val:'1'}]} className='col-span-3' onSelectValue={(val: string)=>{}}/>
|
||||
<SelectBox label='관경' selectArray={[{text:'50', val:'1'}]} className='col-span-3' onSelectValue={(val: string)=>{}}/>
|
||||
</div>
|
||||
<div className='w-1/5 flex justify-end items-center'>
|
||||
<Button className='mr-10 rounded-lg'>조회</Button>
|
||||
<Button className='mr-10 rounded-lg' onClick={fetchData}>조회</Button>
|
||||
</div>
|
||||
</SearchDiv>
|
||||
{/* </div> */}
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="col-span-2">
|
||||
<UiTable tableData={publicReuseFacilityUper} headlist={upHeadList} pageSize={20} total={total} headName={headName()}/>
|
||||
</div>
|
||||
</div>
|
||||
</div> );
|
||||
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="col-span-2">
|
||||
<UiTable tableData={data.content} headlist={tableHeadlist} pageSize={pageSize} total={total} children={null} headName={headName()}/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button onClick={() => router.push("/oper/soil")} className="mr-3 mt-4 bg-red-500 text-white px-4 py-2 rounded">
|
||||
이동
|
||||
</button>
|
||||
</div> );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+105
-39
@@ -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 ( <>
|
||||
<TableRow>{
|
||||
upHeadList.map((head: TableUpperProps) =>
|
||||
(!head.upSequnce?<TableHead rowSpan={2}key={head.id}>{head.title}</TableHead>:
|
||||
head.upName === 'upChangeRe'&& head.upSequnce=== 1?<TableHead key={head.id} rowSpan={1} colSpan={3}>{'중축 개축 증축 '}</TableHead>:null))}
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
{upHeadList.map((head: TableUpperProps) =>
|
||||
(head.upName === 'upChangeRe'?<TableHead key={head.id}>{head.title}</TableHead>:null))}
|
||||
</TableRow>
|
||||
</> )
|
||||
}
|
||||
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(
|
||||
<p className="pl-3 text-xl">현황정보</p>
|
||||
)
|
||||
}
|
||||
return ( <>
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<div>
|
||||
<p className="pl-3 text-2xl"> 현황정보 조회</p>
|
||||
<SearchDiv>
|
||||
<div className='flex'>
|
||||
<SelectBox label='시설물' selectArray={[{text:'관로', val:'1'}]} />
|
||||
<SelectBox label='사용여부' selectArray={[{text:'사용', val:'1'}]} />
|
||||
<SelectBox label='경과년도' selectArray={[{text:'10년', val:'1'}]} />
|
||||
<SelectBox label='경사' selectArray={[{text:'', val:'1'}]} />
|
||||
<SelectBox label='흐름방식' selectArray={[{text:'자연유하', val:'1'}]} />
|
||||
<SelectBox label='용도' selectArray={[{text:'오수관', val:'1'}]} />
|
||||
<SelectBox label='관종' selectArray={[{text:'PE관관', val:'1'}]} />
|
||||
<SelectBox label='관경' selectArray={[{text:'50', val:'1'}]} />
|
||||
<Button className='mr-4' size='sm'>조회</Button>
|
||||
<SearchDiv >
|
||||
<div className='grid grid-cols-12 gap-1 w-4/5'>
|
||||
<SelectBox label='시설물' selectArray={[{text:'관로', val:'1'}]} className='col-span-3'/>
|
||||
<SelectBox label='사용여부' selectArray={[{text:'사용', val:'1'}]} className='col-span-3'/>
|
||||
<SelectBox label='경과년도' selectArray={[{text:'10년', val:'1'}]} className='col-span-3'/>
|
||||
<SelectBox label='경사' selectArray={[{text:'', val:'1'}]} className='col-span-3'/>
|
||||
<SelectBox label='흐름방식' selectArray={[{text:'자연유하', val:'1'}]} className='col-span-3'/>
|
||||
<SelectBox label='용도' selectArray={[{text:'오수관', val:'1'}]} className='col-span-3'/>
|
||||
<SelectBox label='관종' selectArray={[{text:'PE관관', val:'1'}]} className='col-span-3'/>
|
||||
{/* <SelectBox label='관경' selectArray={[{text:'50', val:'1'}]} className='col-span-3'/> */}
|
||||
</div>
|
||||
<div className='w-1/5 flex justify-end items-center'>
|
||||
<Button className='mr-10 rounded-lg'>조회</Button>
|
||||
</div>
|
||||
</SearchDiv>
|
||||
</div>
|
||||
{/* </div> */}
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="colsapn-1">
|
||||
<UiTable publicReuseFacility={publicReuseFacilityUper} headlist={upHeadList} pageSize={20} total={total} headName={headName()}>
|
||||
{nodeList}
|
||||
</UiTable>
|
||||
<div className="col-span-2">
|
||||
<UiTable tableData={publicReuseFacilityUper} headlist={upHeadList} pageSize={20} total={total} headName={headName()}/>
|
||||
</div>
|
||||
</div>
|
||||
</> )
|
||||
</div>
|
||||
|
||||
<button onClick={searchDataList} className="mr-3 mt-4 bg-red-500 text-white px-4 py-2 rounded">
|
||||
조회
|
||||
</button>
|
||||
<button onClick={handleChangeHeader} className="mr-3 mt-4 bg-red-500 text-white px-4 py-2 rounded">
|
||||
헤더
|
||||
</button>
|
||||
<button onClick={decrementList} className="mr-3 mt-4 bg-red-500 text-white px-4 py-2 rounded">
|
||||
삭제
|
||||
</button>
|
||||
<button onClick={() => router.push("/oper/pplines")} className="mr-3 mt-4 bg-red-500 text-white px-4 py-2 rounded">
|
||||
이동
|
||||
</button>
|
||||
</div> );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export * from './ppline'
|
||||
@@ -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}`)
|
||||
}
|
||||
}
|
||||
@@ -19,8 +19,7 @@ export const StoreProvider = ({
|
||||
children,
|
||||
}: StoreProviderProps) => {
|
||||
const storeRef = useRef<StoreApi>(null)
|
||||
console.log("StoreProvider");
|
||||
|
||||
|
||||
if (!storeRef.current) {
|
||||
storeRef.current = StoreZus()
|
||||
}
|
||||
@@ -33,6 +32,7 @@ export const StoreProvider = ({
|
||||
}
|
||||
|
||||
export const useSnStore = <T,>(
|
||||
//selector: (store: ReturnType<typeof StoreZus>) => T,
|
||||
selector: (store: SnStore) => T,
|
||||
): T => {
|
||||
const storeContext = useContext(StoreContext)
|
||||
|
||||
@@ -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)
|
||||
})}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
})}
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -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<typeof StoreZus>["getState"];
|
||||
export const StoreZus = (initState: tableState = tableStateExport) => {
|
||||
return createStore<SnStore>()((set) => {
|
||||
return {
|
||||
|
||||
@@ -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
|
||||
})
|
||||
),
|
||||
}
|
||||
}
|
||||
+10
-1
@@ -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;
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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": [
|
||||
|
||||
Reference in New Issue
Block a user