65 lines
3.0 KiB
TypeScript
65 lines
3.0 KiB
TypeScript
'use client'
|
|
import React, { useState } from 'react'
|
|
import { FormField, SelectBox } from '@common/business_components/ui'
|
|
import { Button, DatePicker, Input } from '@common/components/ui'
|
|
import { z } from 'zod'
|
|
import { zodResolver } from '@hookform/resolvers/zod'
|
|
import { useForm } from 'react-hook-form'
|
|
import FormSection from '@/components/ui/formSection'
|
|
import BaseLayout from '../BaseLayout'
|
|
const formSchema = z.object({
|
|
managenm: z.string(),
|
|
region: z.string(),
|
|
suyeonga: z.number(),
|
|
inputdate: z.coerce.date(),
|
|
rtkSource: z.string(),
|
|
suyeongaPlace: z.string(),
|
|
pattern : z.string()
|
|
})
|
|
const region: { text: string, val: number }[] = [{ text: '양평', val: 1 }, { text: '강남', val: 2 }, { text: 'test', val: 3 }]
|
|
const IrSetting = () => {
|
|
const form = useForm<z.infer<typeof formSchema>>({
|
|
resolver: zodResolver(formSchema),
|
|
defaultValues: {
|
|
managenm: "",
|
|
region: "",
|
|
suyeonga: 0,
|
|
inputdate: new Date(),
|
|
rtkSource: "",
|
|
suyeongaPlace: "",
|
|
pattern: ""
|
|
}
|
|
})
|
|
const [selectedDate, setSelectedDate] = useState(new Date())
|
|
return (
|
|
<BaseLayout titleName={{ mainTitle: '침입수 산정', firstCardTitle: '실측자료 등록', secondCardTitle: '침입수 분석자료 입력' }} form={form} onSubmitEvent={() => { }} graphBtn={false}>
|
|
<div className="grid gap-4">
|
|
<FormSection name='suyeongaPlace' form={form} titleNm='○ 오수관망도'><div className="w-[150px]">
|
|
<Input id="fileNm" type="file" />
|
|
</div></FormSection>
|
|
<FormSection name='suyeonga' form={form} titleNm='○ 수용가-맨홀 매칭결과'><div className="w-[150px]">
|
|
<Input id="fileNm" type="file" />
|
|
</div></FormSection>
|
|
<FormSection name='pattern' form={form} titleNm='○ 오수량 시간패턴'><div className="w-[150px]">
|
|
<Input id="fileNm" type="file" />
|
|
</div></FormSection>
|
|
<FormSection name='inputdate' form={form} titleNm='○ 상수사용량 적용기간'>
|
|
<DatePicker selected={selectedDate} onSelect={(date: Date | undefined) => { if (date) setSelectedDate(date) }} mode={"single"} />
|
|
</FormSection>
|
|
<FormSection name='rtkSource' form={form} titleNm='○ 오수전환율'><Input className="h-[3.2rem] text-center text-xl w-[150px]" /></FormSection>
|
|
<div className="flex justify-end mt-1">
|
|
<Button type="submit">침입수분석 실행</Button>
|
|
</div>
|
|
</div>
|
|
<div className="grid grid-cols-2 gap-4">
|
|
<FormSection name='region' form={form} titleNm='○ 파일위치'>
|
|
<div className="w-[150px]">
|
|
<Input id="fileNm" type="file" />
|
|
</div>
|
|
</FormSection>
|
|
</div>
|
|
</BaseLayout>
|
|
)
|
|
}
|
|
|
|
export default IrSetting |