Compare commits
2
Commits
feature/sein
...
tags/jw
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e88cf0c6d0 | ||
|
|
882ed8d9eb |
@@ -17,3 +17,4 @@ dist
|
||||
|
||||
# env
|
||||
.env*
|
||||
.qodo
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
NODE_OPTIONS='--inspect' npx next dev
|
||||
@@ -14,7 +14,7 @@ function LoginPage() {
|
||||
const formData = new FormData(e.target as HTMLFormElement);
|
||||
const userId = formData.get("id") as string;
|
||||
const password = formData.get("password") as string;
|
||||
|
||||
console.log(userId, password);
|
||||
await LoginApi.login({ userId, password });
|
||||
router.push("/site");
|
||||
};
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.*
|
||||
.yarn/*
|
||||
!.yarn/patches
|
||||
!.yarn/plugins
|
||||
!.yarn/releases
|
||||
!.yarn/versions
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# next.js
|
||||
/.next/
|
||||
/out/
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
.pnpm-debug.log*
|
||||
|
||||
# env files (can opt-in for committing if needed)
|
||||
.env*
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
|
||||
# typescript
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB |
@@ -1,70 +0,0 @@
|
||||
@import "../../../packages/common/components/src/base.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;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import { BaseLayout } from "@common/components";
|
||||
import "./globals.css";
|
||||
import { StoreProvider } from "./store";
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body>
|
||||
<StoreProvider>
|
||||
<BaseLayout>
|
||||
{children}
|
||||
</BaseLayout>
|
||||
</StoreProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
"use client";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import * as z from "zod";
|
||||
import {
|
||||
Form,
|
||||
FormField,
|
||||
FormUi,
|
||||
ScrollArea,
|
||||
SelectBox,
|
||||
} from "@common/business_components/ui";
|
||||
import { Button } from "@common/components/ui";
|
||||
import { CoRegForm } from "@/components/ui/matDmd/coRegForm/component";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import { ToastFormUi } from "@/components/toastFromUi";
|
||||
|
||||
const formSchema = z.object({
|
||||
ctpv: z.string(),
|
||||
sgg: z.string(),
|
||||
coNm: z.string().min(1).max(20),
|
||||
bznmNo: z.string().min(1).min(9).max(12),
|
||||
addr: z.string().min(1).min(6).max(20),
|
||||
telNo: z.string().min(8).max(12),
|
||||
|
||||
});
|
||||
|
||||
export default function MyForm() {
|
||||
|
||||
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
coNm:'',
|
||||
bznmNo:'',
|
||||
addr:'',
|
||||
telNo:'',
|
||||
},
|
||||
});
|
||||
|
||||
function onSubmit(values: z.infer<typeof formSchema>) {
|
||||
try {
|
||||
toast.dismiss();
|
||||
ToastFormUi("수요신청 화면으로 이동하시겠습니까?", "수요처 등록 완료", "./dmdReg", "이동")
|
||||
|
||||
} catch (error) {
|
||||
console.error("Form submission error", error);
|
||||
toast.error("수요처 등록이 실패하였습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="grid h-40 grid-cols-3 place-content-center">
|
||||
<h1 className=" col-start-2 col-span-1 text-4xl underline">
|
||||
수요처 정보입력
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-5 gap-4 overflow-hidden">
|
||||
<div className="col-span-1 "/>
|
||||
<div className="col-span-3 ">
|
||||
<div>
|
||||
<Form {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="space-y-8 max-w-3xl mx-auto"
|
||||
>
|
||||
<CoRegForm>{form}</CoRegForm>
|
||||
|
||||
|
||||
<Button type="submit">수요처등록</Button>
|
||||
</form>
|
||||
</Form>
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-span-1 " >
|
||||
<Toaster position="top-center" />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
"use client";
|
||||
import { useForm } from "react-hook-form";
|
||||
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 toast, { Toaster } from "react-hot-toast";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
const formSchema = z.object({
|
||||
dmdSel: z.string().min(1),
|
||||
dmdTmng: z.coerce.date(),
|
||||
dmdWq: z.string().min(1).optional(),
|
||||
useUsgCd: z.string(),
|
||||
wntUntprc: z.string().min(1),
|
||||
grssClfg: z.string().min(1),
|
||||
tn: z.string().min(1).optional(),
|
||||
combResdch: z.string().min(1).optional(),
|
||||
tp: z.string().min(1).optional(),
|
||||
trbt: z.string().min(1).optional(),
|
||||
ph: z.string().min(1).optional(),
|
||||
bod: z.string().min(1).optional(),
|
||||
clIonQnt: z.string().min(1).optional(),
|
||||
smll: z.string().min(1).optional(),
|
||||
cdtnv: z.string().min(1).optional(),
|
||||
crmty: z.string().min(1).optional(),
|
||||
rmrk: z.string().min(1).optional(),
|
||||
sply1: z.string().min(1).optional(),
|
||||
sply2: z.string().min(1).optional(),
|
||||
sply3: z.string().min(1).optional(),
|
||||
password: z.string().min(1),
|
||||
});
|
||||
|
||||
export default function MyForm() {
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
dmdSel:'',
|
||||
dmdTmng: new Date(),
|
||||
dmdWq: "",
|
||||
useUsgCd: "",
|
||||
wntUntprc: "",
|
||||
grssClfg: "",
|
||||
tn: "",
|
||||
combResdch: "",
|
||||
tp: "",
|
||||
trbt: "",
|
||||
ph: "",
|
||||
bod: "",
|
||||
clIonQnt: "",
|
||||
smll: "",
|
||||
cdtnv: "",
|
||||
crmty: "",
|
||||
rmrk: "",
|
||||
sply1: "",
|
||||
sply2: "",
|
||||
sply3: "",
|
||||
password: "",
|
||||
},
|
||||
});
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
async function onSubmit(values: z.infer<typeof formSchema>) {
|
||||
try {
|
||||
|
||||
toast.success("✅ 수요신청이 완료되었습니다.");
|
||||
await new Promise((resolve) => setTimeout(resolve, 3000));
|
||||
router.push("../../")
|
||||
} catch (error) {
|
||||
toast.error("수요신청을 다시입력해주시길 바랍니다.");
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="grid h-40 grid-cols-3 place-content-center">
|
||||
<h1 className=" col-start-2 col-span-1 text-4xl underline">
|
||||
수요 신청정보입력
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-5 gap-4 overflow-hidden">
|
||||
<div className="col-span-1 " />
|
||||
<div className="col-span-3 max-h-[78vh] overflow-y-scroll ">
|
||||
<div>
|
||||
<Form {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="space-y-8 max-w-3xl mx-auto"
|
||||
>
|
||||
<DmdRegForm> {form}</DmdRegForm>
|
||||
|
||||
<Button type="submit"> 수요신청</Button>
|
||||
</form>
|
||||
</Form>
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-span-1 ">
|
||||
<Toaster position="top-center" />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
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>
|
||||
|
||||
<Button className='place-self-auto'>
|
||||
<Link href="matMng/matDmd/coReg">수요처 등록</Link>
|
||||
</Button>
|
||||
</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>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import { type ReactNode, createContext, useContext, useRef } from 'react'
|
||||
import { useStore } from 'zustand'
|
||||
import { type WrStore, StoreZus } from './store'
|
||||
|
||||
|
||||
export type StoreApi = ReturnType<typeof StoreZus>
|
||||
|
||||
export const StoreContext = createContext<StoreApi | undefined>(
|
||||
undefined,
|
||||
)
|
||||
|
||||
export interface StoreProviderProps {
|
||||
children: ReactNode
|
||||
}
|
||||
|
||||
export const StoreProvider = ({
|
||||
children,
|
||||
}: StoreProviderProps) => {
|
||||
const storeRef = useRef<StoreApi>(null)
|
||||
if (!storeRef.current) {
|
||||
storeRef.current = StoreZus()
|
||||
}
|
||||
return (
|
||||
<StoreContext.Provider value={storeRef.current}>
|
||||
{children}
|
||||
</StoreContext.Provider>
|
||||
)
|
||||
}
|
||||
|
||||
export const useWrStore = <T,>(
|
||||
selector: (store: WrStore) => T,
|
||||
): T => {
|
||||
const storeContext = useContext(StoreContext)
|
||||
if (!storeContext) {
|
||||
throw new Error(`useStore must be used within StoreProvider`)
|
||||
}
|
||||
|
||||
return useStore(storeContext, selector)
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
import type { selectArray } from "../rainReuseFacilityInsert";
|
||||
|
||||
|
||||
|
||||
const selectSido = [
|
||||
{ text: '서울', val: "1" },
|
||||
{ text: "인천", val: "2" },
|
||||
{ text: "부산", val: "3" },
|
||||
];
|
||||
const selectSgg = [
|
||||
{ text: '종로구', val: "1" },
|
||||
{ text: "성북구", val: "2" },
|
||||
{ text: "강남구", val: "3" },
|
||||
];
|
||||
const selectUsg = [
|
||||
{ text: '민간', val: "1" },
|
||||
{ text: "공공", val: "2" },
|
||||
];
|
||||
const selectYN= [
|
||||
{ text: 'Y', val: "1" },
|
||||
{ text: 'N', val: "2" },
|
||||
];
|
||||
|
||||
export type matDmdState ={ dmd:{
|
||||
isInit: boolean;
|
||||
selectSido:selectArray[];
|
||||
selectSgg:selectArray[];
|
||||
selectUsg:selectArray[];
|
||||
selectYN:selectArray[];
|
||||
}}
|
||||
type matDmdActions = {
|
||||
decrementList: () => void
|
||||
}
|
||||
|
||||
export type matDmdType = matDmdState & matDmdActions;
|
||||
|
||||
export const matDmdStateExport:matDmdState= {dmd:{
|
||||
isInit:false,
|
||||
selectSido:selectSido,
|
||||
selectSgg: selectSgg,
|
||||
selectUsg: selectUsg,
|
||||
selectYN:selectYN,
|
||||
|
||||
|
||||
}}
|
||||
export const matDmdActionsExport:(set:any)=>matDmdActions=(set: any) => {
|
||||
return {
|
||||
decrementList:()=>set(
|
||||
(state:matDmdState) => {
|
||||
return (
|
||||
{rain:{
|
||||
}})}
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -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,121 +0,0 @@
|
||||
# Zustand store
|
||||
## Zustand 등록방법
|
||||
**-- index.tsx --**
|
||||
### context 등록
|
||||
기본적으로 createContext를 통해 react에 context를 생성해서 react에서 사용할 수 있도록 해야함.
|
||||
``` js
|
||||
//StoreZus는 내부적으로 사용하기 위한 store파일에서 따로 생성함.
|
||||
export type StoreApi = ReturnType<typeof StoreZus>
|
||||
//react에서 사용하기 위한 context 생성.
|
||||
export const StoreContext = createContext<StoreApi | undefined>(
|
||||
undefined,
|
||||
)
|
||||
```
|
||||
|
||||
### component로 작성
|
||||
등록된 context를 component화 시키기 위한 작업
|
||||
```js
|
||||
//외부에서 호출시 <StoreProvider> 형태로 호출.
|
||||
//app이나 home에서 전체적인 사용이 되도록 작성해야함.
|
||||
export const StoreProvider = ({
|
||||
children,
|
||||
}: StoreProviderProps) => {
|
||||
const storeRef = useRef<StoreApi>(null)
|
||||
if (!storeRef.current) {
|
||||
//StoreZus는 store.tsx를 봐야함.
|
||||
storeRef.current = StoreZus()
|
||||
}
|
||||
return (
|
||||
<StoreContext.Provider value={storeRef.current}>
|
||||
{children}
|
||||
</StoreContext.Provider>
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
### store 등록
|
||||
react에서 사용하는 store에 현재 context 등록
|
||||
```js
|
||||
export const useWrStore = <T,>(
|
||||
selector: (store: WrStore) => T,
|
||||
): T => {
|
||||
const storeContext = useContext(StoreContext)
|
||||
if (!storeContext) {
|
||||
throw new Error(`useStore must be used within StoreProvider`)
|
||||
}
|
||||
|
||||
return useStore(storeContext, selector)
|
||||
}
|
||||
```
|
||||
|
||||
## Zustand 사용방법
|
||||
**-- store.tsx, 폴더별 index.tsx --**
|
||||
### 기본 store 생성
|
||||
index.tsx의 context에 사용되는 StoreZus를 추가하여 사용됨.
|
||||
|
||||
외부에서 생성된 state, actions를 사용 가능한 구조
|
||||
```js
|
||||
import { createStore } from 'zustand/vanilla';
|
||||
import { tableActionsExport, tableStateExport, type tableState, type tableType } from './publicReuseFaciltyInsert/index';//외부 파일 위치.
|
||||
export type WrStore = tableType;//typescript이므로 사용되는 스크립트를 type1 & type2 형식으로 넣어야함.
|
||||
//index.tsx에서 사용하는 store 생성.
|
||||
export const StoreZus = (initState: tableState = tableStateExport) => {
|
||||
return createStore<WrStore>()((set) => {
|
||||
return {
|
||||
//아래에서 사용하는 state & actions은 외부 폴더에서 가져다가 사용.
|
||||
...initState,//외부에 있는 기본 초기값 state
|
||||
...tableActionsExport(set)//외부에 있는 actions
|
||||
}
|
||||
})
|
||||
}
|
||||
```
|
||||
### 외부 스토어 작성 방법
|
||||
외부 스토어는 export를 어떻게 할건지만 정하면됨.
|
||||
|
||||
사용하는 store.tsx에서 import를 받기만 하면 사용가능.
|
||||
#### 타입을 외부로 빼는 방법
|
||||
```js
|
||||
export type tableState = {
|
||||
isInit: boolean;
|
||||
upHeadList: TableUpperProps[];
|
||||
publicReuseFacilityUper: PublicReuseFacility[];
|
||||
}
|
||||
type tableActions = {
|
||||
decrementList: () => void
|
||||
}
|
||||
|
||||
export type tableType = tableState & tableActions;
|
||||
```
|
||||
#### 초기값 state를 외부로 빼는 방법
|
||||
```js
|
||||
export const tableStateExport:tableState= {
|
||||
isInit:false,
|
||||
upHeadList: upHeadList,
|
||||
publicReuseFacilityUper: publicReuseFacilityUper,
|
||||
}
|
||||
```
|
||||
#### actions를 외부로 빼는 방법
|
||||
```js
|
||||
//tableActionsExport를 import 받아서 실행하여 return 된 값을 사용
|
||||
export const tableActionsExport:(set:any)=>tableActions=
|
||||
//set을 통해 react store에 등록
|
||||
(set: any) => {
|
||||
return {
|
||||
//decrementList Object 형태로 전달
|
||||
decrementList:
|
||||
//set 함수를 실행해서 react store에 등록
|
||||
()=>set(
|
||||
// store에 등록되는 함수 구조를 가지고 있음.
|
||||
(state:tableState) => {
|
||||
//actions 실질적인 로직 작성하는 곳.
|
||||
return (
|
||||
{
|
||||
upHeadList: state.upHeadList,
|
||||
publicReuseFacilityUper:
|
||||
state.publicReuseFacilityUper.slice(0, state.publicReuseFacilityUper.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)
|
||||
}})}
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
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';
|
||||
|
||||
|
||||
export type WrStore = pubFacState & rainFacType &rswtFacType &matDmdType;
|
||||
export const StoreZus = (initState: rainFacState& pubFacState & rswtFacState &matDmdState= {
|
||||
...pubFacStateExport,
|
||||
...rainFacStateExport,
|
||||
...rswtFacStateExport ,
|
||||
...matDmdStateExport
|
||||
}) => {
|
||||
return createStore<WrStore>()((set) => {
|
||||
return {
|
||||
...initState,
|
||||
...pubFacActionsExport(set),
|
||||
...rainFacActionsExport(set),
|
||||
...rswtFacActionsExport(set),
|
||||
...matDmdActionsExport(set)
|
||||
}
|
||||
})
|
||||
}
|
||||
//store 등록하는 부분
|
||||
@@ -1,9 +0,0 @@
|
||||
.formInsideTitle{
|
||||
background-color: gray;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.smallTitle{
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"$schema": "https://ui.shadcn.com/schema.json",
|
||||
"style": "default",
|
||||
"rsc": true,
|
||||
"tsx": true,
|
||||
"tailwind": {
|
||||
"config": "tailwind.config.ts",
|
||||
"css": "app/globals.css",
|
||||
"baseColor": "neutral",
|
||||
"cssVariables": true,
|
||||
"prefix": ""
|
||||
},
|
||||
"aliases": {
|
||||
"components": "@/components",
|
||||
"utils": "@/lib/utils",
|
||||
"ui": "@/components/ui",
|
||||
"lib": "@/lib",
|
||||
"hooks": "@/hooks"
|
||||
},
|
||||
"iconLibrary": "lucide"
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
|
||||
import { Button } from "@common/components/ui";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
|
||||
|
||||
export function ToastFormUi(body:string,title:string,url:string,buttonName:string){
|
||||
|
||||
//const router = useRouter();
|
||||
|
||||
return(
|
||||
|
||||
toast.custom((t) => (
|
||||
|
||||
<div
|
||||
className={`${
|
||||
t.visible ? 'animate-enter' : 'animate-leave'
|
||||
} w-4/12 h-40 bg-white shadow-lg rounded-lg pointer-events-auto flex ring-1 ring-black ring-opacity-5`}
|
||||
>
|
||||
<div className="w-full flex-1 py-10">
|
||||
<div className="flex items-start">
|
||||
<div className="flex-shrink-0 pt-0.5">
|
||||
|
||||
</div>
|
||||
<div className="ml-3 flex-1">
|
||||
<p className="text-xl font-medium underline">
|
||||
{title}
|
||||
</p>
|
||||
<p className="mt-1 text-2xl">
|
||||
{body}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex py-20">
|
||||
<Button
|
||||
size='sm'
|
||||
onClick={() => toast.dismiss(t.id)}
|
||||
>
|
||||
<Link href={url}> {buttonName}</Link>
|
||||
</Button>
|
||||
</div>
|
||||
<div className="flex pl-4 pr-4 py-20">
|
||||
<Button
|
||||
onClick={() => toast.dismiss(t.id)}
|
||||
size='sm'
|
||||
>
|
||||
닫기
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -1,91 +0,0 @@
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { selectClass } from "@/app/store/rainReuseFacilityInsert";
|
||||
import { DatePicker, FormField, FormItem, FormLabel, FormUi, SelectBox } from "@common/business_components";
|
||||
import { Button, Input } from "@common/components";
|
||||
import { useState } from "react";
|
||||
|
||||
export function CoRegForm(form:any){
|
||||
|
||||
const { dmd } = useWrStore((state) => state);
|
||||
|
||||
return(
|
||||
|
||||
<>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="ctpv"
|
||||
render={({ field }) => (
|
||||
<FormUi label="시도">
|
||||
<SelectBox selectClass={selectClass} label={""} selectArray={dmd.selectSido} onSelectValue={field.onChange} className={""} />
|
||||
</FormUi>
|
||||
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="sgg"
|
||||
render={({ field }) => (
|
||||
<FormUi label="시군구">
|
||||
<SelectBox selectClass={selectClass} label={""} selectArray={dmd.selectSgg} onSelectValue={field.onChange} className={""} />
|
||||
</FormUi>
|
||||
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="coNm"
|
||||
render={({ field }) => (
|
||||
<FormUi label="회사명">
|
||||
<Input placeholder="" type="text" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="bznmNo"
|
||||
render={({ field }) => (
|
||||
<FormUi label="사업자번호">
|
||||
<Input
|
||||
placeholder="a0123456789"
|
||||
type="text"
|
||||
{...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="addr"
|
||||
render={({ field }) => (
|
||||
<FormUi label="주소">
|
||||
<Input
|
||||
placeholder="성북로24길 16"
|
||||
|
||||
type="text"
|
||||
{...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="telNo"
|
||||
render={({ field }) => (
|
||||
<FormUi label="전화번호">
|
||||
<Input
|
||||
placeholder="01033332222"
|
||||
|
||||
type="text"
|
||||
{...field} />
|
||||
</FormUi>
|
||||
|
||||
)}
|
||||
/>
|
||||
|
||||
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -1,316 +0,0 @@
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { selectClass } from "@/app/store/rainReuseFacilityInsert";
|
||||
import { DatePicker, FormField, FormItem, FormLabel, FormUi, SelectBox } from "@common/business_components";
|
||||
import { Button, Input } from "@common/components";
|
||||
import { useState } from "react";
|
||||
|
||||
export function DmdRegForm(form: any) {
|
||||
const { dmd } = useWrStore((state) => state);
|
||||
|
||||
const [dmdDate, setDmdDate] = useState(new Date())
|
||||
|
||||
|
||||
const onChangeDate = (val: Date|undefined) => {
|
||||
if(val)setDmdDate(val)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="dmdSel"
|
||||
render={({ field }) => (
|
||||
<FormUi label="수요처명">
|
||||
<Input
|
||||
placeholder="수요처명 검색"
|
||||
|
||||
type="text"
|
||||
{...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="dmdTmng"
|
||||
render={({ field }) => (
|
||||
<FormItem className="flex flex-col">
|
||||
<FormLabel>요구시기</FormLabel>
|
||||
<DatePicker mode={"single"} field={{ value: dmdDate, onChange: onChangeDate }} />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="dmdWq"
|
||||
render={({ field }) => (
|
||||
<FormUi label="요구수질">
|
||||
<Input
|
||||
placeholder="55.22"
|
||||
|
||||
type="text"
|
||||
{...field} />
|
||||
</FormUi>
|
||||
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="useUsgCd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="사용용도">
|
||||
<SelectBox selectClass={selectClass} label={""} selectArray={dmd.selectUsg} onSelectValue={field.onChange} className={""} />
|
||||
</FormUi>
|
||||
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="wntUntprc"
|
||||
render={({ field }) => (
|
||||
<FormUi label="희망단가">
|
||||
<Input
|
||||
placeholder="1000000000000000"
|
||||
|
||||
type="text"
|
||||
{...field} />
|
||||
</FormUi>
|
||||
|
||||
)}
|
||||
/>
|
||||
|
||||
<div className="grid grid-cols-4">
|
||||
<h1 className=" col-span-2 pl-5 text-2xl underline">
|
||||
요구수질
|
||||
</h1>
|
||||
</div>
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="grssClfg"
|
||||
render={({ field }) => (
|
||||
<FormUi label="총대장균군">
|
||||
<Input placeholder="10" type="text" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="tn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="총질소">
|
||||
<Input placeholder="10" type="text" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="combResdch"
|
||||
render={({ field }) => (
|
||||
<FormUi label="결합잔류염소">
|
||||
<Input placeholder="10" type="text" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="tp"
|
||||
render={({ field }) => (
|
||||
<FormUi label="총인">
|
||||
<Input placeholder="10" type="text" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="trbt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="탁도">
|
||||
<Input placeholder="10" type="text" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="ph"
|
||||
render={({ field }) => (
|
||||
<FormUi label="수소이온농도">
|
||||
<Input placeholder="10" type="text" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="bod"
|
||||
render={({ field }) => (
|
||||
<FormUi label="생물학적 산소요구량">
|
||||
<Input placeholder="10" type="text" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="clIonQnt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="염화물">
|
||||
<Input placeholder="10" type="text" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="smll"
|
||||
render={({ field }) => (
|
||||
<FormUi label="냄새">
|
||||
<Input placeholder="10" type="text" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="cdtnv"
|
||||
render={({ field }) => (
|
||||
<FormUi label="전기전도도">
|
||||
<Input placeholder="10" type="text" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="crmty"
|
||||
render={({ field }) => (
|
||||
<FormUi label="색도">
|
||||
<Input placeholder="10" type="text" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="rmrk"
|
||||
render={({ field }) => (
|
||||
<FormUi label="비고">
|
||||
<Input placeholder="10" type="text" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid grid-cols-4">
|
||||
<h1 className=" col-span-1 pl-2 text-2xl underline">
|
||||
공급후보지 선택
|
||||
</h1>
|
||||
<div className=" col-start-3 col-span-1 ">
|
||||
<Button >
|
||||
후보지 조회
|
||||
</Button>
|
||||
</div>
|
||||
<div className=" col-start-4 col-span-1 ">
|
||||
<Button >
|
||||
유사사례조회
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="sply1"
|
||||
render={({ field }) => (
|
||||
<FormUi label="후보지_1">
|
||||
<Input placeholder="후보지1" type="text" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="sply2"
|
||||
render={({ field }) => (
|
||||
<FormUi label="후보지_2">
|
||||
<Input placeholder="후보지2" type="text" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="sply3"
|
||||
render={({ field }) => (
|
||||
<FormUi label="후보지_3">
|
||||
<Input placeholder="후보지3" type="text" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid grid-cols-4">
|
||||
<h1 className=" col-span-2 pl-2 text-2xl underline">
|
||||
수요신청 비밀번호
|
||||
</h1>
|
||||
|
||||
<div className="col-start-3 col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="password"
|
||||
render={({ field }) => (
|
||||
<FormUi label="">
|
||||
<Input placeholder="10" type="text" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,497 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { SelectBox } from "@common/business_components";
|
||||
import { DatePicker, FileUpload, FormUi, UiTable } from "@common/business_components/ui";
|
||||
import { Form, FormField } from "@common/business_components/ui/form";
|
||||
import { Button, Input, TableHead, TableRow } from "@common/components";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useState } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
import { useWrStore } from "../../app/store/index";
|
||||
import { selectClass, type TableUpperProps } from "@/app/store/rainReuseFacilityInsert";
|
||||
|
||||
const formSchema = z.object({
|
||||
username: z.string().min(2).max(50),
|
||||
facilityName: z.string().min(2).max(50),
|
||||
});
|
||||
|
||||
|
||||
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>
|
||||
</>)
|
||||
}
|
||||
export function PublicReuseFaciltyFormInsert() {
|
||||
const { pubFac } = useWrStore((state) => state);
|
||||
const { pubMngUpHeadList, pubMngFacData,erctUswtrCd,cyclCd,seCd,buseCd,rprcsCd,buseMet,rprcLoCd} = pubFac;
|
||||
const nodeList = headMakeColSpan(pubMngUpHeadList);
|
||||
|
||||
|
||||
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)
|
||||
|
||||
}
|
||||
|
||||
const [instlAprvDate, setInstlAprvDate] = useState(new Date())
|
||||
const [bizCmcnDate, setBizCmcnDate] = useState(new Date())
|
||||
const [files, setFiles] = useState(null);
|
||||
|
||||
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}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="space-y-8 mx-auto w-full mt-7">
|
||||
<div className="flex justify-between items-center mx-3 mb-3">
|
||||
<h1 className=" text-xl">
|
||||
○ 차수별 하수처리수 재이용 시설 현황
|
||||
</h1>
|
||||
<div className="flex items-center gap-2 mx-3">
|
||||
<h1 className=" text-xl">
|
||||
등록차수
|
||||
</h1>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_1486273033"
|
||||
render={({ field }) => (
|
||||
<FormUi label=''>
|
||||
<SelectBox label='' selectArray={cyclCd} className={""} selectClass={selectClass} onSelectValue={onSelectValue } {...field}></SelectBox>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
<Button className="rounded-lg">
|
||||
신규등록
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h1 className="pl-3 text-xl">♦︎하수처리수 재이용 시설 현황</h1>
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 ">
|
||||
사업개요{" "}
|
||||
</h1>
|
||||
<h1 className="pl-4 text-xl my-0">1. 현황</h1>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_8928357542"
|
||||
render={({ field }) => (
|
||||
<FormUi label="구분">
|
||||
<SelectBox selectArray={seCd} className={""} label={""} selectClass={selectClass} onSelectValue={onSelectValue} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_9484942814"
|
||||
render={({ field }) => (
|
||||
<FormUi label="사업방식">
|
||||
<SelectBox selectArray={buseMet} className={""} label={""} selectClass={selectClass} onSelectValue={onSelectValue}/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</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}
|
||||
name="name_2450741594"
|
||||
render={({ field }) => (
|
||||
<FormUi label="사업준공일">
|
||||
<DatePicker
|
||||
selectClass={'rounded-lg w-full'}
|
||||
field={{
|
||||
value: bizCmcnDate,
|
||||
onChange: function (date: Date | undefined): void {
|
||||
if (date) setBizCmcnDate(date);
|
||||
}
|
||||
}} mode="single" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<h1 className="pl-4 text-xl">2. 사업비</h1>
|
||||
<div className="grid grid-cols-10 gap-4">
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_7678668236"
|
||||
render={({ field }) => (
|
||||
<FormUi label="국고">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_7913744238"
|
||||
render={({ field }) => (
|
||||
<FormUi label="지방비">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_1368081408"
|
||||
render={({ field }) => (
|
||||
<FormUi label="민간투자비">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_1368081408"
|
||||
render={({ field }) => (
|
||||
<FormUi label="원인자부담금">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_1368081408"
|
||||
render={({ field }) => (
|
||||
<FormUi label="기타">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="w-64">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_1368081408"
|
||||
render={({ field }) => (
|
||||
<FormUi label="합계">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</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="시설용량(m³/일)">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_7913744238"
|
||||
render={({ field }) => (
|
||||
<FormUi label="주처리공법">
|
||||
<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>
|
||||
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
<div className="col-span-4 ">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_5139286452"
|
||||
render={({ field }) => (
|
||||
<FormUi label="재처리방식">
|
||||
<SelectBox selectArray={rprcsCd} className={""} label={""} selectClass={selectClass} onSelectValue={onSelectValue }/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_7233630277"
|
||||
render={({ field }) => (
|
||||
<FormUi label="위치(처리장 내외)">
|
||||
<SelectBox selectArray={rprcLoCd} className={""} label={""} selectClass={selectClass} onSelectValue={onSelectValue}/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_0973765174"
|
||||
render={({ field }) => (
|
||||
<FormUi label="메인공급펌프 용량">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</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="눙축수 발생량(m³/일)">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_7913744238"
|
||||
render={({ field }) => (
|
||||
<FormUi label="눙축수연계지점">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_1368081408"
|
||||
render={({ field }) => (
|
||||
<FormUi label="시설용량(m³/일)">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
<div className="col-span-4 ">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_5139286452"
|
||||
render={({ field }) => (
|
||||
<FormUi label="눙축수처리방식">
|
||||
<SelectBox selectArray={erctUswtrCd} className={""} label={""} selectClass={selectClass} onSelectValue={onSelectValue}/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_7233630277"
|
||||
render={({ field }) => (
|
||||
<FormUi label="눙축수처리공법">
|
||||
<Input placeholder="" type="" {...field} />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</Form>
|
||||
</div>
|
||||
</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>
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import { dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { FlatCompat } from "@eslint/eslintrc";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
});
|
||||
|
||||
const eslintConfig = [
|
||||
...compat.extends("next/core-web-vitals", "next/typescript"),
|
||||
];
|
||||
|
||||
export default eslintConfig;
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
/// <reference types="next" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||
@@ -1,41 +0,0 @@
|
||||
import type { NextConfig } from "next";
|
||||
import webpack from "webpack";
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
eslint: {
|
||||
ignoreDuringBuilds: true,
|
||||
},
|
||||
webpack: (config) => {
|
||||
config.plugins.push(
|
||||
new webpack.DefinePlugin({
|
||||
"import.meta.env.VITE_PORT": JSON.stringify(
|
||||
process.env.NEXT_PUBLIC_PORT
|
||||
),
|
||||
"import.meta.env.VITE_PROXY_HOST": JSON.stringify(
|
||||
process.env.NEXT_PUBLIC_PROXY_HOST
|
||||
),
|
||||
"import.meta.env.VITE_SERVER_API_URL": JSON.stringify(
|
||||
process.env.NEXT_PUBLIC_SERVER_API_URL
|
||||
),
|
||||
"import.meta.env.VITE_SITE_ID": JSON.stringify(process.env.SITE_ID),
|
||||
"import.meta.env.VITE_CLAIM_NAME": JSON.stringify(
|
||||
process.env.NEXT_PUBLIC_CLAIM_NAME
|
||||
),
|
||||
"import.meta.env.VITE_ACCESS_TOKEN": JSON.stringify(
|
||||
process.env.NEXT_PUBLIC_ACCESS_TOKEN
|
||||
),
|
||||
"import.meta.env.VITE_REFRESH_TOKEN": JSON.stringify(
|
||||
process.env.NEXT_PUBLIC_REFRESH_TOKEN
|
||||
),
|
||||
"import.meta.env.VITE_AUTH_USER_ID": JSON.stringify(
|
||||
process.env.NEXT_PUBLIC_AUTH_USER_ID
|
||||
),
|
||||
"process.env.SITE_ID": JSON.stringify(process.env.NEXT_PUBLIC_SITE_ID),
|
||||
})
|
||||
);
|
||||
|
||||
return config;
|
||||
},
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
@@ -1,34 +0,0 @@
|
||||
{
|
||||
"name": "wr",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev --turbopack",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@common/business_components": "workspace:*",
|
||||
"@common/components": "workspace:*",
|
||||
"@hookform/resolvers": "^4.1.3",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"lucide-react": "^0.474.0",
|
||||
"next": "15.1.7",
|
||||
"react-hook-form": "^7.54.2",
|
||||
"react-hot-toast": "^2.5.2",
|
||||
"tailwind-merge": "^3.0.1",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"zod": "^3.24.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3",
|
||||
"@types/webpack": "^5.28.5",
|
||||
"eslint": "^9",
|
||||
"eslint-config-next": "15.1.7",
|
||||
"postcss": "^8",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"typescript": "^5"
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
/** @type {import('postcss-load-config').Config} */
|
||||
const config = {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -1 +0,0 @@
|
||||
<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>
|
||||
|
Before Width: | Height: | Size: 391 B |
@@ -1 +0,0 @@
|
||||
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
|
||||
|
Before Width: | Height: | Size: 1.3 KiB |
@@ -1 +0,0 @@
|
||||
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg>
|
||||
|
Before Width: | Height: | Size: 128 B |
@@ -1 +0,0 @@
|
||||
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>
|
||||
|
Before Width: | Height: | Size: 385 B |
@@ -1,66 +0,0 @@
|
||||
import baseConfig from "../../packages/common/components/tailwind.config";
|
||||
|
||||
import type { Config } from "tailwindcss";
|
||||
|
||||
export default {
|
||||
darkMode: ["class"],
|
||||
presets: [baseConfig],
|
||||
content: [
|
||||
"./app/**/*.{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;
|
||||
@@ -1,53 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"target": "ES2017",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"verbatimModuleSyntax": true,
|
||||
"strictNullChecks": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
"incremental": true,
|
||||
"plugins": [
|
||||
{
|
||||
"name": "next"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"@/*": ["./*"],
|
||||
"@common/components/*": ["../../packages/common/components/src/*"],
|
||||
"@common/components": ["../../packages/common/components/src/index"],
|
||||
"@common/business_components/*": [
|
||||
"../../packages/common/business_components/src/*"
|
||||
],
|
||||
"@common/business_components": [
|
||||
"../../packages/common/business_components/src/index"
|
||||
],
|
||||
"@common/network": ["../../packages/common/network"]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
".eslintrc.*",
|
||||
"next-env.d.ts",
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
"**/*.mts",
|
||||
"**/*.js",
|
||||
"**/*.cjs",
|
||||
"**/*.mjs",
|
||||
"**/*.jsx",
|
||||
"**/*.json",
|
||||
".next/types/**/*.ts"
|
||||
],
|
||||
"exclude": ["**/node_modules", "**/.*/*"]
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import { Footer } from "./footer";
|
||||
import "./common.css";
|
||||
import type { QueryClient } from "@tanstack/react-query";
|
||||
|
||||
export function BaseLayout({
|
||||
export function VBaseLayout({
|
||||
children,
|
||||
queryClient,
|
||||
}: {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { ChevronRight } from "lucide-react";
|
||||
|
||||
Reference in New Issue
Block a user