Files
frontend/apps/sn/app/oper/soil/page.tsx
T

127 lines
5.0 KiB
TypeScript

'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(
<p className="pl-3 text-xl">현황정보</p>
)
}
const router = useRouter();
return (
<div>
<p className="pl-3 text-2xl"> 현황정보 조회</p>
<SearchDiv >
<div className='grid grid-cols-12 gap-1 w-4/5'>
<SelectBox label='시설물' selectArray={[{text:'관로', val:'1'}]} className='col-span-3' onSelectValue={(val: string)=>{}} selectClass='w-24' />
<SelectBox label='사용여부' selectArray={[{text:'사용', val:'1'}]} className='col-span-3' onSelectValue={(val: string)=>{}} selectClass='w-24' />
<SelectBox label='경과년도' selectArray={[{text:'10년', val:'1'}]} className='col-span-3' onSelectValue={(val: string)=>{}} selectClass='w-24' />
<SelectBox label='경사' selectArray={[{text:'', val:'1'}]} className='col-span-3' onSelectValue={(val: string)=>{}} selectClass='w-24' />
<SelectBox label='흐름방식' selectArray={[{text:'자연유하', val:'1'}]} className='col-span-3' onSelectValue={(val: string)=>{}} selectClass='w-24' />
<SelectBox label='용도' selectArray={[{text:'오수관', val:'1'}]} className='col-span-3' onSelectValue={(val: string)=>{}} selectClass='w-24' />
<SelectBox label='관종' selectArray={[{text:'PE관관', val:'1'}]} className='col-span-3' onSelectValue={(val: string)=>{}} selectClass='w-24' />
{/* <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 className="grid grid-cols-2 gap-4">
<div className="col-span-2">
</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> );
}