diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/index.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/index.tsx
index afba2f813..23591ae42 100644
--- a/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/index.tsx
+++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/index.tsx
@@ -84,6 +84,7 @@ type rswtChkgdnActions = {
rswtChkPolInit: () => void;
rwstPolAndGuideUpdate: (rswtChk: rswtChkZodType[]) => void;
rswtChkHeadChange: (rswtChkgdn: rswtChkgdnState, isEdit: boolean) => void;
+ setRswtChkLoading:(status:boolean) =>void
};
export type rswtChkgdnType = rswtChkgdnState & rswtChkgdnActions;
@@ -394,6 +395,15 @@ export const rswtChkgdnActionsExport: (set: any) => rswtChkgdnActions = (
} catch (e) {
console.error(e);
}
- },
+ },setRswtChkLoading:(status:boolean) =>{
+ set((state: rswtChkgdnState) => ({
+ ...state,
+ rswtChkgdn: {
+ ...state.rswtChkgdn,
+ isLoading: status,
+ },
+ }));
+ }
+
};
};
diff --git a/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx b/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx
index 84dd7d8e3..24a983dce 100644
--- a/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx
+++ b/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx
@@ -18,6 +18,7 @@ import {
SelectBox,
Title,
} from "@common/business_components/ui";
+import LoadingOverlay from "@common/business_components/ui/loadingBar";
import { Button, Input } from "@common/components/ui";
import { zodResolver } from "@hookform/resolvers/zod";
import { useEffect, useRef, useState } from "react";
@@ -35,9 +36,12 @@ export default function ChkgdExcel({
setYearChange: (year: string) => void;
}) {
const {
+ rswtChkgdn,
+ rainChkgdn,
rainChkExcelDataUPload,
rswtChkExceDataUpload,
setRainChkLoading,
+ setRswtChkLoading,
} = useWrStore((state) => {
return state;
});
@@ -110,43 +114,38 @@ export default function ChkgdExcel({
setRainChkLoading(false);
});
} else if (type === "RST") {
- filePickedArray(file, 0).then((res) => {
-
+ setRswtChkLoading(true);
+ filePickedArray(file, 0)
+ .then((res) => {
+ if (res && res?.length > 1) {
+ const guideData = excelToRswtGuideData(
+ res[0],
+ form.getValues("chckYr")
+ );
+ const polutionData = excelToRswtPolution(res[1]);
- if (res && res?.length > 1) {
- const guideData = excelToRswtGuideData(
- res[0],
- form.getValues("chckYr"),
- );
- const polutionData = excelToRswtPolution(res[1]);
-
-
-
-
const keyGenerator = (item: rswtChkZodType) =>
`${item.bdstRuseFcltSn}|${item.chckYmd}|${item.utztnUsgCd}`;
- const totalData: rswtChkZodType[] = guideData.map(
- (guide) => {
- const fusion = polutionData.find(
- (polution) =>
- guide.bdstRuseFcltSn === polution.bdstRuseFcltSn &&
- guide.chckYmd === polution.chckYmd &&
- guide.utztnUsgCd === polution.utztnUsgCd
- );
+ const totalData: rswtChkZodType[] = guideData.map((guide) => {
+ const fusion = polutionData.find(
+ (polution) =>
+ guide.bdstRuseFcltSn === polution.bdstRuseFcltSn &&
+ guide.chckYmd === polution.chckYmd &&
+ guide.utztnUsgCd === polution.utztnUsgCd
+ );
- if (fusion) {
- return {
- ...guide,
- rswtrPollutions: fusion?.rswtrPollutions,
- rswtrDetails: fusion?.rswtrDetails,
- };
- } else {
- return {
- ...guide,
- };
- }
+ if (fusion) {
+ return {
+ ...guide,
+ rswtrPollutions: fusion?.rswtrPollutions,
+ rswtrDetails: fusion?.rswtrDetails,
+ };
+ } else {
+ return {
+ ...guide,
+ };
}
- );
+ });
const guideKey = new Set(guideData.map(keyGenerator));
const onlypolution = polutionData.filter(
(item) => !guideKey.has(keyGenerator(item))
@@ -158,7 +157,7 @@ export default function ChkgdExcel({
];
const issues: string[] = [];
- rswtExcelDataCheck(listTotalData,issues)
+ rswtExcelDataCheck(listTotalData, issues);
if (issues && issues.length > 0) {
issues.some((err, index) => {
@@ -169,8 +168,9 @@ export default function ChkgdExcel({
} else {
setExcelRswtData(listTotalData);
}
- }
- });
+ }
+ })
+ .finally(() => setRswtChkLoading(false));
}
}
}, [file]);
@@ -222,6 +222,11 @@ export default function ChkgdExcel({
return (
<>
+