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: "자산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 = { 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) })} ) } }