diff --git a/apps/wr/.env.local b/apps/wr/.env.local
index db59d33c4..19f7f5a24 100644
--- a/apps/wr/.env.local
+++ b/apps/wr/.env.local
@@ -12,8 +12,8 @@ NEXT_PUBLIC_CS_SERVER_API_URL = http://dev.onasys.co.kr:8000
NEXT_PUBLIC_CS_TUS_UPLOAD = /attach-service/api/v1/tus/upload
NEXT_PUBLIC_GEOSERVER_URL = https://hasudo.geo.rsonesoft.com/geoserver
NEXT_PUBLIC_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver
-NEXT_PUBLIC_WR_SERVER_API_URL = http://con.mind-one.co.kr:11083/reuse-service/api/v1
-#NEXT_PUBLIC_WR_SERVER_API_URL = http://192.168.1.222:8883/reuse-service/api/v1
+# NEXT_PUBLIC_WR_SERVER_API_URL = http://con.mind-one.co.kr:11083/reuse-service/api/v1
+NEXT_PUBLIC_WR_SERVER_API_URL = http://192.168.1.222:8883/reuse-service/api/v1
NEXT_PUBLIC_SEWERAGE_API_URL = http://con.mind-one.co.kr:11083/sewerage-service # ๊ฐ๋ฐ ์๋ฒ API
# NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.66:8883/sewerage-service
NEXT_PUBLIC_NGII_URL = https://map.ngii.go.kr
diff --git a/apps/wr/app/(with-layout)/matMng/coMat/coMatRvw/page.tsx b/apps/wr/app/(with-layout)/matMng/coMat/coMatRvw/page.tsx
index bcc168aac..330847f86 100644
--- a/apps/wr/app/(with-layout)/matMng/coMat/coMatRvw/page.tsx
+++ b/apps/wr/app/(with-layout)/matMng/coMat/coMatRvw/page.tsx
@@ -1,6 +1,6 @@
"use client";
/**
- * ๐ CoMatRvw ์์๋งค์นญ ๊ฒํ
+ * ๐ CoMatRvw ์์์ฒ ๋งค์นญ ๊ฒํ
* Next.js App Router (app/) ๊ธฐ๋ฐ ํ์ด์ง ์ปดํฌ๋ํธ ์์
*
* - ๋๋ฏผ์์ ์ ์ฒญํ๋ ์์์ฒ์ ์์๋ฑ๋ก ์ ๋ณด๋ฅผ ์ด์๋ด๋น์๊ฐ ์์ ๋งค์นญ ๊ฒํ ๋ฅผ ์งํํ๋ค.
@@ -8,7 +8,7 @@
*/
import { useWrStore } from "@/app/store";
import { btnClass } from "@/app/store/common/code";
-import { usageProcData } from "@/app/store/matDmd/coMatRvw/headList";
+import { usageProcData } from "@/app/store/matDmd/coMatRvw/headList"; // ์ฉ๋์ ๋ฐ๋ฅธ ์ฒ๋ฆฌ๊ณต์
import {
DmdCoReqSchema,
type DmdCoReqType,
@@ -112,19 +112,29 @@ export default function CoMatRvw() {
if (coMatRvwRes && coMatRvwRes[index]) {
setSelectData(coMatRvwRes[index]);
setSelectionVersion((v) => v + 1); // ํ์ ํด๋ฆญํ ๋๋ง๋ค ๋ฒ์ ์ 1์ฉ ์ฆ๊ฐ
- bottomRef.current?.scrollIntoView({ behavior: "smooth" });
+ bottomRef.current?.scrollIntoView({ behavior: "smooth" }); // ํ๋ฉด ์คํฌ๋ก ์ฒ๋ฆฌ
}
};
const useUsgCdWatch = useWatch({ control: form.control, name: "useUsgCd" });
useEffect(() => {
if (useUsgCdWatch) {
+ console.log("useUsgCdWatch:" , useUsgCdWatch);
+ const normalizedUseUsgCd =
+ code.sewageOutFclttUse?.find((item) => item.val === useUsgCdWatch)?.val ??
+ code.sewageOutFclttUse?.find((item) => item.text === useUsgCdWatch)?.val ??
+ useUsgCdWatch;
+
+ if (normalizedUseUsgCd !== useUsgCdWatch) {
+ form.setValue("useUsgCd", normalizedUseUsgCd);
+ }
+
form.setValue(
"demandCst.usgPrcsProcs",
- usageProcData?.find((item) => item.usage === useUsgCdWatch)?.process ??
+ usageProcData?.find((item) => item.useUsgCd === normalizedUseUsgCd)?.process ??
""
);
}
- }, [useUsgCdWatch, form, selectionVersion]);
+ }, [useUsgCdWatch, form, selectionVersion, code.sewageOutFclttUse]);
useEffect(() => {
if (coMatRvwRes && coMatRvwRes.length > 0) {
diff --git a/apps/wr/app/layout.tsx b/apps/wr/app/layout.tsx
index edd57b02b..e26635d4f 100644
--- a/apps/wr/app/layout.tsx
+++ b/apps/wr/app/layout.tsx
@@ -1,6 +1,8 @@
import type { Metadata } from "next";
import { App } from "../src/app";
+import { setCookie } from "../src/shared/lib/cookie";
+setCookie("site-id-key", process.env.NEXT_PUBLIC_SITE_ID || "WR");
export const metadata: Metadata = {
title: "๋ฌผ์ฌ์ด์ฉ๋งค์นญ์์คํ
",
description: "๋ฌผ์ฌ์ด์ฉ๋งค์นญ ์์คํ
์
๋๋ค",
diff --git a/apps/wr/app/store/common/code/index.ts b/apps/wr/app/store/common/code/index.ts
index f6e28339c..fb400de2c 100644
--- a/apps/wr/app/store/common/code/index.ts
+++ b/apps/wr/app/store/common/code/index.ts
@@ -77,6 +77,7 @@ export const getCommonUpCd = async (set: any) => {
pplQulity: lwCdCode["pplQulity"] ?? [],
pplLenght: lwCdCode["pplLenght"] ?? [],
dmdUszCd: lwCdCode["dmdUszCd"] ?? [],
+ sewageOutFclttUse: lwCdCode["sewageOutFclttUse"] ?? [],
ruseMngMtd: lwCdCode["ruseMngMtd"] ?? [],
rusePrcsMthdCd: lwCdCode["rusePrcsMthdCd"] ?? [],
erctUswtrPrcsMeth: lwCdCode["erctUswtrPrcsMeth"] ?? [],
@@ -233,6 +234,7 @@ export type comCodeState = {
pplQulity: SelectDataType[];
pplLenght: SelectDataType[];
dmdUszCd: SelectDataType[];
+ sewageOutFclttUse: SelectDataType[];
buildingType: {
RST: string;
RNB: string;
@@ -274,6 +276,7 @@ export const comCodeStateExport: comCodeState = {
pplLenght: lwCds["pplLenght"] ?? [],
yn: yn,
dmdUszCd: lwCds["dmdUszCd"] ?? [],
+ sewageOutFclttUse: lwCds["sewageOutFclttUse"] ?? [],
buildingType: buildingType,
ruseMngMtd: lwCds["ruseMngMtd"] ?? [],
ruseSeCd: ruseSeCd,
diff --git a/apps/wr/app/store/common/searchCode/index.ts b/apps/wr/app/store/common/searchCode/index.ts
index 1478b10a8..a48225e12 100644
--- a/apps/wr/app/store/common/searchCode/index.ts
+++ b/apps/wr/app/store/common/searchCode/index.ts
@@ -39,7 +39,8 @@ export const comFcltStateExport: comFcltState = {
cdtnv: 0,
crmty: 0,
rmrk: "",
- reqDt: ""
+ reqDt: "",
+ zip: "",
},
constCostRes:[],
rateFeeRes:[],
@@ -51,7 +52,7 @@ export type comFcltState = {
searchFclts: pubHasuType[];
demandCompList: DemandCompType[];
checkDemand: DemandCompType;
- constCostRes:conCostFeeType[],
+ constCostRes:conCostFeeType[], // ํ์ค์ฌ์
๋น
rateFeeRes:rateFeeType[],
};
@@ -164,7 +165,9 @@ export const comFcltSearchAction: (set: any) => comFcltActions = (set: any) => {
} catch (e) {
console.log(" error ", e);
}
- },getConstCostFee: async (year: string) => {
+ },
+ // ๊ณต์ฌ๊ธ์ก ์กฐํ : ONSEMIRO_NEW.EM_STD_COST_REUSE ์ค์น๊ด๋ฆฌํ์ค์ฌ์
๋น ์ฌ์ด์ฉ์์ค ๊ณต์ฌ๋น
+ getConstCostFee: async (year: string) => {
try {
const url = `/prcsFclt/CstRuse/${year}`;
const constCost = await getFetch(fetchType.COMMON, url);
diff --git a/apps/wr/app/store/matDmd/coMatRvw/headList.tsx b/apps/wr/app/store/matDmd/coMatRvw/headList.tsx
index 16d2107c6..895ba5f89 100644
--- a/apps/wr/app/store/matDmd/coMatRvw/headList.tsx
+++ b/apps/wr/app/store/matDmd/coMatRvw/headList.tsx
@@ -187,13 +187,11 @@ export const rateFeeHeadListExport: CommonTableProps[] = [
];
export const usageProcData = [
- { usage: "์ฒญ์", process: "์ด์ธ์ฒ๋ฆฌ์์ค+์ผ์์๋
" },
- { usage: "ํ์ฅ์ค์ฉ์", process: "์ด์ธ์ฒ๋ฆฌ์์ค+์ผ์์๋
" },
- { usage: "์ธ์ฒ", process: "์ด์ธ์ฒ๋ฆฌ์์ค+UV์๋
" },
- { usage: "์ด์", process: "์ด์ธ์ฒ๋ฆฌ์์ค+UV์๋
" },
- { usage: "์กฐ๊ฒฝ", process: "์ด์ธ์ฒ๋ฆฌ์์ค+UV์๋
" },
- { usage: "๋์
", process: "์ด์ธ์ฒ๋ฆฌ์์ค+UV์๋
" },
- { usage: "ํ์ฒ", process: "์ด์ธ์ฒ๋ฆฌ์์ค+UV์๋
" },
- { usage: "์งํ์", process: "์ ์ฒ๋ฆฌ์์ค+RO" },
- { usage: "๊ณต์
", process: "์ ์ฒ๋ฆฌ์์ค+RO" },
+ { useUsgCd: "01", usage: "์ฒญ์ํ์ฅ์ค์ฉ์", process: "์ด์ธ์ฒ๋ฆฌ์์ค+์ผ์์๋
" },
+ { useUsgCd: "02", usage: "์ธ์ฒ์ด์์ฉ์", process: "์ด์ธ์ฒ๋ฆฌ์์ค+UV์๋
" },
+ { useUsgCd: "03", usage: "์กฐ๊ฒฝ์ฉ์", process: "์ด์ธ์ฒ๋ฆฌ์์ค+UV์๋
" },
+ { useUsgCd: "05", usage: "์งํ์์ถฉ์ ", process: "์ ์ฒ๋ฆฌ์์ค+RO" },
+ { useUsgCd: "06", usage: "๋์
์ฉ์", process: "์ด์ธ์ฒ๋ฆฌ์์ค+UV์๋
" },
+ { useUsgCd: "07", usage: "ํ์ฒ๋ฑ์ ์ง์ฉ์", process: "์ด์ธ์ฒ๋ฆฌ์์ค+UV์๋
" },
+ { useUsgCd: "08", usage: "๊ณต์
์ฉ์", process: "์ ์ฒ๋ฆฌ์์ค+RO" },
];
diff --git a/apps/wr/app/store/matDmd/coMatRvw/index.tsx b/apps/wr/app/store/matDmd/coMatRvw/index.tsx
index 0c58db9a6..39d1eaa28 100644
--- a/apps/wr/app/store/matDmd/coMatRvw/index.tsx
+++ b/apps/wr/app/store/matDmd/coMatRvw/index.tsx
@@ -139,6 +139,7 @@ export const coRvwActionsExport: (set: any) => coRvwActions = (set: any) => {
return "๋งค์นญ ๊ฒํ ์ ์ฅ ์ค๋ฅ์
๋๋ค.";
}
},
+ // ์์์ฒ ๋งค์นญ ๊ฒํ ํํฉ
coMatRvwSearch: async (
pageNo: number,
pageCnt: number,
@@ -160,7 +161,7 @@ export const coRvwActionsExport: (set: any) => coRvwActions = (set: any) => {
url += `/0`;
}
- console.log(" url ", url);
+ // console.log(" url ", url);
const coMatRvwRes = await getFetchWithCount(fetchType.WR, url);
return set((state: coRvwState) => ({
diff --git a/apps/wr/components/lib/func/calculateConstCost .tsx b/apps/wr/components/lib/func/calculateConstCost .tsx
index 5e9387385..2c2ec48ae 100644
--- a/apps/wr/components/lib/func/calculateConstCost .tsx
+++ b/apps/wr/components/lib/func/calculateConstCost .tsx
@@ -1,3 +1,18 @@
+/**
+ * ์ฃผ์ด์ง ์ฝ๋์ ์๋ ๊ธฐ์ค์ผ๋ก ๋ณด๊ฐ ๊ณ์ฐ์ ์ฌ์ฉํ ํํ/์ํ ๊ตฌ๊ฐ ๋ฐ์ดํฐ๋ฅผ ์ฐพ๋๋ค.
+ *
+ * ๊ฐ์ ์ฝ๋(`fctCd`)๋ฅผ ๊ฐ์ง ๋ฐ์ดํฐ๋ง ์ถ๋ฆฐ ๋ค,
+ * `qtyCode` ๊ฐ์ด ํ์ฌ ์๋(`qty`) ์ดํ์ธ ํญ๋ชฉ ์ค ๊ฐ์ฅ ํฐ ๊ฐ์ `lower`,
+ * ์ด๊ณผ์ธ ํญ๋ชฉ ์ค ๊ฐ์ฅ ์์ ๊ฐ์ `upper`๋ก ๋ฐํํ๋ค.
+ * ํ์ชฝ ๊ฒฝ๊ณ๋ง ์กด์ฌํ๋ฉด ๊ฐ์ ๊ฐ์ ์/ํํ์ ๋ณด์ ํด ๋ฐํํ๋ค.
+ *
+ * @param data ์ ์ฒด ๊ธฐ์ค ๋ฐ์ดํฐ ๋ชฉ๋ก
+ * @param fctCd ์ฐพ๊ณ ์ถ์ ์์ค/๊ตฌ๋ถ ์ฝ๋ ๊ฐ
+ * @param dataCode ์ฝ๋ ๋น๊ต์ ์ฌ์ฉํ ๊ฐ์ฒด ์์ฑ๋ช
+ * @param qtyCode ์๋ ๋น๊ต์ ์ฌ์ฉํ ๊ฐ์ฒด ์์ฑ๋ช
+ * @param qty ํ์ฌ ๋น๊ต ๊ธฐ์ค ์๋
+ * @returns ๋ณด๊ฐ ๊ณ์ฐ์ ์ฌ์ฉํ ํํ(lower), ์ํ(upper) ๋ฐ์ดํฐ
+ */
export const findBounds = (
data: any[],
fctCd: string,
diff --git a/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx b/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx
index cfb388264..dc1799e30 100644
--- a/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx
+++ b/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx
@@ -20,6 +20,7 @@ import {
Form,
FormField,
FormUi,
+ SelectBox,
UiTable,
} from "@common/business_components/ui";
import PopoverUi from "@common/business_components/ui/popover_ui";
@@ -47,12 +48,13 @@ export default function ConCostForm({
readonly: boolean;
}) {
const {
- constCostRes,
+ constCostRes, // ํ์ค์ฌ์
๋น
rateFeeRes,
coMatRvwUpdate,
ruseRvwCalUpdate,
getRateFee,
getConstCostFee,
+ code,
} = useWrStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
@@ -122,20 +124,19 @@ export default function ConCostForm({
const dmndQtyYear = dmndQtyWatch;
if (usgPrcsProcs && usgPrcsProcs?.length > 0) {
- const firstProc =
- getConstFctCode(usgPrcsProcs?.split("+")[0] || "") || "";
- const secondProc =
- getConstFctCode(usgPrcsProcs?.split("+")[1] || "") || "";
+ const firstProc = getConstFctCode(usgPrcsProcs?.split("+")[0] || "") || ""; // ์ฒซ๋ฒ์งธ ๊ณต์
+ const secondProc = getConstFctCode(usgPrcsProcs?.split("+")[1] || "") || ""; // ๋๋ฒ์งธ ๊ณต์
+ // ์ฒซ๋ฒ์งธ ์ฒ๋ฆฌ๊ณต์ ์ฝ๋์ ํด๋นํ๋ ํ์ค๊ณต์ฌ๋น ํ
์ด๋ธ์ด์ ์๊ตฌ์๋์ ๊ฐ์ธ๋ ํํ/์ํ ๊ตฌ๊ฐ์ ์ฐพ๋ ๋ถ๋ถ์ด๋ค.
const { lower: firstLower, upper: firstUpper } = findBounds(
- constCostRes,
+ constCostRes, // ํ์ค๊ณต์ฌ๋น
firstProc || "",
"fctCd",
"fctCpc",
Number(dmndQtyYear)
);
const { lower: secondLower, upper: secondUpper } = findBounds(
- constCostRes,
+ constCostRes, // ํ์ค๊ณต์ฌ๋น
secondProc || "",
"fctCd",
"fctCpc",
@@ -365,14 +366,17 @@ export default function ConCostForm({
name="useUsgCd"
render={({ field }) => (
- {
- field.onChange(e.target.value);
+ {
+ if (readonly) return;
+ field.onChange(String(val));
}}
value={field.value ?? ""}
- readOnly={true}
+ readOnly={readonly}
/>
)}
diff --git a/packages/common/business_components/src/ui/form/index.tsx b/packages/common/business_components/src/ui/form/index.tsx
index d2f955244..fc9bf5b8c 100644
--- a/packages/common/business_components/src/ui/form/index.tsx
+++ b/packages/common/business_components/src/ui/form/index.tsx
@@ -42,22 +42,24 @@ const FormField = <
}
const useFormField = () => {
- const fieldContext = React.useContext(FormFieldContext)
- const itemContext = React.useContext(FormItemContext)
- const { getFieldState, formState } = useFormContext()
+ const fieldContext = React.useContext(FormFieldContext);
+ const itemContext = React.useContext(FormItemContext);
+ const { getFieldState, formState } = useFormContext();
- const fieldState = getFieldState(fieldContext.name, formState)
+ // ํ๋๋ช
์ผ๋ก ํ๋์ ์ํ๋ฅผ ๊ฐ์ ธ์ด.
+ // errors, isDirty, dirtyFields, touchedFields, isSubmitted, isSubmitSuccessful, isValid, defaultValues, disabled
+ const fieldState = getFieldState(fieldContext.name, formState);
if (!fieldContext) {
throw new Error("useFormField should be used within ")
}
- const { id } = itemContext
+ const { id } = itemContext;
return {
id,
name: fieldContext.name,
- formItemId: `${id}-form-item`,
+ formItemId: `${id}-form-item`, // ์ ๊ทผ์ฑ ์์ฑ ์ฐ๊ฒฐ์ฉ
formDescriptionId: `${id}-form-item-description`,
formMessageId: `${id}-form-item-message`,
...fieldState,
@@ -86,6 +88,8 @@ const FormItem = React.forwardRef<
})
FormItem.displayName = "FormItem"
+// React.forwardRef๋ฅผ ์ฌ์ฉํด์ ๋ถ๋ชจ๊ฐ Label DOM ref๋ฅผ ์ง์ ๋ฐ์ ์ ์๊ฒ ํ๊ณ ,
+// ํ์ฌ FormField์ ์๋ฌ ์ํ์ form item id๋ฅผ ์ฐ๊ฒฐํด ์ ๊ทผ์ฑ(htmlFor)๊ณผ ์๋ฌ ์คํ์ผ์ ํจ๊ป ์ฒ๋ฆฌํ๋ค.
const FormLabel = React.forwardRef<
React.ElementRef,
React.ComponentPropsWithoutRef