하수재이용시서 폼 작업중
This commit is contained in:
@@ -1,18 +1,6 @@
|
||||
"use client";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
import { Button, FileSearch, Input } from "@common/components";
|
||||
import {
|
||||
Form,
|
||||
FormField,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormControl,
|
||||
FormDescription,
|
||||
FormMessage,
|
||||
} from "@common/business_components/ui/form";
|
||||
import { UiTable } from "@common/business_components/ui";
|
||||
|
||||
import { FileUpload, UiTable } from "@common/business_components/ui";
|
||||
import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from "@common/business_components/ui/form";
|
||||
import { Button, FileSearch, Input } from "@common/components";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
@@ -75,49 +63,14 @@ export function PublicReuseFaciltyFormInsert() {
|
||||
{ text: "자쳬+연계", val: "3" },
|
||||
];
|
||||
|
||||
let formData =[
|
||||
{labelName:'농축수발생량(m³/일)', type:'input',selectvlaue:undefined},
|
||||
{labelName:'농축수연계지점',type:'input',selectvlaue:undefined},
|
||||
{labelName:'시설용량(m³/일)',type:'input',selectvlaue:undefined},
|
||||
{labelName:'농축수 처리방식',type:'check', selectvlaue:selectboxMethodValue},
|
||||
{labelName:'농축수 처리공법',type:'input',selectvlaue:undefined},
|
||||
]
|
||||
|
||||
|
||||
const [files, setFiles] = useState(null);
|
||||
|
||||
const formIter = (formData: typeOfForm[] ) => {
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
{formData.map((data:typeOfForm) =>{
|
||||
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_7678668236"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>data.name</FormLabel>
|
||||
<FormControl>
|
||||
{data.type==='input'? <Input placeholder="shadcn" type="" {...field} />: <SelectBox selectArray={selectboxBuisValue}></SelectBox> }
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
} )}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
const filedForm = formIter(formData);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<div>
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)}>
|
||||
@@ -157,59 +110,14 @@ const formIter = (formData: typeOfForm[] ) => {
|
||||
<FormItem>
|
||||
<FormLabel>계통도</FormLabel>
|
||||
<FormControl>
|
||||
<FileSearch id="test1"></FileSearch>
|
||||
<FileUpload files={files} setFiles={setFiles} fileTypes="PDF"></FileUpload>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
{/* <FormField
|
||||
control={form.control}
|
||||
name="name_3799085626"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>계통도</FormLabel>
|
||||
<FormControl className="w-100">
|
||||
<FileUploader
|
||||
value={files}
|
||||
onValueChange={setFiles}
|
||||
dropzoneOptions={dropZoneConfig}
|
||||
className="relative bg-background rounded-lg p-2"
|
||||
>
|
||||
<FileInput
|
||||
id="fileInput"
|
||||
className="outline-dashed outline-1 outline-slate-500"
|
||||
>
|
||||
<div className="flex items-center justify-center flex-col p-8 w-full ">
|
||||
<CloudUpload className='text-gray-500 w-10 h-10' />
|
||||
<p className="mb-1 text-sm text-gray-500 dark:text-gray-400">
|
||||
<span className="font-semibold">Click to upload</span>
|
||||
or drag and drop
|
||||
</p>
|
||||
<p className="text-xs text-gray-500 dark:text-gray-400">
|
||||
SVG, PNG, JPG or GIF
|
||||
</p>
|
||||
</div>
|
||||
</FileInput>
|
||||
<FileUploaderContent>
|
||||
{files &&
|
||||
files.length > 0 &&
|
||||
files.map((file, i) => (
|
||||
<FileUploaderItem key={i} index={i}>
|
||||
<Paperclip className="h-4 w-4 stroke-current" />
|
||||
<span>{file.name}</span>
|
||||
</FileUploaderItem>
|
||||
))}
|
||||
</FileUploaderContent>
|
||||
</FileUploader>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/> */}
|
||||
</div>
|
||||
|
||||
<div className="con-start-2 col-end-8">
|
||||
</div>
|
||||
<div className="col-start-6 col-end-10">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name_0211213336"
|
||||
@@ -217,7 +125,7 @@ const formIter = (formData: typeOfForm[] ) => {
|
||||
<FormItem>
|
||||
<FormLabel>평면도</FormLabel>
|
||||
<FormControl>
|
||||
<FileSearch id="test"></FileSearch>
|
||||
<FileUpload files={files} setFiles={setFiles} fileTypes="PDF"></FileUpload>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -619,13 +527,10 @@ const formIter = (formData: typeOfForm[] ) => {
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 ">
|
||||
농축수관리{" "}
|
||||
</h1>
|
||||
|
||||
{ filedForm}
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
</Form>
|
||||
</div>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use client'
|
||||
|
||||
import {UiTable } from '@common/business_components';
|
||||
import { TableRow } from '@common/components';
|
||||
import {SearchDiv, SelectBox, UiTable } from '@common/business_components';
|
||||
import { Button, TableRow } from '@common/components';
|
||||
import { TableHead } from '@common/components';
|
||||
import Style from "../style/PublicReuseFaciltyInsert.module.css";
|
||||
import { useWrStore } from '../store';
|
||||
@@ -34,16 +34,26 @@ import { PublicReuseFaciltyFormInsert } from '../component/publicReuseInsertFor
|
||||
const total = 100;
|
||||
|
||||
|
||||
|
||||
const searchDiv ='시군구'
|
||||
const selectBox = [{text:'한양', value:1}]
|
||||
|
||||
return ( <>
|
||||
<div>
|
||||
<SearchDiv >
|
||||
<div className='flex'>
|
||||
<SelectBox label={searchDiv} selectArray={selectBox} />
|
||||
<Button className ='mr-4' size='sm'>조회</Button>
|
||||
<Button className ='mr-4' size='sm'>신규추가</Button>
|
||||
</div>
|
||||
</SearchDiv>
|
||||
</div>
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="colsapn-1">
|
||||
<UiTable publicReuseFacility={publicReuseFacilityUper} headlist={upHeadList} pageSize={100} total={total} headName={'test'}>
|
||||
<UiTable publicReuseFacility={publicReuseFacilityUper} headlist={upHeadList} pageSize={100} total={total} headName={'ㅈㅇ'}>
|
||||
{nodeList}
|
||||
</UiTable>
|
||||
</div>
|
||||
<div className="colsapn-1">
|
||||
<div className="colsapn-1 h-full">
|
||||
<PublicReuseFaciltyFormInsert></PublicReuseFaciltyFormInsert>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -11,11 +11,15 @@
|
||||
"dependencies": {
|
||||
"@common/business_components": "workspace:*",
|
||||
"@common/components": "workspace:*",
|
||||
"next": "15.1.7",
|
||||
"zod": "^3.24.2",
|
||||
"@hookform/resolvers": "^4.1.3",
|
||||
"react-hook-form": "^7.54.2"
|
||||
|
||||
"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",
|
||||
"tailwind-merge": "^3.0.1",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"zod": "^3.24.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3",
|
||||
|
||||
@@ -3,9 +3,62 @@ import baseConfig from "../../packages/common/components/tailwind.config";
|
||||
import type { Config } from "tailwindcss";
|
||||
|
||||
export default {
|
||||
presets: [baseConfig],
|
||||
darkMode: ["class"],
|
||||
presets: [baseConfig],
|
||||
content: [
|
||||
"./app/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"../../packages/common/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;
|
||||
|
||||
Reference in New Issue
Block a user