Files
frontend/apps/sn/app/oper/pplines/page.tsx
T
2025-04-24 10:26:49 +09:00

66 lines
3.0 KiB
TypeScript

'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 (
<MainDiv>
<Title title="관로시설" />
<ContentsDiv>
<SearchDiv>
<SearchFormLeft>
<SelectBox label='시설물' selectArray={[{text:'관로', val:'1'}]} className='col-span-3' onSelectValue={()=>{}} selectClass='w-24' />
<SelectBox label='사용여부' selectArray={[{text:'사용', val:'1'}]} className='col-span-3' onSelectValue={()=>{}} selectClass='w-24' />
<SelectBox label='경과년도' selectArray={[{text:'10년', val:'1'}]} className='col-span-3' onSelectValue={()=>{}} selectClass='w-24' />
<SelectBox label='경사' selectArray={[{text:'', val:'1'}]} className='col-span-3' onSelectValue={()=>{}} selectClass='w-24' />
<SelectBox label='흐름방식' selectArray={[{text:'자연유하', val:'1'}]} className='col-span-3' onSelectValue={()=>{}} selectClass='w-24' />
<SelectBox label='용도' selectArray={[{text:'오수관', val:'1'}]} className='col-span-3' onSelectValue={()=>{}} selectClass='w-24' />
<SelectBox label='관종' selectArray={[{text:'PE관관', val:'1'}]} className='col-span-3' onSelectValue={()=>{}} selectClass='w-24' />
<SelectBox label='관경' selectArray={[{text:'50', val:'1'}]} className='col-span-3' onSelectValue={()=>{}} selectClass='w-24' />
</SearchFormLeft>
<SearchFormRight>
<Button className="px-4 py2 bg-blue-600 text-white rounded-sm text-sm font-medium hover:bg-blue-700" size="sm" onClick={fetchData}>조회</Button>
</SearchFormRight>
</SearchDiv>
<ListDiv>
<UiTable tableData={data.content} headlist={tableHeadlist} pageSize={pageSize} total={total} children={null} headName="현황정보" cellClick={()=>{}} />
</ListDiv>
</ContentsDiv>
</MainDiv> );
}