Compare commits
115
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff20cefbe2 | ||
|
|
42b6dfc616 | ||
|
|
96e0df4e0b | ||
|
|
6cc600a8db | ||
|
|
c054d635b1 | ||
|
|
a5c3405049 | ||
|
|
0267ffb0d9 | ||
|
|
f25686da46 | ||
|
|
21a25de096 | ||
|
|
f68f164f64 | ||
|
|
e4dda6e50b | ||
|
|
52560d4b1b | ||
|
|
22209fb426 | ||
|
|
5898d454aa | ||
|
|
7cab00c198 | ||
|
|
1422319f4e | ||
|
|
690907364e | ||
|
|
dc4c1e93b1 | ||
|
|
95b048110a | ||
|
|
5f5c27fcca | ||
|
|
0a5ea76971 | ||
|
|
d21bde8748 | ||
|
|
18d7698c03 | ||
|
|
02a3a47ad0 | ||
|
|
55370f21d2 | ||
|
|
c1540030a5 | ||
|
|
1ac35dfc33 | ||
|
|
e62ddf2877 | ||
|
|
741b9b64b3 | ||
|
|
7c1cc6df65 | ||
|
|
23d8425858 | ||
|
|
6e390199b3 | ||
|
|
6454ae1330 | ||
|
|
6e10389b33 | ||
|
|
965accac4a | ||
|
|
07442cd458 | ||
|
|
3551bc0196 | ||
|
|
4b864019df | ||
|
|
f66bbed334 | ||
|
|
0528abb25b | ||
|
|
b1833d4aa5 | ||
|
|
b2891234ab | ||
|
|
8fd441bcbf | ||
|
|
ea4a4504ee | ||
|
|
677c6501f3 | ||
|
|
8019660593 | ||
|
|
da723e74b9 | ||
|
|
2323c67131 | ||
|
|
46de361f3c | ||
|
|
05b3b0675f | ||
|
|
54f47afaee | ||
|
|
f88e582b5e | ||
|
|
b8d93f1b8b | ||
|
|
5afc8da9a8 | ||
|
|
fb338598ef | ||
|
|
27499977d7 | ||
|
|
554ad2c5a8 | ||
|
|
ca30fc9a33 | ||
|
|
fa9f971226 | ||
|
|
a4350c9788 | ||
|
|
2919d7d637 | ||
|
|
ec89b1fbf3 | ||
|
|
a764bde899 | ||
|
|
4c2d069b59 | ||
|
|
4667e535e9 | ||
|
|
750baa59c1 | ||
|
|
4856e7fc17 | ||
|
|
a6993773a7 | ||
|
|
a263ec0961 | ||
|
|
01612302ba | ||
|
|
33d82eff22 | ||
|
|
44b836f3a2 | ||
|
|
94a05453f8 | ||
|
|
fa209d0c5d | ||
|
|
9c0ca52036 | ||
|
|
5fc4bbdacd | ||
|
|
1624b44c0d | ||
|
|
65419a4d88 | ||
|
|
e781af3209 | ||
|
|
8346f59f45 | ||
|
|
20442392ac | ||
|
|
4b13eb4280 | ||
|
|
f8daea7fcf | ||
|
|
c966581a99 | ||
|
|
850653b442 | ||
|
|
cf518a46c3 | ||
|
|
a147d972b8 | ||
|
|
ea7cb87c7b | ||
|
|
8f1bb4b5f2 | ||
|
|
4e7f40d848 | ||
|
|
489be4ce19 | ||
|
|
27ea503260 | ||
|
|
54803e4061 | ||
|
|
076516fdbf | ||
|
|
ac5573a296 | ||
|
|
6fccf422ea | ||
|
|
0a29570cda | ||
|
|
cc727045e1 | ||
|
|
f0f2665981 | ||
|
|
8d904d6714 | ||
|
|
96828c175e | ||
|
|
9ea9dc5e32 | ||
|
|
23bc71b275 | ||
|
|
c972dffa6e | ||
|
|
9e84a452ff | ||
|
|
78c7770834 | ||
|
|
1d71bbf942 | ||
|
|
d51318431c | ||
|
|
c90aabed50 | ||
|
|
81141e0971 | ||
|
|
20a133119c | ||
|
|
c29017fb51 | ||
|
|
ccf20ee7eb | ||
|
|
c620a84ee3 | ||
|
|
b7164a0542 |
@@ -14,6 +14,8 @@ dist
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
apps/wr/.next/**/*
|
||||
apps/fo/.next/**/*
|
||||
|
||||
# env
|
||||
.env*
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
import "@common/assets/styles/grid.css";
|
||||
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { getCoreRowModel, useReactTable } from "@tanstack/react-table";
|
||||
import { Button, DataTable, Input } from "@common/components";
|
||||
@@ -11,6 +9,8 @@ import { SiteApi, type ISite, type ISiteParams } from "@/entities/site";
|
||||
import { ENDPOINT } from "@/shared/config";
|
||||
import { PageLayout } from "@/shared/ui/page-layout";
|
||||
import { columns } from "../model/table-columns";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
function SitePage() {
|
||||
const router = useRouter();
|
||||
|
||||
+7
-67
@@ -1,70 +1,10 @@
|
||||
@import "../../../packages/common/components/src/base.css";
|
||||
@import "@common/assets/styles/base.css";
|
||||
@import "@common/assets/styles/diveicon.css";
|
||||
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
@layer base {
|
||||
:root {
|
||||
--background: 0 0% 100%;
|
||||
--foreground: 0 0% 3.9%;
|
||||
--card: 0 0% 100%;
|
||||
--card-foreground: 0 0% 3.9%;
|
||||
--popover: 0 0% 100%;
|
||||
--popover-foreground: 0 0% 3.9%;
|
||||
--primary: 0 0% 9%;
|
||||
--primary-foreground: 0 0% 98%;
|
||||
--secondary: 0 0% 96.1%;
|
||||
--secondary-foreground: 0 0% 9%;
|
||||
--muted: 0 0% 96.1%;
|
||||
--muted-foreground: 0 0% 45.1%;
|
||||
--accent: 0 0% 96.1%;
|
||||
--accent-foreground: 0 0% 9%;
|
||||
--destructive: 0 84.2% 60.2%;
|
||||
--destructive-foreground: 0 0% 98%;
|
||||
--border: 0 0% 89.8%;
|
||||
--input: 0 0% 89.8%;
|
||||
--ring: 0 0% 3.9%;
|
||||
--chart-1: 12 76% 61%;
|
||||
--chart-2: 173 58% 39%;
|
||||
--chart-3: 197 37% 24%;
|
||||
--chart-4: 43 74% 66%;
|
||||
--chart-5: 27 87% 67%;
|
||||
--radius: 0.5rem
|
||||
}
|
||||
.dark {
|
||||
--background: 0 0% 3.9%;
|
||||
--foreground: 0 0% 98%;
|
||||
--card: 0 0% 3.9%;
|
||||
--card-foreground: 0 0% 98%;
|
||||
--popover: 0 0% 3.9%;
|
||||
--popover-foreground: 0 0% 98%;
|
||||
--primary: 0 0% 98%;
|
||||
--primary-foreground: 0 0% 9%;
|
||||
--secondary: 0 0% 14.9%;
|
||||
--secondary-foreground: 0 0% 98%;
|
||||
--muted: 0 0% 14.9%;
|
||||
--muted-foreground: 0 0% 63.9%;
|
||||
--accent: 0 0% 14.9%;
|
||||
--accent-foreground: 0 0% 98%;
|
||||
--destructive: 0 62.8% 30.6%;
|
||||
--destructive-foreground: 0 0% 98%;
|
||||
--border: 0 0% 14.9%;
|
||||
--input: 0 0% 14.9%;
|
||||
--ring: 0 0% 83.1%;
|
||||
--chart-1: 220 70% 50%;
|
||||
--chart-2: 160 60% 45%;
|
||||
--chart-3: 30 80% 55%;
|
||||
--chart-4: 280 65% 60%;
|
||||
--chart-5: 340 75% 55%
|
||||
}
|
||||
}
|
||||
|
||||
@layer base {
|
||||
* {
|
||||
@apply border-border;
|
||||
}
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
}
|
||||
}
|
||||
html,
|
||||
body {
|
||||
font-family: "Noto Sans KR", sans-serif;
|
||||
font-size: 10px;
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
'use client'
|
||||
import { BaseLayout } from "@common/components";
|
||||
import "./globals.css";
|
||||
import { StoreProvider } from "./store";
|
||||
import { MainDiv } from "@common/business_components";
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
@@ -12,7 +14,9 @@ export default function RootLayout({
|
||||
<body>
|
||||
<StoreProvider>
|
||||
<BaseLayout>
|
||||
<MainDiv>
|
||||
{children}
|
||||
</MainDiv>
|
||||
</BaseLayout>
|
||||
</StoreProvider>
|
||||
</body>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export default function Loading() {
|
||||
return <div>페이지 불러오는 중입니다...</div>;
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ import {
|
||||
SelectBox,
|
||||
} from "@common/business_components/ui";
|
||||
import { Button } from "@common/components/ui";
|
||||
import { CoRegForm } from "@/components/ui/matDmd/coRegForm/component";
|
||||
import { CoRegForm } from "@/components/ui/form/matDmd/coRegForm/component";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import { ToastFormUi } from "@/components/toastFromUi";
|
||||
import { ToastFormUi } from "@/components/ui/toast/toastFromUi";
|
||||
|
||||
const formSchema = z.object({
|
||||
ctpv: z.string(),
|
||||
|
||||
@@ -4,7 +4,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import * as z from "zod";
|
||||
import { Form } from "@common/business_components/ui";
|
||||
import { Button } from "@common/components/ui";
|
||||
import { DmdRegForm } from "@/components/ui/matDmd/dmdRegform/component";
|
||||
import { DmdRegForm } from "@/components/ui/form/matDmd/dmdRegform/component";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
|
||||
+74
-18
@@ -1,26 +1,82 @@
|
||||
import Link from 'next/link';
|
||||
import { Button } from '@common/components/ui';
|
||||
|
||||
|
||||
"use client";
|
||||
import Link from "next/link";
|
||||
import { Button } from "@common/components/ui";
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<>
|
||||
<div className='flex'>
|
||||
<Button className='place-self-auto'>
|
||||
<Link href="reuseFaciltyManage/reuseFacilityInsert/publicReuseFaciltyInsert"> 하수재이용 시설 등록</Link>
|
||||
</Button>
|
||||
<Button className='place-self-auto'>
|
||||
<Link href="reuseFaciltyManage/reuseFacilityInsert/rainReuseFaciltyInsert"> 빗물재이용 시설 등록</Link>
|
||||
</Button>
|
||||
<Button className='place-self-auto'>
|
||||
<Link href="reuseFaciltyManage/reuseFacilityInsert/rswtReuseFacilityInsert"> 중수도시설 등록</Link>
|
||||
</Button>
|
||||
<div className="flex flex-col gap-8 p-6">
|
||||
{/* 시설 등록 */}
|
||||
<div>
|
||||
<h2 className="text-xl font-semibold mb-4">시설 등록</h2>
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
<div className="col-span-2">
|
||||
<Button className="w-full">
|
||||
<Link href="ruseFcltMng/fcltReg/pbnstReg">
|
||||
하수재이용 시설 등록
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Button className="w-full">
|
||||
<Link href="ruseFcltMng/fcltReg/rainReg">
|
||||
빗물재이용 시설 등록
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Button className="w-full">
|
||||
<Link href="ruseFcltMng/fcltReg/rswtReg">중수도시설 등록</Link>
|
||||
</Button>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Button className="w-full">
|
||||
<Link href="ruseFcltMng/fcltReg/htdflReg">온배수 등록</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Button className='place-self-auto'>
|
||||
<Link href="matMng/matDmd/coReg">수요처 등록</Link>
|
||||
</Button>
|
||||
{/* 지도점검 결과 */}
|
||||
<div>
|
||||
<h2 className="text-xl font-semibold mb-4">지도점검 결과</h2>
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
<div className="col-span-2">
|
||||
<Button className="w-full">
|
||||
<Link href="ruseFcltMng/prfmncReg/chkgdnReg">
|
||||
지도점검 결과 등록
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 시설 현황 */}
|
||||
<div>
|
||||
<h2 className="text-xl font-semibold mb-4">시설 현황</h2>
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
<div className="col-span-2">
|
||||
<Button className="w-full">
|
||||
<Link href="ruseFcltMng/fcltSttn/pbnstSttn">
|
||||
하수재이용시설현황
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 수요처 관리 */}
|
||||
<div>
|
||||
<h2 className="text-xl font-semibold mb-4">수요처 관리</h2>
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
<div className="col-span-2">
|
||||
<Button className="w-full">
|
||||
<Link href="matMng/matDmd/coReg">수요처 등록</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import { ScrollArea, SearchDiv, SelectBox, UiTable } from '@common/business_components';
|
||||
import { Button } from '@common/components';
|
||||
import { PublicReuseFaciltyFormInsert } from '../../../../components/ui/publicReuseInsertForm';
|
||||
import { useWrStore } from '../../../store';
|
||||
|
||||
|
||||
|
||||
export default function PublicReuseFaciltyInsert() {
|
||||
const {pubFac} = useWrStore((state) => state);
|
||||
const { pubFacHeadList, publicReuseFacilityData} = pubFac;
|
||||
const searchDiv = '하수재이용시설 '
|
||||
const selectBox = [{ text: '서울하수처리시설', val: "1_hasu" }, { text: '서울1하수처리시설', val: "2_hasu" }, { text: '서울2하수처리시설', val: "3_hasu" }]
|
||||
const headName = () => {
|
||||
return (
|
||||
<h1 className="pl-3 text-xl">○공공 하수처리시설 등록</h1>
|
||||
)
|
||||
}
|
||||
const onSelectValue = (val: string) => {
|
||||
console.log(val)
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<div className="grid grid-cols-2 gap-4 h-full">
|
||||
<div className='col-span-4'>
|
||||
<h1 className="pl-3 text-xl" > 하수재이용시설 등록</h1>
|
||||
<div className="m-8">
|
||||
<SearchDiv>
|
||||
<div className='w-4/5 grid grid-cols-12 gap-1 mx-4'>
|
||||
<SelectBox className='col-span-4' label={searchDiv} selectArray={selectBox} onSelectValue={onSelectValue} />
|
||||
</div>
|
||||
<div className='w-1/5 flex items-center justify-end'>
|
||||
<Button className='mr-4 rounded-lg'>조회</Button>
|
||||
<Button className='mr-4 rounded-lg'>신규추가</Button>
|
||||
</div>
|
||||
</SearchDiv>
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-span-1 pl-11">
|
||||
<UiTable tableData={publicReuseFacilityData} headlist={pubFacHeadList} pageSize={100} total={10} headName={headName()} children={undefined}/>
|
||||
</div>
|
||||
<div className="col-span-1 pr-6 max-h-full overflow-y-scroll">
|
||||
<ScrollArea>
|
||||
<PublicReuseFaciltyFormInsert />
|
||||
{/* <ScrollBar orientation="vertical"></ScrollBar> */}
|
||||
</ScrollArea>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
'use client'
|
||||
import { useWrStore } from "@/app/store";
|
||||
import type { TableUpperProps } from "@/app/store/rainReuseFacilityInsert"
|
||||
import { RainReuseFaciltyInsertForm } from "@/components/ui/rainReuseInsertForm";
|
||||
import { ScrollArea, SearchDiv, SearchInput, UiTable } from "@common/business_components";
|
||||
import { Button, TableHead, TableRow } from "@common/components";
|
||||
|
||||
|
||||
export const headMakeColSpan = (upHeadList: TableUpperProps[]) => {
|
||||
return (<>
|
||||
<TableRow>{
|
||||
upHeadList.map((head: TableUpperProps) =>
|
||||
(!head.upSequnce ? <TableHead rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
||||
head.upName === 'upChangeRe' && head.upSequnce === 1 ? <TableHead key={head.id} rowSpan={1} colSpan={3}>{'중축 개축 증축 '}</TableHead> : null))}
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
{upHeadList.map((head: TableUpperProps) =>
|
||||
(head.upName === 'upChangeRe' ? <TableHead key={head.id}>{head.title}</TableHead> : null))}
|
||||
</TableRow>
|
||||
</>)
|
||||
}
|
||||
|
||||
|
||||
export default function Home() {
|
||||
const { rain } = useWrStore((state) => state);
|
||||
const nodeList = headMakeColSpan(rain.upHeadList);
|
||||
|
||||
|
||||
const headName = () => {
|
||||
return (
|
||||
<h1 className="pl-3 text-xl">○건축물 목록</h1>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<div className="grid grid-cols-2 gap-4 ">
|
||||
<div className='col-span-2'>
|
||||
<h1 className="pl-3 text-2xl" >빗물이용시설 등록 </h1>
|
||||
<div className="m-8">
|
||||
<SearchDiv >
|
||||
<div className='w-4/5 grid grid-cols-12 gap-1 mx-4'>
|
||||
<SearchInput className='col-span-3 my-7' label="건물명" />
|
||||
</div>
|
||||
<div className='w-1/5 flex items-center justify-end'>
|
||||
<Button className='mr-4 rounded-lg'>조회</Button>
|
||||
<Button className='mr-4 rounded-lg'>저장</Button>
|
||||
<Button className='mr-4 rounded-lg'>신규등록</Button>
|
||||
</div>
|
||||
</SearchDiv>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="colsapn-1 pl-11">
|
||||
<UiTable tableData={rain.rainOfObject} headlist={rain.upHeadList} pageSize={100} total={10} headName={headName()}>
|
||||
{nodeList}
|
||||
</UiTable>
|
||||
</div>
|
||||
<div className="colsapn-1 pr-11 max-h-full ovreflow-y-scroll">
|
||||
<ScrollArea>
|
||||
<RainReuseFaciltyInsertForm></RainReuseFaciltyInsertForm>
|
||||
</ScrollArea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
'use client'
|
||||
import { useWrStore } from "@/app/store";
|
||||
import type { TableUpperProps } from "@/app/store/rainReuseFacilityInsert";
|
||||
import { RswtrReuseFaciltyInsertForm } from "@/components/ui/rswtrReuseInsetForm";
|
||||
import { ScrollArea, SearchDiv, SearchInput, UiTable } from "@common/business_components";
|
||||
import { Button, TableHead, TableRow } from "@common/components";
|
||||
|
||||
|
||||
const headMakeColSpan = (upHeadList: TableUpperProps[]) => {
|
||||
return (<>
|
||||
<TableRow>{
|
||||
upHeadList.map((head: TableUpperProps) =>
|
||||
(!head.upSequnce ? <TableHead rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
||||
head.upName === 'upChangeRe' && head.upSequnce === 1 ? <TableHead key={head.id} rowSpan={1} colSpan={3}>{'중축 개축 증축 '}</TableHead> : null))}
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
{upHeadList.map((head: TableUpperProps) =>
|
||||
(head.upName === 'upChangeRe' ? <TableHead key={head.id}>{head.title}</TableHead> : null))}
|
||||
</TableRow>
|
||||
</>)
|
||||
}
|
||||
|
||||
|
||||
export default function Home() {
|
||||
const {rswt} = useWrStore((state) => state);
|
||||
const nodeList = headMakeColSpan(rswt.upHeadList);
|
||||
const total = 100;
|
||||
|
||||
|
||||
const headName = () => {
|
||||
return (
|
||||
<h1 className="pl-3 text-xl">○건축물 목록</h1>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="grid grid-cols-2 gap-4 ">
|
||||
<div className='col-span-2'>
|
||||
<h1 className="pl-3 text-2xl" >중수도시설 등록 </h1>
|
||||
<div className="m-8">
|
||||
<SearchDiv >
|
||||
<div className='w-4/5 grid grid-cols-6 gap-1 mx-4'>
|
||||
<SearchInput className='col-span-1 my-7 text-2xl' label="건물명:" />
|
||||
</div>
|
||||
<div className='w-1/5 flex items-center justify-end'>
|
||||
<Button className='mr-4 rounded-lg'>조회</Button>
|
||||
<Button className='mr-4 rounded-lg'>저장</Button>
|
||||
<Button className='mr-4 rounded-lg'>신규등록</Button>
|
||||
</div>
|
||||
</SearchDiv>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="colsapn-1 pl-11">
|
||||
<UiTable tableData={rswt.rswtOfObject} headlist={rswt.upHeadList} pageSize={100} total={10} headName={headName()}>
|
||||
{nodeList}
|
||||
</UiTable>
|
||||
</div>
|
||||
<div className="colsapn-1 pr-11 max-h-full ovreflow-y-scroll">
|
||||
<ScrollArea>
|
||||
<RswtrReuseFaciltyInsertForm></RswtrReuseFaciltyInsertForm>
|
||||
</ScrollArea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
"use client";
|
||||
|
||||
import { useWrStore } from "@/app/store";
|
||||
import {
|
||||
ContentsDiv,
|
||||
ScrollArea,
|
||||
SearchDiv,
|
||||
SearchFormLeft,
|
||||
SearchFormRight,
|
||||
SearchInput,
|
||||
Title,
|
||||
UiModal,
|
||||
UiTable,
|
||||
} from "@common/business_components";
|
||||
import { Button } from "@common/components";
|
||||
import { headMakeColSpan } from "../rainReg/page";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { useEffect, useState } from "react";
|
||||
import { tableData } from "@/components/lib/func/commom";
|
||||
import { HtdflRegForm } from "@/components/ui/form/fcltReg/htdflReg/htdflRegForm";
|
||||
import type { chgBuilding } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import BdstChgModal from "@/components/ui/modal/bdstChgModal/bdstChgModal";
|
||||
import { BdstReg } from "@/components/ui/modal/bdstRegModal/bdstRegModal";
|
||||
import type { customHtdflBdst } from "@/app/store/ruseFcltMng/fcltReg/htdflReg";
|
||||
|
||||
export default function Home() {
|
||||
const { code, htdfl, initHtdfl } = useWrStore((state) => state);
|
||||
const nodeList = headMakeColSpan(htdfl.upHeadList);
|
||||
const [searchTxt, setSearchTxt] = useState("");
|
||||
const [htdflForm, setHtdflForm] = useState<customHtdflBdst>();
|
||||
const [bdstTable, setbdstTable] = useState<customHtdflBdst[]>();
|
||||
const [issNewReg,setIsNewReg] = useState<boolean>( false);
|
||||
|
||||
const [bdstChgProps, setBdstChgProps] = useState<{
|
||||
isOpen: boolean;
|
||||
chgBuilding: chgBuilding[];
|
||||
}>({ isOpen: false, chgBuilding: [] });
|
||||
|
||||
const { htdflRes } = htdfl;
|
||||
|
||||
useEffect(() => {
|
||||
if (!htdfl.isInit) {
|
||||
initHtdfl(undefined);
|
||||
}
|
||||
}, [htdfl.isInit, initHtdfl]);
|
||||
|
||||
useEffect(() => {
|
||||
if (code.sggCd.length > 0) {
|
||||
setbdstTable(tableData(htdflRes, { code }));
|
||||
}
|
||||
}, [code, htdflRes]);
|
||||
|
||||
const cellClick: (val: number|undefined ,headId: string) => void = (
|
||||
val
|
||||
,headId) => {
|
||||
if ((bdstTable ?? []).length > 0 && val !== undefined) {
|
||||
{
|
||||
setHtdflForm(htdflRes[val]);
|
||||
}
|
||||
}
|
||||
|
||||
if (headId === "bdstChgYn" && val !== undefined) {
|
||||
if (
|
||||
htdflRes[val]?.bdstInfoPk != null &&
|
||||
htdflRes[val]?.chgBuilding?.length > 0
|
||||
) {
|
||||
bdstChgModal(htdflRes[val]?.chgBuilding);
|
||||
}
|
||||
}
|
||||
};
|
||||
const bdstChgModal = (chgBuilding: chgBuilding[]) => {
|
||||
setBdstChgProps({ isOpen: true, chgBuilding: chgBuilding });
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<ContentsDiv>
|
||||
<div className="grid grid-cols-2 gap-4 ">
|
||||
<div className="col-span-2">
|
||||
<Title title={"온배수시설 등록 "} />
|
||||
<SearchDiv>
|
||||
<SearchFormLeft>
|
||||
<SearchInput
|
||||
className="col-span-3 my-7"
|
||||
label="건물명:"
|
||||
textValue={searchTxt || ""}
|
||||
setText={(e) => {
|
||||
setSearchTxt(e);
|
||||
}}
|
||||
/>
|
||||
</SearchFormLeft>
|
||||
<SearchFormRight>
|
||||
<Button className="mr-4 rounded-lg" onClick={()=>{initHtdfl(searchTxt||"")}}>조회</Button>
|
||||
<Button
|
||||
className="mr-4 rounded-lg"
|
||||
onClick={() => setIsNewReg(!issNewReg)}
|
||||
>
|
||||
신규등록
|
||||
</Button>
|
||||
</SearchFormRight>
|
||||
</SearchDiv>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-6 gap-4 ">
|
||||
<div className="col-span-4">
|
||||
<ListDiv>
|
||||
<UiTable
|
||||
tableData={bdstTable || []}
|
||||
headlist={htdfl.upHeadList}
|
||||
pageSize={100}
|
||||
total={10}
|
||||
headName={"○건축물 목록"}
|
||||
cellClick={(val,headId)=>{cellClick(val||undefined , headId)}}
|
||||
>
|
||||
{nodeList}
|
||||
</UiTable>
|
||||
</ListDiv>
|
||||
</div>
|
||||
<div className="col-span-2 max-h-full ovreflow-y-scroll">
|
||||
<ListDiv>
|
||||
<ScrollArea>
|
||||
<HtdflRegForm
|
||||
htdflForm={htdflForm ?? ({} as customHtdflBdst)}
|
||||
isModal={false}
|
||||
/>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
</div>
|
||||
</div>
|
||||
<UiModal
|
||||
body={<BdstReg moType="HTB"></BdstReg>}
|
||||
bodyClass="w-[90vw] max-w-none"
|
||||
open={issNewReg}
|
||||
onOpenChange={(open) => {
|
||||
setIsNewReg(open);
|
||||
}}
|
||||
/>
|
||||
|
||||
<UiModal
|
||||
bodyClass={""}
|
||||
open={bdstChgProps.isOpen}
|
||||
body={<BdstChgModal chgBuilding={bdstChgProps.chgBuilding}></BdstChgModal>}
|
||||
onOpenChange={(open) => {
|
||||
setBdstChgProps({ ...bdstChgProps, isOpen: open });
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
||||
|
||||
</ContentsDiv>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
"use client";
|
||||
import {
|
||||
ScrollArea,
|
||||
SearchDiv,
|
||||
SelectBox,
|
||||
UiTable,
|
||||
} from "@common/business_components";
|
||||
import { Button } from "@common/components";
|
||||
import { useWrStore } from "../../../store";
|
||||
import { PbnstBuseForm } from "@/components/ui/form/fcltReg/pbnstReg/buseReg/component";
|
||||
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@common/components";
|
||||
import { PbnstMngForm} from "@/components/ui/form/fcltReg/pbnstReg/mngReg/component";
|
||||
import { useEffect, useState } from "react";
|
||||
import type { ruseFcltType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg";
|
||||
|
||||
|
||||
export default function PublicReuseFaciltyInsert() {
|
||||
const { pubFac , pubMng,mngMainValue} = useWrStore((state) => state);
|
||||
const { pubFacHeadList, publicReuseFacilityData } = pubFac;
|
||||
const { ruseFclt } = pubMng;
|
||||
|
||||
const [currentTab, setCurrentTab] = useState<string>('mng');
|
||||
const [fcltMng, setFcltMng] = useState<ruseFcltType[]>();
|
||||
|
||||
const searchDiv = "하수재이용시설 ";
|
||||
const selectBox = [
|
||||
{ text: "서울하수처리시설", val: "1_hasu" },
|
||||
{ text: "서울1하수처리시설", val: "2_hasu" },
|
||||
{ text: "서울2하수처리시설", val: "3_hasu" },
|
||||
];
|
||||
const headName = () => {
|
||||
return <h1 className="pl-3 text-xl">○공공 하수처리시설 등록</h1>;
|
||||
};
|
||||
const onSelectValue = (val: string) => {
|
||||
console.log(val);
|
||||
};
|
||||
const cellClick = (val: number | undefined) => {
|
||||
if (val === undefined) return;
|
||||
let data;
|
||||
if (publicReuseFacilityData[val]) {
|
||||
data = ruseFclt.filter(
|
||||
(item) => item.swtrmtFcltFk === publicReuseFacilityData[val]?.swtrmtFcltFk
|
||||
);
|
||||
setFcltMng(data);
|
||||
}
|
||||
};
|
||||
const resetContents = () => {
|
||||
setFcltMng([]); // 빈 배열로 설정하여 신규 모드로 전환
|
||||
};
|
||||
|
||||
const handleTabChange = (value: string) => {
|
||||
setCurrentTab(value);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="grid grid-cols-2 gap-4 h-full">
|
||||
<div className="col-span-4 ">
|
||||
<h1 className="pl-3 text-xl"> 하수재이용시설 등록</h1>
|
||||
<div className="m-8">
|
||||
<SearchDiv>
|
||||
<div className="w-4/5 grid grid-cols-12 gap-1 mx-4">
|
||||
<SelectBox
|
||||
className="col-span-4"
|
||||
label={searchDiv}
|
||||
selectArray={selectBox}
|
||||
onSelectValue={onSelectValue}
|
||||
selectClass={undefined}
|
||||
/>
|
||||
</div>
|
||||
<div className="w-1/5 flex items-center justify-end">
|
||||
<Button className="mr-16 rounded-lg">조회</Button>
|
||||
</div>
|
||||
</SearchDiv>
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-span-1 pl-11 max-h-full">
|
||||
<UiTable
|
||||
tableData={publicReuseFacilityData}
|
||||
headlist={pubFacHeadList}
|
||||
pageSize={100}
|
||||
total={10}
|
||||
headName={headName()}
|
||||
children={undefined} cellClick={cellClick} />
|
||||
</div>
|
||||
<div className="col-span-1 pr-6 max-h-full overflow-y-scroll">
|
||||
|
||||
|
||||
|
||||
<Tabs defaultValue="mng" onValueChange={handleTabChange}>
|
||||
<div className="flex justify-between items-center">
|
||||
<TabsList>
|
||||
<TabsTrigger value="mng">시설정보</TabsTrigger>
|
||||
<TabsTrigger value="buse">차수별정보</TabsTrigger>
|
||||
</TabsList>
|
||||
<Button className="rounded-lg" onClick={resetContents}>
|
||||
신규등록
|
||||
</Button>
|
||||
</div>
|
||||
<TabsContent className="max-h-full" value="mng">
|
||||
<ScrollArea>
|
||||
<PbnstMngForm
|
||||
data={fcltMng || []}
|
||||
/>
|
||||
</ScrollArea>
|
||||
</TabsContent>
|
||||
<TabsContent value="buse">
|
||||
<ScrollArea>
|
||||
<PbnstBuseForm />
|
||||
</ScrollArea>
|
||||
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
"use client";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import type {
|
||||
chgBuilding,
|
||||
customRainBdst,
|
||||
TableUpperProps,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { tableData } from "@/components/lib/func/commom";
|
||||
import { RainRegForm } from "@/components/ui/form/fcltReg/rainReg/rainRegForm";
|
||||
import BdstChgModal from "@/components/ui/modal/bdstChgModal/bdstChgModal";
|
||||
import { BdstReg } from "@/components/ui/modal/bdstRegModal/bdstRegModal";
|
||||
import {
|
||||
ContentsDiv,
|
||||
ScrollArea,
|
||||
SearchDiv,
|
||||
SearchFormLeft,
|
||||
SearchFormRight,
|
||||
SearchInput,
|
||||
Title,
|
||||
UiModal,
|
||||
UiTable,
|
||||
} from "@common/business_components";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button, TableHead, TableRow } from "@common/components";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export const headMakeColSpan = (upHeadList: TableUpperProps[]) => {
|
||||
return (
|
||||
<>
|
||||
<TableRow>
|
||||
{upHeadList.map((head: TableUpperProps) =>
|
||||
!head.upSequnce ? (
|
||||
<TableHead rowSpan={2} key={head.id}>
|
||||
{head.title}
|
||||
</TableHead>
|
||||
) : head.upName === "upChangeRe" && head.upSequnce === 1 ? (
|
||||
<TableHead key={head.id} rowSpan={1} colSpan={3}>
|
||||
{"중축 개축 재축 "}
|
||||
</TableHead>
|
||||
) : null
|
||||
)}
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
{upHeadList.map((head: TableUpperProps) =>
|
||||
head.upName === "upChangeRe" ? (
|
||||
<TableHead key={head.id}>{head.title}</TableHead>
|
||||
) : null
|
||||
)}
|
||||
</TableRow>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
|
||||
export default function Home() {
|
||||
const { rain, code, init } = useWrStore((state) => {
|
||||
return state;
|
||||
});
|
||||
const { rainRes } = rain;
|
||||
const [rainForm, setRainForm] = useState<customRainBdst>();
|
||||
const [issNewReg, setIsNewReg] = useState<boolean>(false);
|
||||
|
||||
const [bdstTable, setbdstTable] = useState<customRainBdst[]>();
|
||||
const [searchTxt, setSearchTxt] = useState<string>();
|
||||
const [bdstChgProps, setBdstChgProps] = useState<{
|
||||
isOpen: boolean;
|
||||
chgBuilding: chgBuilding[];
|
||||
}>({ isOpen: false, chgBuilding: [] });
|
||||
|
||||
const nodeList = headMakeColSpan(rain.upHeadList);
|
||||
useEffect(() => {
|
||||
if (!rain.isInit) {
|
||||
init(undefined);
|
||||
}
|
||||
}, [rain.isInit, init]);
|
||||
|
||||
useEffect(() => {
|
||||
if (code.sggCd.length > 0) {
|
||||
setbdstTable(tableData(rainRes, { code }));
|
||||
}
|
||||
}, [code, rainRes]);
|
||||
const cellClick: (val: number | undefined, headId: string) => void = (
|
||||
val,
|
||||
headId
|
||||
) => {
|
||||
if (val !== undefined) {
|
||||
setRainForm(rainRes[val]);
|
||||
}
|
||||
|
||||
if (headId === "bdstChgYn" && val !== undefined) {
|
||||
if (
|
||||
rainRes[val]?.bdstInfoPk != null &&
|
||||
rainRes[val]?.chgBuilding.length > 0
|
||||
) {
|
||||
bdstChgModal(rainRes[val].chgBuilding);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const bdstChgModal = (chgBuilding: chgBuilding[]) => {
|
||||
setBdstChgProps({ isOpen: true, chgBuilding: chgBuilding });
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
console.log("rainForm", rainForm);
|
||||
}, [rainForm]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ContentsDiv>
|
||||
<div className="grid grid-cols-4 gap-4 ">
|
||||
<div className="col-span-4">
|
||||
<Title title={"빗물이용시설 등록"} />
|
||||
<SearchDiv>
|
||||
<SearchFormLeft>
|
||||
<SearchInput
|
||||
className="col-span-3 my-7"
|
||||
label="건물명"
|
||||
textValue={searchTxt || ""}
|
||||
setText={(e) => {
|
||||
setSearchTxt(e);
|
||||
}}
|
||||
/>
|
||||
</SearchFormLeft>
|
||||
<SearchFormRight>
|
||||
<Button
|
||||
className="mr-4 rounded-lg"
|
||||
onClick={(e) => {
|
||||
init(searchTxt || "");
|
||||
}}
|
||||
>
|
||||
조회
|
||||
</Button>
|
||||
<Button
|
||||
className="mr-4 rounded-lg"
|
||||
onClick={() => setIsNewReg(!issNewReg)}
|
||||
>
|
||||
신규등록
|
||||
</Button>
|
||||
</SearchFormRight>
|
||||
</SearchDiv>
|
||||
</div>
|
||||
</div>
|
||||
<div className="h-screen grid grid-cols-6 gap-4 !overflow-y-scroll">
|
||||
<div className="col-span-4 h-full min-h-0">
|
||||
<ListDiv className="h-full min-h-0">
|
||||
<ScrollArea className="h-[60vh]">
|
||||
<UiTable
|
||||
tableData={bdstTable || []}
|
||||
headlist={rain.upHeadList}
|
||||
pageSize={100}
|
||||
total={10}
|
||||
headName={"○건축물 목록"}
|
||||
cellClick={(val, headId) => {
|
||||
cellClick(val, headId);
|
||||
}}
|
||||
>
|
||||
{nodeList}
|
||||
</UiTable>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
</div>
|
||||
<div className="col-span-2 max-h-full overflow-y-scroll">
|
||||
<ListDiv className="">
|
||||
<RainRegForm
|
||||
rainForm={rainForm ?? ({} as customRainBdst)}
|
||||
isModal={false}
|
||||
></RainRegForm>
|
||||
</ListDiv>
|
||||
</div>
|
||||
</div>
|
||||
<UiModal
|
||||
body={<BdstReg moType="RNB"></BdstReg>}
|
||||
bodyClass="w-[90vw] max-w-none"
|
||||
open={issNewReg}
|
||||
onOpenChange={(open) => {
|
||||
setIsNewReg(open);
|
||||
}}
|
||||
/>
|
||||
|
||||
<UiModal
|
||||
bodyClass={""}
|
||||
open={bdstChgProps.isOpen}
|
||||
body={
|
||||
<BdstChgModal chgBuilding={bdstChgProps.chgBuilding}></BdstChgModal>
|
||||
}
|
||||
onOpenChange={(open) => {
|
||||
setBdstChgProps({ ...bdstChgProps, isOpen: open });
|
||||
}}
|
||||
/>
|
||||
</ContentsDiv>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
"use client";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { BdstReg } from "@/components/ui/modal/bdstRegModal/bdstRegModal";
|
||||
import {
|
||||
ContentsDiv,
|
||||
ScrollArea,
|
||||
SearchDiv,
|
||||
SearchFormLeft,
|
||||
SearchFormRight,
|
||||
SearchInput,
|
||||
Title,
|
||||
UiModal,
|
||||
UiTable,
|
||||
} from "@common/business_components";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button } from "@common/components";
|
||||
import { headMakeColSpan } from "../rainReg/page";
|
||||
import { useEffect, useState } from "react";
|
||||
import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
|
||||
import { tableData } from "@/components/lib/func/commom";
|
||||
import { RswtrRegForm } from "@/components/ui/form/fcltReg/rswtrReg/RswtrRegForm";
|
||||
import BdstChgModal from "@/components/ui/modal/bdstChgModal/bdstChgModal";
|
||||
import type { chgBuilding } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
|
||||
export default function Home() {
|
||||
const { code, rswt, initRswt } = useWrStore((state) => state);
|
||||
const nodeList = headMakeColSpan(rswt.upHeadList);
|
||||
const [rswtForm, setRswtForm] = useState<customRswtBdst>();
|
||||
const [searchTxt, setSearchTxt] = useState<string>();
|
||||
const [issNewReg, setIsNewReg] = useState<boolean>(false);
|
||||
|
||||
const [bdstTable, setbdstTable] = useState<customRswtBdst[]>();
|
||||
const [bdstChgProps, setBdstChgProps] = useState<{
|
||||
isOpen: boolean;
|
||||
chgBuilding: chgBuilding[];
|
||||
}>({ isOpen: false, chgBuilding: [] });
|
||||
|
||||
const { rswtRes } = rswt;
|
||||
|
||||
useEffect(() => {
|
||||
if (!rswt.isInit) {
|
||||
initRswt(undefined);
|
||||
}
|
||||
}, [rswt.isInit, initRswt]);
|
||||
useEffect(() => {
|
||||
if (code.sggCd.length > 0) {
|
||||
setbdstTable(tableData(rswtRes, { code }));
|
||||
}
|
||||
}, [code, rswtRes]);
|
||||
const cellClick: (val: number | undefined, headId: string) => void = (
|
||||
val,
|
||||
headId
|
||||
) => {
|
||||
if ((bdstTable ?? []).length > 0 && val !== undefined) {
|
||||
{
|
||||
setRswtForm(rswtRes[val]);
|
||||
}
|
||||
}
|
||||
|
||||
if (headId === "bdstChgYn" && val !== undefined) {
|
||||
if (
|
||||
rswtRes[val]?.bdstInfoPk != null &&
|
||||
rswtRes[val]?.chgBuilding?.length > 0
|
||||
) {
|
||||
bdstChgModal(rswtRes[val].chgBuilding);
|
||||
}
|
||||
}
|
||||
};
|
||||
const bdstChgModal = (chgBuilding: chgBuilding[]) => {
|
||||
setBdstChgProps({ isOpen: true, chgBuilding: chgBuilding });
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<ContentsDiv>
|
||||
<div className="grid grid-cols-4 gap-4 ">
|
||||
<div className="col-span-4">
|
||||
<Title title={"중수도시설 등록 "} />
|
||||
<SearchDiv>
|
||||
<SearchFormLeft>
|
||||
<SearchInput
|
||||
className="col-span-3 my-7"
|
||||
label="건물명:"
|
||||
textValue={searchTxt || ""}
|
||||
setText={(e) => {
|
||||
setSearchTxt(e);
|
||||
}}
|
||||
/>
|
||||
</SearchFormLeft>
|
||||
<SearchFormRight>
|
||||
<Button
|
||||
className="mr-4 rounded-lg"
|
||||
onClick={(e) => {
|
||||
initRswt(searchTxt || "");
|
||||
}}
|
||||
>
|
||||
조회
|
||||
</Button>
|
||||
<Button
|
||||
className="mr-4 rounded-lg"
|
||||
onClick={() => setIsNewReg(!issNewReg)}
|
||||
>
|
||||
신규등록
|
||||
</Button>
|
||||
</SearchFormRight>
|
||||
</SearchDiv>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-6 gap-4 ">
|
||||
<div className="col-span-4">
|
||||
<ListDiv>
|
||||
<UiTable
|
||||
tableData={bdstTable || []}
|
||||
headlist={rswt.upHeadList}
|
||||
pageSize={100}
|
||||
total={10}
|
||||
headName={"○건축물 목록"}
|
||||
cellClick={cellClick}
|
||||
>
|
||||
{nodeList}
|
||||
</UiTable>
|
||||
</ListDiv>
|
||||
</div>
|
||||
<div className="col-span-2 max-h-full ovreflow-y-scroll">
|
||||
<ListDiv>
|
||||
<ScrollArea>
|
||||
<RswtrRegForm
|
||||
rswtForm={rswtForm ?? ({} as customRswtBdst)}
|
||||
isModal={false}
|
||||
/>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<UiModal
|
||||
body={<BdstReg moType="RST"></BdstReg>}
|
||||
bodyClass="w-[90vw] max-w-none"
|
||||
open={issNewReg}
|
||||
onOpenChange={(open) => {
|
||||
setIsNewReg(open);
|
||||
}}
|
||||
/>
|
||||
<UiModal
|
||||
bodyClass={""}
|
||||
open={bdstChgProps.isOpen}
|
||||
body={
|
||||
<BdstChgModal chgBuilding={bdstChgProps.chgBuilding}></BdstChgModal>
|
||||
}
|
||||
onOpenChange={(open) => {
|
||||
setBdstChgProps({ ...bdstChgProps, isOpen: open });
|
||||
}}
|
||||
/>
|
||||
</ContentsDiv>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
"use client";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import {
|
||||
ContentsDiv,
|
||||
SearchDiv,
|
||||
SearchFormLeft,
|
||||
SearchFormRight,
|
||||
SelectBox,
|
||||
Title,
|
||||
UiModal,
|
||||
UiTable,
|
||||
} from "@common/business_components/ui";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button } from "@common/components/ui";
|
||||
import { headMakeprfmnc } from "../../prfmncReg/chkgdnReg/page";
|
||||
import HeadChModal from "@/components/ui/modal/headChModal/headChModal";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function PbnstSttn() {
|
||||
const { code,pbnStt } = useWrStore((state) => state);
|
||||
|
||||
|
||||
const [isChHead, setIsChHead] = useState(false);
|
||||
const nodeList = headMakeprfmnc(pbnStt.pbnSttHeadList, pbnStt.pbnSttHeadNm);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ContentsDiv>
|
||||
<div className="grid grid-cols-4 gap-4 ">
|
||||
<div className="col-span-4">
|
||||
<Title title={"하수재이용 시설 현황"} />
|
||||
<SearchDiv>
|
||||
<SearchFormLeft>
|
||||
<SelectBox
|
||||
className={"col-span-2 w-full h-full text-2xl"}
|
||||
label={"권역"}
|
||||
selectClass={""}
|
||||
selectArray={code.yn}
|
||||
onSelectValue={() => {}}
|
||||
value={""}
|
||||
/>
|
||||
<SelectBox
|
||||
className={"col-span-2 w-full h-full text-2xl"}
|
||||
label={"단위유역"}
|
||||
selectClass={""}
|
||||
selectArray={code.yn}
|
||||
onSelectValue={() => {}}
|
||||
value={""}
|
||||
/>
|
||||
<SelectBox
|
||||
className={"col-span-2 w-full h-full text-2xl"}
|
||||
label={"중권역"}
|
||||
selectClass={""}
|
||||
selectArray={code.yn}
|
||||
onSelectValue={() => {}}
|
||||
value={""}
|
||||
/>
|
||||
<SelectBox
|
||||
className={"col-span-2 w-full h-full text-2xl"}
|
||||
label={"환경청"}
|
||||
selectClass={""}
|
||||
selectArray={code.yn}
|
||||
onSelectValue={() => {}}
|
||||
value={""}
|
||||
/>
|
||||
<SelectBox
|
||||
className={"col-span-2 w-full h-full text-2xl"}
|
||||
label={"시도"}
|
||||
selectClass={""}
|
||||
selectArray={code.yn}
|
||||
onSelectValue={() => {}}
|
||||
value={""}
|
||||
/>
|
||||
<SelectBox
|
||||
className={"col-span-2 w-full h-full text-2xl"}
|
||||
label={"시군구"}
|
||||
selectClass={""}
|
||||
selectArray={code.yn}
|
||||
onSelectValue={() => {}}
|
||||
value={""}
|
||||
/>
|
||||
</SearchFormLeft>
|
||||
<SearchFormRight>
|
||||
<Button className="mr-4 rounded-lg" onClick={(e) => {}}>
|
||||
조회
|
||||
</Button>
|
||||
<Button className="mr-4 rounded-lg" onClick={() => {}}>
|
||||
다운로드
|
||||
</Button>
|
||||
<Button className="mr-4 rounded-lg" onClick={() => {
|
||||
// setIsChHead(true)
|
||||
}}>
|
||||
조회항목설정
|
||||
</Button>
|
||||
</SearchFormRight>
|
||||
</SearchDiv>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid grid-cols-6 gap-4 ">
|
||||
<div className="col-span-6">
|
||||
<ListDiv>
|
||||
<UiTable
|
||||
headName={undefined}
|
||||
tableData={[]}
|
||||
headlist={pbnStt.pbnSttHeadList}
|
||||
pageSize={0}
|
||||
total={0}
|
||||
cellClick={undefined}
|
||||
onPageChange={function (page: number): void {
|
||||
throw new Error("Function not implemented.");
|
||||
}}
|
||||
>
|
||||
{nodeList}
|
||||
</UiTable>
|
||||
</ListDiv>
|
||||
</div>
|
||||
</div>
|
||||
<UiModal open ={isChHead} onOpenChange ={()=>{setIsChHead(!isChHead)}} bodyClass={""} body={<HeadChModal/>}/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ContentsDiv>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
"use client";
|
||||
|
||||
import { useWrStore } from "@/app/store";
|
||||
import {
|
||||
fcltDiv,
|
||||
type chHeadType,
|
||||
} from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
||||
import {
|
||||
ContentsDiv,
|
||||
SearchDiv,
|
||||
SearchFormLeft,
|
||||
SearchFormRight,
|
||||
SearchInput,
|
||||
SelectBox,
|
||||
Title,
|
||||
UiModal,
|
||||
UiTable,
|
||||
} from "@common/business_components/ui";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button, Input } from "@common/components/ui";
|
||||
import { useState } from "react";
|
||||
import { TableRow, TableHead } from "@common/components";
|
||||
import React from "react";
|
||||
import type { TableUpperProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import RainChkgdTable from "@/components/ui/table/rainChkgd/rainChkgdTable";
|
||||
import RswtChkgdTable from "@/components/ui/table/rswtChkgd/rswtChkgdTable";
|
||||
import ChkgdModal from "@/components/ui/modal/chkgdModal/chkgdModal";
|
||||
import ChkgdExcel from "@/components/ui/modal/chkgdExcel/chkgdExcel";
|
||||
|
||||
export const headMakeprfmnc = (
|
||||
upHeadList: TableUpperProps[],
|
||||
makeHeadNm: chHeadType[]
|
||||
) => {
|
||||
return (
|
||||
<>
|
||||
<TableRow>
|
||||
{upHeadList
|
||||
.filter((data) => data.visible !=false)
|
||||
.map((head: TableUpperProps) =>
|
||||
!head.upSequnce ? (
|
||||
<TableHead
|
||||
className={ `border border-gray-600 px-2 py-1 `}
|
||||
rowSpan={2} key={head.id}>
|
||||
{head.title}
|
||||
</TableHead>
|
||||
) : head.upSequnce === 1 ? (
|
||||
<TableHead
|
||||
className={ `border border-gray-600 px-2 py-1 `}
|
||||
key={head.id}
|
||||
rowSpan={1}
|
||||
colSpan={
|
||||
makeHeadNm.find((ch) => ch.headNm === head.upName)?.length
|
||||
}
|
||||
>
|
||||
{makeHeadNm.find((ch) => ch.headNm === head.upName)?.text}
|
||||
</TableHead>
|
||||
) : null
|
||||
)}
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
{upHeadList
|
||||
.filter((data) => data.visible !=false)
|
||||
.map((head: TableUpperProps) =>
|
||||
makeHeadNm.find((ch) => ch.headNm === head.upName) ? (
|
||||
<TableHead
|
||||
className={ `border border-gray-600 px-2 py-1 `}
|
||||
key={head.id}>{head.title}</TableHead>
|
||||
) : null
|
||||
)}
|
||||
</TableRow>
|
||||
</>
|
||||
);
|
||||
};
|
||||
//-----------------------
|
||||
export default function Page() {
|
||||
const [isDetail, setIsDetail] = useState(false);
|
||||
const [isExcel, setIsExcel] = useState(false);
|
||||
|
||||
|
||||
|
||||
const [testObj, setTestObj] = useState({});
|
||||
|
||||
const [selFcltDiv, setSelFcltDiv] = useState("RST");
|
||||
|
||||
const cellClick = () => {
|
||||
const ch = { bdstNm: "test", chckYmd: "2022-10-10" };
|
||||
setTestObj(ch);
|
||||
};
|
||||
|
||||
return (
|
||||
<ContentsDiv>
|
||||
<div className="grid grid-cols-4 gap-4 ">
|
||||
<div className="col-span-4">
|
||||
<Title title={"지도점검 결과 등록 "} />
|
||||
<SearchDiv>
|
||||
<SearchFormLeft>
|
||||
<SearchInput
|
||||
className="col-span-3 my-7"
|
||||
label=" 지도점검년도"
|
||||
textValue={""}
|
||||
setText={(e) => {}}
|
||||
/>
|
||||
<SelectBox
|
||||
className={"col-span-3 w-full h-full text-2xl"}
|
||||
label={"시설구분"}
|
||||
selectClass={""}
|
||||
selectArray={fcltDiv}
|
||||
onSelectValue={setSelFcltDiv}
|
||||
value={selFcltDiv ?? fcltDiv[0]?.val}
|
||||
/>
|
||||
</SearchFormLeft>
|
||||
<SearchFormRight>
|
||||
<Button
|
||||
className="mr-4 rounded-lg"
|
||||
onClick={(e) => {
|
||||
cellClick()
|
||||
setIsDetail(!isDetail);
|
||||
}}
|
||||
>
|
||||
조회
|
||||
</Button>
|
||||
<Button className="mr-4 rounded-lg" onClick={() => {}}>
|
||||
삭제
|
||||
</Button>
|
||||
<Button className="mr-4 rounded-lg" onClick={() => {}}>
|
||||
저장
|
||||
</Button>
|
||||
<Button className="mr-4 rounded-lg" onClick={() => {}}>
|
||||
결과등록
|
||||
</Button>
|
||||
<Button className="mr-4 rounded-lg"
|
||||
onClick={() => {
|
||||
setIsExcel(!isDetail);
|
||||
}}>
|
||||
양식받기
|
||||
</Button>
|
||||
</SearchFormRight>
|
||||
</SearchDiv>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid grid-cols-6 gap-4 ">
|
||||
<div className="col-span-6">
|
||||
<ListDiv>
|
||||
{selFcltDiv === "RNB" ? <RainChkgdTable /> : <RswtChkgdTable />}
|
||||
</ListDiv>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<UiModal
|
||||
open={isDetail}
|
||||
onOpenChange={setIsDetail}
|
||||
bodyClass={"w-[40vw] max-w-none"}
|
||||
body={<ChkgdModal type={selFcltDiv} obj={testObj}></ChkgdModal>}
|
||||
/>
|
||||
|
||||
<UiModal open={isExcel}
|
||||
onOpenChange={setIsExcel}
|
||||
bodyClass={"w-[40vw] max-w-none"}
|
||||
body={<ChkgdExcel type={selFcltDiv}></ChkgdExcel>}
|
||||
/>
|
||||
</ContentsDiv>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
import { getFectch } from "@/components/lib/api";
|
||||
|
||||
// Description: 공통코드
|
||||
export type selectArray = {
|
||||
text: string;
|
||||
val: string | number;
|
||||
};
|
||||
|
||||
export const yn :selectArray[]=[
|
||||
{val:'Y', text:'Y'},
|
||||
{val:'N', text:'N'},
|
||||
]
|
||||
|
||||
//공통 건축물 용도
|
||||
export const bdstUsgCd: selectArray[] = [
|
||||
{ val: 1, text: "운동장" },
|
||||
{ val: 2, text: "체육관" },
|
||||
{ val: 3, text: "공공업무시설" },
|
||||
{ val: 4, text: "공공기관의청사" },
|
||||
{ val: 5, text: "아파트" },
|
||||
{ val: 6, text: "연립주택" },
|
||||
{ val: 7, text: "다세대주택" },
|
||||
{ val: 8, text: "기숙사" },
|
||||
{ val: 9, text: "초등학교" },
|
||||
{ val: 10, text: "중학교" },
|
||||
{ val: 11, text: "고등학교" },
|
||||
{ val: 12, text: "전문대학" },
|
||||
{ val: 13, text: "대학및대학교" },
|
||||
{ val: 14, text: "골프장" },
|
||||
{ val: 15, text: "대규모점포" },
|
||||
{ val: 16, text: "기타" },
|
||||
];
|
||||
//빗물 집수면 종류 용도
|
||||
export const rainFcltCd = [
|
||||
{ val: "1", text: "지붕" },
|
||||
{ val: "2", text: "건물옥상" },
|
||||
{ val: "3", text: "골프장 연못" },
|
||||
{ val: "4", text: "운동장 바닥" },
|
||||
{ val: "5", text: "운동장 지붕" },
|
||||
{ val: "6", text: "주차장" },
|
||||
{ val: "7", text: "태양광패널" },
|
||||
{ val: "8", text: "연못" },
|
||||
{ val: "9", text: "기타" },
|
||||
{ val: "10", text: "확인불가" },
|
||||
];
|
||||
// 중수도 필수 원수종류
|
||||
export const rswtBdstType: selectArray[] = [
|
||||
{ text: "숙박업", val: 17 },
|
||||
{ text: "목욕장업", val: 18 },
|
||||
{ text: "공장", val: 19 },
|
||||
{ text: "발전시설", val: 20 },
|
||||
{ text: "관광단지개발사업", val: 21 },
|
||||
{ text: "도시개발사업", val: 22 },
|
||||
{ text: "산업단지개발사업", val: 23 },
|
||||
{ text: "택지개발사업", val: 24 },
|
||||
{ text: "대규모점포(대형마트)", val: 25 },
|
||||
{ text: "대규모점포(전문점)", val: 26 },
|
||||
{ text: "대규모점포(백화점)", val: 27 },
|
||||
{ text: "대규모점포(쇼핑센터)", val: 28 },
|
||||
{ text: "대규모점포(복합쇼핑몰)", val: 29 },
|
||||
{ text: "물류시설", val: 30 },
|
||||
{ text: "운수시설(여객자동차터미널)", val: 31 },
|
||||
{ text: "운수시설(철도시설)", val: 32 },
|
||||
{ text: "운수시설(공항시설)", val: 33 },
|
||||
{ text: "운수시설(항만시설)", val: 34 },
|
||||
{ text: "업무시설(공공업무시설)", val: 35 },
|
||||
{ text: "업무시설(금융업소)", val: 36 },
|
||||
{ text: "업무시설(사무소)", val: 37 },
|
||||
{ text: "업무시설(결혼상담소 등 소개업소)", val: 38 },
|
||||
{ text: "업무시설(출판사)", val: 39 },
|
||||
{ text: "업무시설(신문사)", val: 40 },
|
||||
{ text: "업무시설(오피스텔)", val: 41 },
|
||||
{ text: "교정시설", val: 42 },
|
||||
{ text: "방송국", val: 43 },
|
||||
{ text: "전신전화국", val: 44 },
|
||||
{ text: "기타", val: 45 },
|
||||
];
|
||||
|
||||
const orgwtKndCd = [
|
||||
{ text: "오수(변기 오수 제외)", val: "1" },
|
||||
{ text: "오수", val: "2" },
|
||||
{ text: "폐수", val: "3" },
|
||||
{ text: "오수 및 폐수", val: "4" },
|
||||
{ text: "기타", val: "5" },
|
||||
];
|
||||
|
||||
export const chBuCd = [
|
||||
{ val: "증축", text: "증축" },
|
||||
{ val: "개축", text: "개축" },
|
||||
{ val: "재축", text: "재축" },
|
||||
]
|
||||
|
||||
|
||||
|
||||
export type comCodeState = {
|
||||
code: {
|
||||
isInit: boolean;
|
||||
chBuCd:selectArray[]
|
||||
rainFcltCd: selectArray[];
|
||||
bdstUsgCd: selectArray[];
|
||||
cityCd: selectArray[];
|
||||
sggCd: selectArray[];
|
||||
orgwtKndCd:selectArray[];
|
||||
yn:selectArray[];
|
||||
};
|
||||
};
|
||||
|
||||
export type comCodeType = comCodeState & comCodeActions;
|
||||
|
||||
export const getSggCd = async (set: any) => {
|
||||
const sgg = await getFectch("common", "/addr/sgg");
|
||||
const sggCd = sgg.map((item: any) => ({
|
||||
val: Number(item.adstDstrCd),
|
||||
text: item.gugun,
|
||||
}));
|
||||
set((state: comCodeState) => ({
|
||||
code: {
|
||||
...state.code,
|
||||
sggCd: sggCd,
|
||||
},
|
||||
}));
|
||||
};
|
||||
export const getCityCd = async (set: any) => {
|
||||
const city = await getFectch("common", "/addr/city");
|
||||
const cityCd = city.map((item: any) => ({
|
||||
val: Number(item.adstDstrCd),
|
||||
text: item.sido,
|
||||
}));
|
||||
cityCd.unshift({val:0,text:'전체'})
|
||||
set((state: comCodeState) => ({
|
||||
code: {
|
||||
...state.code,
|
||||
cityCd: cityCd,
|
||||
},
|
||||
}));
|
||||
};
|
||||
|
||||
export const comCodeStateExport: comCodeState = {
|
||||
code: {
|
||||
isInit: false,
|
||||
rainFcltCd: rainFcltCd,
|
||||
bdstUsgCd: bdstUsgCd,
|
||||
chBuCd:chBuCd,
|
||||
orgwtKndCd:orgwtKndCd,
|
||||
cityCd: [],
|
||||
sggCd: [],
|
||||
yn:yn
|
||||
},
|
||||
};
|
||||
|
||||
export type comCodeActions = {
|
||||
codeInit: () => void;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
export const codeActionExport: (set: any) => comCodeActions = (set: any) => {
|
||||
return {
|
||||
codeInit: async () => {
|
||||
const sgg = await getFectch("common", "/addr/sgg");
|
||||
|
||||
const sggCd = sgg.map((item: any) => ({
|
||||
val: Number(item.adstDstrCd),
|
||||
text: item.gugun,
|
||||
}));
|
||||
|
||||
const city = await getFectch("common", "/addr/city");
|
||||
const cityCd = city.map((item: any) => ({
|
||||
val: Number(item.adstDstrCd),
|
||||
text: item.sido,
|
||||
}));
|
||||
|
||||
return set((state: comCodeState) => ({
|
||||
code: {
|
||||
...state.code,
|
||||
sggCd: sggCd,
|
||||
cityCd: cityCd,
|
||||
},
|
||||
}));
|
||||
},
|
||||
|
||||
divCityCd: async(cd: number) => {
|
||||
set((state: comCodeState) => ({
|
||||
code: {
|
||||
...state.code,
|
||||
sggCd:state.code.sggCd.filter((item) => { return Number(item.val.toString().slice(0,2)) === cd }),
|
||||
},
|
||||
}));
|
||||
},
|
||||
};
|
||||
};
|
||||
@@ -1,4 +1,3 @@
|
||||
'use client'
|
||||
|
||||
import { type ReactNode, createContext, useContext, useRef } from 'react'
|
||||
import { useStore } from 'zustand'
|
||||
@@ -15,12 +14,12 @@ export interface StoreProviderProps {
|
||||
children: ReactNode
|
||||
}
|
||||
|
||||
export const StoreProvider = ({
|
||||
export const StoreProvider = ({
|
||||
children,
|
||||
}: StoreProviderProps) => {
|
||||
const storeRef = useRef<StoreApi>(null)
|
||||
if (!storeRef.current) {
|
||||
storeRef.current = StoreZus()
|
||||
storeRef.current = StoreZus()
|
||||
}
|
||||
return (
|
||||
<StoreContext.Provider value={storeRef.current}>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { selectArray } from "../rainReuseFacilityInsert";
|
||||
import type { selectArray } from "../ruseFcltMng/fcltReg/rainReg";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
import type { TableUpperProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import type { text } from "stream/consumers";
|
||||
import { z } from "zod";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const rainRegExcel =z.object({
|
||||
bdstInfoPk:z.number().default(111111111),
|
||||
chckYmd:z.date().default(new Date()),
|
||||
file: z.instanceof(File).optional()
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
export const fcltDiv=[
|
||||
{val:'RST', text:'중수도시설'},
|
||||
{val:'RNB', text:'빗물이용시설'},
|
||||
]
|
||||
|
||||
|
||||
export type chHeadType={
|
||||
headNm: string;
|
||||
text: string;
|
||||
length: number;
|
||||
}
|
||||
|
||||
export const rainHeadNm:chHeadType[] = [
|
||||
{headNm:"useQuilty", text:"이용수질(필요시)" , length: 4},
|
||||
{headNm:"feeHist", text:"과태료 부과내역" , length: 3},
|
||||
{headNm:"subWater", text:"연간보급수 이용량(m³)" , length: 13},
|
||||
{headNm:"detailQulity", text:"분기" , length: 11}
|
||||
]
|
||||
|
||||
export const rainChkgdnHeadList:TableUpperProps[] = [
|
||||
{ id: "cityText", title: "시도" },
|
||||
{ id: "sggText", title: "시군구" },
|
||||
{ id: "bdstNm", title: "시설명" },
|
||||
{ id: "operMngCd", title: "운영관리형태" },
|
||||
{ id: "flowCheck", title: "유량측정방법" },
|
||||
{ id: "yearFee", title: "연간운영비(원/년)" },
|
||||
{ id: "rainDtnbaOpct", title: "빗물저류조용량(m³)" },
|
||||
{ id: "checkDay", title: "점검일" },
|
||||
{ id: "utztnUsg", title: "이용용도" },
|
||||
|
||||
{ id: "splyUswtrUtztnQnt", title: "연간보급수이용량(m³)" },
|
||||
{ id: "rainUsg", title: "연간빗물이용량(m³)" },
|
||||
{ id: "ph", title: "PH", upName: "useQuilty", upSequnce: 1 },
|
||||
{ id: "trbt", title: "탁도", upName: "useQuilty", upSequnce: 2 },
|
||||
{ id: "grssClfg", title: "총대장균군수", upName: "useQuilty", upSequnce: 3 },
|
||||
{ id: "etc", title: "기타", upName: "useQuilty", upSequnce: 4 },
|
||||
{ id: "dayFee", title: "부과일(위반일)", upName: "feeHist", upSequnce: 1 },
|
||||
{ id: "guilty", title: "위반사항", upName: "feeHist", upSequnce: 2 },
|
||||
{ id: "fee", title: "부과금액(천원)", upName: "feeHist", upSequnce: 3 },
|
||||
];
|
||||
|
||||
export const supWaterHeadList:TableUpperProps[] = [
|
||||
{ id: "utztnUsgTest", title: "이용용도" },
|
||||
{ id: "total", title: "계" ,upName: "subWater", upSequnce: 1 , edit:true},
|
||||
{ id: "sub1", title: "1월" , upName: "subWater", upSequnce: 2 , edit:true},
|
||||
{ id: "sub2", title: "2월", upName: "subWater", upSequnce: 3 , edit:true},
|
||||
{ id: "sub3", title: "3월", upName: "subWater", upSequnce: 4 , edit:true},
|
||||
{ id: "sub4", title: "4월", upName: "subWater", upSequnce: 5 , edit:true},
|
||||
{ id: "sub5", title: "5월", upName: "subWater", upSequnce: 6 , edit:true},
|
||||
{ id: "sub6", title: "6월", upName: "subWater", upSequnce: 7 , edit:true},
|
||||
{ id: "sub7", title: "7월", upName: "subWater", upSequnce: 8 , edit:true},
|
||||
{ id: "sub8", title: "8월", upName: "subWater", upSequnce: 9 , edit:true},
|
||||
{ id: "sub9", title: "9월", upName: "subWater", upSequnce: 10, edit:true },
|
||||
{ id: "sub10", title: "10월", upName: "subWater", upSequnce: 11 , edit:true},
|
||||
{ id: "sub11", title: "11월", upName: "subWater", upSequnce: 12 , edit:true},
|
||||
{ id: "sub12", title: "12월", upName: "subWater", upSequnce: 13 , edit:true},
|
||||
]
|
||||
|
||||
|
||||
export const rswtDetailHeadList:TableUpperProps[] = [
|
||||
{ id: "utztnUsgTest", title: "이용용도" },
|
||||
{ id: "avre", title: "평균" ,upName: "detailQulity", upSequnce: 1 , edit:true},
|
||||
{ id: "grssClfg", title: "총대장균군수" , upName: "detailQulity", upSequnce: 2 , edit:true},
|
||||
{ id: "combResdch", title: "결합잔류염소", upName: "detailQulity", upSequnce: 3 , edit:true},
|
||||
{ id: "trbt", title: "탁도", upName: "detailQulity", upSequnce: 4 , edit:true},
|
||||
{ id: "bod", title: "BOD", upName: "detailQulity", upSequnce: 5 , edit:true},
|
||||
{ id: "smll", title: "냄새", upName: "detailQulity", upSequnce: 6 , edit:true},
|
||||
{ id: "crmty", title: "색도", upName: "detailQulity", upSequnce: 7 , edit:true},
|
||||
{ id: "tn", title: "T-N", upName: "detailQulity", upSequnce: 8 , edit:true},
|
||||
{ id: "tph", title: "T-P", upName: "detailQulity", upSequnce: 9 , edit:true},
|
||||
{ id: "ph", title: "PH", upName: "detailQulity", upSequnce: 10, edit:true },
|
||||
{ id: "clIonQnt", title: "염화물", upName: "detailQulity", upSequnce: 11 , edit:true},
|
||||
]
|
||||
|
||||
|
||||
export const supWaterData =[{
|
||||
utztnUsgTest:'test',
|
||||
total:100,
|
||||
sub1:10,
|
||||
sub2:10,
|
||||
sub3:10,
|
||||
sub4:10,
|
||||
sub5:10,
|
||||
sub6:10,
|
||||
sub7:10,
|
||||
sub8:10,
|
||||
sub9:10,
|
||||
sub10:10,
|
||||
sub11:10,
|
||||
sub12:10,
|
||||
},
|
||||
{
|
||||
utztnUsgTest:'test22',
|
||||
total:10011,
|
||||
sub1:101,
|
||||
sub2:101,
|
||||
sub3:101,
|
||||
sub4:101,
|
||||
sub5:101,
|
||||
sub6:101,
|
||||
sub7:101,
|
||||
sub8:101,
|
||||
sub9:101,
|
||||
sub10:101,
|
||||
sub11:101,
|
||||
sub12:101,
|
||||
}
|
||||
]
|
||||
|
||||
type supWaterDataType ={
|
||||
utztnUsgTest:string,
|
||||
total:number,
|
||||
sub1:number,
|
||||
sub2:number,
|
||||
sub3:number,
|
||||
sub4:number,
|
||||
sub5:number,
|
||||
sub6:number,
|
||||
sub7:number,
|
||||
sub8:number,
|
||||
sub9:number,
|
||||
sub10:number,
|
||||
sub11:number,
|
||||
sub12:number,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// export const rainChkgdnHeadList:TableUpperProps[] = [
|
||||
// { id: "cityText", title: "시도" },
|
||||
// { id: "sggText", title: "시군구" },
|
||||
// { id: "bdstNm", title: "시설명" },
|
||||
// { id: "operMngCd", title: "운영관리형태" },
|
||||
// { id: "flowCheck", title: "유량측정방법" },
|
||||
// { id: "yearFee", title: "연간운영비(원/년)" },
|
||||
// { id: "rainDtnbaOpct", title: "빗물저류조용량(m³)" },
|
||||
// { id: "checkDay", title: "점검일" },
|
||||
// { id: "utztnUsg", title: "이용용도" },
|
||||
// { id: "sub1", title: "1월" , upName: "subWater", upSequnce: 1 },
|
||||
// { id: "sub2", title: "2월", upName: "subWater", upSequnce: 2 },
|
||||
// { id: "sub3", title: "3월", upName: "subWater", upSequnce: 3 },
|
||||
// { id: "sub4", title: "4월", upName: "subWater", upSequnce: 4 },
|
||||
// { id: "sub5", title: "5월", upName: "subWater", upSequnce: 5 },
|
||||
// { id: "sub6", title: "6월", upName: "subWater", upSequnce: 6 },
|
||||
// { id: "sub7", title: "7월", upName: "subWater", upSequnce: 7 },
|
||||
// { id: "sub8", title: "8월", upName: "subWater", upSequnce: 8 },
|
||||
// { id: "sub9", title: "9월", upName: "subWater", upSequnce: 9 },
|
||||
// { id: "sub10", title: "10월", upName: "subWater", upSequnce: 10 },
|
||||
// { id: "sub11", title: "11월", upName: "subWater", upSequnce: 11 },
|
||||
// { id: "sub12", title: "12월", upName: "subWater", upSequnce: 12 },
|
||||
|
||||
// { id: "rain1", title: "1월", upName: "yearRainWater", upSequnce: 1 },
|
||||
// { id: "rain2", title: "2월", upName: "yearRainWater", upSequnce: 2 },
|
||||
// { id: "rain3", title: "3월", upName: "yearRainWater", upSequnce: 3 },
|
||||
// { id: "rain4", title: "4월", upName: "yearRainWater", upSequnce: 4 },
|
||||
// { id: "rain5", title: "5월", upName: "yearRainWater", upSequnce: 5 },
|
||||
// { id: "rain6", title: "6월", upName: "yearRainWater", upSequnce: 6 },
|
||||
// { id: "rain7", title: "7월", upName: "yearRainWater", upSequnce: 7 },
|
||||
// { id: "rain8", title: "8월", upName: "yearRainWater", upSequnce: 8 },
|
||||
// { id: "rain9", title: "9월", upName: "yearRainWater", upSequnce: 9 },
|
||||
// { id: "rain10", title: "10월", upName: "yearRainWater", upSequnce: 10 },
|
||||
// { id: "rain11", title: "11월", upName: "yearRainWater", upSequnce: 11 },
|
||||
// { id: "rain12", title: "12월", upName: "yearRainWater", upSequnce: 12 },
|
||||
|
||||
// { id: "ph", title: "PH", upName: "useQuilty", upSequnce: 1 },
|
||||
// { id: "trbt", title: "탁도", upName: "useQuilty", upSequnce: 2 },
|
||||
// { id: "grssClfg", title: "총대장균군수", upName: "useQuilty", upSequnce: 3 },
|
||||
// { id: "etc", title: "기타", upName: "useQuilty", upSequnce: 4 },
|
||||
|
||||
// { id: "dayFee", title: "부과일(위반일)", upName: "feeHist", upSequnce: 1 },
|
||||
// { id: "guilty", title: "위반사항", upName: "feeHist", upSequnce: 2 },
|
||||
// { id: "fee", title: "부과금액(천원)", upName: "feeHist", upSequnce: 3 },
|
||||
// ];
|
||||
|
||||
|
||||
export type rainChkgdnState = {
|
||||
rainChkgdn: {
|
||||
rainChkgdnHeadList:TableUpperProps[]
|
||||
rainHeadNm:chHeadType[]
|
||||
supWaterHeadList:TableUpperProps[]
|
||||
supWaterData:supWaterDataType[]
|
||||
rswtDetailHeadList:TableUpperProps[]
|
||||
};
|
||||
};
|
||||
|
||||
type rainChkgdnActions = {
|
||||
rainChkgdnInit: (sggCd:string, searchTxt:string, flag:string) => void ;
|
||||
};
|
||||
|
||||
|
||||
export type rainChkgdnType = rainChkgdnState & rainChkgdnActions;
|
||||
|
||||
|
||||
export const rainChkgdnStateExport: rainChkgdnState = {
|
||||
rainChkgdn: {
|
||||
rainChkgdnHeadList:rainChkgdnHeadList,
|
||||
rainHeadNm:rainHeadNm,
|
||||
supWaterHeadList:supWaterHeadList,
|
||||
supWaterData:supWaterData,
|
||||
rswtDetailHeadList:rswtDetailHeadList,
|
||||
},
|
||||
};
|
||||
|
||||
export const rainChkgdnActionsExport: (set: any) => rainChkgdnActions = (
|
||||
set: any
|
||||
) => {
|
||||
return {
|
||||
|
||||
rainChkgdnInit: async(sggCd:string, searchTxt:string ,flg:string ) =>{
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,72 @@
|
||||
import type { TableUpperProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import type { chHeadType } from "../rainChkgdn";
|
||||
|
||||
|
||||
|
||||
export const rswtHeadNm:chHeadType[] = [
|
||||
{headNm:"useQuilty", text:"연간 평균 이용수질" , length: 10},
|
||||
{headNm:"feeHist", text:"과태료 부과내역" , length: 3},
|
||||
]
|
||||
export const rswtChkgdnHeadList: TableUpperProps[] = [
|
||||
{ id: "cityText", title: "시도" },
|
||||
{ id: "sggText", title: "시군구" },
|
||||
{ id: "bdstNm", title: "시설명" },
|
||||
{ id: "operMngCd", title: "운영관리형태" },
|
||||
{ id: "yearFee", title: "연간운영비(원/년)" },
|
||||
{ id: "rainDtnbaOpct", title: "처리용량(m³)" },
|
||||
{ id: "checkDay", title: "점검일" },
|
||||
{id: "checkPoint", title: "채수지점"},
|
||||
{ id: "utztnUsg", title: "이용용도" },
|
||||
{ id: "splyUswtrUtztnQnt", title: "연간보급수이용량(m³)" },
|
||||
{ id: "rswtUsg", title: "연간중수도이용량(m³)" },
|
||||
|
||||
|
||||
{ id: "grssClfgUswtr", title: "총대장균군수", upName: "useQuilty", upSequnce: 1 },
|
||||
{ id: "combResdch", title: "결합잔류염소", upName: "useQuilty", upSequnce: 2 },
|
||||
{ id: "trbt", title: "탁도", upName: "useQuilty", upSequnce: 3 },
|
||||
{ id: "bod", title: "BOD", upName: "useQuilty", upSequnce: 4 },
|
||||
{ id: "smll", title: "냄새", upName: "useQuilty", upSequnce: 5 },
|
||||
{ id: "crmty", title: "색도", upName: "useQuilty", upSequnce: 6 },
|
||||
{ id: "tn", title: "T-N", upName: "useQuilty", upSequnce: 7 },
|
||||
{ id: "tph", title: "T-P", upName: "useQuilty", upSequnce: 8 },
|
||||
{ id: "ph", title: "PH", upName: "useQuilty", upSequnce: 9 },
|
||||
{ id: "clIonQnt", title: "염화물", upName: "useQuilty", upSequnce: 10 },
|
||||
|
||||
|
||||
|
||||
{ id: "dayFee", title: "부과일(위반일)", upName: "feeHist", upSequnce: 1 },
|
||||
{ id: "guilty", title: "위반사항", upName: "feeHist", upSequnce: 2 },
|
||||
{ id: "fee", title: "부과금액(천원)", upName: "feeHist", upSequnce: 3 },
|
||||
|
||||
|
||||
];
|
||||
|
||||
export type rswtChkgdnState = {
|
||||
rswtChkgdn: {
|
||||
rswtChkgdnHeadList: TableUpperProps[];
|
||||
rswtHeadNm:chHeadType[];
|
||||
};
|
||||
};
|
||||
|
||||
type rswtChkgdnActions = {
|
||||
rswtChkgdnInit: (sggCd: string, searchTxt: string, flag: string) => void;
|
||||
};
|
||||
|
||||
export type rswtChkgdnType = rswtChkgdnState & rswtChkgdnActions;
|
||||
|
||||
export const rswtChkgdnStateExport: rswtChkgdnState = {
|
||||
rswtChkgdn: {
|
||||
rswtChkgdnHeadList: rswtChkgdnHeadList,
|
||||
rswtHeadNm:rswtHeadNm
|
||||
},
|
||||
};
|
||||
|
||||
export const rswtChkgdnActionsExport: (set: any) => rswtChkgdnActions = (
|
||||
set: any
|
||||
) => {
|
||||
return {
|
||||
rswtChkgdnInit: async (sggCd: string, searchTxt: string, flg: string) => {
|
||||
|
||||
},
|
||||
};
|
||||
};
|
||||
@@ -1,178 +0,0 @@
|
||||
import type { TableUpperProps } from "../rainReuseFacilityInsert";
|
||||
|
||||
export type TableProps = {
|
||||
id: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
export type selectLabel={
|
||||
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
|
||||
|
||||
|
||||
}
|
||||
type pubMngFacData = {
|
||||
mng: string,
|
||||
subCo: string,
|
||||
startDay: string,
|
||||
endDay: string,
|
||||
}
|
||||
const selectLabel:selectLabel[]=[
|
||||
{text:'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: '재이용여부' },
|
||||
{ id: "authoDay", title: '등록여부'}];
|
||||
|
||||
|
||||
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가",
|
||||
locationgubun: "500",
|
||||
facilityCapacity: "800,000",
|
||||
yn: "Y",
|
||||
authoDay: "2012",
|
||||
area:"123"
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
const erctUswtrCd:selectLabel[]=[
|
||||
{text:'처리장연계',val:'1_erct'},
|
||||
{text:'자체/연계',val:'2_erct'},
|
||||
{text:'자체처리',val:'3_erct'},
|
||||
]
|
||||
|
||||
const cyclCd :selectLabel[]= [
|
||||
{ text: "1차", val: "1_cyc" },
|
||||
{ text: "2차", val: "2_cyc" },
|
||||
];
|
||||
const seCd :selectLabel[] = [
|
||||
{ text: "신규", val: "1_Se" },
|
||||
{ text: "진행", val: "2_Se" },
|
||||
];
|
||||
const buseCd :selectLabel[]= [
|
||||
{ text: "재정", val: "1_bus" },
|
||||
{ text: "만루", val: "2_bus" },
|
||||
];
|
||||
const rprcsCd :selectLabel[] = [
|
||||
{ text: "물리적처리", val: "1_rprc" },
|
||||
{ text: "생물학적처리", val: "2_rprc" },
|
||||
];
|
||||
const buseMet :selectLabel[] = [
|
||||
{ text: "재정", val: "1_busemet" },
|
||||
{ text: "민간투자", val: "2_busemet" },
|
||||
{ text: "자체", val: "3_busemet" },
|
||||
];
|
||||
const rprcLoCd :selectLabel[] = [
|
||||
{ text: "내부", val: "1_rprc" },
|
||||
{ text: "외부", val: "2_rprc" },
|
||||
];
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
export type pubFacType = pubFacState & pubFacActions;
|
||||
|
||||
export const pubFacStateExport:pubFacState= {pubFac:{
|
||||
isInit:false,
|
||||
pubFacHeadList: pubFacHeadList,
|
||||
pubMngUpHeadList:pubMngUpHeadList,
|
||||
publicReuseFacilityData: publicReuseFacilityData,
|
||||
selectLabel:selectLabel,
|
||||
pubMngFacData:pubMngFacData,
|
||||
erctUswtrCd:erctUswtrCd,
|
||||
cyclCd:cyclCd,
|
||||
seCd:seCd,
|
||||
buseCd:buseCd,
|
||||
rprcsCd:rprcsCd,
|
||||
buseMet:buseMet,
|
||||
rprcLoCd:rprcLoCd
|
||||
}}
|
||||
export const pubFacActionsExport:(set:any)=>pubFacActions=(set: any) => {
|
||||
return {
|
||||
decrementList:()=>set(
|
||||
(state:pubFacState) => {
|
||||
return (
|
||||
{pubFac:{
|
||||
pubFacheadList: state.pubFac.pubFacHeadList,
|
||||
publicReuseFacilityUper:
|
||||
state.pubFac.publicReuseFacilityData.slice(0, state.pubFac.publicReuseFacilityData.length - 1)
|
||||
}})}
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
|
||||
export type TableUpperProps = {
|
||||
id: string;
|
||||
title: string;
|
||||
upName?: string;
|
||||
upSequnce?: number;
|
||||
}
|
||||
export type rainFacOfType = {
|
||||
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,
|
||||
}
|
||||
|
||||
export 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 rainOfObject:rainFacOfType[] = [
|
||||
{
|
||||
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 selectArray ={
|
||||
text:string,
|
||||
val:string
|
||||
|
||||
}
|
||||
|
||||
export const selectClass ="w-full h-full text-2xl";
|
||||
const selectHomeWater = [
|
||||
{ text: '집수면', val: "1" },
|
||||
{ text: "종류", val: "2" },
|
||||
];
|
||||
|
||||
const selectYN= [
|
||||
{ text: 'Y', val: "1" },
|
||||
{ text: 'N', val: "2" },
|
||||
];
|
||||
|
||||
export type rainFacState ={ rain:{
|
||||
isInit: boolean;
|
||||
upHeadList: TableUpperProps[];
|
||||
rainOfObject: rainFacOfType[];
|
||||
selectHomeWater:selectArray[];
|
||||
selectYN:selectArray[];
|
||||
}}
|
||||
type rainFacSActions = {
|
||||
decrementList: () => void
|
||||
}
|
||||
|
||||
export type rainFacType = rainFacState & rainFacSActions;
|
||||
|
||||
export const rainFacStateExport:rainFacState= {rain:{
|
||||
isInit:false,
|
||||
upHeadList: upHeadList,
|
||||
rainOfObject: rainOfObject,
|
||||
selectHomeWater:selectHomeWater,
|
||||
selectYN:selectYN
|
||||
|
||||
|
||||
}}
|
||||
export const rainFacActionsExport:(set:any)=>rainFacSActions=(set: any) => {
|
||||
return {
|
||||
decrementList:()=>set(
|
||||
(state:rainFacState) => {
|
||||
return (
|
||||
{rain:{
|
||||
upHeadList: state.rain.upHeadList,
|
||||
rainOfObject:
|
||||
state.rain.rainOfObject.slice(0, state.rain.rainOfObject.length - 1)
|
||||
}})}
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
import { upHeadList, type rainFacOfType, type selectArray, type TableUpperProps } from "../rainReuseFacilityInsert";
|
||||
|
||||
|
||||
const rswtOfObject:rainFacOfType[] = [
|
||||
{
|
||||
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"
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
const selectHomeWater = [
|
||||
{ text: '집수면', val: "1" },
|
||||
{ text: "종류", val: "2" },
|
||||
];
|
||||
|
||||
const selectYN= [
|
||||
{ text: 'Y', val: "1" },
|
||||
{ text: 'N', val: "2" },
|
||||
];
|
||||
|
||||
export type rswtFacState ={ rswt:{
|
||||
isInit: boolean;
|
||||
upHeadList: TableUpperProps[];
|
||||
rswtOfObject: rainFacOfType[];
|
||||
selectHomeWater:selectArray[];
|
||||
selectYN:selectArray[];
|
||||
}}
|
||||
type rswtFacSActions = {
|
||||
decrementList: () => void
|
||||
}
|
||||
|
||||
export type rswtFacType = rswtFacState & rswtFacSActions;
|
||||
|
||||
export const rswtFacStateExport:rswtFacState= {rswt:{
|
||||
isInit:false,
|
||||
upHeadList: upHeadList,
|
||||
rswtOfObject: rswtOfObject,
|
||||
selectHomeWater:selectHomeWater,
|
||||
selectYN:selectYN
|
||||
|
||||
|
||||
}}
|
||||
export const rswtFacActionsExport:(set:any)=>rswtFacSActions=(set: any) => {
|
||||
return {
|
||||
decrementList:()=>set(
|
||||
(state:rswtFacState) => {
|
||||
return (
|
||||
{rain:{
|
||||
upHeadList: state.rswt.upHeadList,
|
||||
rainOfObject:
|
||||
state.rswt.rswtOfObject.slice(0, state.rswt.rswtOfObject.length - 1)
|
||||
}})}
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
import { getFectch } from "@/components/lib/api";
|
||||
import type { bdstAll } from "../rainReg";
|
||||
import type { TableProps } from "../pbnstReg";
|
||||
|
||||
type TableUpperProps = {
|
||||
id: string;
|
||||
title: string;
|
||||
upName?: string;
|
||||
upSequnce?: number;
|
||||
};
|
||||
const moUpHeadList: TableUpperProps[] = [
|
||||
{ id: "cityText", title: "시도" },
|
||||
{ id: "sggText", title: "시군구" },
|
||||
{ id: "bdstNm", title: "시설명" },
|
||||
{ id: "daddr", title: "위치" },
|
||||
{ id: "frstArchPrmsnDt", title: "최초건축허가일" },
|
||||
{ id: "archArea", title: "건축면적", },
|
||||
{ id: "archChgYn", title: "여부", upName: "upChangeRe", upSequnce: 1 },
|
||||
{ id: "archChgPrmsnDt", title: "허가일", upName: "upChangeRe", upSequnce: 2 },
|
||||
{ id: "archChgArea", title: "면적", upName: "upChangeRe", upSequnce: 3 },
|
||||
];
|
||||
|
||||
|
||||
const bdstChgHeadList: TableProps[] = [
|
||||
{ id: "bdstChgNm", title: "구분" },
|
||||
{ id: "archChgPrmsnDt", title: "허가일" },
|
||||
{ id: "archChgArea", title: "변경면적" },
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
const bdstBase: bdstAll[] = [];
|
||||
|
||||
|
||||
|
||||
export type bdstFulType = bdstState & bdstActions;
|
||||
|
||||
|
||||
export type bdstState = {
|
||||
bdst: {
|
||||
bdstBase: any[];
|
||||
moUpHeadList:TableUpperProps[]
|
||||
bdstChgHeadList:TableProps[]
|
||||
};
|
||||
};
|
||||
|
||||
type bdstActions = {
|
||||
findBdst: (sggCd:string, searchTxt:string, flag:string) => void ;
|
||||
};
|
||||
|
||||
|
||||
const findBdstInfo = async(sggCd:string, searchTxt:string ,flg:string)=>{
|
||||
return await getFectch('wr', `/reuseFc/building/${flg}/${sggCd}`+(searchTxt?`/${searchTxt}`:'' ))
|
||||
|
||||
}
|
||||
|
||||
export const bdstStateExport: bdstState = {
|
||||
bdst: {
|
||||
bdstBase: bdstBase, // Updated to match the array type
|
||||
moUpHeadList:moUpHeadList,
|
||||
bdstChgHeadList:bdstChgHeadList,
|
||||
},
|
||||
};
|
||||
|
||||
export const bdstActionsExport: (set: any) => bdstActions = (
|
||||
set: any
|
||||
) => {
|
||||
return {
|
||||
|
||||
findBdst: async(sggCd:string, searchTxt:string ,flg:string ) =>{
|
||||
try{
|
||||
|
||||
const bdst = await findBdstInfo(sggCd, searchTxt, flg);
|
||||
const makeBdst = bdst.map((item:any) => {
|
||||
return {
|
||||
...item,
|
||||
reuseBuilding:[]
|
||||
};
|
||||
})
|
||||
return set((state:bdstState) =>({
|
||||
...state,
|
||||
bdst:{
|
||||
...state.bdst,
|
||||
bdstBase:makeBdst
|
||||
}
|
||||
|
||||
}))
|
||||
}catch(error1){
|
||||
console.log("error ", error1)
|
||||
|
||||
}finally{
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,271 @@
|
||||
import { getFectch, postFectch, putFectch } from "@/components/lib/api";
|
||||
import { upHeadList, type bdstAll, type chgBuilding, type TableUpperProps } from "../rainReg";
|
||||
|
||||
import { z } from "zod";
|
||||
|
||||
export const hdtflZod = z.object({
|
||||
bdstInfoPk: z.number().nullish(),
|
||||
ctpvCd: z.number().default(0),
|
||||
sggCd: z.number().default(0),
|
||||
daddr: z.string().default(" "),
|
||||
bdstNm: z.string().default(" "),
|
||||
frstArchPrmsnDt: z.date().default(() => new Date()),
|
||||
archChgPrmsnDt: z.date().default(() => new Date()).nullish() ,
|
||||
archArea: z.number().default(0),
|
||||
archChgArea: z.number().nullish().default(0),
|
||||
|
||||
reuseBuilding: z
|
||||
.array(
|
||||
z.object({
|
||||
bdstRuseFcltPk: z.number().nullish(),
|
||||
bdstInfoFk: z.number().nullish(),
|
||||
instlCmptnDt: z.coerce.date().default(() => new Date()),
|
||||
instlCst: z.number().nullish().default(0),
|
||||
operMngCd: z.string().nullish().default(""),
|
||||
anlOperCst: z.number().default(0),
|
||||
instlCstSprtYn: z.string().default(""),
|
||||
instlCstSprtAmt: z.number().nullish().default(0),
|
||||
grntchBdstCertYn: z.string().default(""),
|
||||
grntchBdstCertYr: z
|
||||
.string()
|
||||
.nullish(),
|
||||
grntchBdstCertNo: z.string().nullish().default(""),
|
||||
grntchBdstCertGrd: z.string().nullish().default(""),
|
||||
crgRdctYn: z.string().default(""),
|
||||
crgRdctBss: z.string().nullish().default(""),
|
||||
crgRdctAmt: z.number().nullish().default(0),
|
||||
ruseFcltFlg: z.string().nullish().default(""),
|
||||
bdstUsgCd: z.number().default(0),
|
||||
lawTrgtYn: z.string().default(""),
|
||||
|
||||
// htdflObj 매핑
|
||||
htdflObj: z
|
||||
.object({
|
||||
htdflFcltPk: z.number().nullish(),
|
||||
bdstRuseFcltFk: z.number().nullish(),
|
||||
etgtType: z.string().default(""),
|
||||
fclCpct: z.number().default(0),
|
||||
plwtYn: z.string().default(""),
|
||||
orgwtWtritSpt: z.number().default(0),
|
||||
orgwtOcrnProcs: z.string().default(""),
|
||||
wtritEntrcTp: z.number().max(4, "온도는 100이상이 될 수 없습니다.")
|
||||
.default(0),
|
||||
amtgnr: z.number().default(0),
|
||||
prcsProcsYn: z.string().default(""),
|
||||
prcsFcltCpct: z.number().default(0),
|
||||
fmYn: z.string().default(""),
|
||||
utztnCpct: z.number().default(0),
|
||||
utztnUsg: z.string().default(""),
|
||||
grssClfg: z.number().default(0),
|
||||
combResdch: z.number().default(0),
|
||||
trbt: z.number().default(0),
|
||||
bod: z.number().default(0),
|
||||
smll: z.number().default(0),
|
||||
crmty: z.number().default(0),
|
||||
tn: z.number().default(0),
|
||||
tph: z.number().default(0),
|
||||
ph: z.number().default(0),
|
||||
clIonQnt: z.number().default(0),
|
||||
cdtnv: z.number().default(0),
|
||||
emsnExitTp: z.number().default(0),
|
||||
})
|
||||
.default({}),
|
||||
})
|
||||
)
|
||||
.default([]),
|
||||
chgBuilding: z
|
||||
.array(
|
||||
z.object({
|
||||
bdstInfoFk: z.number().nullish(),
|
||||
archChgPrmsnDt: z.coerce.date() ,
|
||||
archChgArea: z.string().default("-"),
|
||||
bdstChgNm: z.string().default(""),
|
||||
})
|
||||
)
|
||||
.default([]),
|
||||
});
|
||||
|
||||
export type customHtdflBdst = Omit<bdstAll, 'reuseBuilding'> & {
|
||||
reuseBuilding: htdflReuseBuilding[];
|
||||
};
|
||||
|
||||
//export type customHtdflBdst = z.infer<typeof hdtflZod>;
|
||||
|
||||
// 타입을 조드로 만들어가 하는ㅓㄹ로 테트
|
||||
export type htdflReuseBuilding = {
|
||||
bdstRuseFcltPk: number | undefined;
|
||||
bdstInfoFk: number | undefined;
|
||||
instlCmptnDt: Date | undefined;
|
||||
instlCst: number | undefined;
|
||||
operMngCd: string;
|
||||
anlOperCst: number | undefined;
|
||||
instlCstSprtYn: string | undefined;
|
||||
instlCstSprtAmt: number | undefined;
|
||||
grntchBdstCertYn: string | undefined;
|
||||
grntchBdstCertYr: string | undefined;
|
||||
grntchBdstCertNo: string | undefined;
|
||||
grntchBdstCertGrd: string | undefined;
|
||||
crgRdctYn: string;
|
||||
crgRdctBss: string | undefined;
|
||||
crgRdctAmt: number | undefined;
|
||||
ruseFcltFlg: string;
|
||||
bdstUsgCd: number | undefined;
|
||||
lawTrgtYn: string;
|
||||
htdflObj: htdflObj;
|
||||
};
|
||||
|
||||
export type htdflObj = {
|
||||
htdflFcltPk: number;
|
||||
bdstRuseFcltFk: number;
|
||||
etgtType: string;
|
||||
fclCpct: number | undefined;
|
||||
plwtYn: string;
|
||||
orgwtWtritSpt: number | undefined;
|
||||
orgwtOcrnProcs: string;
|
||||
wtritEntrcTp: number | undefined;
|
||||
amtgnr: number | undefined;
|
||||
prcsProcsYn: string;
|
||||
prcsFcltCpct: number | undefined;
|
||||
fmYn: string;
|
||||
utztnCpct: number | undefined;
|
||||
utztnUsg: string;
|
||||
grssClfg: number | undefined;
|
||||
combResdch: number | undefined;
|
||||
trbt: number | undefined;
|
||||
bod: number | undefined;
|
||||
smll: number | undefined;
|
||||
crmty: number | undefined;
|
||||
tn: number | undefined;
|
||||
tph: number | undefined;
|
||||
ph: number | undefined;
|
||||
clIonQnt: number | undefined;
|
||||
cdtnv: number | undefined;
|
||||
emsnExitTp: number | undefined;
|
||||
};
|
||||
|
||||
export type htdflFacState = {
|
||||
htdfl: {
|
||||
isInit: boolean;
|
||||
upHeadList: TableUpperProps[];
|
||||
htdflRes: customHtdflBdst[];
|
||||
};
|
||||
};
|
||||
type htdflFacSActions = {
|
||||
initHtdfl: (txt: string | undefined) => void;
|
||||
htdflUpdate:(data: customHtdflBdst) => void;
|
||||
htdflReg:(data: customHtdflBdst) => void;
|
||||
};
|
||||
|
||||
const htdflRes: customHtdflBdst[] = [];
|
||||
|
||||
export type htdflFacType = htdflFacState & htdflFacSActions;
|
||||
|
||||
export const htdflFacStateExport: htdflFacState = {
|
||||
htdfl: {
|
||||
isInit: false,
|
||||
upHeadList: upHeadList,
|
||||
htdflRes: htdflRes,
|
||||
},
|
||||
};
|
||||
|
||||
const initFetch = async (txt: string | undefined) => {
|
||||
const htdflRes = await getFectch(
|
||||
"wr",
|
||||
`/drain/facilityList/1/20/0` + (txt ? `/${txt}` : "")
|
||||
);
|
||||
const chHtdflRes = htdflRes.map((item: customHtdflBdst) => {
|
||||
return {
|
||||
...item,
|
||||
bdstChgYn: item.chgBuilding.length > 0 ? "Y" : "N",
|
||||
};
|
||||
});
|
||||
return chHtdflRes;
|
||||
};
|
||||
export const htdflFacActionsExport: (set: any) => htdflFacSActions = (
|
||||
set: any
|
||||
) => {
|
||||
return {
|
||||
initHtdfl: async (txt: string | undefined) => {
|
||||
try {
|
||||
const htdflRes = await initFetch(txt);
|
||||
set((state: htdflFacState) => {
|
||||
return {
|
||||
...state,
|
||||
htdfl: {
|
||||
...state.htdfl,
|
||||
htdflRes: htdflRes,
|
||||
isInit: false,
|
||||
},
|
||||
};
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
htdflUpdate: async (data: customHtdflBdst) => {
|
||||
try {
|
||||
const res = await putFectch("/drain/facility", data);
|
||||
if (res.ok) {
|
||||
alert(" 수정이 완료되었습니다.");
|
||||
}
|
||||
|
||||
const htdflRes = await initFetch(undefined);
|
||||
set((state: htdflFacState) => ({
|
||||
...state,
|
||||
htdfl: {
|
||||
...state.htdfl,
|
||||
htdflRes: htdflRes,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
} catch (errorUpdate) {
|
||||
alert(
|
||||
"업데이트 오류입니다. " +
|
||||
(errorUpdate instanceof Error ? errorUpdate.message : "")
|
||||
);
|
||||
}
|
||||
},
|
||||
htdflReg: async (data: customHtdflBdst) => {
|
||||
try {
|
||||
const res = await postFectch("/drain/facility", data);
|
||||
if (res.ok) {
|
||||
|
||||
if(data.chgBuilding.length > 0){
|
||||
await res
|
||||
.json()
|
||||
.then((resData: any) => {
|
||||
const chPK = resData?.data?.bdstInfoPk;
|
||||
const makeCh = resData.data.chgBuilding.map(
|
||||
(item: chgBuilding) => ({
|
||||
...item,
|
||||
bdstInfoFk: chPK,
|
||||
})
|
||||
);
|
||||
const chch = postFectch("/reuseFc/chgBuilding", makeCh);
|
||||
return chch;
|
||||
})
|
||||
.then((chch: any) => {
|
||||
if (chch.ok) {
|
||||
alert("등록이 완료되었습니다.");
|
||||
}
|
||||
});
|
||||
}else{
|
||||
alert("등록이 완료되었습니다.");
|
||||
|
||||
}
|
||||
}
|
||||
const htdflRes = await initFetch(undefined);
|
||||
set((state: htdflFacState) => ({
|
||||
...state,
|
||||
htdfl: {
|
||||
...state.htdfl,
|
||||
htdflRes: htdflRes,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
} catch (errorReg) {
|
||||
alert("등록 오류입니다.");
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,258 @@
|
||||
import type { TableUpperProps } from "../rainReg";
|
||||
|
||||
export type TableProps = {
|
||||
id: string;
|
||||
title: string;
|
||||
};
|
||||
|
||||
export type selectLabel = {
|
||||
text: string;
|
||||
val: string;
|
||||
};
|
||||
|
||||
export type publicReuseFacilityType = {
|
||||
sido: string;
|
||||
sigungo: string;
|
||||
facilityName: string;
|
||||
location: string;
|
||||
locationgubun: string;
|
||||
facilityCapacity: string;
|
||||
yn?: string;
|
||||
authoDay?: string;
|
||||
area?: string;
|
||||
reuse?: string;
|
||||
register?: string;
|
||||
swtrmtFcltFk: string;
|
||||
};
|
||||
export type fcltOperInfoType = {
|
||||
mng: string;
|
||||
subCo: string;
|
||||
startDay: string;
|
||||
endDay: string;
|
||||
pbnstRuseFcltPk: string;
|
||||
};
|
||||
|
||||
export type ruseFcltType = {
|
||||
swtrmtFcltFk: string;
|
||||
pbnstRuseFcltPk:string;
|
||||
fcltNm:string;
|
||||
fcltCpct: number;
|
||||
swtrmtCpct: number;
|
||||
ruseCpct:number;
|
||||
splyExtraCpct:number;
|
||||
};
|
||||
const selectLabel: selectLabel[] = [{ text: "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: "재이용여부" },
|
||||
{ id: "authoDay", title: "등록여부" },
|
||||
];
|
||||
|
||||
const ruseFclt: ruseFcltType[] = [
|
||||
{ swtrmtFcltFk: "a", fcltCpct: 1000000, swtrmtCpct: 1000000 ,pbnstRuseFcltPk:'aa',fcltNm:'하수1',ruseCpct: 1, splyExtraCpct: 2 },
|
||||
{ swtrmtFcltFk: "a", fcltCpct: 1300000, swtrmtCpct: 1300000 ,pbnstRuseFcltPk:'ab',fcltNm:'하수2',ruseCpct: 3, splyExtraCpct: 4 },
|
||||
|
||||
{ swtrmtFcltFk: "b", fcltCpct: 2000000, swtrmtCpct: 2000000 ,pbnstRuseFcltPk:'bb',fcltNm:'재이용1',ruseCpct: 1, splyExtraCpct: 2 },
|
||||
{ swtrmtFcltFk: "b", fcltCpct: 2300000, swtrmtCpct: 2300000 ,pbnstRuseFcltPk:'ba',fcltNm:'재이용2' ,ruseCpct: 3, splyExtraCpct: 4 },
|
||||
];
|
||||
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 fcltOperInfo: fcltOperInfoType[] = [
|
||||
{
|
||||
mng: "자체운영",
|
||||
subCo: "-",
|
||||
startDay: "2024-11-11",
|
||||
endDay: "2024-11-20",
|
||||
pbnstRuseFcltPk: "aa",
|
||||
},
|
||||
{
|
||||
mng: "자체운영",
|
||||
subCo: "한국수자원공사",
|
||||
startDay: "2022-11-11",
|
||||
endDay: "2024-09-13",
|
||||
pbnstRuseFcltPk: "aa",
|
||||
},
|
||||
{
|
||||
mng: "자체운영",
|
||||
subCo: "스타벅스",
|
||||
startDay: "2023-11-11",
|
||||
endDay: "2024-02-19",
|
||||
pbnstRuseFcltPk: "bb",
|
||||
},
|
||||
];
|
||||
const publicReuseFacilityData: publicReuseFacilityType[] = [
|
||||
{
|
||||
sido: "서울",
|
||||
sigungo: "강남구",
|
||||
facilityName: "난지",
|
||||
location: "경기도 고양시 덕양구 대차로 4가",
|
||||
locationgubun: "500",
|
||||
facilityCapacity: "800,000",
|
||||
reuse: "Y",
|
||||
register: "Y",
|
||||
swtrmtFcltFk: "a",
|
||||
},
|
||||
{
|
||||
sido: "서울",
|
||||
sigungo: "강남구",
|
||||
facilityName: "여의도 중앙",
|
||||
location: "경기도 고양시 덕양구 대차로 4가",
|
||||
locationgubun: "500",
|
||||
facilityCapacity: "800,000",
|
||||
reuse: "Y",
|
||||
register: "Y",
|
||||
swtrmtFcltFk: "b",
|
||||
},
|
||||
{
|
||||
sido: "서울",
|
||||
sigungo: "강남구",
|
||||
facilityName: "너의 마음속",
|
||||
location: "경기도 고양시 덕양구 대차로 4가",
|
||||
locationgubun: "500",
|
||||
facilityCapacity: "800,000",
|
||||
yn: "Y",
|
||||
authoDay: "2012",
|
||||
area: "123",
|
||||
swtrmtFcltFk: "c",
|
||||
},
|
||||
];
|
||||
|
||||
const erctUswtrCd: selectLabel[] = [
|
||||
{ text: "처리장연계", val: "1_erct" },
|
||||
{ text: "자체/연계", val: "2_erct" },
|
||||
{ text: "자체처리", val: "3_erct" },
|
||||
];
|
||||
|
||||
|
||||
const cyclCd: selectLabel[] = [
|
||||
{ text: "1차", val: "1_cyc" },
|
||||
{ text: "2차", val: "2_cyc" },
|
||||
];
|
||||
const seCd: selectLabel[] = [
|
||||
{ text: "신규", val: "1_Se" },
|
||||
{ text: "진행", val: "2_Se" },
|
||||
];
|
||||
const buseCd: selectLabel[] = [
|
||||
{ text: "재정", val: "1_bus" },
|
||||
{ text: "만루", val: "2_bus" },
|
||||
];
|
||||
const rprcsCd: selectLabel[] = [
|
||||
{ text: "물리적처리", val: "1_rprc" },
|
||||
{ text: "생물학적처리", val: "2_rprc" },
|
||||
];
|
||||
const buseMet: selectLabel[] = [
|
||||
{ text: "재정", val: "1_busemet" },
|
||||
{ text: "민간투자", val: "2_busemet" },
|
||||
{ text: "자체", val: "3_busemet" },
|
||||
];
|
||||
const rprcLoCd: selectLabel[] = [
|
||||
{ text: "내부", val: "1_rprc" },
|
||||
{ text: "외부", val: "2_rprc" },
|
||||
];
|
||||
|
||||
export type pubFacState = {
|
||||
pubFac: {
|
||||
isInit: boolean;
|
||||
pubFacHeadList: TableProps[];
|
||||
pubMngUpHeadList: TableUpperProps[];
|
||||
publicReuseFacilityData: publicReuseFacilityType[];
|
||||
selectLabel: selectLabel[];
|
||||
erctUswtrCd: selectLabel[];
|
||||
cyclCd: selectLabel[];
|
||||
seCd: selectLabel[];
|
||||
buseCd: selectLabel[];
|
||||
rprcsCd: selectLabel[];
|
||||
buseMet: selectLabel[];
|
||||
rprcLoCd: selectLabel[];
|
||||
|
||||
ruseFclt:ruseFcltType[];
|
||||
};
|
||||
pubMng:{
|
||||
//isInit:boolean;
|
||||
fcltOperInfo: fcltOperInfoType[];
|
||||
ruseFclt:ruseFcltType[];
|
||||
}
|
||||
};
|
||||
type pubFacActions = {
|
||||
decrementList: () => void;
|
||||
mngMainValue:(swtrmtFcltFk:string)=> void;
|
||||
mngTableValue:(swtrmtFcltFk:string)=> void;
|
||||
};
|
||||
|
||||
export type pubFacType = pubFacState & pubFacActions;
|
||||
|
||||
export const pubFacStateExport: pubFacState = {
|
||||
pubFac: {
|
||||
isInit: false,
|
||||
pubFacHeadList: pubFacHeadList,
|
||||
pubMngUpHeadList: pubMngUpHeadList,
|
||||
publicReuseFacilityData: publicReuseFacilityData,
|
||||
selectLabel: selectLabel,
|
||||
erctUswtrCd: erctUswtrCd,
|
||||
cyclCd: cyclCd,
|
||||
seCd: seCd,
|
||||
buseCd: buseCd,
|
||||
rprcsCd: rprcsCd,
|
||||
buseMet: buseMet,
|
||||
rprcLoCd: rprcLoCd,
|
||||
ruseFclt:ruseFclt,
|
||||
},
|
||||
pubMng:{
|
||||
// isInit: false,
|
||||
fcltOperInfo: fcltOperInfo,
|
||||
ruseFclt:ruseFclt
|
||||
}
|
||||
};
|
||||
export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => {
|
||||
return {
|
||||
decrementList: () =>
|
||||
set((state: pubFacState) => {
|
||||
return {
|
||||
pubFac: {
|
||||
pubFacheadList: state.pubFac.pubFacHeadList,
|
||||
publicReuseFacilityUper: state.pubFac.publicReuseFacilityData.slice(
|
||||
0,
|
||||
state.pubFac.publicReuseFacilityData.length - 1
|
||||
),
|
||||
},
|
||||
};
|
||||
}),
|
||||
mngMainValue:(swtrmtFcltFk:string)=>
|
||||
set((state:pubFacState)=>{
|
||||
return{
|
||||
|
||||
pubMng:{
|
||||
...state.pubMng,
|
||||
ruseFclt:state.pubMng.ruseFclt.filter((item)=>
|
||||
|
||||
item.swtrmtFcltFk===swtrmtFcltFk
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
}),
|
||||
mngTableValue:(pbnstRuseFcltPk:string)=>
|
||||
set((state:pubFacState)=>{
|
||||
return{
|
||||
pubMng:{
|
||||
...state.pubMng,
|
||||
fcltOperInfo:state.pubMng.fcltOperInfo.filter((item)=>item.pbnstRuseFcltPk===pbnstRuseFcltPk)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,363 @@
|
||||
import type { selectArray } from "@/app/store/common/code";
|
||||
import { getFectch, postFectch, putFectch } from "@/components/lib/api";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
|
||||
|
||||
export const rainZod = z.object({
|
||||
bdstInfoPk: z.number().nullish(),
|
||||
ctpvCd: z.number().default(0),
|
||||
sggCd: z.number().default(0),
|
||||
daddr: z.string().default(""),
|
||||
bdstNm: z.string().default(""),
|
||||
frstArchPrmsnDt: z.date().default(() => new Date()),
|
||||
archChgPrmsnDt: z.coerce.date().nullish().default(null),
|
||||
archArea: z.number().default(0),
|
||||
archChgArea: z.number().default(0),
|
||||
|
||||
reuseBuilding: z.array(
|
||||
z.object({
|
||||
bdstRuseFcltPk: z.number().nullish(),
|
||||
bdstInfoFk:z.number().nullish(),
|
||||
instlCmptnDt: z.coerce.date().default(() => new Date()),
|
||||
instlCst: z.number().default(0),
|
||||
operMngCd: z.string().nullish().default(""),
|
||||
anlOperCst: z.number().default(0),
|
||||
instlCstSprtYn: z.string().default(""),
|
||||
instlCstSprtAmt: z.number().default(0),
|
||||
grntchBdstCertYn: z.string().default(""),
|
||||
grntchBdstCertYr: z.string()
|
||||
.max(4, "4자리 연도를 입력하세요")
|
||||
.regex(/^\d{4}$/, "4자리 연도를 입력하세요")
|
||||
.default(""),
|
||||
grntchBdstCertNo: z.string().default(""),
|
||||
grntchBdstCertGrd: z.string().default(""),
|
||||
crgRdctYn: z.string().default("").nullish(),
|
||||
crgRdctBss: z.string().default("").nullish(),
|
||||
crgRdctAmt: z.number().default(0),
|
||||
ruseFcltFlg: z.string().default(""),
|
||||
bdstUsgCd: z.number().default(0),
|
||||
lawTrgtYn: z.string().default(""),
|
||||
|
||||
rainyObj: z.object({
|
||||
bdstReuseFcltFk: z.number().nullish(),
|
||||
pntfColKnd: z.string().default(""),
|
||||
pntfColArea: z.number().default(0),
|
||||
dtfcltCpct: z.number().default(0),
|
||||
filtrTrtmfctCpct: z.number().default(0),
|
||||
filtrTrtmfctYn: z.string().default(""),
|
||||
filtrTrtmfctPrs: z.string().default(""),
|
||||
annRnwtQty: z.number().default(0),
|
||||
oilqMeasMthd: z.string().default("").nullish()
|
||||
}).default({})
|
||||
})
|
||||
).default([]),
|
||||
|
||||
chgBuilding: z.array(
|
||||
z.object({
|
||||
bdstInfoFk: z.number().nullish(),
|
||||
archChgPrmsnDt: z.coerce.date(),
|
||||
archChgArea: z.string().default("-"),
|
||||
bdstChgNm: z.string().default(""),
|
||||
})
|
||||
).default([])
|
||||
});
|
||||
|
||||
|
||||
|
||||
export type chgBuilding={
|
||||
bdstInfoFk: number|null,
|
||||
archChgPrmsnDt: Date,
|
||||
archChgArea: string,
|
||||
bdstChgNm: string
|
||||
}
|
||||
|
||||
|
||||
export type bdstAll = {
|
||||
bdstInfoPk: number|null;
|
||||
ctpvCd: number;
|
||||
sggCd: number;
|
||||
bdstNm: string;
|
||||
daddr: string;
|
||||
frstArchPrmsnDt: Date;
|
||||
archArea: string;
|
||||
archChgArea: number;
|
||||
reuseBuilding: rainReuseBuilding[];
|
||||
chgBuilding:chgBuilding[]
|
||||
};
|
||||
|
||||
export type customRainBdst = Omit<bdstAll, 'reuseBuilding'> & {
|
||||
reuseBuilding: rainReuseBuilding[];
|
||||
};
|
||||
|
||||
|
||||
export type rainReuseBuilding = {
|
||||
lawTrgtYn: string|undefined;
|
||||
bdstUsgCd: number|undefined;
|
||||
bdstRuseFcltPk: number;
|
||||
bdstInfoFk: number;
|
||||
operMngCd: number;
|
||||
anlOperCst: number;
|
||||
instlCmptnDt: Date|undefined;
|
||||
instlCst: number|undefined;
|
||||
//archChgPrmsnDt: string;
|
||||
instlCstSprtYn: string|undefined;
|
||||
instlCstSprtAmt: number|undefined;
|
||||
grntchBdstCertYn: string|undefined;
|
||||
grntchBdstCertNo: string|undefined;
|
||||
grntchBdstCertGrd: string|undefined;
|
||||
grntchBdstCertYr: string|undefined;
|
||||
rainyObj: rainyObj | null;
|
||||
};
|
||||
export type rainyObj = {
|
||||
bdstReuseFcltFk: number;
|
||||
pntfColKnd: string | undefined;
|
||||
pntfColArea: number | undefined;
|
||||
dtfcltCpct: number;
|
||||
filtrTrtmfctCpct: number | undefined;
|
||||
filtrTrtmfctYn: string | undefined;
|
||||
filtrTrtmfctPrs: string | undefined;
|
||||
annRnwtQty: number;
|
||||
oilqMeasMthd: string | undefined;
|
||||
};
|
||||
|
||||
export type TableUpperProps = {
|
||||
id: string;
|
||||
title: string;
|
||||
upName?: string;
|
||||
upSequnce?: number;
|
||||
edit?:boolean;
|
||||
visible?:boolean;
|
||||
};
|
||||
|
||||
|
||||
export const upHeadList: TableUpperProps[] = [
|
||||
{ id: "cityText", title: "시도" },
|
||||
{ id: "sggText", title: "시군구" },
|
||||
{ id: "bdstNm", title: "시설명" },
|
||||
{ id: "daddr", title: "위치" },
|
||||
{ id: "bdsgUsgText", title: "건축물용도" },
|
||||
// { id: "bdstUsgCd", title: "건축물용도" },
|
||||
{ id: "frstArchPrmsnDt", title: "최초건축허가일" },
|
||||
{ id: "archArea", title: "건축면적" },
|
||||
{ id: "lawTrgtYn", title: "법적의무대상여부" },
|
||||
{ id: "bdstChgYn", title: "건축물변경여부" },
|
||||
// { id: "archChgPrmsnDt", title: "허가일", upName: "upChangeRe", upSequnce: 2 },
|
||||
// { id: "archChgArea", title: "면적", upName: "upChangeRe", upSequnce: 3 },
|
||||
];
|
||||
|
||||
const rainRes: customRainBdst[] = [];
|
||||
|
||||
|
||||
const regRainForm:customRainBdst = {
|
||||
ctpvCd: 0,
|
||||
sggCd: 0,
|
||||
bdstNm: "",
|
||||
daddr: "",
|
||||
frstArchPrmsnDt:new Date(),
|
||||
archArea: "",
|
||||
archChgArea: 0,
|
||||
bdstInfoPk: 0,
|
||||
reuseBuilding: [{
|
||||
rainyObj: {
|
||||
bdstReuseFcltFk: 0,
|
||||
pntfColKnd: undefined,
|
||||
pntfColArea: undefined,
|
||||
dtfcltCpct: 0,
|
||||
filtrTrtmfctCpct: undefined,
|
||||
filtrTrtmfctYn: undefined,
|
||||
filtrTrtmfctPrs: undefined,
|
||||
annRnwtQty: 0,
|
||||
oilqMeasMthd: undefined
|
||||
},
|
||||
lawTrgtYn: undefined,
|
||||
bdstUsgCd: undefined,
|
||||
bdstRuseFcltPk: 0,
|
||||
bdstInfoFk: 0,
|
||||
operMngCd: 0,
|
||||
anlOperCst: 0,
|
||||
instlCmptnDt: undefined,
|
||||
instlCst: undefined,
|
||||
// archChgPrmsnDt: "",
|
||||
instlCstSprtYn: undefined,
|
||||
instlCstSprtAmt: undefined,
|
||||
grntchBdstCertYn: undefined,
|
||||
grntchBdstCertNo: undefined,
|
||||
grntchBdstCertGrd: undefined,
|
||||
grntchBdstCertYr: undefined
|
||||
}],
|
||||
//추가됨
|
||||
chgBuilding:[{
|
||||
bdstInfoFk: 0,
|
||||
archChgPrmsnDt: new Date(),
|
||||
archChgArea: "-",
|
||||
bdstChgNm: ""
|
||||
|
||||
}]
|
||||
};
|
||||
|
||||
|
||||
|
||||
export const selectClass = "w-full h-full text-2xl";
|
||||
const selectYN = [
|
||||
{ text: "Y", val: "1" },
|
||||
{ text: "N", val: "2" },
|
||||
];
|
||||
export type rainFacState = {
|
||||
rain: {
|
||||
isInit: boolean;
|
||||
upHeadList: TableUpperProps[];
|
||||
selectYN: selectArray[];
|
||||
rainRes: customRainBdst[];
|
||||
regRainForm:customRainBdst,
|
||||
|
||||
};
|
||||
};
|
||||
type rainFacSActions = {
|
||||
init: (txt:string|undefined) => void;
|
||||
rainSearTxt: (txt:string) => void;
|
||||
rainReg: (data: customRainBdst) => void;
|
||||
rainUpdate: (data: customRainBdst) => void;
|
||||
};
|
||||
|
||||
export type rainFacType = rainFacState & rainFacSActions;
|
||||
|
||||
export const rainFacStateExport: rainFacState = {
|
||||
rain: {
|
||||
isInit: false,
|
||||
rainRes: rainRes,
|
||||
upHeadList: upHeadList,
|
||||
selectYN: selectYN,
|
||||
regRainForm:regRainForm,
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
||||
const initFetch = async (txt:string|undefined) => {
|
||||
|
||||
const rainRes =await getFectch("wr", `/reuseFc/rainyInfoList/1/20/41` +(txt? `/${txt}`:''));
|
||||
const chRainRes = rainRes.map((item: customRainBdst) => {
|
||||
return {
|
||||
...item,
|
||||
bdstChgYn: item.chgBuilding.length > 0 ? "Y" : "N",
|
||||
} })
|
||||
return chRainRes;
|
||||
|
||||
|
||||
};
|
||||
export const rainFacActionsExport: (set: any) => rainFacSActions = (
|
||||
set: any
|
||||
) => {
|
||||
return {
|
||||
init: async (txt:string|undefined) => {
|
||||
try {
|
||||
// 파라이터 수정 통합관리자 =0, 시관리자=시코드, 시군구 관리자= 시군구 코드 를 세번째 파라미터로 지정 / 건축물 서치가 있을경우 4번째 파라미터로 던지기 즉 1/20/42(서울시)/영현빌딩 이런식으로)
|
||||
const rainRes = await initFetch(txt);
|
||||
|
||||
|
||||
// 여기서 상태 업데이트
|
||||
return set((state: rainFacState) => ({
|
||||
...state,
|
||||
rain: {
|
||||
...state.rain,
|
||||
rainRes: rainRes,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
} catch (error) {
|
||||
console.log("error", error);
|
||||
} finally {
|
||||
console.log("finally");
|
||||
}
|
||||
},
|
||||
rainSearTxt: async(txt:string) =>{
|
||||
try{
|
||||
|
||||
const rainRes = await getFectch('wr' , `/reuseFc/rainyInfoList/1/20/41` +(txt? `/${txt}`:''))
|
||||
set((state: rainFacState) => {
|
||||
return {
|
||||
rain: {
|
||||
...state.rain,
|
||||
rainRes: rainRes,
|
||||
isInit: false,
|
||||
},
|
||||
};
|
||||
})}
|
||||
catch(erTxt){
|
||||
console.log("error", erTxt)
|
||||
}
|
||||
},
|
||||
rainReg: async (data: customRainBdst) => {
|
||||
try {
|
||||
const res = await postFectch("/reuseFc/rainyInfo", data);
|
||||
if(res.ok){
|
||||
|
||||
if(data.chgBuilding.length > 0){
|
||||
await res.json().then((resData: any) => {
|
||||
|
||||
const chPK = resData?.data?.bdstInfoPk
|
||||
const makeCh= resData.data.chgBuilding.map((item: chgBuilding) =>
|
||||
( {
|
||||
...item,
|
||||
bdstInfoFk: chPK,
|
||||
})
|
||||
);
|
||||
const chch= postFectch("/reuseFc/chgBuilding", makeCh);
|
||||
return chch;
|
||||
}).then((chch: any) => {
|
||||
if(chch.ok) {
|
||||
alert("등록이 완료되었습니다.");
|
||||
|
||||
}
|
||||
})
|
||||
}else{
|
||||
alert("등록이 완료되었습니다.");
|
||||
}
|
||||
}
|
||||
const rainRes = await initFetch(undefined);
|
||||
set((state: rainFacState) => ({
|
||||
...state,
|
||||
rain: {
|
||||
...state.rain,
|
||||
rainRes: rainRes,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
} catch (e) {
|
||||
console.log("e", e);
|
||||
alert("등록 오류입니다.");
|
||||
} finally {
|
||||
}
|
||||
},
|
||||
rainUpdate: async (data: customRainBdst) => {
|
||||
try {
|
||||
console.log("data ", data)
|
||||
const res = await putFectch("/reuseFc/rainyInfo", data);
|
||||
console.log('rainUpdate', res);
|
||||
if(res.ok){
|
||||
alert(" 수정이 완료되었습니다.")
|
||||
}
|
||||
|
||||
const rainRes = await initFetch(undefined);
|
||||
set((state: rainFacState) => ({
|
||||
...state,
|
||||
rain: {
|
||||
...state.rain,
|
||||
rainRes: rainRes,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
} catch (e) {
|
||||
console.log("e", e);
|
||||
alert("업데이트 오류입니다.");
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
import { getFectch, postFectch, putFectch } from "@/components/lib/api";
|
||||
import { upHeadList, type bdstAll, type chgBuilding, type TableUpperProps } from "../rainReg";
|
||||
import { rswtBdstType } from "@/app/store/common/code";
|
||||
|
||||
import { z } from "zod";
|
||||
|
||||
export const rswtZod = z.object({
|
||||
bdstInfoPk: z.number().nullish(),
|
||||
ctpvCd: z.number().default(0),
|
||||
sggCd: z.number().default(0),
|
||||
daddr: z.string().default(""),
|
||||
bdstNm: z.string().default(""),
|
||||
frstArchPrmsnDt: z.date().default(() => new Date()),
|
||||
archChgPrmsnDt: z.coerce.date().nullish().default(null),
|
||||
|
||||
archArea: z.number().default(0),
|
||||
archChgArea: z.number().default(0),
|
||||
|
||||
reuseBuilding: z.array(
|
||||
z.object({
|
||||
bdstRuseFcltPk: z.number().nullish(),
|
||||
bdstInfoFk: z.number().nullish(),
|
||||
instlCmptnDt: z.coerce.date().default(() => new Date()),
|
||||
instlCst: z.number().default(0),
|
||||
operMngCd: z.string().nullish().default(""),
|
||||
|
||||
anlOperCst: z.number().default(0),
|
||||
instlCstSprtYn: z.string().default(""),
|
||||
instlCstSprtAmt: z.number().default(0),
|
||||
|
||||
grntchBdstCertYn: z.string().default(""),
|
||||
grntchBdstCertYr: z.string().max(4, "4자리 연도를 입력하세요")
|
||||
.regex(/^\d{4}$/, "4자리 연도를 입력하세요")
|
||||
.default(""),
|
||||
grntchBdstCertNo: z.string().default(""),
|
||||
grntchBdstCertGrd: z.string().default(""),
|
||||
|
||||
crgRdctYn: z.string().default(""),
|
||||
crgRdctBss: z.string().default(""),
|
||||
crgRdctAmt: z.number().default(0),
|
||||
ruseFcltFlg: z.string().default(""),
|
||||
bdstUsgCd: z.number().default(0),
|
||||
lawTrgtYn: z.string().default(""),
|
||||
|
||||
rswtrObj: z.object({
|
||||
bdstRuseFcltFk: z.number().nullish(),
|
||||
wtrUsqty: z.number().default(0),
|
||||
oblgTrgtWtrUsqty: z.number().default(0),
|
||||
orgwtKndCd: z.string().default(""),
|
||||
filtrTrtmfctProcs: z.string().default(""),
|
||||
filtrTrtmfctUsgCd: z.string().default(""),
|
||||
rswtrUsqty: z.number().default(0),
|
||||
altUswtrUtztnYn: z.string().default(""),
|
||||
altUswtrKndCd: z.string().default(""),
|
||||
altUswtrUtztnQnt: z.number().default(0),
|
||||
altUswtrIdntyMthdCd: z.string().default("")
|
||||
}).default({})
|
||||
})
|
||||
).default([]),
|
||||
|
||||
chgBuilding: z
|
||||
.array(
|
||||
z.object({
|
||||
bdstInfoFk: z.number().nullish(),
|
||||
archChgPrmsnDt: z.coerce.date() ,
|
||||
archChgArea: z.string().default("-"),
|
||||
bdstChgNm: z.string().default(""),
|
||||
})
|
||||
)
|
||||
.default([]),
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
export type customRswtBdst = Omit<bdstAll, 'reuseBuilding'> & {
|
||||
reuseBuilding: rswtReuseBuilding[];
|
||||
};
|
||||
|
||||
|
||||
|
||||
export type rswtReuseBuilding = {
|
||||
bdstRuseFcltPk: number;
|
||||
bdstInfoFk: number;
|
||||
instlCmptnDt: Date | undefined;
|
||||
instlCst: number | undefined;
|
||||
operMngCd: number;
|
||||
lawTrgtYn: string | undefined;
|
||||
anlOperCst: number;
|
||||
instlCstSprtYn: string | undefined;
|
||||
instlCstSprtAmt: number | undefined;
|
||||
bdstUsgCd: number | undefined;
|
||||
grntchBdstCertYn: string | undefined;
|
||||
grntchBdstCertNo: string | undefined;
|
||||
grntchBdstCertGrd: string | undefined;
|
||||
grntchBdstCertYr: string | undefined;
|
||||
rswtrObj: rswtrObj | null;
|
||||
};
|
||||
export type rswtrObj = {
|
||||
bdstRuseFcltFk: number | undefined;
|
||||
wtrUsqty: number | undefined;
|
||||
oblgTrgtWtrUsqty: number | undefined;
|
||||
orgwtKndCd: string | undefined;
|
||||
filtrTrtmfctProcs: string | undefined;
|
||||
filtrTrtmfctUsgCd: string | undefined;
|
||||
rswtrUsqty: number;
|
||||
altUswtrUtztnYn: string;
|
||||
altUswtrKndCd: string;
|
||||
altUswtrUtztnQnt: number;
|
||||
altUswtrIdntyMthdCd: string;
|
||||
};
|
||||
|
||||
|
||||
const rswtRes: customRswtBdst[] = [];
|
||||
|
||||
export type rswtFacState = {
|
||||
rswt: {
|
||||
isInit: boolean;
|
||||
upHeadList: TableUpperProps[];
|
||||
rswtRes: customRswtBdst[];
|
||||
};
|
||||
};
|
||||
type rswtFacSActions = {
|
||||
initRswt: (txt: string | undefined) => void;
|
||||
rswtUpdate: (data: customRswtBdst) => void;
|
||||
rswtReg: (data: customRswtBdst) => void;
|
||||
};
|
||||
|
||||
export type rswtFacType = rswtFacState & rswtFacSActions;
|
||||
|
||||
export const rswtFacStateExport: rswtFacState = {
|
||||
rswt: {
|
||||
isInit: false,
|
||||
upHeadList: upHeadList,
|
||||
rswtRes: rswtRes,
|
||||
},
|
||||
};
|
||||
|
||||
const initFetch = async (txt: string | undefined) => {
|
||||
const rswtRes =await getFectch(
|
||||
"wr",
|
||||
`/reuseFc/waterreuseFc/1/20/41` + (txt ? `/${txt}` : "")
|
||||
);
|
||||
const chRswtRes = rswtRes.map((item: customRswtBdst) => {
|
||||
return {
|
||||
...item,
|
||||
bdstChgYn: item.chgBuilding.length > 0 ? "Y" : "N",
|
||||
} })
|
||||
return chRswtRes;
|
||||
};
|
||||
export const rswtFacActionsExport: (set: any) => rswtFacSActions = (
|
||||
set: any
|
||||
) => {
|
||||
return {
|
||||
initRswt: async (txt: string | undefined) => {
|
||||
try {
|
||||
const rswtRes = await initFetch(txt);
|
||||
return set((state: rswtFacState) => ({
|
||||
...state,
|
||||
rswt: {
|
||||
...state.rswt,
|
||||
rswtRes: rswtRes,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
rswtUpdate: async (data: customRswtBdst) => {
|
||||
try {
|
||||
const res = await putFectch("/reuseFc/waterreuseFc", data);
|
||||
if (res.ok) {
|
||||
alert("등록이 완료되었습니다.");
|
||||
}
|
||||
const rswtRes = await initFetch(undefined);
|
||||
set((state: rswtFacState) => ({
|
||||
...state,
|
||||
rain: {
|
||||
...state.rswt,
|
||||
rswtRes: rswtRes,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
} catch (errorUpdate) {
|
||||
alert("업데이트 오류입니다. " + (errorUpdate instanceof Error ? errorUpdate.message : ""));
|
||||
} finally {
|
||||
}
|
||||
},
|
||||
rswtReg: async (data: customRswtBdst) => {
|
||||
try {
|
||||
const res = await postFectch("/reuseFc/waterreuseFc", data);
|
||||
if(res.ok){
|
||||
if(data.chgBuilding.length > 0){
|
||||
await res
|
||||
.json()
|
||||
.then((resData: any) => {
|
||||
const chPK = resData?.data?.bdstInfoPk;
|
||||
const makeCh = resData.data.chgBuilding.map(
|
||||
(item: chgBuilding) => ({
|
||||
...item,
|
||||
bdstInfoFk: chPK,
|
||||
})
|
||||
);
|
||||
const chch = postFectch("/reuseFc/chgBuilding", makeCh);
|
||||
return chch;
|
||||
})
|
||||
.then((chch: any) => {
|
||||
if (chch.ok) {
|
||||
alert("등록이 완료되었습니다.");
|
||||
}
|
||||
});
|
||||
}else{
|
||||
alert("등록이 완료되었습니다.");
|
||||
|
||||
}
|
||||
}
|
||||
const rainRes = await initFetch(undefined);
|
||||
set((state: rswtFacState) => ({
|
||||
...state,
|
||||
rain: {
|
||||
...state.rswt,
|
||||
rswtRes: rswtRes,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
} catch (e) {
|
||||
console.log("e", e);
|
||||
alert("등록 오류입니다.");
|
||||
} finally {
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,82 @@
|
||||
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
||||
import type { TableUpperProps } from "../../fcltReg/rainReg";
|
||||
import { z } from "zod";
|
||||
|
||||
export const pbnSttHeadNm:chHeadType[] = [
|
||||
{headNm:"catchment", text:"유역" , length: 3},
|
||||
{headNm:"adminDiv", text:"행정구역" , length: 2},
|
||||
{headNm:"rusSup", text:"재이용수공급가능량" , length: 3},
|
||||
{headNm:"yearResult", text:"연간실적정보(m³)" , length: 3},
|
||||
{headNm:"mngInfo", text:"운영정보" , length: 4}
|
||||
]
|
||||
|
||||
// id는 다확인해야함
|
||||
export const pbnSttHeadList:TableUpperProps[] = [
|
||||
{ id: "a", title: "권역" ,upName:"catchment" ,upSequnce:1,visible:false},
|
||||
{ id: "aaa", title: "단위유역" ,upName:"catchment" ,upSequnce:2 ,visible:false},
|
||||
{ id: "aaaa", title: "중권역" ,upName:"catchment" ,upSequnce:3,visible:false},
|
||||
{ id: "operMngCd", title: "환경청" ,visible:false },
|
||||
{ id: "cityText", title: "시도" ,upName:"adminDiv" ,upSequnce:1,visible:false},
|
||||
{ id: "sggText", title: "시군구" ,upName:"adminDiv" ,upSequnce:2,visible:false},
|
||||
{ id: "bdnstNm", title: "시설명" ,visible:false },
|
||||
{ id: "locDiv", title: "지역구분" ,visible:false },
|
||||
{ id: "phone" , title: "전화번호" ,visible:false },
|
||||
|
||||
{ id: "fcltQuantity", title: "시설용량(톤/일)" ,visible:false},
|
||||
{ id: "rusNm", title: "재이용시설명" ,visible:false},
|
||||
|
||||
|
||||
{ id: "fcltCpct", title: "시설용량(m³/일)", upName: "rusSup", upSequnce: 1 ,visible:false},
|
||||
{ id: "trbt", title: "하수처리량(m³/일)", upName: "rusSup", upSequnce: 2 ,visible:false},
|
||||
{ id: "ruseCpct", title: "재이용량(m³/일)", upName: "rusSup", upSequnce: 3 ,visible:false},
|
||||
|
||||
{ id: "total", title: "합계", upName: "yearResult", upSequnce: 1 ,visible:false},
|
||||
{ id: "ithlWtr", title: "장내용수", upName: "yearResult", upSequnce: 2 ,visible:false},
|
||||
{ id: "othlWtr", title: "장외용수", upName: "yearResult", upSequnce: 3 ,visible:false},
|
||||
|
||||
{ id: "mngMeth", title: "운영방식", upName: "mngInfo", upSequnce: 1 ,visible:false},
|
||||
{ id: "rprtvBzenty", title: "대행업체", upName: "mngInfo", upSequnce: 2 ,visible:false},
|
||||
{ id: "firstDay", title: "시작일", upName: "mngInfo", upSequnce: 3 ,visible:false },
|
||||
{ id: "LastDay", title: "종료일", upName: "mngInfo", upSequnce: 4 ,visible:false},
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export type pbnstSttnState = {
|
||||
pbnStt: {
|
||||
pbnSttHeadList:TableUpperProps[],
|
||||
pbnSttHeadNm:chHeadType[]
|
||||
|
||||
};
|
||||
};
|
||||
type pbnSttActions = {
|
||||
};
|
||||
|
||||
export type pbnSttType = pbnstSttnState & pbnSttActions;
|
||||
|
||||
export const pbnSttStateExport: pbnstSttnState = {
|
||||
pbnStt: {
|
||||
pbnSttHeadList:pbnSttHeadList,
|
||||
pbnSttHeadNm:pbnSttHeadNm
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
||||
export const pbnSttActionsExport: (set: any) => pbnSttActions = (
|
||||
set: any
|
||||
) => {
|
||||
return {
|
||||
|
||||
pbnSttnInit: async(sggCd:string, searchTxt:string ,flg:string ) =>{
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
+84
-17
@@ -1,25 +1,92 @@
|
||||
import { createStore } from 'zustand/vanilla';
|
||||
import { pubFacActionsExport, pubFacStateExport, type pubFacState } from './publicReuseFaciltyInsert/index';
|
||||
import { rainFacActionsExport, rainFacStateExport, type rainFacState, type rainFacType } from './rainReuseFacilityInsert';
|
||||
import { rswtFacActionsExport, rswtFacStateExport, type rswtFacState, type rswtFacType } from './rswtrReuseFaciltyInsert';
|
||||
import { matDmdActionsExport, matDmdStateExport, type matDmdState, type matDmdType } from './matDmd';
|
||||
import { createStore } from "zustand/vanilla";
|
||||
import {
|
||||
pubFacActionsExport,
|
||||
pubFacStateExport,
|
||||
type pubFacState,
|
||||
type pubFacType,
|
||||
} from "./ruseFcltMng/fcltReg/pbnstReg";
|
||||
import {
|
||||
rainFacActionsExport,
|
||||
rainFacStateExport,
|
||||
type rainFacState,
|
||||
type rainFacType,
|
||||
} from "./ruseFcltMng/fcltReg/rainReg";
|
||||
import {
|
||||
rswtFacActionsExport,
|
||||
rswtFacStateExport,
|
||||
type rswtFacState,
|
||||
type rswtFacType,
|
||||
} from "./ruseFcltMng/fcltReg/rswtReg";
|
||||
import {
|
||||
matDmdActionsExport,
|
||||
matDmdStateExport,
|
||||
type matDmdState,
|
||||
type matDmdType,
|
||||
} from "./matDmd";
|
||||
import {
|
||||
htdflFacActionsExport,
|
||||
htdflFacStateExport,
|
||||
type htdflFacState,
|
||||
type htdflFacType,
|
||||
} from "./ruseFcltMng/fcltReg/htdflReg";
|
||||
import { codeActionExport, comCodeStateExport, getCityCd, getSggCd, type comCodeState, type comCodeType } from "./common/code";
|
||||
import { bdstActionsExport, bdstStateExport, type bdstFulType, type bdstState } from "./ruseFcltMng/fcltReg/bdstReg";
|
||||
import { rainChkgdnActionsExport, rainChkgdnStateExport, type rainChkgdnState, type rainChkgdnType } from "./prfmncReg/chkgdnReg/rainChkgdn";
|
||||
import { rswtChkgdnActionsExport, rswtChkgdnStateExport, type rswtChkgdnState, type rswtChkgdnType } from "./prfmncReg/chkgdnReg/rswrtChkgdn";
|
||||
import { pbnSttActionsExport, pbnSttStateExport, type pbnstSttnState, type pbnSttType } from "./ruseFcltMng/fcltSttn/pbnstSttn";
|
||||
|
||||
export type WrStore = comCodeType&
|
||||
pubFacType &
|
||||
rainFacType &
|
||||
rswtFacType &
|
||||
matDmdType &
|
||||
htdflFacType&
|
||||
bdstFulType&
|
||||
rainChkgdnType&
|
||||
rswtChkgdnType&
|
||||
pbnSttType
|
||||
;
|
||||
|
||||
export type WrStore = pubFacState & rainFacType &rswtFacType &matDmdType;
|
||||
export const StoreZus = (initState: rainFacState& pubFacState & rswtFacState &matDmdState= {
|
||||
...pubFacStateExport,
|
||||
...rainFacStateExport,
|
||||
...rswtFacStateExport ,
|
||||
...matDmdStateExport
|
||||
}) => {
|
||||
export const StoreZus = (
|
||||
initState: comCodeState&
|
||||
rainFacState &
|
||||
pubFacState &
|
||||
rswtFacState &
|
||||
matDmdState &
|
||||
htdflFacState &
|
||||
bdstState &
|
||||
rainChkgdnState&
|
||||
rswtChkgdnState&
|
||||
pbnstSttnState
|
||||
= {
|
||||
...comCodeStateExport,
|
||||
...pubFacStateExport,
|
||||
...rainFacStateExport,
|
||||
...rswtFacStateExport,
|
||||
...matDmdStateExport,
|
||||
...htdflFacStateExport,
|
||||
...bdstStateExport,
|
||||
...rainChkgdnStateExport,
|
||||
...rswtChkgdnStateExport,
|
||||
...pbnSttStateExport
|
||||
}
|
||||
) => {
|
||||
return createStore<WrStore>()((set) => {
|
||||
getSggCd(set),
|
||||
getCityCd(set)
|
||||
return {
|
||||
...initState,
|
||||
...pubFacActionsExport(set),
|
||||
...rainFacActionsExport(set),
|
||||
...rswtFacActionsExport(set),
|
||||
...matDmdActionsExport(set)
|
||||
}
|
||||
})
|
||||
}
|
||||
//store 등록하는 부분
|
||||
...matDmdActionsExport(set),
|
||||
...htdflFacActionsExport(set),
|
||||
...codeActionExport(set),
|
||||
...bdstActionsExport(set),
|
||||
...rainChkgdnActionsExport(set),
|
||||
...rswtChkgdnActionsExport(set),
|
||||
...pbnSttActionsExport(set)
|
||||
};
|
||||
});
|
||||
};
|
||||
//store 등록하는 부분
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
.formInsideTitle{
|
||||
background-color: gray;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.smallTitle{
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
//8880
|
||||
|
||||
import { DEV_URL_FO, DEV_URL_WR } from "../config/";
|
||||
|
||||
|
||||
|
||||
export const getFectch = async( type:string , url: string) => {
|
||||
const div = type === 'common' ? DEV_URL_FO : DEV_URL_WR
|
||||
const response = await fetch( div+url , {
|
||||
method: "GET",
|
||||
headers: {
|
||||
accept: "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
if(!response.ok) {
|
||||
throw new Error(`오류 발생: ${response.status}`);
|
||||
}
|
||||
const res = await response.json()
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export const postFectch = async (url: string, params: any) => {
|
||||
const response = await fetch(DEV_URL_WR+url, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
});
|
||||
if(!response.ok) {
|
||||
throw new Error(`오류 발생: ${response.status}`);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
export const putFectch = async (url: string, params: any) => {
|
||||
|
||||
const response = await fetch(DEV_URL_WR+url, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
});
|
||||
if(!response.ok) {
|
||||
throw new Error(`오류 발생: ${response.status}`);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
export const deleteFectch = async (url: string, params: any) => {
|
||||
const response = await fetch(DEV_URL_WR+url, {
|
||||
method: "DELETE",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
});
|
||||
if(!response.ok) {
|
||||
throw new Error(`오류 발생: ${response.status}`);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
const LOCAL_PORT = "3000";
|
||||
const DEV_PORT = "11080";
|
||||
|
||||
|
||||
const DEV_PORT_FO = "11082"; // common
|
||||
|
||||
export const LOCAL_URL_WR = `http://localhost:${LOCAL_PORT}/api/v1`;
|
||||
export const DEV_URL_WR = `http://con.mind-one.co.kr:${DEV_PORT}/api/v1`;
|
||||
|
||||
export const DEV_URL_FO = `http://con.mind-one.co.kr:${DEV_PORT_FO}/api/v1`;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
import type { comCodeState, selectArray } from "@/app/store/common/code";
|
||||
import type { bdstAll } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getCity = (val: string, sggCd: selectArray[]) => {
|
||||
const data = sggCd
|
||||
.filter((item) => String(item.val).substring(0, 2) === val)
|
||||
.map((item) => ({
|
||||
val: item.val,
|
||||
text: item.text // 한국어 텍스트
|
||||
}));
|
||||
return data
|
||||
|
||||
};
|
||||
|
||||
|
||||
// cd text 넣기
|
||||
export const tableData = ( data: any,code:comCodeState)=>{
|
||||
const chCode = code.code;
|
||||
|
||||
return data?.map((item: { sggCd: string; ctpvCd: string; reuseBuilding: { lawTrgtYn: any , bdstUsgCd:any}[]; }) => {
|
||||
let returnData = {};
|
||||
const sggText = chCode.sggCd.find(
|
||||
(cd) => cd.val === item.sggCd
|
||||
)?.text;
|
||||
const cityText = chCode.cityCd.find(
|
||||
(cd) => cd.val === item.ctpvCd
|
||||
)?.text;
|
||||
|
||||
if (item?.reuseBuilding?.length >0) {
|
||||
const bdsgUsgText = chCode.bdstUsgCd.find(
|
||||
(cd) =>cd.val === item?.reuseBuilding[0]?.bdstUsgCd
|
||||
)?.text
|
||||
const lawTrgtYn = item?.reuseBuilding[0]?.lawTrgtYn
|
||||
|
||||
returnData= { ...item, sggText: sggText, cityText: cityText ,bdsgUsgText:bdsgUsgText ,lawTrgtYn:lawTrgtYn};
|
||||
}else{
|
||||
returnData= { ...item, sggText: sggText, cityText: cityText};
|
||||
}
|
||||
|
||||
// console.log(" returnData ", returnData)
|
||||
return returnData;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
import { FileUpload, FormControl, FormField, FormItem, FormLabel, FormMessage, SelectBox } from "@common/business_components";
|
||||
import { DatePicker } from "@common/components";
|
||||
import { Input } from "@common/components";
|
||||
|
||||
|
||||
export type typeOfForm ={
|
||||
labelName: string;
|
||||
type: string;
|
||||
placeholder:any;
|
||||
formName: string;
|
||||
selectValue:selectValue|undefined;
|
||||
}
|
||||
type onSelectValue = (val:string) => void;
|
||||
export type selectValue ={
|
||||
label:string,
|
||||
value:{ text: string; val: string }[],
|
||||
fun:onSelectValue
|
||||
}
|
||||
|
||||
|
||||
export function IteraterFrom(formData:typeOfForm[],form:any , formClass:string ){
|
||||
|
||||
const formItem =(data:typeOfForm,field:any)=>{
|
||||
let tag
|
||||
if(data.type==='select'){
|
||||
tag= (data.selectValue ? <SelectBox className='' label={data.selectValue.label} selectArray={data.selectValue.value} onSelectValue={data.selectValue.fun} >{...form}</SelectBox> : null)
|
||||
}else if(data.type==='date'){
|
||||
tag =(<DatePicker mode="single" {...field} />)
|
||||
}else{
|
||||
tag=(<Input className ='w-64'placeholder= {data.placeholder} type="" {...field} />)
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{formData.map((data: typeOfForm, index) => (
|
||||
<FormField key={`${index}+key`}
|
||||
control={form.control}
|
||||
name={data.formName}
|
||||
render={({ field }) => (
|
||||
<FormItem className={formClass} >
|
||||
<FormLabel>{data.labelName}</FormLabel>
|
||||
<FormControl>
|
||||
{formItem(data,field)}
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,325 @@
|
||||
import { useWrStore } from "@/app/store";
|
||||
import type { selectArray } from "@/app/store/common/code";
|
||||
import { selectClass, type bdstAll } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { getCity } from "@/components/lib/func/commom";
|
||||
import type { objSearchType } from "@/components/ui/modal/bdstRegModal/bdstRegModal";
|
||||
import { FormField, FormUi, DatePicker, SelectBox } from "@common/business_components";
|
||||
import { Button, Input } from "@common/components";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useFieldArray } from "react-hook-form";
|
||||
|
||||
export default function BdstReg({ form }: { form: any }) {
|
||||
const { code } = useWrStore((state) => {
|
||||
return state;
|
||||
});
|
||||
|
||||
const { fields, append, remove } = useFieldArray({
|
||||
name: "chgBuilding",
|
||||
control: form?.control, // Provide a fallback to avoid errors
|
||||
});
|
||||
|
||||
const plusHist = () => {
|
||||
append({
|
||||
bdstNm: "",
|
||||
daddr: "",
|
||||
bdstUsgCd: "",
|
||||
});
|
||||
};
|
||||
|
||||
const removeLastItem = () => {
|
||||
if (fields.length > 0) {
|
||||
remove(fields.length - 1);
|
||||
}
|
||||
};
|
||||
|
||||
const [selectSgg, setSelectSgg] = useState<selectArray[] | undefined>()
|
||||
const [objSearch, setObjSearch] = useState<objSearchType>({sgg:"",city:""});
|
||||
|
||||
const getSelCity = (val: string) => {
|
||||
const data= getCity(val,code.sggCd)
|
||||
setSelectSgg(data);
|
||||
const sgg =form.getValues('sggCd')
|
||||
|
||||
setObjSearch({ city:val , sgg:''})
|
||||
|
||||
};
|
||||
|
||||
const getSgg = (val: string | number) => {
|
||||
|
||||
const sgg =form.getValues('sggCd')
|
||||
setObjSearch({...objSearch,sgg: val!=''?String(val):sgg })
|
||||
};
|
||||
|
||||
|
||||
useEffect(()=>{
|
||||
const city =form.getValues('ctpvCd')
|
||||
const sgg =form.getValues('sggCd')
|
||||
setObjSearch({city:city , sgg:sgg })
|
||||
|
||||
}, [selectSgg])
|
||||
|
||||
useEffect(() => {
|
||||
const subscription = form.form?.watch((value: any) => {
|
||||
console.log('vale', value)
|
||||
});
|
||||
|
||||
return () => subscription?.unsubscribe();
|
||||
}, [form.form]);
|
||||
|
||||
|
||||
const safeDate = (value: any): Date | undefined => {
|
||||
const date = new Date(value);
|
||||
return isNaN(date.getTime()) ? undefined : date;
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 pl-6">
|
||||
건축물 시설 정보
|
||||
</h1>
|
||||
<div className="grid grid-cols-6 gap-2 mt-4">
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="ctpvCd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="시도">
|
||||
<SelectBox
|
||||
className="col-span-3 "
|
||||
label={""}
|
||||
selectClass={selectClass}
|
||||
selectArray={code.cityCd}
|
||||
|
||||
onSelectValue={(val)=>{
|
||||
getSelCity(String(val))
|
||||
field.onChange(Number(val) );
|
||||
}
|
||||
|
||||
}
|
||||
value={field.value}
|
||||
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="sggCd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="시군구">
|
||||
<SelectBox
|
||||
className="col-span-3"
|
||||
label={""}
|
||||
selectClass={selectClass}
|
||||
selectArray={selectSgg? selectSgg:code.sggCd || []}
|
||||
onSelectValue={(val) =>{
|
||||
getSgg(val)
|
||||
field.onChange(Number(val))
|
||||
}}
|
||||
value={field.value}
|
||||
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid grid-cols-6 gap-2 mt-4 ">
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="bdstNm"
|
||||
render={({ field }) => (
|
||||
<FormUi label="건축물명">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
{...field}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="daddr"
|
||||
render={({ field }) => (
|
||||
<FormUi label="위치">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type="search"
|
||||
{...field}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.bdstUsgCd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="건축물용도">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.bdstUsgCd}
|
||||
onSelectValue={(val) => {
|
||||
field.onChange(Number(val));
|
||||
}}
|
||||
value={field.value}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="frstArchPrmsnDt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="최초건축허가일">
|
||||
<DatePicker
|
||||
mode={"single"}
|
||||
field={{
|
||||
value: field.value|| new Date(),
|
||||
onChange: (date: Date | undefined) =>
|
||||
field.onChange(date),
|
||||
}}
|
||||
selectClass={selectClass}
|
||||
></DatePicker>
|
||||
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="archArea"
|
||||
render={({ field }) => (
|
||||
<FormUi label="건축면적(m³)">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type="number"
|
||||
{...field}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
field.onChange(value === "" ? "" : Number(value));
|
||||
}}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.lawTrgtYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="법정의무대상여부">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.yn}
|
||||
onSelectValue={(val) => {
|
||||
field.onChange(val);
|
||||
}}
|
||||
value={field.value}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4">
|
||||
중축, 개축, 재축
|
||||
</h1>
|
||||
<div className="flex justify-end gap-2">
|
||||
<Button type="button" className="rounded-lg" onClick={plusHist}>
|
||||
이력추가
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
className="rounded-lg bg-red-500 text-white"
|
||||
onClick={removeLastItem}
|
||||
>
|
||||
삭제
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{fields.map((field, index) => (
|
||||
<div key={field.id} className="grid grid-cols-6 gap-2 mt-4">
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name={`chgBuilding.${index}.bdstChgNm`}
|
||||
render={({ field }) => (
|
||||
<FormUi label="구분">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.chBuCd}
|
||||
|
||||
onSelectValue={(val) => {
|
||||
field.onChange(val);
|
||||
}}
|
||||
value={field.value ?? code.chBuCd[0]?.val}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name={`chgBuilding.${index}.archChgPrmsnDt`}
|
||||
render={({ field }) => (
|
||||
<FormUi label="허가일">
|
||||
<DatePicker
|
||||
mode={"single"}
|
||||
field={{
|
||||
value: safeDate(field.value) || new Date(),
|
||||
onChange: (date: Date | undefined) =>
|
||||
field.onChange(date),
|
||||
}}
|
||||
selectClass={selectClass}
|
||||
></DatePicker>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name={`chgBuilding.${index}.archChgArea`}
|
||||
render={({ field }) => (
|
||||
<FormUi label="면적">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="-"
|
||||
type="text"
|
||||
value={ field.value??"-"}
|
||||
onChange={(e) => field.onChange((e.target.value))}
|
||||
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
<div className="border-b border-gray-300 my-4"> </div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,560 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
Form,
|
||||
FormField,
|
||||
FormUi,
|
||||
SelectBox,
|
||||
} from "@common/business_components/ui";
|
||||
import { Button, Input } from "@common/components/ui";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import {
|
||||
hdtflZod,
|
||||
type customHtdflBdst,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/htdflReg";
|
||||
import { useEffect } from "react";
|
||||
import BdstReg from "../bdstReg/bdstReg";
|
||||
|
||||
export function HtdflRegForm({
|
||||
htdflForm,
|
||||
isModal,
|
||||
}: {
|
||||
htdflForm: customHtdflBdst;
|
||||
isModal: boolean;
|
||||
}) {
|
||||
const { code, htdflUpdate, htdflReg } = useWrStore((state) => state);
|
||||
|
||||
const defaultValues: z.infer<typeof hdtflZod> = hdtflZod.parse({});
|
||||
|
||||
const form = useForm<z.infer<typeof hdtflZod>>({
|
||||
resolver: zodResolver(hdtflZod),
|
||||
defaultValues: defaultValues,
|
||||
});
|
||||
|
||||
function onSubmit(values: z.infer<typeof hdtflZod>) {
|
||||
if (isModal) {
|
||||
htdflReg(values);
|
||||
} else {
|
||||
htdflUpdate(values);
|
||||
}
|
||||
}
|
||||
|
||||
const onSelectValue = (val: string | number) => {
|
||||
console.log(val);
|
||||
};
|
||||
|
||||
function cleanHtdflData(raw: any): z.infer<typeof hdtflZod> {
|
||||
return {
|
||||
...raw,
|
||||
frstArchPrmsnDt: new Date(raw?.frstArchPrmsnDt || null),
|
||||
archChgPrmsnDt: raw?.archChgPrmsnDt
|
||||
? new Date(raw?.archChgPrmsnDt)
|
||||
: null,
|
||||
chgBuilding: (raw?.chgBuilding || []).map((item: any) => ({
|
||||
...item,
|
||||
archChgPrmsnDt:
|
||||
item?.archChgPrmsnDt === null
|
||||
? new Date()
|
||||
: new Date(item?.archChgPrmsnDt),
|
||||
bdstChgNm: item?.bdstChgNm ?? "", // null → ""
|
||||
})),
|
||||
reuseBuilding: (raw?.reuseBuilding || []).map((item: any) => ({
|
||||
...item,
|
||||
instlCmptnDt: new Date(item?.instlCmptnDt),
|
||||
htdflObj: {
|
||||
...item?.htdflObj,
|
||||
},
|
||||
})),
|
||||
};
|
||||
}
|
||||
useEffect(() => {
|
||||
console.log("form errors:", form.formState.errors);
|
||||
}, [form.formState.errors]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (hdtflZod) form.reset(cleanHtdflData(htdflForm));
|
||||
}, [htdflForm]);
|
||||
|
||||
return (
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)}>
|
||||
{/* <div className="flex justify-between items-center mx-3"> */}
|
||||
<div>
|
||||
<div className="grid grid-cols-12">
|
||||
<h1 className="pl-3 text-xl col-span-10">○온배수 시설 정보</h1>
|
||||
<Button type="submit" className="mr-4 rounded-lg col-span-2">
|
||||
저장
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{ isModal && htdflForm != undefined ? (
|
||||
<BdstReg form={form} />
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
{isModal ? (
|
||||
<h1 className="pl-3 text-xl col-span-10 mt-4 ">
|
||||
○ 중수도 시설 정보{" "}
|
||||
</h1>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
|
||||
|
||||
|
||||
<div className="grid grid-cols-6 gap-2 mt-4 pl-6">
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.etgtType"
|
||||
render={({ field }) => (
|
||||
<FormUi label="발전유형(코드정비후 수정)">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.fclCpct" // 이름 이상함.
|
||||
render={({ field }) => (
|
||||
<FormUi label="설비용량">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.plwtYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="담수화 여부">
|
||||
<SelectBox
|
||||
className={""}
|
||||
label={""}
|
||||
selectClass={selectClass}
|
||||
selectArray={code.yn}
|
||||
onSelectValue={onSelectValue}
|
||||
value={field.value ?? code.yn[0]?.val}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className=" my-4">
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 pl-6">
|
||||
온배수 시설 운영현황
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-10 gap-1 mt-4">
|
||||
<div className="col-span-5 pl-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.orgwtWtritSpt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="원수취수 지점(코드정비후 수정)">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-5">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.orgwtOcrnProcs"
|
||||
render={({ field }) => (
|
||||
<FormUi label="원수발생 공정">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-5 pl-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.wtritEntrcTp"
|
||||
render={({ field }) => (
|
||||
<FormUi label="취수구 온도">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-5 pl-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.amtgnr"
|
||||
render={({ field }) => (
|
||||
<FormUi label="발생량(m³/년)">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-5 pl-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.prcsProcsYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="처리공정">
|
||||
<SelectBox
|
||||
className={""}
|
||||
label={""}
|
||||
selectClass={selectClass}
|
||||
selectArray={code.yn}
|
||||
onSelectValue={onSelectValue}
|
||||
value={field.value ?? code.yn[0]?.val}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-5 pl-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.prcsFcltCpct"
|
||||
render={({ field }) => (
|
||||
<FormUi label="처리시설 용량(m³/년)">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-5 pl-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.fmYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="유량계유무">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.yn}
|
||||
onSelectValue={onSelectValue}
|
||||
value={field.value ?? code.yn[0]?.val}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-5 pl-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.utztnCpct"
|
||||
render={({ field }) => (
|
||||
<FormUi label="이용량(m³/년)">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-5 pl-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.utztnUsg"
|
||||
render={({ field }) => (
|
||||
<FormUi label="이용용도">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className=" my-2">
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 ">
|
||||
요구수질
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 gap-4 pl-6">
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.grssClfg"
|
||||
render={({ field }) => (
|
||||
<FormUi label="총대장균군">
|
||||
<Input
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.tn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="총질소">
|
||||
<Input
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 gap-4 pl-6">
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.combResdch"
|
||||
render={({ field }) => (
|
||||
<FormUi label="결합잔류염소">
|
||||
<Input
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-6 ">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.tph"
|
||||
render={({ field }) => (
|
||||
<FormUi label="총인">
|
||||
<Input
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 gap-4 pl-6">
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.trbt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="탁도">
|
||||
<Input
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.ph"
|
||||
render={({ field }) => (
|
||||
<FormUi label="수소이온농도">
|
||||
<Input
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 gap-4 pl-6">
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.bod"
|
||||
render={({ field }) => (
|
||||
<FormUi label="생물학적 산소요구량">
|
||||
<Input
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.clIonQnt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="염화물">
|
||||
<Input
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 gap-4 pl-6">
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.smll"
|
||||
render={({ field }) => (
|
||||
<FormUi label="냄새">
|
||||
<Input
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.cdtnv"
|
||||
render={({ field }) => (
|
||||
<FormUi label="전기전도도">
|
||||
<Input
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 gap-4 pl-6">
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.crmty"
|
||||
render={({ field }) => (
|
||||
<FormUi label="색도">
|
||||
<Input
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.htdflObj.emsnExitTp"
|
||||
render={({ field }) => (
|
||||
<FormUi label="배출구온도">
|
||||
<Input
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
+68
-138
@@ -8,8 +8,8 @@ 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";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { selectClass, type TableUpperProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
|
||||
const formSchema = z.object({
|
||||
username: z.string().min(2).max(50),
|
||||
@@ -30,9 +30,9 @@ const formSchema = z.object({
|
||||
</TableRow>
|
||||
</>)
|
||||
}
|
||||
export function PublicReuseFaciltyFormInsert() {
|
||||
export function PbnstBuseForm() {
|
||||
const { pubFac } = useWrStore((state) => state);
|
||||
const { pubMngUpHeadList, pubMngFacData,erctUswtrCd,cyclCd,seCd,buseCd,rprcsCd,buseMet,rprcLoCd} = pubFac;
|
||||
const { pubMngUpHeadList, erctUswtrCd,cyclCd,seCd,buseCd,rprcsCd,buseMet,rprcLoCd} = pubFac;
|
||||
const nodeList = headMakeColSpan(pubMngUpHeadList);
|
||||
|
||||
|
||||
@@ -60,120 +60,6 @@ const nodeList = headMakeColSpan(pubMngUpHeadList);
|
||||
|
||||
return (
|
||||
<div className="pl-3">
|
||||
<div>
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)}>
|
||||
<div className="flex justify-between items-center mx-3 mb-3">
|
||||
<div className="col-span-2 flex items-top">
|
||||
<h1 className="pl-3 pr-3 text-xl">○ 재이용시설 운영정보</h1>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="facilityName"
|
||||
render={({ field }) => (
|
||||
<FormUi label="">
|
||||
<Input readOnly className="h-10 text-center text-xl" placeholder="난지" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Button className=" rounded-lg" type="submit">
|
||||
신규등록
|
||||
</Button>
|
||||
</div>
|
||||
<div className="grid grid-cols-12 gap-4 my-4">
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_0211213336"
|
||||
render={({ }) => (
|
||||
<FormUi label="계통도">
|
||||
<FileUpload files={files} setFiles={setFiles} fileTypes="PDF"></FileUpload>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_0211213336"
|
||||
render={({ }) => (
|
||||
<FormUi label="평면도">
|
||||
<FileUpload files={files} setFiles={setFiles} fileTypes="PDF"></FileUpload>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="flex justify-between items-center mx-3 mb-3">
|
||||
<h1 className="pl-3 text-xl">○ 재이용시설 운영정보</h1>
|
||||
<Button className=" rounded-lg" >추가등록</Button>
|
||||
</div>
|
||||
<div>
|
||||
<UiTable
|
||||
tableData={pubMngFacData}
|
||||
headlist={pubMngUpHeadList}
|
||||
pageSize={100}
|
||||
total={-1}
|
||||
headName={""}
|
||||
>{nodeList}</UiTable>
|
||||
</div>
|
||||
<div>
|
||||
<h1 className="pl-3 text-xl mb-3">○ 재이용수 공급 가능량</h1>
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_0943143371"
|
||||
render={({ field }) => (
|
||||
<FormUi label="시설용량(m³/일)">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_2007089217"
|
||||
render={({ field }) => (
|
||||
<FormUi label="하수처리량(m³/일)">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_1624679275"
|
||||
render={({ field }) => (
|
||||
<FormUi label="재이용량(m³/일)">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_1624679277"
|
||||
render={({ field }) => (
|
||||
<FormUi label="공급여유량(m³/일)">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</Form>
|
||||
</div>
|
||||
{/* 차수별 등록 현황 폼 */}
|
||||
<div className="justify-between">
|
||||
<Form {...form}>
|
||||
@@ -234,25 +120,6 @@ const nodeList = headMakeColSpan(pubMngUpHeadList);
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_2450741594"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치승인인가일">
|
||||
<DatePicker
|
||||
|
||||
selectClass={'rounded-lg w-full bg-white'} field={{
|
||||
value: instlAprvDate,
|
||||
onChange: (date: Date | undefined): void => {
|
||||
if (date) setInstlAprvDate(date);
|
||||
}
|
||||
}} mode="single" {...field}/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
@@ -271,6 +138,24 @@ const nodeList = headMakeColSpan(pubMngUpHeadList);
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_2450741594"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치승인인가일">
|
||||
<DatePicker
|
||||
|
||||
selectClass={'rounded-lg w-full bg-white'} field={{
|
||||
value: instlAprvDate,
|
||||
onChange: (date: Date | undefined): void => {
|
||||
if (date) setInstlAprvDate(date);
|
||||
}
|
||||
}} mode="single" {...field}/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<h1 className="pl-4 text-xl">2. 사업비</h1>
|
||||
<div className="grid grid-cols-10 gap-4">
|
||||
@@ -422,7 +307,7 @@ const nodeList = headMakeColSpan(pubMngUpHeadList);
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 ">
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 ">
|
||||
농축수관리{" "}
|
||||
</h1>
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
@@ -489,6 +374,51 @@ const nodeList = headMakeColSpan(pubMngUpHeadList);
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 ">
|
||||
폐수배출시설 정보
|
||||
</h1>
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_7678668236"
|
||||
render={({ field }) => (
|
||||
<FormUi label="폐수배출물신고 허가여부">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_7913744238"
|
||||
render={({ field }) => (
|
||||
<FormUi label="Tms설치여부">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_1368081408"
|
||||
render={({ field }) => (
|
||||
<FormUi label="공공하수도 유입제외 허가여부">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<h1 className=" text-xl">
|
||||
재이용 원수취수 현황
|
||||
</h1>
|
||||
|
||||
</form>
|
||||
</Form>
|
||||
</div>
|
||||
@@ -0,0 +1,244 @@
|
||||
"use client";
|
||||
|
||||
import { SelectBox } from "@common/business_components";
|
||||
import {
|
||||
FileUpload,
|
||||
FormUi,
|
||||
UiTable,
|
||||
} from "@common/business_components/ui";
|
||||
import { Form, FormField } from "@common/business_components/ui/form";
|
||||
import { Button, Input, TableHead, TableRow } from "@common/components";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { nullable, z } from "zod";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import {
|
||||
selectClass,
|
||||
type TableUpperProps,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import type { fcltOperInfoType, ruseFcltType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg";
|
||||
import { PbnstMngModal } from "@/components/ui/modal/pbnstMng/component";
|
||||
|
||||
const formSchema = z.object({
|
||||
fcltNm: z.string().min(2).max(50),
|
||||
psysScdg: z.string(),
|
||||
designScdg: z.string(),
|
||||
fcltCpct: z.number(),
|
||||
swtrmtCpct: z.number(),
|
||||
ruseCpct: z.number(),
|
||||
splyExtraCpct: z.number(),
|
||||
});
|
||||
|
||||
|
||||
|
||||
export function PbnstMngForm({ data }: { data: ruseFcltType[] }) {
|
||||
const { pubFac, pubMng } = useWrStore((state) => state);
|
||||
const { pubMngUpHeadList, isInit } = pubFac;
|
||||
const { fcltOperInfo } = pubMng;
|
||||
const [ruseOperData, setRuseOperData] = useState<fcltOperInfoType[]>();
|
||||
const [files, setFiles] = useState(null);
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
|
||||
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
fcltNm: '',
|
||||
psysScdg: '',
|
||||
designScdg: '',
|
||||
fcltCpct: 0,
|
||||
swtrmtCpct: 0,
|
||||
ruseCpct: 0,
|
||||
splyExtraCpct: 0,
|
||||
},
|
||||
});
|
||||
|
||||
const selectOptions = data?.map((item) => ({text: item.fcltNm, val: item.pbnstRuseFcltPk})) || [{text:'없음', val:'1'}];
|
||||
|
||||
const onSelectValue = (val: string) => {
|
||||
const selectedData = data?.find((item) => item.pbnstRuseFcltPk === val);
|
||||
if (selectedData) {
|
||||
form.reset(selectedData);
|
||||
setRuseOperData(fcltOperInfo.filter((item) => item.pbnstRuseFcltPk === val));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (isInit) {
|
||||
form.reset();
|
||||
setRuseOperData([{}] as fcltOperInfoType[]);
|
||||
}
|
||||
}, [isInit]);
|
||||
|
||||
// 2. Define a submit handler.
|
||||
function onSubmit(values: z.infer<typeof formSchema>) {
|
||||
console.log(values);
|
||||
}
|
||||
|
||||
const headMakeColSpan = (upHeadList: TableUpperProps[]) => {
|
||||
return (
|
||||
<>
|
||||
<TableRow>
|
||||
{upHeadList.map((head: TableUpperProps) =>
|
||||
!head.upSequnce ? (
|
||||
<TableHead rowSpan={2} key={head.id}>
|
||||
{head.title}
|
||||
</TableHead>
|
||||
) : head.upName === "upChangeRe" && head.upSequnce === 1 ? (
|
||||
<TableHead key={head.id} rowSpan={1} colSpan={2}>
|
||||
{"운영대행기간"}
|
||||
</TableHead>
|
||||
) : null
|
||||
)}
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
{upHeadList.map((head: TableUpperProps) =>
|
||||
head.upName === "upChangeRe" ? (
|
||||
<TableHead key={head.id}>{head.title}</TableHead>
|
||||
) : null
|
||||
)}
|
||||
</TableRow>
|
||||
</>
|
||||
);
|
||||
};
|
||||
const nodeList = headMakeColSpan(pubMngUpHeadList);
|
||||
|
||||
return (
|
||||
<div className="pl-3 pb-[10.3vh]">
|
||||
<div>
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)}>
|
||||
<div className="flex justify-between items-center mx-3 mb-3">
|
||||
<div className="col-span-2 flex items-top">
|
||||
<h1 className="pl-3 pr-3 text-xl">○ 재이용 시설명</h1>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="fcltNm"
|
||||
render={({ field }) => (
|
||||
<FormUi label="">
|
||||
{data.length === 0 ? (
|
||||
<Input placeholder="시설명을 입력하세요" {...field} />
|
||||
) : (
|
||||
<SelectBox
|
||||
label=""
|
||||
selectArray={selectOptions}
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
onSelectValue={onSelectValue}
|
||||
{...field}
|
||||
/>
|
||||
)}
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid grid-cols-12 gap-4 my-4">
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="psysScdg"
|
||||
render={({}) => (
|
||||
<FormUi label="계통도">
|
||||
<FileUpload
|
||||
files={files}
|
||||
setFiles={setFiles}
|
||||
fileTypes="PDF"
|
||||
></FileUpload>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="designScdg"
|
||||
render={({}) => (
|
||||
<FormUi label="평면도">
|
||||
<FileUpload
|
||||
files={files}
|
||||
setFiles={setFiles}
|
||||
fileTypes="PDF"
|
||||
></FileUpload>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex justify-between items-center mx-3 mb-3 ">
|
||||
<h1 className="pl-3 text-xl">○ 재이용시설 운영정보</h1>
|
||||
<Button type="button" className="rounded-lg" onClick={() => setIsModalOpen(true)}>추가등록</Button>
|
||||
{/* <PbnstMngModal /> */}
|
||||
</div>
|
||||
<div className="h-[200px] overflow-y-auto">
|
||||
<UiTable
|
||||
tableData={ruseOperData?ruseOperData:[]}
|
||||
headlist={pubMngUpHeadList}
|
||||
pageSize={100}
|
||||
total={-1}
|
||||
headName={""}
|
||||
cellClick={() => {}}
|
||||
>
|
||||
{nodeList}
|
||||
</UiTable>
|
||||
</div>
|
||||
<div>
|
||||
<h1 className="pl-3 text-xl mb-3">○ 재이용수 공급 가능량</h1>
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="fcltCpct"
|
||||
render={({ field }) => (
|
||||
<FormUi label="시설용량(m³/일)">
|
||||
<Input placeholder="" type="number" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="swtrmtCpct"
|
||||
render={({ field }) => (
|
||||
<FormUi label="하수처리량(m³/일)">
|
||||
<Input placeholder="" type="number" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="ruseCpct"
|
||||
render={({ field }) => (
|
||||
<FormUi label="재이용량(m³/일)">
|
||||
<Input placeholder="" type="number" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="splyExtraCpct"
|
||||
render={({ field }) => (
|
||||
<FormUi label="공급여유량(m³/일)">
|
||||
<Input placeholder="" type="number" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</Form>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,382 @@
|
||||
"use client";
|
||||
|
||||
import { useWrStore } from "@/app/store";
|
||||
import {
|
||||
rainZod,
|
||||
selectClass,
|
||||
type customRainBdst,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { DatePicker, FormUi } from "@common/business_components";
|
||||
import { Form, FormField, SelectBox } from "@common/business_components/ui";
|
||||
import { Button, Input } from "@common/components/ui";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useForm, type UseFormReturn } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
import BdstReg from "../bdstReg/bdstReg";
|
||||
|
||||
export function RainRegForm({
|
||||
rainForm,
|
||||
isModal,
|
||||
}: {
|
||||
rainForm: customRainBdst;
|
||||
isModal: boolean;
|
||||
}) {
|
||||
const { code, rainReg, rainUpdate, rain } = useWrStore((state) => state);
|
||||
const { rainFcltCd } = code;
|
||||
|
||||
const defaultValues: z.infer<typeof rainZod> = rainZod.parse({});
|
||||
|
||||
const form = useForm<z.infer<typeof rainZod>>({
|
||||
resolver: zodResolver(rainZod),
|
||||
defaultValues: defaultValues,
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function cleanRainData(raw: any): z.infer<typeof rainZod> {
|
||||
return {
|
||||
...raw,
|
||||
frstArchPrmsnDt: new Date(raw?.frstArchPrmsnDt||null),
|
||||
archChgPrmsnDt: raw?.archChgPrmsnDt ? new Date(raw?.archChgPrmsnDt) : null,
|
||||
reuseBuilding: (raw?.reuseBuilding || []).map((item: any) => ({
|
||||
...item,
|
||||
instlCmptnDt: new Date(item?.instlCmptnDt),
|
||||
operMngCd: item?.operMngCd ?? "", // null → ""
|
||||
grntchBdstCertYr: typeof item?.grntchBdstCertYr === "string"
|
||||
? item?.grntchBdstCertYr
|
||||
: "", // null → ""
|
||||
rainObj: {
|
||||
...item?.rainObj
|
||||
}
|
||||
}))
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// form 값이 변경될 때마다 로그 출력
|
||||
useEffect(() => {
|
||||
const subscription = form.watch((value) => {});
|
||||
return () => subscription.unsubscribe();
|
||||
}, [form]);
|
||||
|
||||
|
||||
|
||||
|
||||
function onSubmit(values: z.infer<typeof rainZod>) {
|
||||
|
||||
if (isModal) {
|
||||
// regRainForm.bdstInfoPk = null;
|
||||
rainReg(values);
|
||||
} else {
|
||||
rainUpdate(values);
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
console.log("form errors:", form.formState.errors);
|
||||
}, [form.formState.errors]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if(rainZod)
|
||||
form.reset( cleanRainData(rainForm))
|
||||
}, [rainForm]);
|
||||
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)}>
|
||||
<div>
|
||||
<div className="grid grid-cols-12">
|
||||
<h1 className="pl-3 text-xl col-span-10">
|
||||
{isModal ? "○건축물 운영정보" : "○ 빗물이용시설 정보"}
|
||||
</h1>
|
||||
<Button type="submit" className="mr-4 rounded-lg col-span-2">
|
||||
저장
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
{isModal && rainForm != undefined ? <BdstReg form={form} /> : <></>}
|
||||
{isModal ? (
|
||||
<h1 className="pl-3 text-xl col-span-10 mt-4 ">
|
||||
○ 빗물이용시설 정보{" "}
|
||||
</h1>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 ">
|
||||
기본정보
|
||||
</h1>
|
||||
|
||||
<div className="grid grid-cols-4 gap-2 mt-4 pl-6">
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCmptnDt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치완료일">
|
||||
<DatePicker
|
||||
mode="single"
|
||||
field={{
|
||||
value:
|
||||
field.value && !isNaN(new Date(field.value).getTime())
|
||||
? new Date(field.value)
|
||||
: new Date(), // Provide a default Date value
|
||||
onChange: (date) => field.onChange(date),
|
||||
}}
|
||||
selectClass={""}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCst"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치비">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => {
|
||||
field.onChange(e.target.value === "" ? "" : Number(e.target.value));
|
||||
}}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className=" my-4">
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 pl-6">
|
||||
빗물이용시설 정보
|
||||
</h1>
|
||||
</div>
|
||||
<div>
|
||||
<h2 className="pl-3 text-xl">✓ 1. 집수면</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-10 gap-1 mt-4">
|
||||
<div className="col-span-5 pl-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rainyObj.pntfColKnd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="종류">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={rainFcltCd}
|
||||
onSelectValue={field.onChange}
|
||||
value={field.value ?? rainFcltCd[0]?.val}
|
||||
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-5">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rainyObj.pntfColArea"
|
||||
render={({ field }) => (
|
||||
<FormUi label="면적(m³)">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2 className="pl-3 text-xl">✓ 2. 여과 등 처리시설</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-12 gap-2 mt-4">
|
||||
<div className="col-span-4 pl-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rainyObj.filtrTrtmfctYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="유무">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.yn}
|
||||
onSelectValue={field.onChange}
|
||||
value={field.value ?? code.yn[0]?.val}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rainyObj.filtrTrtmfctCpct"
|
||||
render={({ field }) => (
|
||||
<FormUi label="용량(m³/일)">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rainyObj.filtrTrtmfctPrs"
|
||||
render={({ field }) => (
|
||||
<FormUi label="처리공정">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className=" my-2">
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 ">
|
||||
인센티브 정보
|
||||
</h1>
|
||||
</div>
|
||||
<div>
|
||||
<h2 className="pl-3 text-xl">✓ 1. 설치비 지원</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-10 gap-2 pl-6 mt-4">
|
||||
<div className="col-span-5">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCstSprtYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치비 지원 여부">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.yn}
|
||||
onSelectValue={field.onChange}
|
||||
value={field.value ?? code.yn[0]?.val}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-5">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCstSprtAmt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="지원금액(원)">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
field.onChange(value === "" ? "" : Number(value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2 className="pl-3 text-xl">✓ 2. 녹색건축물 인증</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-6 gap-2 mt-4">
|
||||
<div className="col-span-3 pl-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증여부">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.yn}
|
||||
onSelectValue={field.onChange}
|
||||
value={field.value ?? code.yn[0]?.val}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertYr"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증년도">
|
||||
<Input className="" placeholder="2024" type="" value={field.value ?? ""}
|
||||
onChange={field.onChange} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 pl-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertNo"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증번호">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="ab1234678"
|
||||
type=""
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertGrd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증등급">
|
||||
<Input className="" placeholder="A" type="" value={field.value ?? ""}
|
||||
onChange={field.onChange}/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</Form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,371 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
DatePicker,
|
||||
Form,
|
||||
FormField,
|
||||
FormUi,
|
||||
SelectBox,
|
||||
} from "@common/business_components/ui";
|
||||
import { Button, Input } from "@common/components/ui";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useFieldArray, useForm } from "react-hook-form";
|
||||
import { number, z } from "zod";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import {
|
||||
rswtZod,
|
||||
type customRswtBdst,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
|
||||
import { useEffect } from "react";
|
||||
import BdstReg from "../bdstReg/bdstReg";
|
||||
|
||||
export function RswtrRegForm({
|
||||
rswtForm,
|
||||
isModal,
|
||||
}: {
|
||||
rswtForm: customRswtBdst;
|
||||
isModal: boolean;
|
||||
}) {
|
||||
const { rswt, code ,rswtUpdate,rswtReg} = useWrStore((state) => state);
|
||||
|
||||
|
||||
const defaultValues: z.infer<typeof rswtZod> = rswtZod.parse({});
|
||||
|
||||
|
||||
const form = useForm<z.infer<typeof rswtZod>>({
|
||||
resolver: zodResolver(rswtZod),
|
||||
defaultValues: defaultValues,
|
||||
|
||||
})
|
||||
|
||||
// 2. Define a submit handler.
|
||||
async function onSubmit(values: z.infer<typeof rswtZod>) {
|
||||
// Do something with the form values.
|
||||
// ✅ This will be type-safe and validated.
|
||||
console.log(values);
|
||||
|
||||
|
||||
if (isModal) {
|
||||
// regRainForm.bdstInfoPk = null;
|
||||
await rswtReg(values);
|
||||
} else {
|
||||
rswtUpdate(values);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const onSelectValue = (val: string | number) => {
|
||||
console.log(val);
|
||||
|
||||
};
|
||||
|
||||
|
||||
function cleanRswtData(raw: any): z.infer<typeof rswtZod> {
|
||||
return {
|
||||
...raw,
|
||||
frstArchPrmsnDt: new Date(raw?.frstArchPrmsnDt||null),
|
||||
archChgPrmsnDt: raw?.archChgPrmsnDt ? new Date(raw?.archChgPrmsnDt) : null,
|
||||
reuseBuilding: (raw?.reuseBuilding || []).map((item: any) => ({
|
||||
...item,
|
||||
instlCmptnDt: new Date(item?.instlCmptnDt),
|
||||
operMngCd: item?.operMngCd ?? "", // null → ""
|
||||
grntchBdstCertYr: typeof item?.grntchBdstCertYr === "string"
|
||||
? item?.grntchBdstCertYr
|
||||
: "", // null → ""
|
||||
rswtrObj: {
|
||||
...item?.rswtrObj
|
||||
}
|
||||
}))
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if(rswtZod)
|
||||
console.log("rswtForm", rswtForm);
|
||||
form.reset( cleanRswtData(rswtForm))
|
||||
}, [rswtForm]);
|
||||
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)}>
|
||||
{/* <div className="flex justify-between items-center mx-3"> */}
|
||||
<div>
|
||||
<div className="grid grid-cols-12">
|
||||
<h1 className="pl-3 text-xl col-span-10">
|
||||
○ 중수도 시설 정보
|
||||
</h1>
|
||||
<Button type="submit" className="mr-4 rounded-lg col-span-2">
|
||||
저장
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{isModal && rswtForm != undefined ? (
|
||||
<BdstReg form={form} />
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
{isModal ? (
|
||||
<h1 className="pl-3 text-xl col-span-10 mt-4 ">
|
||||
○ 중수도 시설 정보{" "}
|
||||
</h1>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 ">
|
||||
기본정보
|
||||
</h1>
|
||||
<div className="grid grid-cols-4 gap-2 mt-4 pl-6">
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCmptnDt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치완료일">
|
||||
<DatePicker
|
||||
mode="single"
|
||||
field={{
|
||||
value:
|
||||
field.value && !isNaN(new Date(field.value).getTime())
|
||||
? new Date(field.value)
|
||||
: new Date(), // Provide a default Date value
|
||||
onChange: (date) => field.onChange(date),
|
||||
}}
|
||||
selectClass={""}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCst"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치비">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
value={field.value ?? ""}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid grid-cols-4 gap-2 mt-4 pl-6">
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rswtrObj.wtrUsqty"
|
||||
render={({ field }) => (
|
||||
<FormUi label="물사용량(m³)">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rswtrObj.oblgTrgtWtrUsqty"
|
||||
render={({ field }) => (
|
||||
<FormUi label="의무대상 물사용량(m³)">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className=" my-4">
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 pl-6">
|
||||
중수도 시설 정보
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-10 gap-1 mt-4">
|
||||
<div className="col-span-5 pl-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rswtrObj.orgwtKndCd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="원수 종류">
|
||||
<SelectBox
|
||||
className={""}
|
||||
label={""}
|
||||
selectClass={selectClass}
|
||||
selectArray={code.orgwtKndCd}
|
||||
onSelectValue={field.onChange}
|
||||
value={field.value ?? code.orgwtKndCd[0]?.val}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-5">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rswtrObj.filtrTrtmfctProcs"
|
||||
render={({ field }) => (
|
||||
<FormUi label="주요처리공정">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className=" my-2">
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 ">
|
||||
인센티브 정보
|
||||
</h1>
|
||||
</div>
|
||||
<div>
|
||||
<h2 className="pl-3 text-xl">✓ 1. 설치비 지원</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-2 gap-2 mt-4">
|
||||
<div className="col-span-1 pl-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCstSprtYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치비 지원여부">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.yn}
|
||||
onSelectValue={field.onChange}
|
||||
value={field.value ?? code.yn[0]?.val}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-1">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCstSprtAmt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="지원금액(원)">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? ""}
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2 className="pl-3 text-xl">✓ 2. 녹색건축물 인증</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-6 gap-2 mt-4">
|
||||
<div className="col-span-3 pl-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증여부">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.yn}
|
||||
onSelectValue={field.onChange}
|
||||
value={field.value ?? code.yn[0]?.val}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertYr"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증년도">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="2024"
|
||||
type=""
|
||||
{...field}
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 pl-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertNo"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증번호">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="ab1234678"
|
||||
type=""
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertGrd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증등급">
|
||||
<Input
|
||||
className=""
|
||||
placeholder="A"
|
||||
type=""
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</Form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { selectClass } from "@/app/store/rainReuseFacilityInsert";
|
||||
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { DatePicker, FormField, FormItem, FormLabel, FormUi, SelectBox } from "@common/business_components";
|
||||
import { Button, Input } from "@common/components";
|
||||
import { useState } from "react";
|
||||
@@ -10,9 +10,9 @@ export function CoRegForm(form:any){
|
||||
|
||||
return(
|
||||
|
||||
<>
|
||||
<FormField
|
||||
control={form.control}
|
||||
<>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="ctpv"
|
||||
render={({ field }) => (
|
||||
<FormUi label="시도">
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { selectClass } from "@/app/store/rainReuseFacilityInsert";
|
||||
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { DatePicker, FormField, FormItem, FormLabel, FormUi, SelectBox } from "@common/business_components";
|
||||
import { Button, Input } from "@common/components";
|
||||
import { useState } from "react";
|
||||
@@ -0,0 +1,36 @@
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { UiTable } from "@common/business_components/ui";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { useEffect } from "react";
|
||||
|
||||
|
||||
|
||||
import type {
|
||||
chgBuilding,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
export default function BdstChgModal({ chgBuilding }: { chgBuilding:chgBuilding[] }) {
|
||||
|
||||
const {bdst,rain} = useWrStore((state) => {
|
||||
return state;
|
||||
});
|
||||
const { bdstChgHeadList } = bdst;
|
||||
console.log("chgBuilding", chgBuilding);
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<ListDiv>
|
||||
<UiTable
|
||||
headlist={bdstChgHeadList}
|
||||
pageSize={-1}
|
||||
total={0}
|
||||
onPageChange={() => {}}
|
||||
headName={"○건축물 변경 이력"}
|
||||
tableData={chgBuilding}
|
||||
children={undefined}
|
||||
cellClick={undefined}
|
||||
/>
|
||||
</ListDiv>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
"use client";
|
||||
import { headMakeColSpan } from "@/app/ruseFcltMng/fcltReg/rainReg/page";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import {
|
||||
selectClass,
|
||||
type customRainBdst,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { ScrollArea, SelectBox, UiTable } from "@common/business_components";
|
||||
import { Button, Input, Label } from "@common/components";
|
||||
import { useEffect, useState } from "react";
|
||||
import { RainRegForm } from "../../form/fcltReg/rainReg/rainRegForm";
|
||||
import { type selectArray } from "@/app/store/common/code";
|
||||
import { getCity, tableData } from "@/components/lib/func/commom";
|
||||
import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
|
||||
import { HtdflRegForm } from "../../form/fcltReg/htdflReg/htdflRegForm";
|
||||
import type { customHtdflBdst } from "@/app/store/ruseFcltMng/fcltReg/htdflReg";
|
||||
import { RswtrRegForm } from "../../form/fcltReg/rswtrReg/RswtrRegForm";
|
||||
|
||||
export type objSearchType = {
|
||||
sgg: string|number;
|
||||
city: string|number;
|
||||
};
|
||||
//RNB(빗물), RST(중수도), HTB(온배수)
|
||||
type MoType = 'RNB' | 'RST' | 'HTB'; // 여기에 'htdf' 추가
|
||||
|
||||
type BdstTypeMap = {
|
||||
RNB: customRainBdst;
|
||||
RST: customRswtBdst;
|
||||
HTB: customRswtBdst; // 해야해// 아직 아노딤
|
||||
};
|
||||
|
||||
interface BdstRegProps<T extends MoType> {
|
||||
moType: T;
|
||||
}
|
||||
|
||||
export function BdstReg<T extends MoType>({ moType }: BdstRegProps<T>) {
|
||||
const { rain, code, bdst,findBdst } = useWrStore((state) => {
|
||||
return state;
|
||||
});
|
||||
const [bdstTable, setbdstTable] = useState<BdstTypeMap[T][]>();
|
||||
const [rainBdstForm, setRainBdstForm] = useState<BdstTypeMap[T]>({} as BdstTypeMap[T]);
|
||||
const [searchTxt, setSearchTxt] = useState<string>()
|
||||
const [selectSgg, setSelectSgg] = useState<selectArray[] | []>()
|
||||
const [objSearch, setObjSearch] = useState<objSearchType>({sgg:"",city:""});
|
||||
|
||||
const getSelCity = (val: string | number) => {
|
||||
const cityValue = String(val); // Ensure val is treated as a string
|
||||
const data = getCity(cityValue, code.sggCd);
|
||||
setSelectSgg(data);
|
||||
|
||||
setObjSearch({ city: cityValue, sgg: '' });
|
||||
};
|
||||
|
||||
const getSgg = (val: string | number) => {
|
||||
console.log(val);
|
||||
setObjSearch({...objSearch,sgg: String(val)})
|
||||
};
|
||||
|
||||
const searchBdst=(searchTxt: string | undefined)=>{
|
||||
let data =objSearch.city;
|
||||
if(objSearch.city==="" ){
|
||||
|
||||
data = String(code.cityCd[0]?.val)
|
||||
}
|
||||
if(objSearch.sgg !=="" ){
|
||||
data = objSearch.sgg
|
||||
}
|
||||
|
||||
//RNB(빗물), RST(중수도), HTB(온배수)
|
||||
findBdst(String(data), searchTxt || "",moType )
|
||||
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (code.sggCd.length > 0) {
|
||||
|
||||
setbdstTable( tableData(bdst.bdstBase, { code }));
|
||||
}
|
||||
}, [ bdst]);
|
||||
|
||||
|
||||
const tableClick: (val: number | undefined , headId:string) => void = (val ,headId) => {
|
||||
|
||||
if(val!==undefined && bdst?.bdstBase.length>0){
|
||||
const data:BdstTypeMap[T] =bdst?.bdstBase[val]
|
||||
if (data) {
|
||||
setRainBdstForm(data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
useEffect(()=>{
|
||||
setbdstTable([]) // 초기화 작업
|
||||
},[])
|
||||
const nodeList = headMakeColSpan(bdst.moUpHeadList);
|
||||
return (
|
||||
<>
|
||||
<div className="grid grid-cols-12 gap-4 mt-4">
|
||||
<SelectBox
|
||||
className="col-span-3 "
|
||||
label={"시도"}
|
||||
selectClass={selectClass}
|
||||
selectArray={code.cityCd || []}
|
||||
onSelectValue={getSelCity}
|
||||
>
|
||||
{""}
|
||||
</SelectBox>
|
||||
<SelectBox
|
||||
className="col-span-3"
|
||||
label={"시군구"}
|
||||
selectClass={selectClass}
|
||||
selectArray={selectSgg || []}
|
||||
onSelectValue={getSgg}
|
||||
>
|
||||
{" "}
|
||||
</SelectBox>
|
||||
<Label className="w-20 text-base text-gray-600 mt-4 text-right">건축물명</Label>
|
||||
<Input className="w-full h-full text-2xl col-span-2 col-start-8" type="text" value={searchTxt || ''} onChange={(e) => setSearchTxt(e.target.value)}/>
|
||||
|
||||
<Button className="rounded-lg" onClick={()=>{searchBdst(searchTxt)}}>조회</Button>
|
||||
</div>
|
||||
<div className="border-t border-gray-300 my-4"></div>
|
||||
<div className="h-auto">
|
||||
<ScrollArea className="h-[20vh]">
|
||||
<div>
|
||||
<UiTable
|
||||
tableData={bdstTable || []}
|
||||
headlist={bdst.moUpHeadList}
|
||||
pageSize={-10}
|
||||
total={-1}
|
||||
headName={undefined}
|
||||
cellClick={(idx,headId)=> (tableClick(idx, headId||"" ))}
|
||||
>
|
||||
{nodeList}
|
||||
</UiTable>
|
||||
</div>
|
||||
</ScrollArea>
|
||||
<div className="border-t border-gray-300 my-4"></div>
|
||||
<ScrollArea className="h-[60vh]">
|
||||
<div>
|
||||
{ moType === 'RNB'?
|
||||
<RainRegForm rainForm={rainBdstForm as customRainBdst} isModal={true} />
|
||||
:moType==='RST'
|
||||
? <RswtrRegForm rswtForm={rainBdstForm as customRswtBdst} isModal={true}></RswtrRegForm>
|
||||
:<HtdflRegForm htdflForm={rainBdstForm as customHtdflBdst} isModal={true}></HtdflRegForm>
|
||||
}
|
||||
|
||||
</div>
|
||||
</ScrollArea>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
import { rainRegExcel } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
||||
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import {
|
||||
DatePicker,
|
||||
FileUpload,
|
||||
Form,
|
||||
FormField,
|
||||
FormUi,
|
||||
Title,
|
||||
} from "@common/business_components/ui";
|
||||
import { Button } from "@common/components/ui";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useState } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import type { z } from "zod";
|
||||
|
||||
export default function ChkgdExcel({ type }: { type: string }) {
|
||||
const [files, setFiles] = useState(null);
|
||||
|
||||
const [dmdDate, setDmdDate] = useState(new Date());
|
||||
|
||||
const defaultValues: z.infer<typeof rainRegExcel> = rainRegExcel.parse({});
|
||||
|
||||
const form = useForm<z.infer<typeof rainRegExcel>>({
|
||||
resolver: zodResolver(rainRegExcel),
|
||||
defaultValues: defaultValues,
|
||||
});
|
||||
|
||||
const onChangeDate = (val: Date | undefined) => {
|
||||
if (val) setDmdDate(val);
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<Form {...form}>
|
||||
<div>
|
||||
<Title
|
||||
title={
|
||||
type === "RNB"
|
||||
? "빗물 이용시설"
|
||||
: "중수도 이용시설" + "점검 결과등록"
|
||||
}
|
||||
></Title>
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
<h3 className="text-2xl font-bold text-gray-900">
|
||||
{"○점검정보 입력"}
|
||||
</h3>
|
||||
|
||||
<Button className="">저장</Button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="chckYmd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="점검일자">
|
||||
<DatePicker
|
||||
mode="single"
|
||||
field={{
|
||||
value:
|
||||
field.value && !isNaN(new Date(field.value).getTime())
|
||||
? new Date(field.value)
|
||||
: new Date(), // Provide a default Date value
|
||||
onChange: (date) => field.onChange(date),
|
||||
}}
|
||||
selectClass={selectClass}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="file"
|
||||
render={({ field }) => (
|
||||
<FormUi label="점검결과 파일">
|
||||
<FileUpload
|
||||
files={field.value}
|
||||
setFiles={setFiles}
|
||||
fileTypes="excel"
|
||||
></FileUpload>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/page";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { ScrollArea, Title, UiTable } from "@common/business_components/ui";
|
||||
import { Button } from "@common/components/ui";
|
||||
import { useEffect } from "react";
|
||||
|
||||
export default function ChkgdModal({type, obj}:{type:string , obj:any} ){
|
||||
|
||||
|
||||
const { rainChkgdn} = useWrStore((state) => state);
|
||||
|
||||
|
||||
|
||||
const nodeList = headMakeprfmnc(rainChkgdn?.supWaterHeadList,rainChkgdn?.rainHeadNm ) ;
|
||||
const rswtnodeList = headMakeprfmnc(rainChkgdn?.rswtDetailHeadList,rainChkgdn?.rainHeadNm ) ;
|
||||
|
||||
|
||||
useEffect(() =>{
|
||||
|
||||
},[rainChkgdn])
|
||||
|
||||
|
||||
const cellClick =(val:number|undefined, headId:string)=>{
|
||||
if(val!=undefined)
|
||||
console.log(rainChkgdn.supWaterData[val])
|
||||
|
||||
|
||||
}
|
||||
|
||||
return(
|
||||
<>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<Title title= {type==='RNB'?'빗물이용시설':'중수도 이용시설' + '지도점검 결과등록' }></Title>
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
<h3 className="text-2xl font-bold text-gray-900">{"○"+ obj.bdstNm + `(${obj.chckYmd})`}</h3>
|
||||
|
||||
<Button className="">저장</Button>
|
||||
</div>
|
||||
|
||||
<ScrollArea className="h-[60vh]">
|
||||
<UiTable
|
||||
headName={"연간 보급수이용량"}
|
||||
tableData={rainChkgdn.supWaterData||[]}
|
||||
headlist={rainChkgdn?.supWaterHeadList}
|
||||
pageSize={0}
|
||||
total={0}
|
||||
cellClick={(val, headId) => {
|
||||
cellClick(val, headId);
|
||||
}}
|
||||
onPageChange={function (page: number): void {
|
||||
throw new Error("Function not implemented.");
|
||||
} }>
|
||||
|
||||
{nodeList}
|
||||
</UiTable>
|
||||
|
||||
|
||||
<UiTable
|
||||
headName={"연간 빗물이용량"}
|
||||
tableData={rainChkgdn.supWaterData}
|
||||
headlist={rainChkgdn?.supWaterHeadList}
|
||||
pageSize={0}
|
||||
total={0}
|
||||
cellClick={(val, headId) => {
|
||||
cellClick(val, headId);
|
||||
}}
|
||||
onPageChange={function (page: number): void {
|
||||
throw new Error("Function not implemented.");
|
||||
} }>
|
||||
{nodeList}
|
||||
|
||||
</UiTable>
|
||||
|
||||
{type !=='RNB'?
|
||||
<div>
|
||||
<UiTable
|
||||
headName={"연간이용수질(1분기)"}
|
||||
tableData={[]}
|
||||
headlist={rainChkgdn?.rswtDetailHeadList}
|
||||
pageSize={0}
|
||||
total={0}
|
||||
cellClick={(val, headId) => {
|
||||
cellClick(val, headId);
|
||||
}}
|
||||
onPageChange={function (page: number): void {
|
||||
throw new Error("Function not implemented.");
|
||||
} }>
|
||||
{rswtnodeList}
|
||||
|
||||
</UiTable>
|
||||
|
||||
<UiTable
|
||||
headName={"연간이용수질(2분기)"}
|
||||
tableData={[]}
|
||||
headlist={rainChkgdn?.rswtDetailHeadList}
|
||||
pageSize={0}
|
||||
total={0}
|
||||
cellClick={(val, headId) => {
|
||||
cellClick(val, headId);
|
||||
}}
|
||||
onPageChange={function (page: number): void {
|
||||
throw new Error("Function not implemented.");
|
||||
} }>
|
||||
{rswtnodeList}
|
||||
|
||||
</UiTable>
|
||||
|
||||
<UiTable
|
||||
headName={"연간이용수질(3분기)"}
|
||||
tableData={[]}
|
||||
headlist={rainChkgdn?.rswtDetailHeadList}
|
||||
pageSize={0}
|
||||
total={0}
|
||||
cellClick={(val, headId) => {
|
||||
cellClick(val, headId);
|
||||
}}
|
||||
onPageChange={function (page: number): void {
|
||||
throw new Error("Function not implemented.");
|
||||
} }>
|
||||
{rswtnodeList}
|
||||
|
||||
</UiTable>
|
||||
|
||||
<UiTable
|
||||
headName={"연간이용수질(4분기)"}
|
||||
tableData={[]}
|
||||
headlist={rainChkgdn?.rswtDetailHeadList}
|
||||
pageSize={0}
|
||||
total={0}
|
||||
cellClick={(val, headId) => {
|
||||
cellClick(val, headId);
|
||||
}}
|
||||
onPageChange={function (page: number): void {
|
||||
throw new Error("Function not implemented.");
|
||||
} }>
|
||||
{rswtnodeList}
|
||||
|
||||
</UiTable>
|
||||
</div>
|
||||
:<></>}
|
||||
|
||||
</ScrollArea>
|
||||
</div>
|
||||
</>
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { pbnSttHeadList } from "@/app/store/ruseFcltMng/fcltSttn/pbnstSttn";
|
||||
import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from "@common/business_components/ui";
|
||||
import { Button, Checkbox } from "@common/components/ui";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
|
||||
export default function HeadChModal() {
|
||||
const { pbnStt } = useWrStore((state) => state);
|
||||
|
||||
|
||||
|
||||
const items = pbnSttHeadList.map(item => ({id:item.id, label:item.title}));
|
||||
|
||||
|
||||
|
||||
|
||||
const FormSchema = z.object({
|
||||
items: z.array(z.string()).refine((value) => value.some((item) => item), {
|
||||
message: "You have to select at least one item.",
|
||||
}),
|
||||
})
|
||||
|
||||
const form = useForm<z.infer<typeof FormSchema>>({
|
||||
resolver: zodResolver(FormSchema),
|
||||
})
|
||||
|
||||
|
||||
|
||||
const onSubmit = (val : z.infer<typeof FormSchema>) =>{
|
||||
|
||||
console.log(val)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-8">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="items"
|
||||
render={() => (
|
||||
<FormItem>
|
||||
<div className="mb-4">
|
||||
<FormLabel className="text-base">Sidebar</FormLabel>
|
||||
<FormDescription>
|
||||
Select the items you want to display in the sidebar.
|
||||
</FormDescription>
|
||||
</div>
|
||||
{items.map((item) => (
|
||||
<FormField
|
||||
key={item.id}
|
||||
control={form.control}
|
||||
name="items"
|
||||
render={({ field }) => {
|
||||
return (
|
||||
<FormItem
|
||||
key={item.id}
|
||||
className="flex flex-row items-start space-x-3 space-y-0"
|
||||
>
|
||||
<FormControl>
|
||||
<Checkbox
|
||||
checked={field.value?.includes(item.id)}
|
||||
onCheckedChange={(checked) => {
|
||||
return checked
|
||||
? field.onChange([...field.value, item.id])
|
||||
: field.onChange(
|
||||
field.value?.filter(
|
||||
(value) => value !== item.id
|
||||
)
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormLabel className="text-sm font-normal">
|
||||
{item.label}
|
||||
</FormLabel>
|
||||
</FormItem>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<Button type="submit">Submit</Button>
|
||||
</form>
|
||||
</Form>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,240 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
Form,
|
||||
FormField,
|
||||
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 { FormUi } from "@common/business_components";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { selectClass } from "@/app/store/rainReuseFacilityInsert";
|
||||
|
||||
const formSchema = z.object({
|
||||
username: z.string().min(2).max(50),
|
||||
facilityName: z.string().min(2).max(50),
|
||||
});
|
||||
|
||||
|
||||
export function RainReuseFaciltyInsertForm() {
|
||||
const { rain } = useWrStore((state) => state);
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
username: "",
|
||||
},
|
||||
});
|
||||
|
||||
// 2. Define a submit handler.
|
||||
function onSubmit(values: z.infer<typeof formSchema>) {
|
||||
// Do something with the form values.
|
||||
// ✅ This will be type-safe and validated.
|
||||
console.log(values);
|
||||
}
|
||||
|
||||
const onSelectValue=(val:string)=>{
|
||||
console.log(val)
|
||||
|
||||
}
|
||||
return (
|
||||
<div className="">
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)}>
|
||||
{/* <div className="flex justify-between items-center mx-3"> */}
|
||||
<div>
|
||||
<div>
|
||||
<h1 className="pl-3 text-xl ">○ 빗물이용시설 운영정보</h1>
|
||||
</div>
|
||||
</div>
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 ">
|
||||
기본정보
|
||||
</h1>
|
||||
<div className="grid grid-cols-4 gap-2 mt-4 pl-6" >
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_0211213336"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치완료일">
|
||||
<Input className="" placeholder="1,000,000" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-2" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치비">
|
||||
<Input className="" placeholder="1,000,000" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className=" my-4">
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 pl-6" >
|
||||
빗물이용시설 정보
|
||||
</h1>
|
||||
</div>
|
||||
<div>
|
||||
<h2 className="pl-3 text-xl">✓ 1. 집수면</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-10 gap-1 mt-4">
|
||||
<div className="col-span-5 pl-6" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="종류">
|
||||
<SelectBox selectClass={selectClass} label={""} selectArray={rain.selectYN} onSelectValue={onSelectValue} {...field}/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-5" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
|
||||
<FormUi label="면적(m³)">
|
||||
<Input className="" placeholder="1,000,000" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2 className="pl-3 text-xl">✓ 2. 여과 등 처리시설</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-12 gap-2 mt-4">
|
||||
<div className="col-span-4 pl-6" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="유무">
|
||||
<SelectBox selectClass={selectClass} label={""} selectArray={rain.selectYN} onSelectValue={onSelectValue} {...field}/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="용량(m³/일)">
|
||||
<Input className="" placeholder="1,000,000" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="처리공정">
|
||||
<Input className="" placeholder="1,000,000" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div className=" my-2">
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 ">
|
||||
인센티브 정보
|
||||
</h1>
|
||||
</div>
|
||||
<div>
|
||||
<h2 className="pl-3 text-xl">✓ 1. 설치비 지원</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-10 gap-2 pl-6 mt-4">
|
||||
<div className="col-span-5" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치비 지원 여부">
|
||||
<SelectBox selectClass={selectClass} label={""} selectArray={rain.selectYN} onSelectValue={onSelectValue} {...field}/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-5" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="지원금액(원)">
|
||||
<Input className="" placeholder="1,000,000" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2 className="pl-3 text-xl">✓ 2. 녹색건축물 인증</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-6 gap-2 mt-4">
|
||||
<div className="col-span-3 pl-6" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증여부">
|
||||
<SelectBox selectClass={selectClass} label={""} selectArray={rain.selectYN} onSelectValue={onSelectValue} {...field}/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증년도">
|
||||
<Input className="" placeholder="2024" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 pl-6" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증번호">
|
||||
<Input className="" placeholder="ab1234678" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증등급">
|
||||
<Input className="" placeholder="A" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</Form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,240 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
FormDescription,
|
||||
FormField,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
FormUi,
|
||||
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 { useWrStore } from "@/app/store";
|
||||
import { selectClass } from "@/app/store/rainReuseFacilityInsert";
|
||||
|
||||
const formSchema = z.object({
|
||||
username: z.string().min(2).max(50),
|
||||
facilityName: z.string().min(2).max(50),
|
||||
});
|
||||
|
||||
|
||||
export function RswtrReuseFaciltyInsertForm() {
|
||||
const { rswt } = useWrStore((state) => state);
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
username: "",
|
||||
},
|
||||
});
|
||||
|
||||
// 2. Define a submit handler.
|
||||
function onSubmit(values: z.infer<typeof formSchema>) {
|
||||
// Do something with the form values.
|
||||
// ✅ This will be type-safe and validated.
|
||||
console.log(values);
|
||||
}
|
||||
|
||||
const onSelectValue=(val:string)=>{
|
||||
console.log(val)
|
||||
|
||||
}
|
||||
return (
|
||||
<div className="">
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)}>
|
||||
{/* <div className="flex justify-between items-center mx-3"> */}
|
||||
<div>
|
||||
<div>
|
||||
<h1 className="pl-3 text-xl ">○ 중수도 시설 운영정보</h1>
|
||||
</div>
|
||||
</div>
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 ">
|
||||
기본정보
|
||||
</h1>
|
||||
<div className="grid grid-cols-4 gap-2 mt-4 pl-6" >
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_0211213336"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치완료일">
|
||||
<Input className="" placeholder="1,000,000" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-2" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치비">
|
||||
<Input className="" placeholder="1,000,000" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid grid-cols-4 gap-2 mt-4 pl-6" >
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_0211213336"
|
||||
render={({ field }) => (
|
||||
<FormUi label="물사용량(m³)">
|
||||
<Input className="" placeholder="1,000,000" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-2" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="의무대상 물사용량(m³)">
|
||||
<Input className="" placeholder="1,000,000" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className=" my-4">
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 pl-6" >
|
||||
중수도 시설 정보
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-10 gap-1 mt-4">
|
||||
<div className="col-span-5 pl-6" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="필수 종류">
|
||||
<SelectBox selectClass={selectClass} selectArray={rswt.selectYN} onSelectValue={onSelectValue} {...field}/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-5" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
|
||||
<FormUi label="주요처리공정">
|
||||
<Input className="" placeholder="1,000,000" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-5 pl-6" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="이용용도">
|
||||
<SelectBox selectClass={selectClass}label={""} selectArray={rswt.selectYN} onSelectValue={onSelectValue} {...field}/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className=" my-2">
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 ">
|
||||
인센티브 정보
|
||||
</h1>
|
||||
</div>
|
||||
<div>
|
||||
<h2 className="pl-3 text-xl">✓ 1. 설치비 지원</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-2 gap-2 mt-4">
|
||||
<div className="col-span-1 pl-6" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치비 지원여부">
|
||||
<SelectBox selectClass={selectClass} label={""} selectArray={rswt.selectYN} onSelectValue={onSelectValue} {...field}/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-1" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="지원금액(원)">
|
||||
<Input className="" placeholder="1,000,000" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2 className="pl-3 text-xl">✓ 2. 녹색건축물 인증</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-6 gap-2 mt-4">
|
||||
<div className="col-span-3 pl-6" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증여부">
|
||||
<SelectBox selectClass={selectClass} label={""} selectArray={rswt.selectYN} onSelectValue={onSelectValue} {...field}/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증년도">
|
||||
<Input className="" placeholder="2024" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 pl-6" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증번호">
|
||||
<Input className="" placeholder="ab1234678" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3" >
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9765724553"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증등급">
|
||||
<Input className="" placeholder="A" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</Form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
'use client'
|
||||
|
||||
import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/page";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { UiTable } from "@common/business_components/ui";
|
||||
|
||||
export default function RainChkgdTable() {
|
||||
|
||||
const { code, rainChkgdn} = useWrStore((state) => state);
|
||||
const nodeList = headMakeprfmnc(rainChkgdn?.rainChkgdnHeadList,rainChkgdn?.rainHeadNm ) ;
|
||||
|
||||
|
||||
return(
|
||||
|
||||
<>
|
||||
<UiTable
|
||||
tableData={[]}
|
||||
headlist={rainChkgdn.rainChkgdnHeadList}
|
||||
pageSize={100}
|
||||
total={10}
|
||||
headName={"지도점검 결과등록"}
|
||||
cellClick={()=>{} } >
|
||||
{nodeList}
|
||||
</UiTable>
|
||||
</>
|
||||
)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
'use client'
|
||||
|
||||
import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/page";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { UiTable } from "@common/business_components/ui";
|
||||
|
||||
export default function RswtChkgdTable() {
|
||||
|
||||
const { rswtChkgdn} = useWrStore((state) => state);
|
||||
const nodeList = headMakeprfmnc(rswtChkgdn?.rswtChkgdnHeadList , rswtChkgdn?.rswtHeadNm );
|
||||
|
||||
|
||||
return(
|
||||
|
||||
<>
|
||||
<UiTable
|
||||
tableData={[]}
|
||||
headlist={rswtChkgdn.rswtChkgdnHeadList}
|
||||
pageSize={100}
|
||||
total={10}
|
||||
headName={"지도점검 결과등록"}
|
||||
cellClick={() => { } } onPageChange={function (page: number): void {
|
||||
throw new Error("Function not implemented.");
|
||||
} } >
|
||||
{nodeList}
|
||||
</UiTable>
|
||||
</>
|
||||
)
|
||||
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
|
||||
import { Button } from "@common/components/ui";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev --turbopack",
|
||||
"dev": "next dev -p 3001",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint"
|
||||
@@ -11,7 +11,9 @@
|
||||
"dependencies": {
|
||||
"@common/business_components": "workspace:*",
|
||||
"@common/components": "workspace:*",
|
||||
"@common/assets": "workspace:*",
|
||||
"@hookform/resolvers": "^4.1.3",
|
||||
"@tanstack/react-table": "^8.21.2",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"lucide-react": "^0.474.0",
|
||||
|
||||
+14
-59
@@ -1,66 +1,21 @@
|
||||
import baseConfig from "../../packages/common/components/tailwind.config";
|
||||
|
||||
import type { Config } from "tailwindcss";
|
||||
import tailwindcssAnimate from "tailwindcss-animate";
|
||||
import presetConfig from "../../tailwind.config.preset";
|
||||
|
||||
export default {
|
||||
darkMode: ["class"],
|
||||
presets: [baseConfig],
|
||||
presets: [presetConfig],
|
||||
content: [
|
||||
"./app/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"./components/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"./src/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"./components/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"../../packages/common/components/src/ui/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"../../packages/common/business_components/src/ui/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
],
|
||||
plugins: [require("tailwindcss-animate")],
|
||||
theme: {
|
||||
extend: {
|
||||
borderRadius: {
|
||||
lg: 'var(--radius)',
|
||||
md: 'calc(var(--radius) - 2px)',
|
||||
sm: 'calc(var(--radius) - 4px)'
|
||||
},
|
||||
colors: {
|
||||
background: 'hsl(var(--background))',
|
||||
foreground: 'hsl(var(--foreground))',
|
||||
card: {
|
||||
DEFAULT: 'hsl(var(--card))',
|
||||
foreground: 'hsl(var(--card-foreground))'
|
||||
},
|
||||
popover: {
|
||||
DEFAULT: 'hsl(var(--popover))',
|
||||
foreground: 'hsl(var(--popover-foreground))'
|
||||
},
|
||||
primary: {
|
||||
DEFAULT: 'hsl(var(--primary))',
|
||||
foreground: 'hsl(var(--primary-foreground))'
|
||||
},
|
||||
secondary: {
|
||||
DEFAULT: 'hsl(var(--secondary))',
|
||||
foreground: 'hsl(var(--secondary-foreground))'
|
||||
},
|
||||
muted: {
|
||||
DEFAULT: 'hsl(var(--muted))',
|
||||
foreground: 'hsl(var(--muted-foreground))'
|
||||
},
|
||||
accent: {
|
||||
DEFAULT: 'hsl(var(--accent))',
|
||||
foreground: 'hsl(var(--accent-foreground))'
|
||||
},
|
||||
destructive: {
|
||||
DEFAULT: 'hsl(var(--destructive))',
|
||||
foreground: 'hsl(var(--destructive-foreground))'
|
||||
},
|
||||
border: 'hsl(var(--border))',
|
||||
input: 'hsl(var(--input))',
|
||||
ring: 'hsl(var(--ring))',
|
||||
chart: {
|
||||
'1': 'hsl(var(--chart-1))',
|
||||
'2': 'hsl(var(--chart-2))',
|
||||
'3': 'hsl(var(--chart-3))',
|
||||
'4': 'hsl(var(--chart-4))',
|
||||
'5': 'hsl(var(--chart-5))'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} satisfies Config;
|
||||
theme: {
|
||||
extend: {
|
||||
boxShadow: {
|
||||
blur: "0 0 10px -1px rgba(0, 0, 0, 0.06)",
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [tailwindcssAnimate],
|
||||
} satisfies Config;
|
||||
@@ -63,7 +63,7 @@
|
||||
"eslint-plugin-react-refresh": "^0.4.16",
|
||||
"eslint-plugin-storybook": "^0.11.2",
|
||||
"globals": "^15.14.0",
|
||||
"postcss": "^8.5.1",
|
||||
"postcss": "^8.5.3",
|
||||
"prettier": "^3.4.2",
|
||||
"prettier-plugin-tailwindcss": "^0.6.11",
|
||||
"storybook": "^8.5.3",
|
||||
|
||||
@@ -1,65 +1,10 @@
|
||||
@import "@common/assets/styles/base.css";
|
||||
@import "@common/assets/styles/diveicon.css";
|
||||
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
@layer base {
|
||||
:root {
|
||||
--background: #ffffff;
|
||||
--foreground: #0a0a0a;
|
||||
--card: #ffffff;
|
||||
--card-foreground: #0a0a0a;
|
||||
--popover: #ffffff;
|
||||
--popover-foreground: #0a0a0a;
|
||||
--primary: #2094fa;
|
||||
--primary-foreground: #fafafa;
|
||||
--secondary: #f5f5f5;
|
||||
--secondary-foreground: #0f1e33;
|
||||
--muted: #f5f5f5;
|
||||
--muted-foreground: #737373;
|
||||
--accent: #f5f5f5;
|
||||
--accent-foreground: #0f1e33;
|
||||
--destructive: #ff4141;
|
||||
--destructive-foreground: #fafafa;
|
||||
--border: #e5e5e5;
|
||||
--input: #e5e5e5;
|
||||
--label: #666666;
|
||||
--ring: #0a0a0a;
|
||||
--chart-1: #d95b43;
|
||||
--chart-2: #299392;
|
||||
--chart-3: #263e4d;
|
||||
--chart-4: #dfb938;
|
||||
--chart-5: #f08634;
|
||||
--radius: 1rem;
|
||||
}
|
||||
[data-mode="dark"] {
|
||||
--background: #0a0a0a;
|
||||
--foreground: #fafafa;
|
||||
--card: #0a0a0a;
|
||||
--card-foreground: #fafafa;
|
||||
--popover: #0a0a0a;
|
||||
--popover-foreground: #fafafa;
|
||||
--primary: #2094fa;
|
||||
--primary-foreground: #171717;
|
||||
--secondary: #262626;
|
||||
--secondary-foreground: #fafafa;
|
||||
--muted: #262626;
|
||||
--muted-foreground: #a2a2a2;
|
||||
--accent: #262626;
|
||||
--accent-foreground: #fafafa;
|
||||
--destructive: #b22222;
|
||||
--destructive-foreground: #fafafa;
|
||||
--border: #262626;
|
||||
--input: #262626;
|
||||
--label: #f1f1f1;
|
||||
--ring: #d4d4d4;
|
||||
--chart-1: #3399ff;
|
||||
--chart-2: #339966;
|
||||
--chart-3: #ff9933;
|
||||
--chart-4: #cc66ff;
|
||||
--chart-5: #ff3399;
|
||||
}
|
||||
}
|
||||
|
||||
@layer base {
|
||||
* {
|
||||
@apply border-border;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +0,0 @@
|
||||
|
||||
@layer base {}
|
||||
|
||||
@layer base {
|
||||
* {
|
||||
@apply border-border outline-ring/50;
|
||||
}
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@common/components";
|
||||
import React from "react";
|
||||
|
||||
type ModalType = {
|
||||
bodyClass: string;
|
||||
butNm: string;
|
||||
title: string;
|
||||
body: React.ReactNode;
|
||||
open?: boolean;
|
||||
onOpenChange?: (open: boolean) => void;
|
||||
}
|
||||
|
||||
export function UiModal({ bodyClass, butNm, title, body, open, onOpenChange }: ModalType) {
|
||||
const dialogProps = open !== undefined && onOpenChange !== undefined
|
||||
? { open, onOpenChange }
|
||||
: {};
|
||||
|
||||
return (
|
||||
<>
|
||||
{!open && (
|
||||
<Dialog>
|
||||
<DialogTrigger asChild>
|
||||
<Button className="mr-4 rounded-lg">{butNm}</Button>
|
||||
</DialogTrigger>
|
||||
<DialogContent className={bodyClass}>
|
||||
<DialogHeader>
|
||||
<DialogTitle>{title}</DialogTitle>
|
||||
<DialogDescription>
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
{body}
|
||||
<DialogFooter className="sm:justify-start">
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
)}
|
||||
{open && (
|
||||
<Dialog {...dialogProps}>
|
||||
<DialogContent className={bodyClass}>
|
||||
<DialogHeader>
|
||||
<DialogTitle>{title}</DialogTitle>
|
||||
<DialogDescription>
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
{body}
|
||||
<DialogFooter className="sm:justify-start">
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -9,12 +9,23 @@ import type { DayPickerSingleProps } from "react-day-picker";
|
||||
import { Button, Calendar, Popover, PopoverContent, PopoverTrigger } from "@common/components/ui";
|
||||
import { cn } from "../../lib/utils";
|
||||
import { FormControl } from "../form";
|
||||
import { ko } from "date-fns/locale";
|
||||
import { useState } from "react";
|
||||
|
||||
type DatePickerProps = DayPickerSingleProps & { field: { value: Date; onChange: (date: Date | undefined) => void } ,selectClass:string|undefined };
|
||||
|
||||
|
||||
export function DatePicker({ field, selectClass }: DatePickerProps) {
|
||||
|
||||
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
const handleSelect = (date: Date | undefined) => {
|
||||
field.onChange(date); // React Hook Form 업데이트
|
||||
setOpen(false);
|
||||
};
|
||||
return (
|
||||
<Popover>
|
||||
<Popover open={open} onOpenChange={setOpen}>
|
||||
<PopoverTrigger asChild>
|
||||
<FormControl>
|
||||
<Button
|
||||
@@ -27,7 +38,12 @@ export function DatePicker({ field, selectClass }: DatePickerProps) {
|
||||
):selectClass}
|
||||
>
|
||||
{field?.value ? (
|
||||
format(field?.value, "PPP")
|
||||
format(
|
||||
field.value instanceof Date && !isNaN(field.value.getTime())
|
||||
? field.value
|
||||
: new Date()
|
||||
|
||||
, "PPP", { locale: ko })
|
||||
) : (
|
||||
<span>Pick a date</span>
|
||||
)}
|
||||
@@ -39,8 +55,9 @@ export function DatePicker({ field, selectClass }: DatePickerProps) {
|
||||
<Calendar
|
||||
mode="single"
|
||||
selected={field?.value}
|
||||
onSelect={field?.onChange}
|
||||
onSelect={handleSelect}
|
||||
initialFocus
|
||||
locale={ko}
|
||||
/>
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTrigger } from "@common/components";
|
||||
import { useState } from "react";
|
||||
|
||||
type ModalType = {
|
||||
bodyClass: string;
|
||||
body: React.ReactNode;
|
||||
open?: boolean;
|
||||
onOpenChange?: (open: boolean) => void;
|
||||
noHeaderYn?: 'N' | 'Y';
|
||||
noFooterYn?: 'N' | 'Y';
|
||||
headerTitle?: string;
|
||||
footerContent?: React.ReactNode;
|
||||
}
|
||||
|
||||
export function UiModal({
|
||||
bodyClass,
|
||||
body,
|
||||
open,
|
||||
onOpenChange,
|
||||
noHeaderYn = 'N',
|
||||
noFooterYn = 'N',
|
||||
headerTitle,
|
||||
footerContent
|
||||
}: ModalType) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className={bodyClass}>
|
||||
{noHeaderYn === 'N' && (
|
||||
<DialogHeader>
|
||||
<DialogDescription>
|
||||
{headerTitle}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
)}
|
||||
{(open && body)}
|
||||
{noFooterYn === 'N' && (
|
||||
<DialogFooter className="sm:justify-start">
|
||||
{footerContent}
|
||||
</DialogFooter>
|
||||
)}
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -9,4 +9,11 @@ export * from "./search_input";
|
||||
export * from "./search_input_select";
|
||||
export * from "./select";
|
||||
export * from "./table";
|
||||
|
||||
export * from "./main_content_div";
|
||||
export * from "./title";
|
||||
export * from "./search_form_left";
|
||||
export * from "./search_form_right";
|
||||
export * from "./table_div";
|
||||
export * from "./list_div";
|
||||
export * from "./tab";
|
||||
export * from "./dialog_ui"
|
||||
@@ -0,0 +1,11 @@
|
||||
import React from 'react'
|
||||
|
||||
function ListDiv(props: {children: React.ReactNode, className?: string|undefined}) {
|
||||
return (
|
||||
<div className={`card card-border ${props.className}`}>
|
||||
{props.children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ListDiv
|
||||
@@ -0,0 +1,11 @@
|
||||
import React from 'react'
|
||||
|
||||
export default function MainDiv(props: {children: React.ReactNode}) {
|
||||
return (
|
||||
<div className="min-h-screen bg-container">
|
||||
{props.children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export { MainDiv };
|
||||
@@ -1,6 +1,6 @@
|
||||
function SearchDiv ({children}:{ children: React.ReactNode; }) {
|
||||
return (
|
||||
<div className="flex border border-black m-4 rounded-lg min-h-[80px]">
|
||||
<div className="flex card card-border !mt-6">
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import React from 'react'
|
||||
|
||||
function SearchFormLeft(props: {children: React.ReactNode}) {
|
||||
return (
|
||||
<div className="grid grid-cols-12 gap-4 w-4/5 mx-4">
|
||||
{props.children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export { SearchFormLeft };
|
||||
@@ -0,0 +1,11 @@
|
||||
import React from 'react'
|
||||
|
||||
function SearchFormRight(props: {children: React.ReactNode}) {
|
||||
return (
|
||||
<div className="w-1/5 mx-5 flex items-center justify-end space-x-2">
|
||||
{props.children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export { SearchFormRight };
|
||||
@@ -1,15 +1,29 @@
|
||||
import { Input, Label } from "@common/components";
|
||||
import React from "react";
|
||||
|
||||
const SearchInput = React.forwardRef<
|
||||
HTMLDivElement& HTMLInputElement,
|
||||
React.HTMLAttributes<HTMLDivElement> & {className:string, label:string}>
|
||||
(({className, label}, ref) => {
|
||||
const SearchInput = React.forwardRef<HTMLInputElement, {className:string, label:string, textValue:string, setText:(val:string)=>void}>(({className, label, textValue, setText}, ref) => {
|
||||
const changeText=(e:React.ChangeEvent<HTMLInputElement>)=>{
|
||||
|
||||
if(e?.target?.value){
|
||||
|
||||
setText(e.target.value)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const keyUp=(e:any)=>{
|
||||
if(e.keyCode===8 && e.target.value.length==1){
|
||||
setText('')
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={className+" flex"} >
|
||||
{label && <Label className="m-4 text-2xl w-1/4">{label}</Label>}
|
||||
<Input className="ml-8 w-3/4 text-lg" ref={ref}></Input>
|
||||
<div className={className+" flex items-center"} >
|
||||
{label && <Label className="w-20 text-base text-gray-600">{label}</Label>}
|
||||
<Input className="flex-1 ml-8 w-3/4 h-10 border rounded" value={textValue} onChange={changeText} onKeyUp={keyUp}></Input>
|
||||
</div>
|
||||
)
|
||||
});
|
||||
export { SearchInput };
|
||||
export { SearchInput };
|
||||
@@ -11,19 +11,23 @@ export type SelectDataType = {
|
||||
* @param label - string label
|
||||
* @param selectData - SelectDataType[] 선택 데이터
|
||||
* @param onSelectValue - (val:string)=>void 선택 값 콜백
|
||||
* @param textValue - string 입력 값
|
||||
* @param setText - (val:string)=>void 입력 값 설정 콜백
|
||||
* @param selectValue - string select 선택 값
|
||||
* @param refs - React.forwardRef<HTMLInputElement> | null 입력값 ref
|
||||
* @returns React.FC
|
||||
*/
|
||||
const SearchInputSelect = React.forwardRef<HTMLInputElement, {className:string, label:string, selectData: SelectDataType[], onSelectValue:(val:string)=>void, textValue:string, setText:(val:string)=>void}>(({className, label, selectData, onSelectValue, textValue, setText}) => {
|
||||
const SearchInputSelect = React.forwardRef<HTMLInputElement, {className:string, label:string, selectData: SelectDataType[], onSelectValue:(val:string)=>void, textValue:string, setText:(val:string)=>void, selectValue:string}>(({className, label, selectData, onSelectValue, textValue, setText, selectValue}, ref) => {
|
||||
const changeText=(e:React.ChangeEvent<HTMLInputElement>)=>{
|
||||
if(e?.target?.value) setText(e.target.value)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={className+" flex items-center"} >
|
||||
{label && <Label className="m-4 text-2xl w-1/4">{label}</Label>}
|
||||
{label && <Label className="w-20 text-base text-gray-600">{label}</Label>}
|
||||
<div className="flex w-full items-center">
|
||||
<Input className="w-2/3 text-lg" value={textValue} onChange={changeText} />
|
||||
<Select onValueChange={onSelectValue}>
|
||||
<Input className="w-2/3 text-lg h-10 p-2 border rounded" value={textValue} onChange={changeText} />
|
||||
<Select onValueChange={onSelectValue} value={selectValue}>
|
||||
<SelectTrigger className="ml-2 w-1/3 text-lg" >
|
||||
<SelectValue placeholder={selectData?.[0]?.text ?? ""} />
|
||||
</SelectTrigger>
|
||||
@@ -38,4 +42,4 @@ const SearchInputSelect = React.forwardRef<HTMLInputElement, {className:string,
|
||||
</div>
|
||||
)
|
||||
});
|
||||
export { SearchInputSelect };
|
||||
export { SearchInputSelect };
|
||||
@@ -5,26 +5,32 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from ".
|
||||
/** 차트 기본 스타일 */
|
||||
interface SelectBox1 {
|
||||
text:string,
|
||||
val:string
|
||||
val:string|number
|
||||
}
|
||||
|
||||
|
||||
const SelectBox = React.forwardRef<
|
||||
HTMLDivElement,
|
||||
React.HTMLAttributes<HTMLDivElement> & {label:string, selectClass:string|undefined, className:string, selectArray:SelectBox1[], onSelectValue:(val:string)=>void}
|
||||
>(({ label, className, selectClass, selectArray, onSelectValue }, ref)=>{
|
||||
React.HTMLAttributes<HTMLDivElement> & {
|
||||
label:string,
|
||||
selectClass:string|undefined,
|
||||
className:string,
|
||||
selectArray:SelectBox1[],
|
||||
onSelectValue:(val:string|number)=>void,
|
||||
value?: string|number
|
||||
}
|
||||
>(({ label, className, selectClass, selectArray, onSelectValue, value }, ref)=>{
|
||||
const placeHolder = selectArray?.[0]?.text ?? "";
|
||||
|
||||
return (
|
||||
<div className={className+" flex items-center"} ref={ref}>
|
||||
{label && <Label className="m-4 text-2xl w-1/4">{label}</Label>}
|
||||
<Select onValueChange={onSelectValue}>
|
||||
<SelectTrigger className={selectClass?selectClass:"ml-8 w-3/4 text-2xl"}>
|
||||
{label && <Label className="w-20 text-base text-gray-600">{label}</Label>}
|
||||
<Select onValueChange={onSelectValue} value={value !== undefined ? String(value) : undefined}>
|
||||
<SelectTrigger className={selectClass?selectClass:"flex-1 p-2 border rounded"}>
|
||||
<SelectValue placeholder={placeHolder} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{selectArray.map((selectArray) => (
|
||||
<SelectItem key={selectArray.val} value={selectArray.val}>{selectArray.text}</SelectItem>
|
||||
<SelectItem key={selectArray.val} value={String(selectArray.val)}>{selectArray.text}</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import { Tabs, TabsList, TabsTrigger } from '@common/components/ui';
|
||||
import React from 'react';
|
||||
|
||||
interface TabItem {
|
||||
value: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
interface UITabProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
defaultValue?: string;
|
||||
tabList: TabItem[];
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
const UITab = React.forwardRef<
|
||||
HTMLDivElement,
|
||||
UITabProps
|
||||
>(({defaultValue, tabList, children}, ref)=>{
|
||||
return (
|
||||
<Tabs defaultValue={defaultValue || tabList[0]?.value} className={"w-full space-x-1 border-b border-gray-200"}>
|
||||
<TabsList className="flex space-x-1">
|
||||
{tabList.map((tab) => (
|
||||
<TabsTrigger
|
||||
key={tab.value}
|
||||
value={tab.value}
|
||||
className="py-2 px-4 text-sm font-medium border-b-2 focus:outline-none data-[state=active]:border-blue-500 data-[state=active]:text-blue-600 data-[state=inactive]:border-transparent data-[state=inactive]:text-gray-500 hover:text-gray-700 hover:border-gray-300"
|
||||
>
|
||||
{tab.label}
|
||||
</TabsTrigger>
|
||||
))}
|
||||
</TabsList>
|
||||
{children}
|
||||
</Tabs>
|
||||
)
|
||||
})
|
||||
export { UITab };
|
||||
@@ -1,47 +1,84 @@
|
||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@common/components";
|
||||
import { useEffect, useState } from "react";
|
||||
import UiPageNations from "./uiPageNations";
|
||||
|
||||
type UiTableProps = {
|
||||
headName: React.ReactNode | undefined;
|
||||
tableData: { [key: string]: string | number | boolean }[];
|
||||
tableData: { [key: string]: string | number | boolean | object}[];
|
||||
headlist: UiHeadProps[];
|
||||
pageSize: number;
|
||||
total: number;
|
||||
children: React.ReactNode | undefined;
|
||||
cellClick : (index:number)=>void | undefined;
|
||||
cellClick : ((index:number|undefined, headId:string)=>void )| undefined;
|
||||
onPageChange: (page: number) => void;
|
||||
className?: string;
|
||||
resetPageNo?: boolean;
|
||||
}
|
||||
|
||||
type UiHeadProps = {
|
||||
id: string;
|
||||
title: string;
|
||||
align?: string;
|
||||
}
|
||||
|
||||
export function UiTable({ tableData, headlist, pageSize, total, children, headName, cellClick }: UiTableProps) {
|
||||
const cur = 1;
|
||||
export function UiTable({ tableData, headlist, pageSize, total, children, headName, cellClick, onPageChange, className = '', resetPageNo = false }: UiTableProps) {
|
||||
const [cur, setCur] = useState<number>(1);
|
||||
const [idx, setIdx] = useState<number>(-1);
|
||||
|
||||
useEffect(() => {
|
||||
if (resetPageNo) {
|
||||
setCur(1);
|
||||
onPageChange(1);
|
||||
}
|
||||
}, [onPageChange, resetPageNo]);
|
||||
|
||||
const handlePageChange = (page: number) => {
|
||||
setCur(page);
|
||||
onPageChange(page);
|
||||
}
|
||||
|
||||
const handleCellClick = (index: number,headId:string )=> {
|
||||
if (cellClick) {
|
||||
cellClick(index,headId);
|
||||
setIdx(index);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{headName ? headName : <></>}
|
||||
<Table>
|
||||
<TableHeader>
|
||||
{headName ? <div className="card-header">
|
||||
<h3 className="text-2xl font-medium text-label">{headName}</h3>
|
||||
</div> : <></>}
|
||||
<div className={`card !m-[1.2rem] !p-0r ${className}`}>
|
||||
<Table variant="secondary">
|
||||
<TableHeader >
|
||||
{children ? <>{children}</> : <TableRow>
|
||||
{headlist?.map((head) => (
|
||||
<TableHead key={head.id}>{head.title}</TableHead>
|
||||
))}
|
||||
</TableRow>}
|
||||
|
||||
</TableHeader>
|
||||
<TableBody className='text-center'>
|
||||
{tableData?.map((el: { [key: string]: string | number | boolean }, index) => (
|
||||
<TableRow key={index + "row"} >
|
||||
{headlist.map((head) => (
|
||||
<TableCell onClick={()=>cellClick(index)} key={head.id + index}>{el[head.id]}</TableCell>
|
||||
{tableData?.map((el: { [key: string]: string | number | boolean | object}, index) => (
|
||||
<TableRow key={index + "row"}>
|
||||
{headlist?.map((head) => (
|
||||
<TableCell
|
||||
className={`${head.align === 'right' ? 'text-right' : 'text-center'} ${
|
||||
cellClick && idx === index ? '!font-[1000] cursor-pointer' :
|
||||
cellClick ? 'cursor-pointer' : ''
|
||||
}`}
|
||||
onClick={() => handleCellClick(index, head.id)}
|
||||
key={head.id + index}
|
||||
>
|
||||
{String(el[head.id] ?? '')}
|
||||
</TableCell>
|
||||
))}
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
{total <= 0 ? <></> : <UiPageNations total={total} cur={cur} pageSize={pageSize} />}
|
||||
</Table>
|
||||
{total <= 0 ? <></> : <UiPageNations total={total} cur={cur} pageSize={pageSize} onPageChange={handlePageChange} />}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,46 +1,77 @@
|
||||
'use client'
|
||||
|
||||
'use client';
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { Pagination, PaginationContent, PaginationItem, PaginationPrevious, PaginationLink, PaginationNext } from "./lib/pagination";
|
||||
|
||||
import { PaginationNext } from "./lib/pagination";
|
||||
import { PaginationLink } from "./lib/pagination";
|
||||
import { PaginationPrevious } from "./lib/pagination";
|
||||
import { PaginationItem } from "./lib/pagination";
|
||||
import { PaginationContent } from "./lib/pagination";
|
||||
import { Pagination } from "./lib/pagination";
|
||||
|
||||
interface CommonPageNationsProps {
|
||||
total: number;
|
||||
cur: number;
|
||||
pageSize: number;
|
||||
total: number;
|
||||
cur: number;
|
||||
pageSize: number;
|
||||
onPageChange: (page: number) => void;
|
||||
}
|
||||
|
||||
export default function UiPageNations(commonPageNationsProps: CommonPageNationsProps) {
|
||||
|
||||
const [pageProps, setPageProps] = useState(commonPageNationsProps);
|
||||
const [pageProps, setPageProps] = useState(commonPageNationsProps);
|
||||
|
||||
useEffect(() => {
|
||||
setPageProps(commonPageNationsProps);
|
||||
}, [commonPageNationsProps]);
|
||||
|
||||
useEffect(() => {
|
||||
setPageProps(commonPageNationsProps);
|
||||
} ,[commonPageNationsProps]);
|
||||
const totalPages = Math.ceil(pageProps.total / pageProps.pageSize);
|
||||
const pagesPerGroup = 10;
|
||||
const currentGroup = Math.floor((pageProps.cur - 1) / pagesPerGroup);
|
||||
const startPage = currentGroup * pagesPerGroup + 1;
|
||||
const endPage = Math.min(startPage + pagesPerGroup - 1, totalPages);
|
||||
|
||||
const handlePageChange = (page: number) => {
|
||||
pageProps.onPageChange(page);
|
||||
};
|
||||
|
||||
return(
|
||||
<Pagination>
|
||||
<PaginationContent>
|
||||
<PaginationItem>
|
||||
<PaginationPrevious href="#" />
|
||||
</PaginationItem>
|
||||
return (
|
||||
<Pagination>
|
||||
<PaginationContent>
|
||||
|
||||
{/* 이전 그룹으로 이동 */}
|
||||
<PaginationItem>
|
||||
<PaginationPrevious
|
||||
href="#"
|
||||
onClick={() => {
|
||||
if (startPage > 1) handlePageChange(startPage - 1);
|
||||
}}
|
||||
/>
|
||||
</PaginationItem>
|
||||
|
||||
{/* 현재 그룹 페이지들 표시 */}
|
||||
{
|
||||
Array.from({length:Math.ceil(commonPageNationsProps.total/commonPageNationsProps.pageSize)},(_,i)=>i+1).map((el,index)=>(
|
||||
<PaginationItem key={index}>
|
||||
<PaginationLink href= '#'>{el}</PaginationLink>
|
||||
</PaginationItem>
|
||||
))
|
||||
}
|
||||
<PaginationItem>
|
||||
<PaginationNext href="#" />
|
||||
Array.from({ length: endPage - startPage + 1 }, (_, i) => startPage + i).map((pageNum) => (
|
||||
<PaginationItem key={pageNum}>
|
||||
<PaginationLink
|
||||
href="#"
|
||||
isActive={pageNum === pageProps.cur}
|
||||
onClick={() => handlePageChange(pageNum)}
|
||||
>
|
||||
{pageNum}
|
||||
</PaginationLink>
|
||||
</PaginationItem>
|
||||
|
||||
|
||||
|
||||
</PaginationContent>
|
||||
</Pagination>
|
||||
);
|
||||
))
|
||||
}
|
||||
|
||||
{/* 다음 그룹으로 이동 */}
|
||||
<PaginationItem>
|
||||
<PaginationNext
|
||||
href="#"
|
||||
onClick={() => {
|
||||
if (endPage < totalPages) handlePageChange(endPage + 1);
|
||||
}}
|
||||
/>
|
||||
</PaginationItem>
|
||||
|
||||
</PaginationContent>
|
||||
</Pagination>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import React from 'react'
|
||||
|
||||
function ContentsDiv(props: {children: React.ReactNode}) {
|
||||
return (
|
||||
<div className="card card-border !mt-6">
|
||||
{props.children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export { ContentsDiv };
|
||||
@@ -0,0 +1,11 @@
|
||||
import React from 'react'
|
||||
|
||||
function Title(props: {title: string}) {
|
||||
return (
|
||||
<h2 className="px-[1.8rem] pt-[2rem] text-[2.4rem] font-semibold text-title">
|
||||
{props.title}
|
||||
</h2>
|
||||
)
|
||||
}
|
||||
|
||||
export { Title };
|
||||
@@ -1,93 +1,8 @@
|
||||
import presetConfig from "../../../tailwind.config.preset";
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
export default {
|
||||
darkMode: ["class", "[data-mode='dark']"],
|
||||
content: ["./src/**/*.{ts,tsx,js,jsx}", "./.storybook/**/*.{ts,tsx,js,jsx}"],
|
||||
theme: {
|
||||
extend: {
|
||||
borderRadius: {
|
||||
lg: "var(--radius)",
|
||||
md: "calc(var(--radius) - 2px)",
|
||||
sm: "calc(var(--radius) - 4px)",
|
||||
},
|
||||
colors: {
|
||||
background: "var(--background)",
|
||||
foreground: "var(--foreground)",
|
||||
card: {
|
||||
DEFAULT: "var(--card)",
|
||||
foreground: "var(--card-foreground)",
|
||||
},
|
||||
popover: {
|
||||
DEFAULT: "var(--popover)",
|
||||
foreground: "var(--popover-foreground)",
|
||||
},
|
||||
primary: {
|
||||
DEFAULT: "var(--primary)",
|
||||
foreground: "var(--primary-foreground)",
|
||||
},
|
||||
secondary: {
|
||||
DEFAULT: "var(--secondary)",
|
||||
foreground: "var(--secondary-foreground)",
|
||||
},
|
||||
muted: {
|
||||
DEFAULT: "var(--muted)",
|
||||
foreground: "var(--muted-foreground)",
|
||||
},
|
||||
accent: {
|
||||
DEFAULT: "var(--accent)",
|
||||
foreground: "var(--accent-foreground)",
|
||||
},
|
||||
destructive: {
|
||||
DEFAULT: "var(--destructive)",
|
||||
foreground: "var(--destructive-foreground)",
|
||||
},
|
||||
border: "var(--border)",
|
||||
input: "var(--input)",
|
||||
label: "var(--label)",
|
||||
ring: "var(--ring)",
|
||||
chart: {
|
||||
1: "var(--chart-1)",
|
||||
2: "var(--chart-2)",
|
||||
3: "var(--chart-3)",
|
||||
4: "var(--chart-4)",
|
||||
5: "var(--chart-5)",
|
||||
},
|
||||
},
|
||||
keyframes: {
|
||||
"accordion-down": {
|
||||
from: { height: "0" },
|
||||
to: { height: "var(--radix-accordion-content-height)" },
|
||||
},
|
||||
"accordion-up": {
|
||||
from: { height: "var(--radix-accordion-content-height)" },
|
||||
to: { height: "0" },
|
||||
},
|
||||
"spin-parent": {
|
||||
from: { transform: "translate(-50%,-50%) rotate(0deg)" },
|
||||
to: { transform: "translate(-50%,-50%) rotate(360deg)" },
|
||||
},
|
||||
"spin-child": {
|
||||
from: { transform: "translate(0,0) rotate(0deg)" },
|
||||
to: { transform: "translate(0,0) rotate(360deg)" },
|
||||
},
|
||||
},
|
||||
animation: {
|
||||
"accordion-down": "accordion-down 0.2s ease-out",
|
||||
"accordion-up": "accordion-up 0.2s ease-out",
|
||||
"spin-parent": "spin-parent 6s linear infinite",
|
||||
"spin-child": "spin-child 1s ease-in-out infinite",
|
||||
},
|
||||
backgroundImage: {
|
||||
"gradient-blue": "linear-gradient(.25turn, #2094fa, #00e5dd)",
|
||||
"gradient-blue-hover":
|
||||
"linear-gradient(.25turn, #2298ff, #01dcda, #00e8b4)",
|
||||
"gradient-green": "linear-gradient(.25turn, #00bad0, #00eb6f)",
|
||||
"gradient-green-hover": "linear-gradient(.25turn, #00bad0, #12fe81)",
|
||||
"gradient-red": "linear-gradient(.25turn, #ff487c, #ffc425)",
|
||||
"gradient-red-hover": "linear-gradient(.25turn, #ff487c, #ffea3a)",
|
||||
"gradient-purple": "linear-gradient(.25turn, #be30d7, #ff9264)",
|
||||
"gradient-purple-hover": "linear-gradient(.25turn, #be30d7, #ffaf5a)",
|
||||
},
|
||||
},
|
||||
},
|
||||
presets: [presetConfig],
|
||||
content: ["./src/**/*.{ts,tsx,js,jsx}"],
|
||||
plugins: [require("tailwindcss-animate")],
|
||||
};
|
||||
|
||||
@@ -29,7 +29,7 @@ const TableHeader = React.forwardRef<
|
||||
HTMLTableSectionElement,
|
||||
React.HTMLAttributes<HTMLTableSectionElement>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
|
||||
<thead ref={ref} className={cn("sticky top-0 bg-secondary [&_tr]:border-b", className)} {...props} />
|
||||
));
|
||||
TableHeader.displayName = "TableHeader";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user