readOnly 수정
This commit is contained in:
@@ -364,6 +364,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
setIndexMng(index);
|
||||
}}
|
||||
indexMng={indexMng}
|
||||
readonly={false}
|
||||
/>
|
||||
</TabsContent>
|
||||
<TabsContent className="max-h-full" value="buse">
|
||||
|
||||
@@ -494,7 +494,7 @@ export function PbnstBuseForm({
|
||||
sonClass="col-span-4"
|
||||
indexMng={indexMng}
|
||||
indexBiz={indexBiz}
|
||||
formType={""}
|
||||
readonly={false}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
+15
-15
@@ -13,7 +13,7 @@ export function BuseWaterQulity({
|
||||
sonClass,
|
||||
indexMng,
|
||||
indexBiz,
|
||||
formType,
|
||||
readonly,
|
||||
}: {
|
||||
form: UseFormReturn<{ items: PbnstRegArrrayType }>;
|
||||
h1Title: string;
|
||||
@@ -22,7 +22,7 @@ export function BuseWaterQulity({
|
||||
sonClass: string;
|
||||
indexMng: number;
|
||||
indexBiz: number;
|
||||
formType?: string;
|
||||
readonly?: boolean;
|
||||
}) {
|
||||
const [frontPHdata, setFrontPHdata] = useState("0");
|
||||
const [backPHdata, setBackPHdata] = useState("0");
|
||||
@@ -131,7 +131,7 @@ export function BuseWaterQulity({
|
||||
? `${field.value}`
|
||||
: ""
|
||||
}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={6}
|
||||
/>
|
||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
||||
@@ -168,7 +168,7 @@ export function BuseWaterQulity({
|
||||
? `${field.value}`
|
||||
: ""
|
||||
}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={6}
|
||||
/>
|
||||
{/* TODO: 총대장균군수 확인 필요*/}
|
||||
@@ -203,7 +203,7 @@ export function BuseWaterQulity({
|
||||
? `${field.value}`
|
||||
: ""
|
||||
}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={6}
|
||||
/>
|
||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
||||
@@ -237,7 +237,7 @@ export function BuseWaterQulity({
|
||||
? `${field.value}`
|
||||
: ""
|
||||
}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={6}
|
||||
/>
|
||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
||||
@@ -267,7 +267,7 @@ export function BuseWaterQulity({
|
||||
field.onChange(String(e.target.value));
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly === "sttn" ? true : false}
|
||||
maxLength={txtSize}
|
||||
/> */}
|
||||
<SelectBox
|
||||
@@ -278,7 +278,7 @@ export function BuseWaterQulity({
|
||||
{ val: "불쾌하지않을것", text: "불쾌하지않을것" },
|
||||
{ val: "없음", text: "없음" },
|
||||
]}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
onSelectValue={(val) => {
|
||||
field.onChange(val);
|
||||
}}
|
||||
@@ -310,7 +310,7 @@ export function BuseWaterQulity({
|
||||
? `${field.value}`
|
||||
: ""
|
||||
}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={6}
|
||||
/>
|
||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
||||
@@ -344,7 +344,7 @@ export function BuseWaterQulity({
|
||||
? `${field.value}`
|
||||
: ""
|
||||
}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={6}
|
||||
/>
|
||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
||||
@@ -379,7 +379,7 @@ export function BuseWaterQulity({
|
||||
? `${field.value}`
|
||||
: ""
|
||||
}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={6}
|
||||
/>
|
||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
||||
@@ -413,7 +413,7 @@ export function BuseWaterQulity({
|
||||
? `${field.value}`
|
||||
: ""
|
||||
}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={7}
|
||||
/>
|
||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
||||
@@ -448,7 +448,7 @@ export function BuseWaterQulity({
|
||||
? `${field.value}`
|
||||
: ""
|
||||
}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={7}
|
||||
/>
|
||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
||||
@@ -472,7 +472,7 @@ export function BuseWaterQulity({
|
||||
isSetFrontPh(e.target.value)
|
||||
}
|
||||
value={frontPHdata ?? ""}
|
||||
readOnly={formType === "sttn"}
|
||||
readOnly={readonly}
|
||||
maxLength={3}
|
||||
/>
|
||||
<span className="text-xl">~</span>
|
||||
@@ -484,7 +484,7 @@ export function BuseWaterQulity({
|
||||
isSetBackPh(e.target.value);
|
||||
}}
|
||||
value={backPHdata ?? ""}
|
||||
readOnly={formType === "sttn"}
|
||||
readOnly={readonly}
|
||||
maxLength={3}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -41,11 +41,13 @@ export function PbnstMngForm({
|
||||
formType,
|
||||
indexMng,
|
||||
setIndexMng,
|
||||
readonly
|
||||
}: {
|
||||
form: UseFormReturn<{ items: PbnstRegArrrayType }>;
|
||||
formType: string;
|
||||
indexMng: number;
|
||||
setIndexMng: (index: number) => void;
|
||||
readonly:boolean
|
||||
}) {
|
||||
const { code, pbnst, fileDelete, fileDownLoad } = useWrStore(
|
||||
(state) => state
|
||||
@@ -293,7 +295,7 @@ export function PbnstMngForm({
|
||||
field.onChange(String(e.target.value));
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={txtSize}
|
||||
/>
|
||||
</FormUi>
|
||||
@@ -374,7 +376,7 @@ export function PbnstMngForm({
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -398,7 +400,7 @@ export function PbnstMngForm({
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -421,7 +423,7 @@ export function PbnstMngForm({
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
|
||||
@@ -99,6 +99,7 @@ export function PbnstRegModal({
|
||||
formType={"reg"}
|
||||
indexMng={indexMng}
|
||||
setIndexMng={setIndexMng}
|
||||
readonly={false}
|
||||
/>
|
||||
</TabsContent>
|
||||
<TabsContent className="max-h-full" value="buse">
|
||||
|
||||
@@ -35,7 +35,7 @@ import { useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
|
||||
export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titleVisible?: boolean }) {
|
||||
const { pbnstSttn, prfmnc , pbnstPrfmncSttn} = useWrStore((state) => state);
|
||||
const { pbnstSttn, prfmnc, pbnstPrfmncSttn } = useWrStore((state) => state);
|
||||
const [fcltTab, setFcltTab] = useState<string>("fclt");
|
||||
const [ruseTab, setRuseTab] = useState<string>("totalPrf");
|
||||
const [ruseHeadList, setRuseHeadList] = useState<TableUpperProps[]>([]);
|
||||
@@ -67,10 +67,10 @@ export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titl
|
||||
cusrAlotm: item.cusrAlotm ?? "-",
|
||||
etc: item.etc ?? "-",
|
||||
totalMoney:
|
||||
Number(item.addr) +
|
||||
Number(item.gvsbs) +
|
||||
Number(item.lcep) +
|
||||
Number(item.cusrAlotm),
|
||||
Number(item.cusrAlotm) +
|
||||
(isNaN(Number(item.etc)) ? 0 : Number(item.etc)),
|
||||
instlAprvSncnDt: item.instlAprvSncnDt?.toISOString ?? "-",
|
||||
bizCmcnDay: item.bizCmcnDay?.toISOString ?? "-",
|
||||
rprcsFcltCpct: item.rprcsFcltCpct ?? "-",
|
||||
@@ -167,8 +167,8 @@ export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titl
|
||||
const getTablePrfData = (prfList: PrfType[]) => {
|
||||
const inUsageData = structuredClone(initValInUsage);
|
||||
const outUsageData = structuredClone(initValOutUsage);
|
||||
const inSubtotal = structuredClone(subTotalObj);
|
||||
const outSubtotal = structuredClone(subTotalObj);
|
||||
const inSubtotal = { ...structuredClone(subTotalObj), 구분: "장내용수" };
|
||||
const outSubtotal = { ...structuredClone(subTotalObj), 구분: "장외용수" };
|
||||
|
||||
if (prfList) {
|
||||
prfList?.forEach((prfItem) => {
|
||||
@@ -216,7 +216,9 @@ export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titl
|
||||
(usageTotalObj as any)[key] = val;
|
||||
}
|
||||
const tableData = [...inUsageData, ...outUsageData, usageTotalObj];
|
||||
|
||||
console.log("inusageData", inUsageData)
|
||||
console.log("outUsageData", outUsageData)
|
||||
console.log("tableData", tableData)
|
||||
setPrfData({
|
||||
inPrf: inUsageData,
|
||||
outPrf: outUsageData,
|
||||
@@ -264,6 +266,7 @@ export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titl
|
||||
formType={"sttn"}
|
||||
indexMng={indexMng}
|
||||
setIndexMng={setIndexMng}
|
||||
readonly={true}
|
||||
/>
|
||||
<div className="px-6">
|
||||
<div className="">
|
||||
@@ -300,8 +303,8 @@ export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titl
|
||||
}}
|
||||
>
|
||||
{fcltTab === "fclt" ? (
|
||||
<HeadMakeColSpan upHeadList={pbnstSttn.ruseFcltNodeList} />
|
||||
) : undefined}
|
||||
<HeadMakeColSpan upHeadList={pbnstSttn.ruseFcltNodeList} />
|
||||
) : undefined}
|
||||
</UiTable>
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
@@ -323,22 +326,22 @@ export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titl
|
||||
<TabsContent className="max-h-full" value={ruseTab}>
|
||||
{prfData && (
|
||||
<ListDiv className="col-span-8 pr-6 ">
|
||||
<ScrollArea className="h-[60vh]">
|
||||
<div className="card-header">
|
||||
<h3 className="text-2xl font-medium text-label">
|
||||
{"하수처리수재이용 실적(m³) 등록결과"}
|
||||
</h3>
|
||||
</div>
|
||||
<Table variant="secondary">
|
||||
<TableHeader className="font-bold">
|
||||
{headMakeprfmnc(pbnstPrfmncSttn.monthSttnHeadList, [])}
|
||||
</TableHeader>
|
||||
<TableBody key={prfmnc.pageKey + 'pageKey'}>
|
||||
{InputTableBody(prfData[ruseTab as keyof typeof prfData] || [], pbnstPrfmncSttn.monthSttnHeadList, setPrfData as any)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
<ScrollArea className="h-[60vh]">
|
||||
<div className="card-header">
|
||||
<h3 className="text-2xl font-medium text-label">
|
||||
{"하수처리수재이용 실적(m³) 등록결과"}
|
||||
</h3>
|
||||
</div>
|
||||
<Table variant="secondary">
|
||||
<TableHeader className="font-bold">
|
||||
{headMakeprfmnc(pbnstPrfmncSttn.monthSttnHeadList, [])}
|
||||
</TableHeader>
|
||||
<TableBody key={prfmnc.pageKey + 'pageKey'}>
|
||||
{InputTableBody(prfData[ruseTab as keyof typeof prfData] || [], pbnstPrfmncSttn.monthSttnHeadList, setPrfData as any)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
)}
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
|
||||
@@ -421,11 +421,11 @@ export default function CoDetailModal({
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder=""
|
||||
type="number"
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
field.onChange(e.target.value);
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
value={formatCommaNumber(field.value) ?? 0}
|
||||
min={0}
|
||||
readOnly={true}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user