결함대장 수정중

This commit is contained in:
leedj312
2025-07-03 20:22:19 +09:00
parent 6f263a185e
commit 2cc8d5209c
25 changed files with 606 additions and 225 deletions
@@ -368,7 +368,7 @@ export default function ConCostForm({
childrenTriger={
<>
<Label className="underline">
총사업비 (백만원) <i className="diveicon di-search" />
처리시설 총사업비(백만원) <i className="diveicon di-search" />
</Label>
</>
}
@@ -405,7 +405,7 @@ export default function ConCostForm({
)}
/>
</div>
<div className="col-span-3 mt-4">
{/* <div className="col-span-3 mt-4">
<div className="flex items-center justify-between">
<Label>공급처 선정</Label>
<Button size={"sm"} onClick={(e) => {}} className="bg-none">
@@ -428,7 +428,7 @@ export default function ConCostForm({
</FormUi>
)}
/>
</div>
</div> */}
<div className="col-span-4 mt-4">
<FormField
control={form.control}
@@ -7,11 +7,9 @@ import {
excelToRswtGuideData,
excelToRswtPolution,
} from "@/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel";
import { ToastFormUi } from "@/components/ui/toast/toastFromUi";
import {
filePicked,
filePickedArray,
FileUpload,
Form,
FormField,
FormUi,
@@ -26,7 +24,7 @@ import { useForm } from "react-hook-form";
import toast from "react-hot-toast";
import type { z } from "zod";
export default function ChkgdExcel({ type }: { type: string }) {
export default function ChkgdExcel({ type,setIsRegExcel }: { type: string, setIsRegExcel:(open:boolean) =>void }) {
const { rswtChkgdn, rainChkExcelDataUPload, rswtChkExceDataUpload } =
useWrStore((state) => {
return state;
@@ -146,29 +144,28 @@ export default function ChkgdExcel({ type }: { type: string }) {
const onSubmit = (values: z.infer<typeof chkgdRegExcel>) => {
if (values.chckYr === "") {
ToastFormUi({ body: "등록년도를 작성해주세요", title: "지도점검 등록" });
toast.error("등록년도를 작성해주세요");
return;
}
if (type === "RNB") {
if (excelData === undefined || excelData?.length === 0) {
ToastFormUi({
body: "빈 파일 및 파일 오류 입니다.",
title: "지도점검 등록",
});
toast.error("빈 파일 및 파일 오류 입니다.");
return;
} else {
rainChkExcelDataUPload(excelData as rainChkZodType[]);
setIsRegExcel(false)
}
} else if (type === "RST") {
if (excelRswtData === undefined || excelRswtData?.length === 0) {
ToastFormUi({
body: "빈 파일 및 파일 오류 입니다.",
title: "중수지도점검 등록",
});
toast.error("빈 파일 및 파일 오류 입니다.");
return;
} else {
rswtChkExceDataUpload(excelRswtData as rswtChkZodType[]);
setIsRegExcel(false)
}
}
};
@@ -10,7 +10,7 @@ import type { z } from "zod";
import React from "react";
import type { TableUpperProps } from "@/app/store/common/type/header";
export default function ChkgdModal({ type, obj }: { type: string; obj: any }) {
export default function ChkgdModal({ type, obj ,setIsModal }: { type: string; obj: any , setIsModal:(open:boolean)=>void}) {
const {
rainChkgdn,
rswtChkgdn,
@@ -79,6 +79,8 @@ export default function ChkgdModal({ type, obj }: { type: string; obj: any }) {
]);
useEffect(() => {
console.log('obj ', obj)
const result = obj.guideDetails?.reduce((acc: any, cur: any) => {
const code = cur.utztnUsgCd;
const month = cur.ym?.slice(4); // "MM"
@@ -114,9 +116,10 @@ export default function ChkgdModal({ type, obj }: { type: string; obj: any }) {
});
}
console.log("result ", result);
setGuidData(result as splRuseWaterType[]);
console.log('obj ', obj)
if (obj.rswtrPollutions) {
const resultPolution: Record<string, any[]> = {
"1": [],
@@ -217,12 +220,14 @@ export default function ChkgdModal({ type, obj }: { type: string; obj: any }) {
obj.guideDetails = realGuideDetail;
if (type === "RNB") {
rainChkGuidUpdate(obj);
setIsModal(false)
} else {
const polution = Object.values(upPolutionData)
.flat()
.filter((item) => item.utztnUsgCd !== "평균");
obj.rswtrPollutions = polution;
rwstPolAndGuideUpdate([obj]);
setIsModal(false)
}
};
@@ -262,12 +267,13 @@ export default function ChkgdModal({ type, obj }: { type: string; obj: any }) {
<ScrollArea className="h-[60vh]">
<div className="card-header">
<h3 className="text-2xl font-medium text-label">
{`연간보급수이용량`}
{`연간대체수이용량`}
</h3>
</div>
<GuideDetailsTable
chgRes={guidData || []}
headList={headList.ruseHeadList}
headList={headList.splHeadList}
upheadList={type === "RNB"? rainChkgdn.rainSplHeadNm :rswtChkgdn.rswtSplHeadNm}
type={""}
setChGuidData={(data) => {
setChGuidData(data);
@@ -280,7 +286,8 @@ export default function ChkgdModal({ type, obj }: { type: string; obj: any }) {
</div>
<GuideDetailsTable
chgRes={guidData || []}
headList={headList.splHeadList}
headList={headList.ruseHeadList}
upheadList={type === "RNB"? rainChkgdn.rainRuseHeadNm :rswtChkgdn.rswtRuseHeadNm}
type={""}
setChGuidData={(data) => {
setChGuidData(data);
@@ -302,6 +309,7 @@ export default function ChkgdModal({ type, obj }: { type: string; obj: any }) {
<GuideDetailsTable
chgRes={value}
headList={headList?.rswtDetailHeadList}
upheadList={rswtChkgdn.rswtSplHeadNm}
type={""}
setChGuidData={(data) => {
getPolutionData(data);
@@ -4,6 +4,7 @@ import { useWrStore } from "@/app/store";
import type { TableUpperProps } from "@/app/store/common/type/header";
import type {
} from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList";
import { InputTableBody } from "@/components/lib/func/TableData";
import {
Input,
@@ -18,11 +19,13 @@ import { useEffect, useState, type Dispatch, type SetStateAction } from "react"
export function GuideDetailsTable({
chgRes,
headList,
upheadList,
type,
setChGuidData,
}: {
chgRes: any[];
headList: TableUpperProps[];
upheadList:chHeadType[]
type: string;
setChGuidData: (chgRes: any[]) => void;
}) {
@@ -44,7 +47,7 @@ export function GuideDetailsTable({
<>
<div className={`card !m-[1.2rem] !p-0r `}>
<Table variant="secondary">
<TableHeader className="font-bold">{headMakeprfmnc(headList, rainChkgdn?.rainHeadNm)}</TableHeader>
<TableHeader className="font-bold">{headMakeprfmnc(headList, upheadList)}</TableHeader>
<TableBody >
{InputTableBody(inputData ?? [],headList, setInputData) }
</TableBody>
@@ -1,7 +1,7 @@
"use client";
import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/TableHead";
import { useWrStore } from "@/app/store";
import type { rainChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
import { rainPageSize, type rainChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList";
import type { TableUpperProps } from "@/app/store/common/type/header";
import { tableData } from "@/components/lib/func/commom";
@@ -17,6 +17,7 @@ import {
} from "@common/components/ui";
import { useCallback, useEffect, useState } from "react";
import UiPageNations from "@common/business_components/ui/table/uiPageNations";
import LoadingOverlay from "@common/business_components/ui/loadingBar";
export default function RainChkgdTable({
detailUp,
handleClick = () => { },
@@ -70,16 +71,12 @@ export default function RainChkgdTable({
}, [makeTableData, handleClick]);
useEffect(() =>{
},[rainChkgdn.rainChk])
useEffect(() => {
setSelectedIds([])// 셀렉트 초기화를 위한 작업
if (rainChkData) {
if (rainChkData&&rainChkData.length>0) {
const rainChg = rainChkData.map((item: any) => {
const rainChg = rainChkData?.map((item: any) => {
const bud = tableData([item.building], { code });
return {
...item,
@@ -89,6 +86,8 @@ export default function RainChkgdTable({
});
setMakeTableData(rainChkTableData(rainChg));
}else{
setMakeTableData([]);
}
}, [rainChkData, code]);
@@ -167,7 +166,7 @@ export default function RainChkgdTable({
} else {
setHeadList({
headList: rainChkgdn.rainChkgdnHeadList,
upHeadList: rainChkgdn.rainHeadNm
upHeadList: rainChkgdn.rainMainHeadNm
})
}
@@ -175,9 +174,15 @@ export default function RainChkgdTable({
}, [rainChkSttn.isSttn, rainChkgdn.rainChkgdnHeadList, rainChkSttn.rainChkgdnHeadList]);
useEffect(() =>{
console.log('rainChkgdn.count ', rainChkgdn.rainChkCount)
},[rainChkgdn.rainChkCount])
return (
<>
<LoadingOverlay isLoading={rainChkgdn.isLoading}></LoadingOverlay>
<Table variant="secondary">
<TableHeader className="font-bold">
{headMakeprfmnc(
headList?.headList,
@@ -197,9 +202,9 @@ export default function RainChkgdTable({
</TableBody>
</Table>
<UiPageNations
total={rainChkData?.length ?? 0}
total={rainChkgdn.rainChkCount||20}
cur={pageNation}
pageSize={20}
pageSize={rainPageSize}
onPageChange={onPageChange}
/>
</>
@@ -2,9 +2,10 @@
import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/TableHead";
import { useWrStore } from "@/app/store";
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList";
import type {
rswtChkZodType,
rswtrChkDetailsZodType,
import {
rswtPageSize,
type rswtChkZodType,
type rswtrChkDetailsZodType,
} from "@/app/store/prfmncReg/chkgdnReg/rswrtChkgdn";
import type { TableUpperProps } from "@/app/store/common/type/header";
import { tableData } from "@/components/lib/func/commom";
@@ -15,6 +16,7 @@ import {
import { Table, TableBody, TableHeader } from "@common/components/ui";
import { useCallback, useEffect, useState } from "react";
import UiPageNations from "@common/business_components/ui/table/uiPageNations";
import LoadingOverlay from "@common/business_components/ui/loadingBar";
export default function RswtChkgdTable({
detaiRswtlUpdate,
@@ -72,7 +74,6 @@ export default function RswtChkgdTable({
}, [rswtChkgdn.rswtChkPolGuide]);
useEffect(() => {
console.log("makeTableData ", makeTableData)
getRswtSttnExcel(makeTableData)
const selectedData = makeTableData
.map((item) => {
@@ -133,6 +134,7 @@ export default function RswtChkgdTable({
return (
<>
<LoadingOverlay isLoading={rswtChkgdn.isLoading}></LoadingOverlay>
<Table variant="secondary">
<TableHeader className="font-bold">
{headMakeprfmnc(headList?.headList, headList?.upHeadList)}
@@ -150,9 +152,9 @@ export default function RswtChkgdTable({
</TableBody>
</Table>
<UiPageNations
total={rswtChkData?.length ?? 0}
total={rswtChkgdn.rswtChkCount}
cur={pageNation}
pageSize={20}
pageSize={rswtPageSize}
onPageChange={onPageChange}
/>
</>