diff --git a/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rainReuseFaciltyInsert/page.tsx b/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rainReuseFaciltyInsert/page.tsx new file mode 100644 index 000000000..dd08c1866 --- /dev/null +++ b/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rainReuseFaciltyInsert/page.tsx @@ -0,0 +1,63 @@ +'use client' +import { useWrStore } from "@/app/store"; +import type { TableUpperProps } from "@/app/store/publicReuseFaciltyInsert"; +import { RainReuseFaciltyInsertForm } from "@/components/ui/rainReuseInsertForm"; +import { SearchDiv, SelectBox, UiTable } from "@common/business_components"; +import { Button, TableHead, TableRow } from "@common/components"; + + +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 Home (){ + const { building } = useWrStore((state) => state); + const nodeList= headMakeColSpan(building.upHeadList); + const total = 100; + + + const selectBox = [{text:'서울', value:'대전'}] + const headName= ()=>{ + return( +

○건축물 목록

+ ) + } + + return( + <> + {/*
+

빗물이용시설 등록

+ + + + + + +
*/} +
+ +
+ + {nodeList} + +
+
+ +
+ +
+ + ); +} + \ No newline at end of file diff --git a/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rswtrReuseFacilityInsert/page.tsx b/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rswtrReuseFacilityInsert/page.tsx new file mode 100644 index 000000000..8ed4b61b8 --- /dev/null +++ b/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rswtrReuseFacilityInsert/page.tsx @@ -0,0 +1,63 @@ +'use client' +import { useWrStore } from "@/app/store"; +import type { TableUpperProps } from "@/app/store/publicReuseFaciltyInsert"; +import { RswtrReuseFaciltyInsertForm } from "@/components/ui/rswtrReuseFacilityInsetForm"; +import { SearchDiv, SelectBox, UiTable } from "@common/business_components"; +import { Button, TableHead, TableRow } from "@common/components"; + + +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 Home (){ + const { building } = useWrStore((state) => state); + const nodeList= headMakeColSpan(building.upHeadList); + const total = 100; + + + const selectBox = [{text:'서울', value:'대전'}] + const headName= ()=>{ + return( +

○건축물 목록

+ ) + } + + return( + <> + {/*
+

빗물이용시설 등록

+ + + + + + +
*/} +
+ +
+ + {nodeList} + +
+
+ +
+ +
+ + ); +} + \ No newline at end of file diff --git a/apps/wr/app/store/rainReuseFacilityInsert/index.tsx b/apps/wr/app/store/rainReuseFacilityInsert/index.tsx new file mode 100644 index 000000000..5dec7f586 --- /dev/null +++ b/apps/wr/app/store/rainReuseFacilityInsert/index.tsx @@ -0,0 +1,108 @@ +export type TableUpperProps = { + id: string; + title: string; + upName?: string; + upSequnce?: number; +} +type buildingOfType = { + sido: string, + sigungo: string, + facilityName: string, + location: string, + locationgubun: string, + firstConstructionPermission:string, + facilityCapacity: string, + buildingArea:string, + yn?: string, + permissionDay:string; + authoDay?: string, + area?: string, + reuse?: string, + register?: string, + legalTargetYn:string, +} +const upHeadList:TableUpperProps[] = [ + { 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 }]; + +const buildingObject:buildingOfType[] = [ + { + sido: "서울", + sigungo: "종로구", + facilityName: "그랑서울", + location: "종로 33", + locationgubun: "업무시설", + firstConstructionPermission : '2024-10-10', + buildingArea: "50", + facilityCapacity: "800,000", + reuse: "Y", + permissionDay:'2024-10-10', + register: "Y", + legalTargetYn:"Y" + }, + { + sido: "서울", + sigungo: "종로구", + facilityName: "그랑서울", + location: "종로 33", + locationgubun: "업무시설", + firstConstructionPermission : '2024-10-10', + buildingArea: "50", + facilityCapacity: "800,000", + reuse: "Y", + permissionDay:'2024-10-10', + register: "Y", + legalTargetYn:"Y" + }, + { + sido: "서울", + sigungo: "종로구", + facilityName: "그랑서울", + location: "종로 33", + locationgubun: "업무시설", + firstConstructionPermission : '2024-10-10', + buildingArea: "50", + facilityCapacity: "800,000", + reuse: "Y", + permissionDay:'2024-10-10', + register: "Y", + legalTargetYn:"Y" + }, +] + +export type buildingTableState ={ building:{ + isInit: boolean; + upHeadList: TableUpperProps[]; + buildingObject: buildingOfType[]; +}} +type buildingTableActions = { + decrementList: () => void +} + +export type buildingTableType = buildingTableState & buildingTableActions; + +export const buildingtableStateExport:buildingTableState= {building:{ + isInit:false, + upHeadList: upHeadList, + buildingObject: buildingObject, +}} +export const buildingTableActionsExport:(set:any)=>buildingTableActions=(set: any) => { + return { + decrementList:()=>set( + (state:buildingTableState) => { + return ( + {building:{ + upHeadList: state.building.upHeadList, + buildingObject: + state.building.buildingObject.slice(0, state.building.buildingObject.length - 1) + }})} + ) + } +} diff --git a/apps/wr/components.json b/apps/wr/components.json new file mode 100644 index 000000000..d9ef0ae53 --- /dev/null +++ b/apps/wr/components.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "default", + "rsc": true, + "tsx": true, + "tailwind": { + "config": "tailwind.config.ts", + "css": "app/globals.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "iconLibrary": "lucide" +} \ No newline at end of file diff --git a/apps/wr/components/ui/IteratreForm.tsx b/apps/wr/components/ui/IteratreForm.tsx new file mode 100644 index 000000000..96b9e2593 --- /dev/null +++ b/apps/wr/components/ui/IteratreForm.tsx @@ -0,0 +1,38 @@ +import { FormControl, FormField, FormItem, FormLabel, FormMessage, SelectBox } from "@common/business_components"; +import { Input } from "@common/components"; + + +type typeOfForm ={ + labelName: string; + type: string; + selectvlaue?: { text: string; val: string }[]; + placeholder:any + formName: string; +} + +export function IteraterFrom(formData:typeOfForm[],form:any , colSpanValue:string){ + + return ( + <> + {formData.map((data: typeOfForm, index) => ( + ( + + {data.labelName} + + {data.selectvlaue == undefined ? ( + + ) : ( + + )} + + + + )} + /> + ))} + + ); + }; \ No newline at end of file diff --git a/apps/wr/components/ui/rainReuseInsertForm.tsx b/apps/wr/components/ui/rainReuseInsertForm.tsx new file mode 100644 index 000000000..d095ef171 --- /dev/null +++ b/apps/wr/components/ui/rainReuseInsertForm.tsx @@ -0,0 +1,233 @@ +"use client"; + +import { + Form, + FormControl, + FormDescription, + FormField, + FormItem, + FormLabel, + FormMessage, + SelectBox, +} from "@common/business_components/ui"; +import { Input } from "@common/components/ui"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { useForm } from "react-hook-form"; +import { z } from "zod"; +import { IteraterFrom } from "./IteratreForm"; + +const formSchema = z.object({ + username: z.string().min(2).max(50), + facilityName: z.string().min(2).max(50), +}); + +type typeOfForm = { + labelName: string; + type: string; + selectvlaue?: { text: string; val: string }[]; + formName: string; +}; + +export function RainReuseFaciltyInsertForm() { + const total = 100; + + const form = useForm>({ + resolver: zodResolver(formSchema), + defaultValues: { + username: "", + }, + }); + + // 2. Define a submit handler. + function onSubmit(values: z.infer) { + // Do something with the form values. + // ✅ This will be type-safe and validated. + console.log(values); + } + const selectYNValue = [ + { text: "Y", val: "1" }, + { text: "N", val: "2" }, + ]; + + let homeWaterData = [ + { + labelName: "종류", + type: "input", + selectvlaue: undefined, + formName: "homeWaterData 1", + placeholder:'ooo' + }, + { + labelName: "면적(m³)", + type: "input", + selectvlaue: undefined, + formName: "homeWaterData 2", + placeholder:'1,000,000' + }, + ]; + let filtrTrtmfct = [ + { + labelName: "유무", + type: "input", + selectvlaue: undefined, + formName: "filtrTrtmfct 1", + placeholder:'Y' + }, + { + labelName: "용량", + type: "input", + selectvlaue: undefined, + formName: "filtrTrtmfct 2", + placeholder:100000 + + }, + { + labelName: "처리공정", + type: "input", + selectvlaue: undefined, + formName: "filtrTrtmfct 3", + placeholder:'원수취수' + }, + ]; + let instlCst = [ + { + labelName: "지원여부", + type: "input", + selectvlaue: undefined, + formName: "instlCst 1", + placeholder:'Y' + }, + { + labelName: "지원여부(원)", + type: "input", + selectvlaue: undefined, + formName: "instlCst 2", + placeholder:1000000 + }, + ]; + let greenBuilding = [ + { + labelName: "설치완료일", + type: "chek", + selectvlaue: selectYNValue , + formName: "greenBuilding 1", + placeholder:'Y' + }, + { + labelName: "인증년도", + type: "input", + selectvlaue: undefined, + formName: " greenBuilding 2", + placeholder:'2024' + }, + { + labelName: "인증번호", + type: "input", + selectvlaue: undefined, + formName: "greenBuilding 3", + placeholder:'wr123456789' + }, + { + labelName: "인증등급", + type: "input", + selectvlaue: undefined, + formName: "greenBuilding 4", + placeholder:'A' + }, + ]; + let baseInfo = [ + { + labelName: "설치완료일", + type: "input", + selectvlaue: undefined , + formName: "baseInfo 1", + placeholder:'2022-1010' + }, + { + labelName: "설치비(월)", + type: "input", + selectvlaue: undefined, + formName: " baseInfo 2", + placeholder:'10000000' + }, + + ]; + + return ( +
+
+ + {/*
*/} +
+
+

○ 재이용시설 운영정보

+
+
+
+
+ ( + + 설치완료일 + + + + + + )} + /> +
+ +
+ ( + + 설치비(월) + + + + + + )} + /> +
+
+
+

