물재이용사례관리 퍼블리싱 완료

This commit is contained in:
leedj312
2025-06-10 13:27:58 +09:00
parent 7764c8afab
commit 0507a8e66a
7 changed files with 377 additions and 555 deletions
-106
View File
@@ -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/form/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>
</>
);
}
+12 -13
View File
@@ -1,5 +1,6 @@
"use client";
import { useWrStore } from "@/app/store";
import { ruseUtzType } from "@/app/store/matDmd/ruseCaseMng/headList";
import { getCity } from "@/components/lib/func/commom";
import type { objSearchType } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal";
import { ContentsDiv, SearchDiv, SearchFormLeft, SearchFormRight, SearchInput, SelectBox, Title, UiTable, type SelectDataType } from "@common/business_components/ui";
@@ -8,9 +9,11 @@ import { Button } from "@common/components/ui";
import { useState } from "react";
export default function RuseCaseMng() {
const { code, } = useWrStore((state) => state);
const { code,ruseCase} = useWrStore((state) => state);
const [selectSgg, setSelectSgg] = useState<SelectDataType[] | []>()
const [objSearch, setObjSearch] = useState<objSearchType>({ sgg: "", city: "" });
const [selectUtz, setSelectUtz] = useState<string[] | []>()
const [searchTxt, setSearchTxt] = useState<string>()
const getSelCity = (val: string | number) => {
const cityValue = String(val);
@@ -20,7 +23,6 @@ export default function RuseCaseMng() {
};
const getSgg = (val: string | number) => {
console.log(val);
setObjSearch({ ...objSearch, sgg: String(val) })
};
return (
@@ -50,21 +52,18 @@ export default function RuseCaseMng() {
className="col-span-2 w-1/3 h-full text-2xl"
label="용도"
selectClass={""}
selectArray={[]}
onSelectValue={() => { }}
/>
<SelectBox
className="ml-4 col-span-2 w-1/3 h-full text-2xl"
label=" "
selectClass={""}
selectArray={[]}
onSelectValue={() => { }}
selectArray={ruseUtzType}
onSelectValue={(val) => {
if(val)
setSelectUtz([String(val)])}}
/>
<SearchInput
className={"text-2xl"}
label=""
label="수요처명"
textValue={""}
setText={(e) => {
setSearchTxt(e)
}}
/>
</div>
@@ -111,7 +110,7 @@ export default function RuseCaseMng() {
headName={"물재이용사례 현황"}
tableData={[]}
children={undefined}
headlist={[]}
headlist={ruseCase.ruseHeadList}
pageSize={20}
total={100000}
cellClick={(index: number | undefined, headId: string) => {
+332 -25
View File
@@ -1,48 +1,355 @@
import { z } from "zod";
export const sttnHeadListType = z.array(
z.object({
id: z.string(),
title: z.string(),
visible: z.boolean(),
})
);
import type { SelectDataType } from "@common/business_components/ui";
import type { TableUpperProps } from "../../common/type/header";
//★☆★☆ 여기서부터 수정하기 ★☆★☆
export const coRvwHeadListExport: z.infer<typeof sttnHeadListType> = [
export const ruseCaseHeadListExport: TableUpperProps[] = [
{
id: "ctpv",
title: "시도",
id: "a",
title: "사업명",
visible: true,
row: 0,
rowSpan: 2,
},
{
id: "sgg",
title: "시군구",
id: "b",
title: "사업기간",
visible: true,
row: 0,
rowSpan: 2,
},
{
id: "coNm",
title: "회사명",
id: "c",
title: "공급처",
visible: true,
row: 0,
colSpan: 3,
},
{
id: "addr",
title: "공장주소",
id: "d",
title: "시설종류",
visible: true,
row: 1,
},
{
id: "telNo",
title: "전화번호",
id: "e",
title: "공급처명",
visible: true,
row: 1,
},
{
id: "regDt", //바꾸기
title: "신청일자",
id: "f",
title: "시설용량(m³/일)",
visible: true,
row: 1,
},
{
id: "state", //바꾸기
title: "진행상태",
id: "g",
title: "수요처",
visible: true,
row: 0,
colSpan: 2,
},
];
{
id: "h",
title: "수요처명",
visible: true,
row: 1,
},
{
id: "i",
title: "주소",
visible: true,
row: 1,
},
{
id: "q",
title: "재이용시설",
visible: true,
row: 0,
colSpan: 5,
},
{
id: "q2",
title: "시설용량(m³/일)",
visible: true,
row: 1,
},
{
id: "q3",
title: "관로(km)",
visible: true,
row: 1,
},
{
id: "q4",
title: "용도",
visible: true,
row: 1,
},
{
id: "q5",
title: "공급량(m³/일)",
visible: true,
row: 1,
},
{
id: "q6",
title: "처리공법",
visible: true,
row: 1,
},
{
id: "k",
title: "보증수질",
visible: true,
row: 0,
colSpan: 13,
},
{
id: "k1",
title: "용도별",
visible: true,
row: 1,
},
{
id: "k2",
title: "총대장균군수​(개/100ml)",
visible: true,
row: 1,
},
{
id: "k3",
title: "결합잔류염소(mg/L)",
visible: true,
row: 1,
},
{
id: "k4",
title: "탁도(NTU)",
visible: true,
row: 1,
},
{
id: "k5",
title: "생물학적​산소요구량(BOD)(mg/L)​",
visible: true,
row: 1,
},
{
id: "k6",
title: "냄새​",
visible: true,
row: 1,
},
{
id: "k7",
title: "색도​",
visible: true,
row: 1,
},
{
id: "k8",
title: "총질소(T-N)(mg/L)​",
visible: true,
row: 1,
},
{
id: "k9",
title: "총인(T-P)(mg/L)",
visible: true,
row: 1,
},
{
id: "k10",
title: "수소이온농도(PH)​",
visible: true,
row: 1,
},
{
id: "k11",
title: "수소이온농도(PH)​",
visible: true,
row: 1,
},
{
id: "k12",
title: "전기전도도​(㎲/cm",
visible: true,
row: 1,
},
{
id: "k13",
title: "비고​",
visible: true,
row: 1,
},
{
id: "h",
title: "소요사업비(백만원)",
visible: true,
row: 0,
colSpan: 14,
},
{
id: "h1",
title: "총",
visible: true,
row: 1,
},
{
id: "h2",
title: "토목재이용시설",
visible: true,
row: 1,
},
{
id: "h3",
title: "토목관로",
visible: true,
row: 1,
},
{
id: "h4",
title: "건축",
visible: true,
row: 1,
},
{
id: "h5",
title: "기계",
visible: true,
row: 1,
},
{
id: "h6",
title: "전기・계측",
visible: true,
row: 1,
},
{
id: "h7",
title: "GIS・DB",
visible: true,
row: 1,
},
{
id: "h8",
title: "CCTV",
visible: true,
row: 1,
},
{
id: "h9",
title: "시공및준공",
visible: true,
row: 1,
},
{
id: "h10",
title: "페기물",
visible: true,
row: 1,
},
{
id: "h11",
title: "설계비",
visible: true,
row: 1,
},
{
id: "h12",
title: "감리비",
visible: true,
row: 1,
},
{
id: "h13",
title: "시설부대비",
visible: true,
row: 1,
},
{
id: "h14",
title: "기타",
visible: true,
row: 1,
},
{
id: "i",
title: "자원조달계획(백만원)",
visible: true,
row: 0,
colSpan: 4,
},
{
id: "i1",
title: "총",
visible: true,
row: 1,
},
{
id: "i2",
title: "국비",
visible: true,
row: 1,
},
{
id: "i3",
title: "지방비",
visible: true,
row: 1,
},
{
id: "i4",
title: "원인자부담",
visible: true,
row: 1,
},
{
id: "j",
title: "사업비정산(백만원)",
visible: true,
row: 0,
colSpan: 5,
},
{
id: "j1",
title: "총",
visible: true,
row: 1,
},
{
id: "j2",
title: "국비",
visible: true,
row: 1,
},
{
id: "j3",
title: "지방비",
visible: true,
row: 1,
},
{
id: "j4",
title: "원인자부담",
visible: true,
row: 1,
},
{
id: "j5",
title: "국고비율",
visible: true,
row: 1,
},
];
export const ruseUtzType: SelectDataType[] = [
{ text: "조경용수", val: "조경용수" },
{ text: "청소화장실용수", val: "청소화장실용수" },
{ text: "세척살수용수", val: "세척살수용수" },
{ text: "농업용수", val: "농업용수" },
{ text: "공업용수", val: "공업용수" },
{ text: "친수용수", val: "친수용수" },
{ text: "기타", val: "기타" },
];
@@ -0,0 +1,24 @@
import type { TableUpperProps } from "../../common/type/header";
import { ruseCaseHeadListExport } from "./headList";
export type ruseCaseState = {
ruseCase: {
ruseHeadList:TableUpperProps[];
};
};
type ruseCaseActions = {
};
export type ruseCaseType = ruseCaseState & ruseCaseActions;
export const ruseCaseStateExport: ruseCaseState = {
ruseCase: {
ruseHeadList:ruseCaseHeadListExport,
},
};
export const ruseCaseActionsExport: (set: any) => ruseCaseActions = (
set: any
) => {
return {
};
};
+9 -4
View File
@@ -92,6 +92,7 @@ import { pbnstPrfmncActionsExport, pbnstPrfmncStateExport, type pbnstPrfmncState
import { coRvwActionsExport, coRvwStateExport, type coRvwState, type coRvwType } from "./matDmd/coMatRvw";
import { ruseHstryActionsExport, ruseHstryStateExport, type ruseHstryState, type ruseHstryType } from "./matDmd/ruseRvwHstry";
import { pbnstPrfmncSttnActionsExport, pbnstPrfmncSttnExport, type pbnstPrfmncSttnState, type pbnstPrfmncSttnType } from "./prfmncSttn/pbnstPrfmncSttn";
import { ruseCaseActionsExport, ruseCaseStateExport, type ruseCaseType, type ruseCaseState } from "./matDmd/ruseCaseMng";
export type WrStore = comCodeType &
pubFacType &
@@ -114,7 +115,8 @@ export type WrStore = comCodeType &
pbnstPrfmncType&
coRvwType&
ruseHstryType&
pbnstPrfmncSttnType
pbnstPrfmncSttnType&
ruseCaseType
;
export const StoreZus = (
@@ -138,7 +140,8 @@ export const StoreZus = (
pbnstPrfmncState&
coRvwState&
ruseHstryState&
pbnstPrfmncSttnState
pbnstPrfmncSttnState&
ruseCaseState
= {
...comCodeStateExport,
...pubFacStateExport,
@@ -160,7 +163,8 @@ export const StoreZus = (
...pbnstPrfmncStateExport,
...coRvwStateExport,
...ruseHstryStateExport,
...pbnstPrfmncSttnExport
...pbnstPrfmncSttnExport,
...ruseCaseStateExport
}
) => {
return createStore<WrStore>()((set) => {
@@ -193,7 +197,8 @@ export const StoreZus = (
...pbnstPrfmncActionsExport(set),
...coRvwActionsExport(set),
...ruseHstryActionsExport(set),
...pbnstPrfmncSttnActionsExport(set)
...pbnstPrfmncSttnActionsExport(set),
...ruseCaseActionsExport(set)
};
});
};
@@ -1,91 +0,0 @@
import { useWrStore } from "@/app/store";
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import { DatePicker, FormField, FormItem, FormLabel, FormUi, SelectBox } from "@common/business_components";
import { Button, Input } from "@common/components";
import { useState } from "react";
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/ruseFcltMng/fcltReg/rainReg";
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 }} selectClass={undefined} />
</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>
</>
);
}