From f026268aa862a3a51303b6756734ed798a32bf84 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Wed, 12 Mar 2025 20:07:18 +0900 Subject: [PATCH] =?UTF-8?q?=ED=95=98=EC=88=98=EC=9E=AC=EC=9D=B4=EC=9A=A9?= =?UTF-8?q?=20=EB=93=B1=EB=A1=9D=20=ED=8F=BC=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../publicReuseFaciltyInsert/page.tsx | 13 +- .../rainReuseFaciltyInsert/page.tsx | 2 +- .../store/publicReuseFaciltyInsert/index.tsx | 159 +++++++++++++----- .../components/ui/publicReuseInsertForm.tsx | 150 +++++++++++------ 4 files changed, 226 insertions(+), 98 deletions(-) diff --git a/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/publicReuseFaciltyInsert/page.tsx b/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/publicReuseFaciltyInsert/page.tsx index 71dffacbb..c5bb231ab 100644 --- a/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/publicReuseFaciltyInsert/page.tsx +++ b/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/publicReuseFaciltyInsert/page.tsx @@ -9,7 +9,7 @@ import { useWrStore } from '../../../store'; export default function PublicReuseFaciltyInsert() { const {pubFac} = useWrStore((state) => state); - const { pubFacHeadList, publicReuseFacilityData, selectLabel} = pubFac; + const { pubFacHeadList, publicReuseFacilityData} = pubFac; const searchDiv = '하수재이용시설 ' const selectBox = [{ text: '서울하수처리시설', val: "1" }, { text: '서울1하수처리시설', val: "2" }, { text: '서울2하수처리시설', val: "3" }] const headName = () => { @@ -23,25 +23,24 @@ import { useWrStore } from '../../../store'; return ( <>
-
-

하수재이용시설 등록

+
+

하수재이용시설 등록

- +
- {/*
*/}
-
+
-
+
{/* */} diff --git a/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rainReuseFaciltyInsert/page.tsx b/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rainReuseFaciltyInsert/page.tsx index b5dfd509b..c94a93075 100644 --- a/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rainReuseFaciltyInsert/page.tsx +++ b/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rainReuseFaciltyInsert/page.tsx @@ -6,7 +6,7 @@ import { ScrollArea, SearchDiv, SearchInput, UiTable } from "@common/business_co import { Button, TableHead, TableRow } from "@common/components"; -const headMakeColSpan = (upHeadList: TableUpperProps[]) => { +export const headMakeColSpan = (upHeadList: TableUpperProps[]) => { return (<> { upHeadList.map((head: TableUpperProps) => diff --git a/apps/wr/app/store/publicReuseFaciltyInsert/index.tsx b/apps/wr/app/store/publicReuseFaciltyInsert/index.tsx index de51fd788..b57604257 100644 --- a/apps/wr/app/store/publicReuseFaciltyInsert/index.tsx +++ b/apps/wr/app/store/publicReuseFaciltyInsert/index.tsx @@ -1,32 +1,39 @@ +import type { TableUpperProps } from "../rainReuseFacilityInsert"; + export type TableProps = { id: string; title: string; } export type selectLabel={ - title:string, + text:string, val:string } + type publicReuseFacilityData = { - sido: string, - sigungo: string, - facilityName: string, - location: string, - locationgubun: string, - facilityCapacity: string, - yn?: string, - authoDay?: string, - area?: string, - reuse?: string, - register?: string - - + sido: string, + sigungo: string, + facilityName: string, + location: string, + locationgubun: string, + facilityCapacity: string, + yn?: string, + authoDay?: string, + area?: string, + reuse?: string, + register?: string + + +} +type pubMngFacData = { + mng: string, + subCo: string, + startDay: string, + endDay: string, } - - const selectLabel:selectLabel[]=[ - {title:'test',val:'1'} + {text:'test',val:'1'} ] @@ -39,30 +46,43 @@ const pubFacHeadList:TableProps[] = [ { id: "facilityCapacity", title: "시설용량"}, { id: "yn", title: '재이용여부' }, { id: "authoDay", title: '등록여부'}]; - -const publicReuseFacilityData:publicReuseFacilityData[] = [ - { - sido: "서울", - sigungo: "강남구", - facilityName: "난지", - location: "경기도 고양시 덕양구 대차로 4가", - locationgubun: "500", - facilityCapacity: "800,000", - reuse: "Y", - register: "Y" - }, - { - sido: "서울", - sigungo: "강남구", - facilityName: "난지", - location: "경기도 고양시 덕양구 대차로 4가", - locationgubun: "500", - facilityCapacity: "800,000", - reuse: "Y", - register: "Y" - }, - { - sido: "서울", + + + const pubMngUpHeadList:TableUpperProps[] = [ + { id: "mng", title: "운영방식"}, + { id: "subCo", title: "대행업체"}, + { id: "startDay", title: "시작일", upName:'upChangeRe' , upSequnce:1 }, + { id: "endDay", title: "종료일", upName:'upChangeRe' , upSequnce:2 }, + ]; + const date = new Date() + const pubMngFacData:pubMngFacData[] = [ + { mng:"자체운영", subCo:"-",startDay: '2024-11-11' ,endDay:'2024-11-20'}, + { mng:"자체운영", subCo:"한국수자원공사",startDay: '2022-11-11' ,endDay:'2024-09-13'}, + { mng:"자체운영", subCo:"스타벅스",startDay: '2023-11-11' ,endDay:'2024-02-19'}, + ]; + const publicReuseFacilityData:publicReuseFacilityData[] = [ + { + sido: "서울", + sigungo: "강남구", + facilityName: "난지", + location: "경기도 고양시 덕양구 대차로 4가", + locationgubun: "500", + facilityCapacity: "800,000", + reuse: "Y", + register: "Y" + }, + { + sido: "서울", + sigungo: "강남구", + facilityName: "난지", + location: "경기도 고양시 덕양구 대차로 4가", + locationgubun: "500", + facilityCapacity: "800,000", + reuse: "Y", + register: "Y" + }, + { + sido: "서울", sigungo: "강남구", facilityName: "난지", location: "경기도 고양시 덕양구 대차로 4가", @@ -74,11 +94,57 @@ const publicReuseFacilityData:publicReuseFacilityData[] = [ }, ] + +const erctUswtrCd:selectLabel[]=[ + {text:'처리장연계',val:'1'}, + {text:'자체/연계',val:'2'}, + {text:'자체처리',val:'3'}, +] + +const cyclCd :selectLabel[]= [ + { text: "1치", val: "1" }, + { text: "2차", val: "2" }, + ]; + const seCd :selectLabel[] = [ + { text: "신규", val: "1" }, + { text: "진행", val: "2" }, + ]; + const buseCd :selectLabel[]= [ + { text: "재정", val: "1" }, + { text: "만루", val: "2" }, + ]; + const rprcsCd :selectLabel[] = [ + { text: "물리적처리", val: "1" }, + { text: "생물학적처리", val: "2" }, + ]; + const buseMet :selectLabel[] = [ + { text: "재정", val: "1" }, + { text: "민간투자", val: "2" }, + { text: "자체", val: "2" }, + ]; + const rprcLoCd :selectLabel[] = [ + { text: "내부", val: "1" }, + { text: "외부", val: "2" }, + ]; + const rprcLoCd :selectLabel[] = [ + { text: "내부", val: "1" }, + { text: "외부", val: "2" }, + ]; + export type pubFacState = {pubFac:{ isInit: boolean; pubFacHeadList: TableProps[]; + pubMngUpHeadList:TableUpperProps[] publicReuseFacilityData: publicReuseFacilityData[]; selectLabel:selectLabel[]; + pubMngFacData:pubMngFacData[]; + erctUswtrCd:selectLabel[]; + cyclCd:selectLabel[]; + seCd:selectLabel[]; + buseCd :selectLabel[] + rprcsCd :selectLabel[] + buseMet :selectLabel[] + rprcLoCd:selectLabel[] }} type pubFacActions = { decrementList: () => void @@ -89,8 +155,17 @@ export type pubFacType = pubFacState & pubFacActions; export const pubFacStateExport:pubFacState= {pubFac:{ isInit:false, pubFacHeadList: pubFacHeadList, + pubMngUpHeadList:pubMngUpHeadList, publicReuseFacilityData: publicReuseFacilityData, - selectLabel:selectLabel + selectLabel:selectLabel, + pubMngFacData:pubMngFacData, + erctUswtrCd:erctUswtrCd, + cyclCd:cyclCd, + seCd:seCd, + buseCd:buseCd, + rprcsCd:rprcsCd, + buseMet:buseMet, + rprcLoCd: }} export const pubFacActionsExport:(set:any)=>pubFacActions=(set: any) => { return { diff --git a/apps/wr/components/ui/publicReuseInsertForm.tsx b/apps/wr/components/ui/publicReuseInsertForm.tsx index 1150bdc0d..3113560ce 100644 --- a/apps/wr/components/ui/publicReuseInsertForm.tsx +++ b/apps/wr/components/ui/publicReuseInsertForm.tsx @@ -3,12 +3,13 @@ import { SelectBox } from "@common/business_components"; import { DatePicker, FileUpload, FormUi, UiTable } from "@common/business_components/ui"; import { Form, FormField } from "@common/business_components/ui/form"; -import { Button, Input } from "@common/components"; +import { Button, Input, TableHead, TableRow } from "@common/components"; import { zodResolver } from "@hookform/resolvers/zod"; import { useState } from "react"; import { useForm } from "react-hook-form"; import { z } from "zod"; import { useWrStore } from "../../app/store/index"; +import { selectClass, type TableUpperProps } from "@/app/store/rainReuseFacilityInsert"; const formSchema = z.object({ username: z.string().min(2).max(50), @@ -16,15 +17,24 @@ const formSchema = z.object({ }); -// type typeOfForm = { -// labelName: string; -// type: string; -// selectvlaue?: { text: string; val: string }[]; -// } + 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 function PublicReuseFaciltyFormInsert() { const { pubFac } = useWrStore((state) => state); - const { pubFacHeadList, publicReuseFacilityData} = pubFac; - const total = 100; + const { pubMngUpHeadList, pubMngFacData,erctUswtrCd,cyclCd,seCd,buseCd,rprcsCd,buseMet,rprcLoCd} = pubFac; +const nodeList = headMakeColSpan(pubMngUpHeadList); + const form = useForm>({ resolver: zodResolver(formSchema), @@ -39,34 +49,16 @@ export function PublicReuseFaciltyFormInsert() { // ✅ This will be type-safe and validated. console.log(values); } + const onSelectValue=(val:string)=>{ + console.log(val) - const selectboxValue = [ - { text: "1치", val: "1" }, - { text: "2차", val: "2" }, - ]; - const selectboxDivValue = [ - { text: "신규", val: "1" }, - { text: "진행", val: "2" }, - ]; - const selectboxBuisValue = [ - { text: "재정", val: "1" }, - { text: "만루", val: "2" }, - ]; - const selectboxReuseMethodValue = [ - { text: "물리적처리", val: "1" }, - { text: "생물학적처리", val: "2" }, - ]; - const selectboxMethodValue = [ - { text: "처리장연계", val: "1" }, - { text: "자쳬처리", val: "2" }, - { text: "자쳬+연계", val: "3" }, - ]; +} const [datePick, setDatePick] = useState(new Date()) const [files, setFiles] = useState(null); return ( -
+
@@ -76,7 +68,7 @@ export function PublicReuseFaciltyFormInsert() {

○ 재이용시설 운영정보

-
+
-
-
@@ -121,17 +113,16 @@ export function PublicReuseFaciltyFormInsert() {

○ 재이용시설 운영정보

- +
+ >{nodeList}

○ 재이용수 공급 가능량

@@ -194,23 +185,23 @@ export function PublicReuseFaciltyFormInsert() { onSubmit={form.handleSubmit(onSubmit)} className="space-y-8 mx-auto w-full mt-7">
-
+

○ 차수별 하수처리수 재이용 시설 현황

-
+
( - + )} />
-
+
@@ -231,7 +222,7 @@ export function PublicReuseFaciltyFormInsert() { name="name_8928357542" render={({ field }) => ( - + )} /> @@ -243,7 +234,7 @@ export function PublicReuseFaciltyFormInsert() { name="name_9484942814" render={({ field }) => ( - + )} /> @@ -401,7 +392,7 @@ export function PublicReuseFaciltyFormInsert() { name="name_5139286452" render={({ field }) => ( - + )} /> @@ -413,7 +404,7 @@ export function PublicReuseFaciltyFormInsert() { name="name_7233630277" render={({ field }) => ( - + )} /> @@ -435,7 +426,70 @@ export function PublicReuseFaciltyFormInsert() {

농축수관리{" "}

- +
+
+ ( + + + + )} + /> +
+ +
+ ( + + + + )} + /> +
+ +
+ ( + + + + )} + /> +
+
+ +
+
+ ( + + + + )} + /> +
+ +
+ ( + + + + )} + /> +
+ +