diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/buseWaterQulity/buseWaterQulity.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/buseWaterQulity/buseWaterQulity.tsx index 54e21e6c0..8ff9430a4 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/buseWaterQulity/buseWaterQulity.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/buseWaterQulity/buseWaterQulity.tsx @@ -1,7 +1,6 @@ -import { txtSize } from "@/app/store/common/code/basicCode"; import type { PbnstRegArrrayType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type"; import { formH1Class } from "@/components/lib/class/comClass"; -import { FormField, FormUi } from "@common/business_components/ui"; +import { FormField, FormUi, SelectBox } from "@common/business_components/ui"; import { Input, Label } from "@common/components/ui"; import { useCallback, useEffect, useState } from "react"; import type { UseFormReturn } from "react-hook-form"; @@ -40,7 +39,7 @@ export function BuseWaterQulity({ form.getValues(`items.${indexMng}.pbnstRuseFcltId`) + String(form.getValues(`items.${indexMng}.fcBizs.${indexBiz}.cycl`)); - console.log('checkPkAndCycle ', checkPkAndCycle) + console.log("checkPkAndCycle ", checkPkAndCycle); if (chekcPk !== checkPkAndCycle) { if (watchPH && watchPH !== undefined) { const [frontPH, backPH] = watchPH.split("~"); @@ -56,9 +55,7 @@ export function BuseWaterQulity({ } setCheakPk(checkPkAndCycle); } - }, [form.getValues(`items.${indexMng}.fcBizs.${indexBiz}.ph`), - - chekcPk]); + }, [form.getValues(`items.${indexMng}.fcBizs.${indexBiz}.ph`), chekcPk]); const isSetFrontPh = useCallback( (frontPHdata: string) => { @@ -71,11 +68,10 @@ export function BuseWaterQulity({ const MatchData = frontPHdata + "~" + backPH; form.setValue(`items.${indexMng}.fcBizs.${indexBiz}.ph`, MatchData); setFrontPHdata(frontPHdata); - }else{ - const MatchData = frontPHdata+ "~" + '0'; - form.setValue(`items.${indexMng}.fcBizs.${indexBiz}.ph`, MatchData); - setFrontPHdata(frontPHdata); - + } else { + const MatchData = frontPHdata + "~" + "0"; + form.setValue(`items.${indexMng}.fcBizs.${indexBiz}.ph`, MatchData); + setFrontPHdata(frontPHdata); } } }, @@ -91,16 +87,16 @@ export function BuseWaterQulity({ if (PHdata) { const frontPH = PHdata.split("~")[0]; - const MatchData = frontPH + "~" + backPHdata + const MatchData = frontPH + "~" + backPHdata; + + console.log(" backPHdata ", MatchData); + form.setValue(`items.${indexMng}.fcBizs.${indexBiz}.ph`, MatchData); + setBackPHdata(backPHdata); + } else { + const MatchData = "0" + "~" + backPHdata; - console.log(' backPHdata ', MatchData) form.setValue(`items.${indexMng}.fcBizs.${indexBiz}.ph`, MatchData); setBackPHdata(backPHdata); - }else{ - const MatchData = '0' + "~" + backPHdata; - - form.setValue(`items.${indexMng}.fcBizs.${indexBiz}.ph`, MatchData); - setBackPHdata(backPHdata); } } }, @@ -134,7 +130,7 @@ export function BuseWaterQulity({ : "" } readOnly={formType === "sttn" ? true : false} - maxLength={txtSize} + maxLength={6} /> )} @@ -159,7 +155,7 @@ export function BuseWaterQulity({ }} value={field.value ?? ""} readOnly={formType === "sttn" ? true : false} - maxLength={txtSize} + maxLength={6} /> )} @@ -186,7 +182,7 @@ export function BuseWaterQulity({ : "" } readOnly={formType === "sttn" ? true : false} - maxLength={txtSize} + maxLength={6} /> )} @@ -213,7 +209,7 @@ export function BuseWaterQulity({ : "" } readOnly={formType === "sttn" ? true : false} - maxLength={txtSize} + maxLength={6} /> )} @@ -229,7 +225,7 @@ export function BuseWaterQulity({ key={`items.${indexMng}.fcBizs.${indexBiz}.smll-key`} render={({ field }) => ( - + /> */} + { + field.onChange(val); + }} + value={field.value||undefined} + > )} /> @@ -265,7 +275,7 @@ export function BuseWaterQulity({ : "" } readOnly={formType === "sttn" ? true : false} - maxLength={txtSize} + maxLength={6} /> )} @@ -292,7 +302,7 @@ export function BuseWaterQulity({ : "" } readOnly={formType === "sttn" ? true : false} - maxLength={txtSize} + maxLength={6} /> )} @@ -320,7 +330,7 @@ export function BuseWaterQulity({ : "" } readOnly={formType === "sttn" ? true : false} - maxLength={txtSize} + maxLength={6} /> )} @@ -347,7 +357,7 @@ export function BuseWaterQulity({ : "" } readOnly={formType === "sttn" ? true : false} - maxLength={txtSize} + maxLength={7} /> )} @@ -375,7 +385,7 @@ export function BuseWaterQulity({ : "" } readOnly={formType === "sttn" ? true : false} - maxLength={txtSize} + maxLength={7} /> )} @@ -394,7 +404,7 @@ export function BuseWaterQulity({ } value={frontPHdata ?? ""} readOnly={formType === "sttn"} - maxLength={txtSize} + maxLength={3} /> ~