+ 빗물이용시설 정보 +

+
+
+

✓ 1. 집수면

+
+
{IteraterFrom(homeWaterData,form,'2')}
+ +
+

✓ 2. 여과 등 처리시설

+
+
{IteraterFrom(filtrTrtmfct,form,'2' )}
+
+

+ 인센티브 정보 +

+
+
+

✓ 1. 설치비 지원

+
+
{IteraterFrom(instlCst,form,'2' )}
+ +
+

✓ 2. 녹색건축물 인증

+
+
{IteraterFrom(greenBuilding,form,'2')}
+ + + + +
+ ); +} diff --git a/apps/wr/components/ui/rswtrReuseFacilityInsetForm.tsx b/apps/wr/components/ui/rswtrReuseFacilityInsetForm.tsx new file mode 100644 index 000000000..40448db32 --- /dev/null +++ b/apps/wr/components/ui/rswtrReuseFacilityInsetForm.tsx @@ -0,0 +1,219 @@ +"use client"; + +import { + Form, + FormControl, + FormDescription, + FormField, + FormItem, + FormLabel, + FormMessage, + SelectBox, +} from "@common/business_components/ui"; +import { Input } from "@common/components/ui"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { useForm } from "react-hook-form"; +import { z } from "zod"; +import { IteraterFrom } from "./IteratreForm"; + +const formSchema = z.object({ + username: z.string().min(2).max(50), + facilityName: z.string().min(2).max(50), +}); + +type typeOfForm = { + labelName: string; + type: string; + selectvlaue?: { text: string; val: string }[]; + formName: string; +}; + +export function RswtrReuseFaciltyInsertForm() { + const total = 100; + + const form = useForm>({ + resolver: zodResolver(formSchema), + defaultValues: { + username: "", + }, + }); + + // 2. Define a submit handler. + function onSubmit(values: z.infer) { + // Do something with the form values. + // ✅ This will be type-safe and validated. + console.log(values); + } + const selectYNValue = [ + { text: "Y", val: "1" }, + { text: "N", val: "2" }, + ]; + + let homeWaterData = [ + { + labelName: "종류", + type: "check", + selectvlaue: undefined, + formName: "homeWaterData 1", + placeholder:'ooo' + }, + { + labelName: "주요처리공정", + type: "input", + selectvlaue: undefined, + formName: "homeWaterData 2", + placeholder:'1,000,000' + }, + { + labelName: "이용용도", + type: "check", + selectvlaue: undefined, + formName: "homeWaterData 2", + placeholder:'1,000,000' + } + ]; + + let filtrTrtmfct = [ + { + labelName: "설치비지원 여", + type: "input", + selectvlaue: undefined, + formName: "filtrTrtmfct 1", + placeholder:'Y' + }, + { + labelName: "용량", + type: "input", + selectvlaue: undefined, + formName: "filtrTrtmfct 2", + placeholder:100000 + + }, + { + labelName: "처리공정", + type: "input", + selectvlaue: undefined, + formName: "filtrTrtmfct 3", + placeholder:'원수취수' + }, + ]; + let instlCst = [ + { + labelName: "지원여부", + type: "input", + selectvlaue: undefined, + formName: "instlCst 1", + placeholder:'Y' + }, + { + labelName: "지원여부(원)", + type: "input", + selectvlaue: undefined, + formName: "instlCst 2", + placeholder:1000000 + }, + ]; + let greenBuilding = [ + { + labelName: "설치완료일", + type: "chek", + selectvlaue: selectYNValue , + formName: "greenBuilding 1", + placeholder:'Y' + }, + { + labelName: "인증년도", + type: "input", + selectvlaue: undefined, + formName: " greenBuilding 2", + placeholder:'2024' + }, + { + labelName: "인증번호", + type: "input", + selectvlaue: undefined, + formName: "greenBuilding 3", + placeholder:'wr123456789' + }, + { + labelName: "인증등급", + type: "input", + selectvlaue: undefined, + formName: "greenBuilding 4", + placeholder:'A' + }, + ]; + + let baseInfo = [ + { + labelName: "설치완료일", + type: "input", + selectvlaue: undefined , + formName: "baseInfo 1", + placeholder:'2022-1010' + }, + { + labelName: "설치비(월)", + type: "input", + selectvlaue: undefined, + formName: " baseInfo 2", + placeholder:'10000000' + }, + { + labelName: "물사용량(m³)", + type: "input", + selectvlaue: undefined, + formName: " baseInfo 2", + placeholder:'10000000' + }, + { + labelName: "의무대상 물사용량(m³)", + type: "input", + selectvlaue: undefined, + formName: " baseInfo 2", + placeholder:'10000000' + } + + ]; + + return ( +
+ + {/*
*/} +
+
+

○ 중수도 시설현황 등록

+
+
+
+ {IteraterFrom(baseInfo,form,'1' )} +
+
+

+ 중수도 시설 정보{" "} +

+
{IteraterFrom(homeWaterData,form,'3' )}
+
+ + + +
+

+ 인센티브 정보 +

+
+
+

✓ 1. 설치비 지원

+
+
{IteraterFrom(filtrTrtmfct,form,'1' )}
+ +
+

✓ 2. 녹색건축물 인증

+
+
{IteraterFrom(greenBuilding,form,'1' )}
+ + + + + ); +}