diff --git a/apps/wr/app/page.tsx b/apps/wr/app/page.tsx index 5892ab211..4f5f24425 100644 --- a/apps/wr/app/page.tsx +++ b/apps/wr/app/page.tsx @@ -11,7 +11,7 @@ export default function Home() { 하수재이용 시설 등록 diff --git a/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/publicReuseFaciltyInsert/page.tsx b/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/publicReuseFaciltyInsert/page.tsx index 49605f54f..eba860561 100644 --- a/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/publicReuseFaciltyInsert/page.tsx +++ b/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/publicReuseFaciltyInsert/page.tsx @@ -4,34 +4,13 @@ import { ScrollArea, SearchDiv, SelectBox, UiTable } from '@common/business_comp import { Button, TableHead, TableRow } from '@common/components'; import { PublicReuseFaciltyFormInsert } from '../../../../components/ui/publicReuseInsertForm'; import { useWrStore } from '../../../store'; -import type { TableUpperProps } from '../../../store/publicReuseFaciltyInsert'; - - 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))} - - ) - } - - - - export default function PublicReuseFaciltyInsert() { - const {building} = useWrStore((state) => state); - const { upHeadList, publicReuseFacilityUper} = building; - const nodeList= headMakeColSpan(upHeadList); - const total = 100; - + const {pubFac} = useWrStore((state) => state); + const { pubFacHeadList, publicReuseFacilityData, selectLabel} = pubFac; + console.log(pubFacHeadList) const searchDiv ='시군구' const selectBox = [{text:'한양', value:1}] @@ -54,9 +33,9 @@ import type { TableUpperProps } from '../../../store/publicReuseFaciltyInsert';
- - {nodeList} - + + +
diff --git a/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rainReuseFaciltyInsert/page.tsx b/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rainReuseFaciltyInsert/page.tsx index 88068f39d..23badd2c4 100644 --- a/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rainReuseFaciltyInsert/page.tsx +++ b/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rainReuseFaciltyInsert/page.tsx @@ -1,6 +1,6 @@ 'use client' import { useWrStore } from "@/app/store"; -import type { TableUpperProps } from "@/app/store/publicReuseFaciltyInsert"; +import type { TableUpperProps } from "@/app/store/rainReuseFacilityInsert" import { RainReuseFaciltyInsertForm } from "@/components/ui/rainReuseInsertForm"; import { SearchDiv, SearchInput, UiTable } from "@common/business_components"; import { Button, TableHead, TableRow } from "@common/components"; @@ -50,7 +50,7 @@ export default function Home() {
- + {nodeList}
diff --git a/apps/wr/app/store/publicReuseFaciltyInsert/index.tsx b/apps/wr/app/store/publicReuseFaciltyInsert/index.tsx index e72612131..de51fd788 100644 --- a/apps/wr/app/store/publicReuseFaciltyInsert/index.tsx +++ b/apps/wr/app/store/publicReuseFaciltyInsert/index.tsx @@ -1,10 +1,14 @@ -export type TableUpperProps = { +export type TableProps = { id: string; title: string; - upName?: string; - upSequnce?: number; } -type PublicReuseFacility = { + +export type selectLabel={ + title:string, + val:string +} + +type publicReuseFacilityData = { sido: string, sigungo: string, facilityName: string, @@ -16,19 +20,27 @@ type PublicReuseFacility = { area?: string, reuse?: string, register?: string + + } -const upHeadList:TableUpperProps[] = [ + + +const selectLabel:selectLabel[]=[ + {title:'test',val:'1'} +] + + +const pubFacHeadList:TableProps[] = [ { id: "sido", title: "시도"}, { id: "sigungo", title: "시군구"}, { id: "facilityName", title: "시설명"}, { id: "location", title: "위치"}, { id: "locationgubun", title: "지역구분"}, { id: "facilityCapacity", title: "시설용량"}, - { id: "yn", title: '여부', upName:'upChangeRe' , upSequnce:1 }, - { id: "authoDay", title: '허가일',upName:'upChangeRe', upSequnce:2 }, - { id: "area", title: '면적' ,upName:'upChangeRe',upSequnce:3 }]; + { id: "yn", title: '재이용여부' }, + { id: "authoDay", title: '등록여부'}]; -const publicReuseFacilityUper:PublicReuseFacility[] = [ +const publicReuseFacilityData:publicReuseFacilityData[] = [ { sido: "서울", sigungo: "강남구", @@ -62,31 +74,33 @@ const publicReuseFacilityUper:PublicReuseFacility[] = [ }, ] -export type tableState = {pubFac:{ +export type pubFacState = {pubFac:{ isInit: boolean; - upHeadList: TableUpperProps[]; - publicReuseFacilityUper: PublicReuseFacility[]; + pubFacHeadList: TableProps[]; + publicReuseFacilityData: publicReuseFacilityData[]; + selectLabel:selectLabel[]; }} -type tableActions = { +type pubFacActions = { decrementList: () => void } -export type tableType = tableState & tableActions; +export type pubFacType = pubFacState & pubFacActions; -export const tableStateExport:tableState= {pubFac:{ +export const pubFacStateExport:pubFacState= {pubFac:{ isInit:false, - upHeadList: upHeadList, - publicReuseFacilityUper: publicReuseFacilityUper, + pubFacHeadList: pubFacHeadList, + publicReuseFacilityData: publicReuseFacilityData, + selectLabel:selectLabel }} -export const tableActionsExport:(set:any)=>tableActions=(set: any) => { +export const pubFacActionsExport:(set:any)=>pubFacActions=(set: any) => { return { decrementList:()=>set( - (state:tableState) => { + (state:pubFacState) => { return ( {pubFac:{ - upHeadList: state.pubFac.upHeadList, + pubFacheadList: state.pubFac.pubFacHeadList, publicReuseFacilityUper: - state.pubFac.publicReuseFacilityUper.slice(0, state.pubFac.publicReuseFacilityUper.length - 1) + state.pubFac.publicReuseFacilityData.slice(0, state.pubFac.publicReuseFacilityData.length - 1) }})} ) } diff --git a/apps/wr/app/store/rainReuseFacilityInsert/index.tsx b/apps/wr/app/store/rainReuseFacilityInsert/index.tsx index 5dec7f586..53b193f6e 100644 --- a/apps/wr/app/store/rainReuseFacilityInsert/index.tsx +++ b/apps/wr/app/store/rainReuseFacilityInsert/index.tsx @@ -21,6 +21,7 @@ type buildingOfType = { register?: string, legalTargetYn:string, } + const upHeadList:TableUpperProps[] = [ { id: "sido", title: "시도"}, { id: "sigungo", title: "시군구"}, @@ -92,6 +93,7 @@ export const buildingtableStateExport:buildingTableState= {building:{ isInit:false, upHeadList: upHeadList, buildingObject: buildingObject, + }} export const buildingTableActionsExport:(set:any)=>buildingTableActions=(set: any) => { return { diff --git a/apps/wr/app/store/store.tsx b/apps/wr/app/store/store.tsx index fe7dc33a8..93a4fe6c9 100644 --- a/apps/wr/app/store/store.tsx +++ b/apps/wr/app/store/store.tsx @@ -1,12 +1,12 @@ import { createStore } from 'zustand/vanilla'; -import { tableActionsExport, tableStateExport, type tableState, type tableType } from './publicReuseFaciltyInsert/index'; +import { pubFacActionsExport, pubFacStateExport, type pubFacState, type pubFacType } from './publicReuseFaciltyInsert/index'; import { buildingTableActionsExport, buildingtableStateExport, type buildingTableType } from './rainReuseFacilityInsert'; -export type WrStore = tableType & buildingTableType; -export const StoreZus = (initState: tableState = tableStateExport) => { +export type WrStore = pubFacType & buildingTableType; +export const StoreZus = (initState: pubFacState = pubFacStateExport) => { return createStore()((set) => { return { ...initState, - ...tableActionsExport(set), + ...pubFacActionsExport(set), ...buildingtableStateExport, ...buildingTableActionsExport(set) }