페이지별 이벤트 권한체크, 시설 등록,현황, 수요처 관리 까지 완료
This commit is contained in:
@@ -33,6 +33,7 @@ import toast, { Toaster } from "react-hot-toast";
|
||||
|
||||
export default function CoSttn() {
|
||||
const {
|
||||
auth,
|
||||
code,
|
||||
coSttn,
|
||||
coSttnInit,
|
||||
@@ -43,6 +44,7 @@ export default function CoSttn() {
|
||||
coSttnTxtSearch,
|
||||
demandCompList,
|
||||
} = useWrStore((state) => state);
|
||||
const { regAuthrtYn, mdfcnAuthrtYn } = auth;
|
||||
|
||||
const [bdstTable, setBdstTable] = useState<DemandCompType[]>();
|
||||
const [pageNation, setPageNation] = useState(1);
|
||||
@@ -205,6 +207,7 @@ export default function CoSttn() {
|
||||
setUpdateData(undefined);
|
||||
setIsDmdModal({ ...isDmdModal, isMoal: true });
|
||||
}}
|
||||
disabled={regAuthrtYn === "N"}
|
||||
>
|
||||
등록
|
||||
</Button>
|
||||
@@ -222,6 +225,7 @@ export default function CoSttn() {
|
||||
});
|
||||
}
|
||||
}}
|
||||
disabled={mdfcnAuthrtYn === "N"}
|
||||
>
|
||||
수정
|
||||
</Button>
|
||||
|
||||
@@ -21,7 +21,7 @@ import { useEffect, useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
|
||||
export default function Home() {
|
||||
const { code, htdfl, initHtdflReg, getHtdflBdstData, htdflNmSearch } =
|
||||
const { auth,code, htdfl, initHtdflReg, getHtdflBdstData, htdflNmSearch } =
|
||||
useWrStore((state) => state);
|
||||
const [searchTxt, setSearchTxt] = useState("");
|
||||
const [pageNation, setPageNation] = useState(1);
|
||||
@@ -30,12 +30,9 @@ export default function Home() {
|
||||
const [bdstTable, setbdstTable] = useState<customHtdflBdst[]>();
|
||||
const [issNewReg, setIsNewReg] = useState<boolean>(false);
|
||||
|
||||
// const [bdstChgProps, setBdstChgProps] = useState<{
|
||||
// isOpen: boolean;
|
||||
// chgBuilding: chgBuilding[];
|
||||
// }>({ isOpen: false, chgBuilding: [] });
|
||||
|
||||
const { htdflRes ,htdflResCount} = htdfl;
|
||||
const { regAuthrtYn, mdfcnAuthrtYn } = auth;
|
||||
|
||||
useEffect(() => {
|
||||
if (!htdfl.isInit) {
|
||||
@@ -116,7 +113,10 @@ export default function Home() {
|
||||
>
|
||||
조회
|
||||
</Button>
|
||||
<Button size={"sm"} onClick={() => setIsNewReg(!issNewReg)}>
|
||||
<Button size={"sm"}
|
||||
onClick={() => setIsNewReg(!issNewReg)}
|
||||
disabled={regAuthrtYn === "N"}
|
||||
>
|
||||
신규등록
|
||||
</Button>
|
||||
</div>
|
||||
@@ -149,6 +149,7 @@ export default function Home() {
|
||||
<HtdflRegForm
|
||||
htdflForm={htdflForm ?? ({} as customHtdflBdst)}
|
||||
isModal={false}
|
||||
readonly={mdfcnAuthrtYn === "N"}
|
||||
/>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
|
||||
@@ -38,6 +38,7 @@ import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function PublicReuseFaciltyInsert() {
|
||||
const {
|
||||
auth,
|
||||
code,
|
||||
pbnst,
|
||||
pubHasuInit,
|
||||
@@ -50,7 +51,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
|
||||
const { t } = useTranslation("base");
|
||||
const { pubFacHeadList, pbnstHasuResCount, pbnstHasuRes, pbnstRes } = pbnst;
|
||||
|
||||
const { regAuthrtYn, mdfcnAuthrtYn } = auth;
|
||||
const [, setCurrentTab] = useState<string>("mng");
|
||||
const [isRuseReg, setIsRuseReg] = useState<{
|
||||
isModal: boolean;
|
||||
@@ -264,13 +265,6 @@ export default function PublicReuseFaciltyInsert() {
|
||||
isResetPage(false);
|
||||
}, [pageNation, pubHasuInit]);
|
||||
|
||||
const { auth } = useWrStore((state) => state);
|
||||
const { mngAuthrtYn, inqAuthrtYn, regAuthrtYn, mdfcnAuthrtYn, delAuthrtYn } =auth;
|
||||
useEffect(() => {
|
||||
console.log("auth", mngAuthrtYn, inqAuthrtYn, regAuthrtYn, mdfcnAuthrtYn, delAuthrtYn);
|
||||
}, [mngAuthrtYn, inqAuthrtYn, regAuthrtYn, mdfcnAuthrtYn, delAuthrtYn]);
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<ContentsDiv>
|
||||
@@ -292,13 +286,14 @@ export default function PublicReuseFaciltyInsert() {
|
||||
className=""
|
||||
size={"sm"}
|
||||
onClick={() => {
|
||||
if (searchTxt && searchTxt?.length > 0) {
|
||||
pubHasuSearch(String(pageNation), "41", searchTxt);
|
||||
} else {
|
||||
pubHasuInit(String(pageNation), "41");
|
||||
}
|
||||
isResetPage(true);
|
||||
if (searchTxt && searchTxt?.length > 0) {
|
||||
pubHasuSearch(String(pageNation), "41", searchTxt);
|
||||
} else {
|
||||
pubHasuInit(String(pageNation), "41");
|
||||
}
|
||||
isResetPage(true);
|
||||
}}
|
||||
|
||||
>
|
||||
조회
|
||||
</Button>
|
||||
@@ -316,6 +311,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
appendPbnstRuseFclt();
|
||||
}
|
||||
}}
|
||||
disabled={regAuthrtYn === "N"}
|
||||
>
|
||||
신규등록
|
||||
</Button>
|
||||
@@ -358,6 +354,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
size={"sm"}
|
||||
onClick={form.handleSubmit(onSubmit, onInvalid)}
|
||||
className="mr-5 mt-2"
|
||||
disabled={mdfcnAuthrtYn === "N"}
|
||||
>
|
||||
저장
|
||||
</Button>
|
||||
@@ -371,7 +368,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
setIndexMng(index);
|
||||
}}
|
||||
indexMng={indexMng}
|
||||
readonly={false}
|
||||
readonly={mdfcnAuthrtYn === "N"}
|
||||
/>
|
||||
</TabsContent>
|
||||
<TabsContent className="max-h-full" value="buse">
|
||||
@@ -383,6 +380,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
}}
|
||||
indexMng={indexMng}
|
||||
indexBiz={indexBiz}
|
||||
readonly={mdfcnAuthrtYn === "N"}
|
||||
/>
|
||||
</TabsContent>
|
||||
</ScrollArea>
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
"use client";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import {
|
||||
type customRainBdst,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { type customRainBdst } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { formatCommaNumber, tableData } from "@/components/lib/func/commom";
|
||||
import RainRegForm from "@/components/ui/form/fcltReg/rainReg/rainRegForm";
|
||||
import { BdstReg } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal";
|
||||
@@ -19,14 +17,19 @@ import {
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button } from "@common/components";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
|
||||
export default function Home() {
|
||||
const { rain, code, initRain, rainSearch, getRainData } = useWrStore(
|
||||
const { auth, rain, code, initRain, rainSearch, getRainData } = useWrStore(
|
||||
(state) => {
|
||||
return state;
|
||||
}
|
||||
);
|
||||
|
||||
const { regAuthrtYn, mdfcnAuthrtYn } = auth;
|
||||
|
||||
|
||||
|
||||
const { rainRes, rainResCount } = rain;
|
||||
const [rainForm, setRainForm] = useState<customRainBdst>();
|
||||
const [issNewReg, setIsNewReg] = useState<boolean>(false);
|
||||
@@ -53,7 +56,6 @@ export default function Home() {
|
||||
return {
|
||||
...item,
|
||||
archArea: formatCommaNumber(archArea),
|
||||
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -64,13 +66,10 @@ export default function Home() {
|
||||
}
|
||||
}
|
||||
}, [code, rainRes]);
|
||||
const cellClick: (val: number | undefined) => void = (
|
||||
val
|
||||
) => {
|
||||
const cellClick: (val: number | undefined) => void = (val) => {
|
||||
if (val !== undefined) {
|
||||
setRainForm(rainRes[val]);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
@@ -99,7 +98,7 @@ export default function Home() {
|
||||
size={"sm"}
|
||||
onClick={() => {
|
||||
rainSearch(searchTxt || "", 1, "41");
|
||||
//rainSearch(searchTxt || "", pageNation, "41");
|
||||
//rainSearch(searchTxt || "", pageNation, "41");
|
||||
}}
|
||||
>
|
||||
조회
|
||||
@@ -107,7 +106,10 @@ export default function Home() {
|
||||
<Button
|
||||
size={"sm"}
|
||||
className=""
|
||||
onClick={() => setIsNewReg(!issNewReg)}
|
||||
onClick={() => {
|
||||
setIsNewReg(!issNewReg);
|
||||
}}
|
||||
disabled={regAuthrtYn === "N"}
|
||||
>
|
||||
신규등록
|
||||
</Button>
|
||||
@@ -143,6 +145,7 @@ export default function Home() {
|
||||
<RainRegForm
|
||||
rainForm={rainForm ?? ({} as customRainBdst)}
|
||||
isModal={false}
|
||||
readonly={mdfcnAuthrtYn !== "Y"}
|
||||
></RainRegForm>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
|
||||
@@ -20,9 +20,11 @@ import { useEffect, useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
|
||||
export default function Home() {
|
||||
const { code, rswt, initRswt, rswtBdstSearch, getRswtBdstData } = useWrStore(
|
||||
const { auth,code, rswt, initRswt, rswtBdstSearch, getRswtBdstData } = useWrStore(
|
||||
(state) => state
|
||||
);
|
||||
const { regAuthrtYn, mdfcnAuthrtYn } = auth;
|
||||
|
||||
const [rswtForm, setRswtForm] = useState<customRswtBdst>();
|
||||
const [searchTxt, setSearchTxt] = useState<string>();
|
||||
const [issNewReg, setIsNewReg] = useState<boolean>(false);
|
||||
@@ -114,6 +116,7 @@ export default function Home() {
|
||||
size={"sm"}
|
||||
className="mr-4"
|
||||
onClick={() => setIsNewReg(!issNewReg)}
|
||||
disabled={regAuthrtYn === "N"}
|
||||
>
|
||||
신규등록
|
||||
</Button>
|
||||
@@ -146,6 +149,7 @@ export default function Home() {
|
||||
<RswtrRegForm
|
||||
rswtForm={rswtForm ?? ({} as customRswtBdst)}
|
||||
isModal={false}
|
||||
readonly={mdfcnAuthrtYn === "N"}
|
||||
/>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
|
||||
@@ -44,6 +44,7 @@ export function PbnstBuseForm({
|
||||
indexBiz = 0,
|
||||
setIndexBiz,
|
||||
form,
|
||||
readonly = false,
|
||||
}: {
|
||||
formType: string;
|
||||
firstBizData?: fcBizType[];
|
||||
@@ -51,6 +52,7 @@ export function PbnstBuseForm({
|
||||
indexMng: number;
|
||||
indexBiz: number;
|
||||
setIndexBiz: (index: number) => void;
|
||||
readonly?: boolean;
|
||||
}) {
|
||||
const {
|
||||
code,
|
||||
@@ -329,6 +331,7 @@ export function PbnstBuseForm({
|
||||
onClick={addRuseFcltObj}
|
||||
type="button"
|
||||
size={commonButonSize}
|
||||
disabled={readonly}
|
||||
>
|
||||
추가
|
||||
</Button>
|
||||
@@ -343,6 +346,7 @@ export function PbnstBuseForm({
|
||||
sonClass="col-span-4"
|
||||
indexMng={indexMng}
|
||||
indexBiz={indexBiz}
|
||||
readonly={readonly}
|
||||
/>
|
||||
<MngRegFormDetail
|
||||
key={`buziMoney-${indexMng}-${indexBiz}`}
|
||||
@@ -353,6 +357,7 @@ export function PbnstBuseForm({
|
||||
sonClass="col-span-4"
|
||||
indexMng={indexMng}
|
||||
indexBiz={indexBiz}
|
||||
readonly={readonly}
|
||||
/>
|
||||
|
||||
<MngRegFormDetail
|
||||
@@ -364,6 +369,7 @@ export function PbnstBuseForm({
|
||||
sonClass="col-span-4"
|
||||
indexMng={indexMng}
|
||||
indexBiz={indexBiz}
|
||||
readonly={readonly}
|
||||
/>
|
||||
<MngRegFormDetail
|
||||
key={`concertedWater-${indexMng}-${indexBiz}`}
|
||||
@@ -374,6 +380,7 @@ export function PbnstBuseForm({
|
||||
sonClass="col-span-4"
|
||||
indexMng={indexMng}
|
||||
indexBiz={indexBiz}
|
||||
readonly={readonly}
|
||||
/>
|
||||
<MngRegFormDetail
|
||||
key={`wasteFcltinfo-${indexMng}-${indexBiz}`}
|
||||
@@ -384,6 +391,7 @@ export function PbnstBuseForm({
|
||||
sonClass="col-span-4"
|
||||
indexMng={indexMng}
|
||||
indexBiz={indexBiz}
|
||||
readonly={readonly}
|
||||
/>
|
||||
|
||||
<h1 className={formH1Class}>재이용 원수취수 현황</h1>
|
||||
@@ -394,6 +402,7 @@ export function PbnstBuseForm({
|
||||
onClick={() => setIsFcOrgwts(true)}
|
||||
size={commonButonSize}
|
||||
className=""
|
||||
disabled={readonly}
|
||||
>
|
||||
추가등록
|
||||
</Button>
|
||||
@@ -412,6 +421,7 @@ export function PbnstBuseForm({
|
||||
indexMng={indexMng}
|
||||
formNm={"fcOrgwts"}
|
||||
indexBiz={indexBiz}
|
||||
readonly={readonly}
|
||||
/>
|
||||
</div>
|
||||
<h1 className={formH1Class}>재이용 공급관로 설치 현황</h1>
|
||||
@@ -424,6 +434,7 @@ export function PbnstBuseForm({
|
||||
className="w-32"
|
||||
selectClass="w-full"
|
||||
onSelectValue={(val) => setPpiYn(String(val))}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
<Label className="text-right">합계</Label>
|
||||
<Input
|
||||
@@ -439,6 +450,7 @@ export function PbnstBuseForm({
|
||||
size={commonButonSize}
|
||||
className="!text-xl"
|
||||
onClick={plusHist}
|
||||
disabled={readonly}
|
||||
>
|
||||
추가등록
|
||||
</Button>
|
||||
@@ -447,6 +459,7 @@ export function PbnstBuseForm({
|
||||
size={commonButonSize}
|
||||
className="!text-xl !bg-red-500 !text-white ml-1"
|
||||
onClick={removeSelected}
|
||||
disabled={readonly}
|
||||
>
|
||||
삭제
|
||||
</Button>
|
||||
@@ -471,6 +484,7 @@ export function PbnstBuseForm({
|
||||
form={form}
|
||||
formNm={"pplInstls"}
|
||||
upHeadList={[]}
|
||||
readonly={readonly}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -494,7 +508,7 @@ export function PbnstBuseForm({
|
||||
sonClass="col-span-4"
|
||||
indexMng={indexMng}
|
||||
indexBiz={indexBiz}
|
||||
readonly={false}
|
||||
readonly={readonly}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -510,6 +524,7 @@ export function PbnstBuseForm({
|
||||
}}
|
||||
size={commonButonSize}
|
||||
className="mt-6 mr-3"
|
||||
disabled={readonly}
|
||||
>
|
||||
수요처 추가
|
||||
</Button>
|
||||
@@ -523,6 +538,7 @@ export function PbnstBuseForm({
|
||||
}}
|
||||
size={commonButonSize}
|
||||
className="mt-6"
|
||||
disabled={readonly}
|
||||
>
|
||||
수요처 신규등록
|
||||
</Button>
|
||||
@@ -575,6 +591,7 @@ export function PbnstBuseForm({
|
||||
searchPk: item.dmdInfoId,
|
||||
};
|
||||
})}
|
||||
readonly={readonly}
|
||||
></SearchInputText>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -611,6 +628,7 @@ export function PbnstBuseForm({
|
||||
selectArray={code.dmdUszCd}
|
||||
onSelectValue={f.onChange}
|
||||
value={f.value ?? code.dmdUszCd[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -630,6 +648,7 @@ export function PbnstBuseForm({
|
||||
f.onChange(date),
|
||||
}}
|
||||
selectClass={"rounded-lg !w-full"}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -652,6 +671,7 @@ export function PbnstBuseForm({
|
||||
f.onChange(date),
|
||||
}}
|
||||
selectClass={"rounded-lg !w-full"}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -670,6 +690,7 @@ export function PbnstBuseForm({
|
||||
handleCommaNumberChange(e, f.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(f.value)}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -690,6 +711,7 @@ export function PbnstBuseForm({
|
||||
f.onChange(val)
|
||||
}
|
||||
value={f.value ?? code.yn[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
|
||||
@@ -41,13 +41,13 @@ export function PbnstMngForm({
|
||||
formType,
|
||||
indexMng,
|
||||
setIndexMng,
|
||||
readonly
|
||||
readonly,
|
||||
}: {
|
||||
form: UseFormReturn<{ items: PbnstRegArrrayType }>;
|
||||
formType: string;
|
||||
indexMng: number;
|
||||
setIndexMng: (index: number) => void;
|
||||
readonly:boolean
|
||||
readonly: boolean;
|
||||
}) {
|
||||
const { code, pbnst, fileDelete, fileDownLoad } = useWrStore(
|
||||
(state) => state
|
||||
@@ -60,6 +60,7 @@ export function PbnstMngForm({
|
||||
const [mngMtdCode, setMngMtdCode] =
|
||||
useState<{ name: string; val: SelectDataType[] }[]>();
|
||||
|
||||
|
||||
const {
|
||||
fields: fcOpersField,
|
||||
prepend,
|
||||
@@ -87,7 +88,6 @@ export function PbnstMngForm({
|
||||
endDt: new Date(),
|
||||
});
|
||||
//trigger(`items.${indexMng}.fcOpers`);
|
||||
|
||||
};
|
||||
|
||||
const removeSelected = () => {
|
||||
@@ -318,6 +318,7 @@ export function PbnstMngForm({
|
||||
size={commonButonSize}
|
||||
className="!text-xl"
|
||||
onClick={plusHist}
|
||||
disabled={readonly}
|
||||
>
|
||||
추가등록
|
||||
</Button>
|
||||
@@ -326,6 +327,7 @@ export function PbnstMngForm({
|
||||
size={commonButonSize}
|
||||
className="!text-xl !bg-red-500 !text-white ml-1"
|
||||
onClick={removeSelected}
|
||||
disabled={readonly}
|
||||
>
|
||||
삭제
|
||||
</Button>
|
||||
@@ -335,20 +337,11 @@ export function PbnstMngForm({
|
||||
<div className="h-[200px] overflow-y-auto">
|
||||
<RuseMngTableForm
|
||||
key={`ruse-table-${indexMng}-${fcOpersField.length}`} // 🔥 length까지 넣어야 동기화됨
|
||||
tableData={form.getValues(`items.${indexMng}.fcOpers`) ||[]}
|
||||
headList={
|
||||
formType === "sttn"
|
||||
? pbnst.pbnstMngUpHeadList.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
readonly: true,
|
||||
};
|
||||
})
|
||||
: pbnst.pbnstMngUpHeadList
|
||||
}
|
||||
tableData={form.getValues(`items.${indexMng}.fcOpers`) || []}
|
||||
headList={pbnst.pbnstMngUpHeadList}
|
||||
upHeadList={pbnst.pbnstMngNm}
|
||||
code={mngMtdCode || []}
|
||||
|
||||
readonly={readonly}
|
||||
indexMng={indexMng}
|
||||
form={form}
|
||||
formNm={"fcOpers"}
|
||||
@@ -372,7 +365,6 @@ export function PbnstMngForm({
|
||||
maxLength={numSize} //입력제한
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
if (formType !== "sttn")
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
@@ -396,7 +388,6 @@ export function PbnstMngForm({
|
||||
maxLength={numSize} //입력제한
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
if (formType !== "sttn")
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
@@ -419,7 +410,6 @@ export function PbnstMngForm({
|
||||
maxLength={numSize} //입력제한
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
if (formType !== "sttn")
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
@@ -435,7 +425,7 @@ export function PbnstMngForm({
|
||||
</div>
|
||||
<div className="grid grid-cols-12 gap-4 my-4">
|
||||
<div className="col-span-6">
|
||||
{formType === "sttn" ? (
|
||||
{readonly ? (
|
||||
relationfiles && relationfiles?.length > 0 ? (
|
||||
<>
|
||||
<Label className="text-3xl">계통도</Label>
|
||||
@@ -472,7 +462,7 @@ export function PbnstMngForm({
|
||||
)}
|
||||
</div>
|
||||
<div className="col-span-6">
|
||||
{formType === "sttn" ? (
|
||||
{readonly ? (
|
||||
planFiles && planFiles?.length > 0 ? (
|
||||
<>
|
||||
<Label className="text-3xl">평면도</Label>
|
||||
|
||||
+15
-4
@@ -21,6 +21,7 @@ export default function MngRegFormDetail({
|
||||
sonClass,
|
||||
indexBiz,
|
||||
indexMng,
|
||||
readonly
|
||||
}: {
|
||||
formList: formDetailType[];
|
||||
h1Title?: string;
|
||||
@@ -30,6 +31,7 @@ export default function MngRegFormDetail({
|
||||
indexBiz?: number;
|
||||
indexMng?: number;
|
||||
sonClass?: string;
|
||||
readonly?:boolean
|
||||
}) {
|
||||
const { code } = useWrStore((state) => state);
|
||||
|
||||
@@ -67,7 +69,10 @@ export default function MngRegFormDetail({
|
||||
field.onChange(date),
|
||||
}}
|
||||
selectClass={"w-full"}
|
||||
disabled={formHead.option === "disabled" ? true : false}
|
||||
readOnly={readonly
|
||||
//|| formHead.option === "disabled" ? true : false
|
||||
|
||||
}
|
||||
|
||||
/>
|
||||
) : formHead.type === "number" ? (
|
||||
@@ -81,7 +86,9 @@ export default function MngRegFormDetail({
|
||||
);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
readOnly={formHead.option === "readOnly" ? true : false}
|
||||
readOnly={readonly
|
||||
// || formHead.option === "readOnly" ? true : false
|
||||
}
|
||||
disabled={formHead.option === "disabled" ? true : false}
|
||||
maxLength={numSize}
|
||||
/>
|
||||
@@ -103,7 +110,9 @@ export default function MngRegFormDetail({
|
||||
}
|
||||
onSelectValue={field.onChange}
|
||||
value={field.value?.trim() ?? (Array.isArray(potentialOptions) && potentialOptions[0]?.val)}
|
||||
readOnly={formHead.option === "readOnly"}
|
||||
readOnly={readonly
|
||||
// || formHead.option === "readOnly"
|
||||
}
|
||||
/>
|
||||
);
|
||||
})()
|
||||
@@ -113,7 +122,9 @@ export default function MngRegFormDetail({
|
||||
type="text"
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
readOnly={formHead.option === "readOnly" ? true : false}
|
||||
readOnly={readonly
|
||||
// || formHead.option === "readOnly" ? true : false
|
||||
}
|
||||
disabled={formHead.option === "disabled" ? true : false}
|
||||
maxLength={txtSize}
|
||||
/>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Input } from "@common/components/ui";
|
||||
import React, { useCallback, useEffect, useRef, useState } from "react";
|
||||
|
||||
type SearchType = {
|
||||
@@ -10,6 +11,7 @@ type thisProps = {
|
||||
setValue: (searchNm?: string) => void;
|
||||
setRtnData: (rtnData: any) => void;
|
||||
searchList?: any[];
|
||||
readonly?:boolean
|
||||
};
|
||||
export default function SearchInputText({
|
||||
label = undefined,
|
||||
@@ -17,6 +19,7 @@ export default function SearchInputText({
|
||||
setValue = () => {},
|
||||
setRtnData = () => {},
|
||||
searchList = undefined,
|
||||
readonly = false, // 추가: readonly prop
|
||||
}: thisProps) {
|
||||
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
@@ -65,13 +68,14 @@ export default function SearchInputText({
|
||||
|
||||
return (
|
||||
<div ref={wrapperRef}>
|
||||
<input
|
||||
<Input
|
||||
type="text"
|
||||
value={textValue}
|
||||
onChange={handleInputChange}
|
||||
/* onFocus={() => setIsOpen(true)} */
|
||||
className="w-full h-[3.2rem] !text-xl pl-3 text-gray-600 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
placeholder={`${label}을(를) 입력하세요`}
|
||||
readOnly={readonly} // readonly 상태 적용
|
||||
/>
|
||||
{isOpen && (
|
||||
<div className=" z-1 w-full mt-2 bg-white border border-gray-300 rounded-md shadow-lg h-90 overflow-auto">
|
||||
|
||||
@@ -35,6 +35,7 @@ type RuseMngTableProps = {
|
||||
indexBiz?: number;
|
||||
form?: any;
|
||||
formNm?: string;
|
||||
readonly?: boolean;
|
||||
};
|
||||
|
||||
const RuseMngTableForm = React.forwardRef<any, RuseMngTableProps>(
|
||||
@@ -48,6 +49,7 @@ const RuseMngTableForm = React.forwardRef<any, RuseMngTableProps>(
|
||||
form,
|
||||
formNm,
|
||||
indexBiz,
|
||||
readonly= false
|
||||
},
|
||||
ref
|
||||
) => {
|
||||
@@ -111,7 +113,7 @@ const RuseMngTableForm = React.forwardRef<any, RuseMngTableProps>(
|
||||
? formatCommaNumber(field.value)
|
||||
: field.value || ""
|
||||
}
|
||||
readOnly={head.readonly ? true : false}
|
||||
readOnly={readonly|| head.readonly ? true : false}
|
||||
maxLength={head.maxLength?head.maxLength:15}
|
||||
/>
|
||||
) : head.type === "select" ? (
|
||||
@@ -132,7 +134,7 @@ const RuseMngTableForm = React.forwardRef<any, RuseMngTableProps>(
|
||||
field.onChange(val);
|
||||
}
|
||||
}}
|
||||
readOnly={head.readonly ? true : false}
|
||||
readOnly={ readonly||head.readonly ? true : false}
|
||||
// Disabled prop removed as SelectBox does not support it
|
||||
></SelectBox>
|
||||
) : head.type === "date" ? (
|
||||
@@ -149,14 +151,18 @@ const RuseMngTableForm = React.forwardRef<any, RuseMngTableProps>(
|
||||
},
|
||||
}}
|
||||
selectClass={"w-full"}
|
||||
readOnly={head.readonly ? true : false}
|
||||
readOnly={readonly||head.readonly ? true : false}
|
||||
/>
|
||||
) : head.type === "checkbox" ? (
|
||||
<Checkbox
|
||||
className=""
|
||||
checked={field.value || false}
|
||||
onCheckedChange={(checked) => {
|
||||
field.onChange(checked);
|
||||
if(readonly || head.readonly) {
|
||||
return;
|
||||
}else{
|
||||
field.onChange(checked);
|
||||
}
|
||||
}}
|
||||
></Checkbox>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user