공공 재이용 등록 수정
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { SelectBox } from "@common/business_components";
|
||||
import {
|
||||
FormUi,
|
||||
} from "@common/business_components/ui";
|
||||
import { FormUi } 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";
|
||||
@@ -28,18 +26,16 @@ import {
|
||||
ruseFcltinfo,
|
||||
wasteWaterFcltINfo,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/headList";
|
||||
import { pbnstRegZod } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
|
||||
|
||||
import { pbnstRegZod } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
|
||||
import RuseMngTable from "@/components/ui/table/pbnstReg/ruseMngTable/ruseMngTable";
|
||||
|
||||
export function PbnstBuseForm() {
|
||||
const { code, pbnst } = useWrStore((state) => state);
|
||||
const { pubMngUpHeadList,pbnstBizCycle } = pbnst;
|
||||
const [getBizCycle, setBizCycle] = useState('');
|
||||
|
||||
const { pbnstBizCycle } = pbnst;
|
||||
const [getBizCycle, setBizCycle] = useState([{ text: "없음", val: "1" }]);
|
||||
|
||||
const form = useForm<z.infer<typeof pbnstRegZod>>({
|
||||
resolver: zodResolver(pbnstRegZod),
|
||||
|
||||
});
|
||||
|
||||
// 2. Define a submit handler.
|
||||
@@ -56,13 +52,16 @@ export function PbnstBuseForm() {
|
||||
const [bizCmcnDate, setBizCmcnDate] = useState(new Date());
|
||||
const [files, setFiles] = useState(null);
|
||||
useEffect(() => {
|
||||
if (getBizCycle ) {
|
||||
console.log("getBizCycle", getBizCycle);
|
||||
|
||||
form.reset()
|
||||
console.log("getBizCycle", getBizCycle);
|
||||
if (getBizCycle) {
|
||||
form.reset();
|
||||
}
|
||||
}, [getBizCycle]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("pbnstBizCycle", pbnstBizCycle);
|
||||
}, [pbnstBizCycle]);
|
||||
|
||||
return (
|
||||
<div className=" !mx-[1.6rem] !p-0r">
|
||||
{/* 차수별 등록 현황 폼 */}
|
||||
@@ -76,18 +75,22 @@ export function PbnstBuseForm() {
|
||||
<h1 className=" text-xl"></h1>
|
||||
<div className="flex items-center gap-2 mx-3">
|
||||
<h1 className={formTableName}>등록차수</h1>
|
||||
|
||||
<SelectBox
|
||||
label=""
|
||||
selectArray={pbnstBizCycle}
|
||||
value={pbnstBizCycle.length > 0 && pbnstBizCycle[0]? pbnstBizCycle[0].val : ""}
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
onSelectValue={(val) => {setBizCycle}}
|
||||
>
|
||||
|
||||
</SelectBox>
|
||||
|
||||
<SelectBox
|
||||
label=""
|
||||
selectArray={pbnstBizCycle}
|
||||
value={
|
||||
pbnstBizCycle.length > 0 && pbnstBizCycle[0]
|
||||
? pbnstBizCycle[0].val
|
||||
: ""
|
||||
}
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
onSelectValue={(val) => {
|
||||
setBizCycle;
|
||||
}}
|
||||
></SelectBox>
|
||||
|
||||
<Button size={commonButonSize}>저장</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -98,7 +101,7 @@ export function PbnstBuseForm() {
|
||||
moClass="grid grid-cols-12 gap-4"
|
||||
sonClass="col-span-4"
|
||||
/>
|
||||
|
||||
|
||||
<MngRegFormDetail
|
||||
formList={businessMoneyInfo}
|
||||
h1Title={"사업비"}
|
||||
@@ -129,6 +132,15 @@ export function PbnstBuseForm() {
|
||||
/>
|
||||
|
||||
<h1 className={formH1Class}>재이용 원수취수 현황</h1>
|
||||
<div>
|
||||
<Button size={commonButonSize}>
|
||||
추가등록
|
||||
</Button>
|
||||
<RuseMngTable
|
||||
tableData={[]}
|
||||
headList={pbnst.pbnstOrgwtHeadList}
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
</Form>
|
||||
</div>
|
||||
|
||||
@@ -37,7 +37,7 @@ const formSchema = z.object({
|
||||
|
||||
export function PbnstMngForm({ data }: { data: ruseFcltType[] }) {
|
||||
const { pbnst } = useWrStore((state) => state);
|
||||
const { pubMngUpHeadList, isInit } = pbnst;
|
||||
const { pbnstMngUpHeadList, isInit } = pbnst;
|
||||
const [ruseOperData, setRuseOperData] = useState<fcltOperInfoType[]>();
|
||||
const [planFiles, setPlanFiles] = useState<File[] | null>(null);
|
||||
const [relationfiles, setRelationFiles] = useState<File[] | null>(null);
|
||||
@@ -114,33 +114,7 @@ export function PbnstMngForm({ data }: { data: ruseFcltType[] }) {
|
||||
// handleSuccess: setUpload,
|
||||
// })
|
||||
}, [relationfiles]);
|
||||
const headMakeColSpan = (upHeadList: TableUpperProps[]) => {
|
||||
return (
|
||||
<>
|
||||
<TableRow>
|
||||
{upHeadList.map((head: TableUpperProps) =>
|
||||
!head.upSequnce ? (
|
||||
<TableHead rowSpan={2} key={head.id}>
|
||||
{head.title}
|
||||
</TableHead>
|
||||
) : head.upName === "upChangeRe" && head.upSequnce === 1 ? (
|
||||
<TableHead key={head.id} rowSpan={1} colSpan={2}>
|
||||
{"운영대행기간"}
|
||||
</TableHead>
|
||||
) : null
|
||||
)}
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
{upHeadList.map((head: TableUpperProps) =>
|
||||
head.upName === "upChangeRe" ? (
|
||||
<TableHead key={head.id}>{head.title}</TableHead>
|
||||
) : null
|
||||
)}
|
||||
</TableRow>
|
||||
</>
|
||||
);
|
||||
};
|
||||
const nodeList = headMakeColSpan(pubMngUpHeadList);
|
||||
|
||||
|
||||
return (
|
||||
<div className=" !mx-[1.6rem] !p-0r">
|
||||
@@ -186,8 +160,8 @@ export function PbnstMngForm({ data }: { data: ruseFcltType[] }) {
|
||||
</div>
|
||||
<RuseMngTable
|
||||
tableData={[]}
|
||||
headList={pbnst.pubMngUpHeadList}
|
||||
upHeadList={pbnst.pubMngNm}
|
||||
headList={pbnst.pbnstMngUpHeadList}
|
||||
upHeadList={pbnst.pbnstMngNm}
|
||||
></RuseMngTable>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/TableHead";
|
||||
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList";
|
||||
import type { TableUpperProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { Input, Table, TableBody, TableCell, TableHeader, TableRow } from "@common/components/ui";
|
||||
import {
|
||||
Input,
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@common/components/ui";
|
||||
|
||||
export default function RuseMngTable({
|
||||
tableData,
|
||||
@@ -10,13 +18,23 @@ export default function RuseMngTable({
|
||||
}: {
|
||||
tableData: any[];
|
||||
headList: TableUpperProps[];
|
||||
upHeadList: chHeadType[];
|
||||
upHeadList?: chHeadType[];
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Table variant="secondary">
|
||||
<TableHeader className="font-bold">
|
||||
{headMakeprfmnc(headList, upHeadList)}
|
||||
{upHeadList ? (
|
||||
headMakeprfmnc(headList, upHeadList)
|
||||
) : (
|
||||
<TableRow key={"table-row-test"}>
|
||||
{headList.map((head) => (
|
||||
<TableHead className={`border border-gray-600 px-2 py-1 `}>
|
||||
{head.title}
|
||||
</TableHead>
|
||||
))}
|
||||
</TableRow>
|
||||
)}
|
||||
</TableHeader>
|
||||
|
||||
<TableBody>
|
||||
@@ -32,9 +50,7 @@ export default function RuseMngTable({
|
||||
<Input
|
||||
className={`${head.type === "number" ? "text-right" : "text-center"} !text-xl`}
|
||||
type={head.type}
|
||||
onChange={(e) => {
|
||||
;
|
||||
}}
|
||||
onChange={(e) => {}}
|
||||
value={item[head.id] || ""}
|
||||
/>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user