Merge commit 'fe71d85bc62a941cf47a043365d555a979fffbfe' into iipbs/wr/regForTest
This commit is contained in:
+18
-3
@@ -3,23 +3,38 @@ import { BaseLayout } from "@common/components";
|
|||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
import { StoreProvider } from "./store";
|
import { StoreProvider } from "./store";
|
||||||
import { MainDiv } from "@common/business_components";
|
import { MainDiv } from "@common/business_components";
|
||||||
|
import koBase from '../public/locales/ko/message.json';
|
||||||
|
import i18next from "i18next";
|
||||||
|
import { I18nextProvider } from "react-i18next";
|
||||||
|
|
||||||
export default function RootLayout({
|
export default function RootLayout({
|
||||||
children,
|
children,
|
||||||
}: Readonly<{
|
}: Readonly<{
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}>) {
|
}>) {
|
||||||
|
i18next.init({
|
||||||
|
lng: 'ko',
|
||||||
|
fallbackLng: 'ko',
|
||||||
|
resources: {
|
||||||
|
ko: {
|
||||||
|
base: koBase,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<body>
|
<body>
|
||||||
|
<I18nextProvider i18n={i18next}>
|
||||||
<StoreProvider>
|
<StoreProvider>
|
||||||
<BaseLayout>
|
<BaseLayout>
|
||||||
<MainDiv>
|
<MainDiv>
|
||||||
{children}
|
{children}
|
||||||
</MainDiv>
|
</MainDiv>
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
</StoreProvider>
|
</StoreProvider>
|
||||||
|
</I18nextProvider>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html >
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
|||||||
const { rainSttn, rainSttnSearch, rainSttnInit } = useWrStore(
|
const { rainSttn, rainSttnSearch, rainSttnInit } = useWrStore(
|
||||||
(state) => state
|
(state) => state
|
||||||
);
|
);
|
||||||
let { rainSttnRes } = rainSttn;
|
let { rainSttnRes, rainSttnResCount } = rainSttn;
|
||||||
const [rainTable, setRainTable] = useState<customRainBdst[]>();
|
const [rainTable, setRainTable] = useState<customRainBdst[]>();
|
||||||
const [rainBdstChgProps, setRainBdstChgProps] = useState<{
|
const [rainBdstChgProps, setRainBdstChgProps] = useState<{
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
@@ -90,7 +90,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
|||||||
const { rswtSttn, rswtSttnSearch, rswtSttnInit } = useWrStore(
|
const { rswtSttn, rswtSttnSearch, rswtSttnInit } = useWrStore(
|
||||||
(state) => state
|
(state) => state
|
||||||
);
|
);
|
||||||
let { rswtSttnRes } = rswtSttn;
|
let { rswtSttnRes, rswtSttnResCount } = rswtSttn;
|
||||||
const [rswtrTable, setRswtrTable] = useState<customRswtBdst[]>();
|
const [rswtrTable, setRswtrTable] = useState<customRswtBdst[]>();
|
||||||
const [rswtrDetailModal, setRswtrDetailModal] = useState<{ isOpen: boolean, data: customRswtBdst | undefined }>({ data: undefined, isOpen: false });
|
const [rswtrDetailModal, setRswtrDetailModal] = useState<{ isOpen: boolean, data: customRswtBdst | undefined }>({ data: undefined, isOpen: false });
|
||||||
const [rswtrBdstChgProps, setRswtrBdstChgProps] = useState<{
|
const [rswtrBdstChgProps, setRswtrBdstChgProps] = useState<{
|
||||||
@@ -101,24 +101,23 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
|||||||
|
|
||||||
// 온배수시설 변수
|
// 온배수시설 변수
|
||||||
const { htdflSttn, htdflSttnSearch, initHtdfl } = useWrStore((state) => state);
|
const { htdflSttn, htdflSttnSearch, initHtdfl } = useWrStore((state) => state);
|
||||||
let { htdflSttnRes } = htdflSttn;
|
let { htdflSttnRes,htdflSttnResCount } = htdflSttn;
|
||||||
const [htdflTable, setHtdflTable] = useState<customHtdflBdst[]>();
|
const [htdflTable, setHtdflTable] = useState<customHtdflBdst[]>();
|
||||||
const [htdflDetailModal, setHtdflDetailModal] = useState<{ isOpen: boolean, data: customHtdflBdst | undefined }>({ data: undefined, isOpen: false });
|
const [htdflDetailModal, setHtdflDetailModal] = useState<{ isOpen: boolean, data: customHtdflBdst | undefined }>({ data: undefined, isOpen: false });
|
||||||
const [bdstChgProps, setBdstChgProps] = useState<{ isOpen: boolean, chBuilding: chgBuilding[] }>({ isOpen: false, chBuilding: [] });
|
|
||||||
const [htdflPage, setHtdflPage] = useState(1)
|
const [htdflPage, setHtdflPage] = useState(1)
|
||||||
const [htdflResetPage, isHtdflResetPage] = useState(false);
|
|
||||||
|
|
||||||
//하수처리시설 변수
|
//하수처리시설 변수
|
||||||
const {
|
const {
|
||||||
pbnst,
|
pbnst,
|
||||||
pubHasuInit,
|
pubHasuInit,
|
||||||
} = useWrStore((state) => state);
|
} = useWrStore((state) => state);
|
||||||
let { pubFacHeadList, pbnstHasuRes, pbnstRes } = pbnst;
|
let { pubFacHeadList, pbnstHasuRes } = pbnst;
|
||||||
const [isRuseReg, setIsRuseReg] = useState<{
|
const [isRuseReg, setIsRuseReg] = useState<{
|
||||||
data: any | undefined;
|
data: any | undefined;
|
||||||
}>({ data: undefined });
|
}>({ data: undefined });
|
||||||
const [hasuTable, setHasuTable] = useState<pubHasuType[]>();
|
const [hasuTable, setHasuTable] = useState<pubHasuType[]>();
|
||||||
const [hasuPage, setHasuPage] = useState<number>(1);
|
const [hasuPage, setHasuPage] = useState<number>(1);
|
||||||
|
const [hasuRes,setHasuRes] = useState<number>()
|
||||||
if (!featureData) return;
|
if (!featureData) return;
|
||||||
///////////////////////////////////////////// 피쳐데이터 선택 시 각 시설별 데이터 처리 ///////////////////////////////////////////////
|
///////////////////////////////////////////// 피쳐데이터 선택 시 각 시설별 데이터 처리 ///////////////////////////////////////////////
|
||||||
const getSelectedLayers = () => {
|
const getSelectedLayers = () => {
|
||||||
@@ -488,7 +487,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
|||||||
tableData={hasuTable || []}
|
tableData={hasuTable || []}
|
||||||
headlist={pubFacHeadList}
|
headlist={pubFacHeadList}
|
||||||
pageSize={10}
|
pageSize={10}
|
||||||
total={100000}
|
total={5000}
|
||||||
headName={""}
|
headName={""}
|
||||||
cellClick={hasuCellClick}
|
cellClick={hasuCellClick}
|
||||||
onPageChange={setHasuPage}
|
onPageChange={setHasuPage}
|
||||||
@@ -570,7 +569,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
|||||||
children={<HeadMakeColSpan upHeadList={pbnstSttn.pbnstSttNodeList} />}
|
children={<HeadMakeColSpan upHeadList={pbnstSttn.pbnstSttNodeList} />}
|
||||||
headlist={pbnstSttn.pbnstSttHeadList}
|
headlist={pbnstSttn.pbnstSttHeadList}
|
||||||
pageSize={20}
|
pageSize={20}
|
||||||
total={100000}
|
total={pbnstSttnResCount || 0}
|
||||||
cellClick={(index: number | undefined, headId: string) => {
|
cellClick={(index: number | undefined, headId: string) => {
|
||||||
pbnstCellClick(index);
|
pbnstCellClick(index);
|
||||||
}}
|
}}
|
||||||
@@ -605,7 +604,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
|||||||
children={<HeadMakeColSpan upHeadList={rainSttn.rainSttNodeList} />}
|
children={<HeadMakeColSpan upHeadList={rainSttn.rainSttNodeList} />}
|
||||||
headlist={rainSttn.rainSttHeadList}
|
headlist={rainSttn.rainSttHeadList}
|
||||||
pageSize={20}
|
pageSize={20}
|
||||||
total={100000}
|
total={rainSttnResCount}
|
||||||
cellClick={(index: number | undefined, headId: string) => {
|
cellClick={(index: number | undefined, headId: string) => {
|
||||||
rainCellClick(index ?? undefined, headId);
|
rainCellClick(index ?? undefined, headId);
|
||||||
}}
|
}}
|
||||||
@@ -640,7 +639,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
|||||||
children={<HeadMakeColSpan upHeadList={rswtSttn.rswtSttNodeList} />}
|
children={<HeadMakeColSpan upHeadList={rswtSttn.rswtSttNodeList} />}
|
||||||
headlist={rswtSttn.rswtSttHeadList}
|
headlist={rswtSttn.rswtSttHeadList}
|
||||||
pageSize={20}
|
pageSize={20}
|
||||||
total={100000}
|
total={rswtSttnResCount}
|
||||||
cellClick={(index: number | undefined, headId: string) => {
|
cellClick={(index: number | undefined, headId: string) => {
|
||||||
rswtCellClick(index, headId);
|
rswtCellClick(index, headId);
|
||||||
}}
|
}}
|
||||||
@@ -675,7 +674,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
|||||||
children={<HeadMakeColSpan upHeadList={htdflSttn.htdflSttNodeList} />}
|
children={<HeadMakeColSpan upHeadList={htdflSttn.htdflSttNodeList} />}
|
||||||
headlist={htdflSttn.htdflSttHeadList}
|
headlist={htdflSttn.htdflSttHeadList}
|
||||||
pageSize={20}
|
pageSize={20}
|
||||||
total={100000}
|
total={htdflSttnResCount || 0}
|
||||||
cellClick={(index: number | undefined, headId: string) => {
|
cellClick={(index: number | undefined, headId: string) => {
|
||||||
htdflCellClick(index ?? undefined, headId);
|
htdflCellClick(index ?? undefined, headId);
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export default function Home() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (code.sggCd.length > 0) {
|
if (code.sggCd.length > 0) {
|
||||||
|
|
||||||
if( rswtRes?.length > 0){
|
if (rswtRes?.length > 0) {
|
||||||
const rswtData = tableData(rswtRes, { code })?.map(
|
const rswtData = tableData(rswtRes, { code })?.map(
|
||||||
(item: customRswtBdst) => {
|
(item: customRswtBdst) => {
|
||||||
let archArea =
|
let archArea =
|
||||||
@@ -62,12 +62,20 @@ export default function Home() {
|
|||||||
);
|
);
|
||||||
setbdstTable(rswtData);
|
setbdstTable(rswtData);
|
||||||
setRswtForm(rswtRes[selectVal ?? 0]);
|
setRswtForm(rswtRes[selectVal ?? 0]);
|
||||||
}else{
|
} else {
|
||||||
setbdstTable([]);
|
setbdstTable([]);
|
||||||
setRswtForm({} as customRswtBdst);
|
setRswtForm({} as customRswtBdst);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [code, rswtRes, selectVal]);
|
// }, [code, rswtRes, selectVal]);
|
||||||
|
|
||||||
|
}, [code, rswtRes]);
|
||||||
|
useEffect(() => {
|
||||||
|
if (rswtRes && rswtRes.length > 0) {
|
||||||
|
setRswtForm(rswtRes[selectVal ?? 0]);
|
||||||
|
}
|
||||||
|
}, [rswtRes, selectVal]);
|
||||||
|
|
||||||
const cellClick: (val: number | undefined, headId: string) => void = (
|
const cellClick: (val: number | undefined, headId: string) => void = (
|
||||||
val,
|
val,
|
||||||
headId
|
headId
|
||||||
@@ -75,7 +83,7 @@ export default function Home() {
|
|||||||
if ((bdstTable ?? []).length > 0 && val !== undefined) {
|
if ((bdstTable ?? []).length > 0 && val !== undefined) {
|
||||||
{
|
{
|
||||||
setSelect(val);
|
setSelect(val);
|
||||||
setRswtForm(rswtRes[val]);
|
// setRswtForm(rswtRes[val]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export default function RainStat() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
searchRainStatList(searchYear);
|
searchRainStatList(searchYear);
|
||||||
}, [code.cityCd, code.sggCd, searchRainStatList, searchYear])
|
}, [code.cityCd, code.sggCd, searchRainStatList])
|
||||||
|
|
||||||
const excelDetailDownLoad=() =>{
|
const excelDetailDownLoad=() =>{
|
||||||
const sidoList = new Set<string>();
|
const sidoList = new Set<string>();
|
||||||
@@ -237,7 +237,7 @@ export default function RainStat() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-row space-x-2 items-center">
|
<div className="flex flex-row space-x-2 items-center">
|
||||||
<Button className="" size={"sm"} onClick={() => { }}>
|
<Button className="" size={"sm"} onClick={()=>{searchRainStatList(searchYear);}}>
|
||||||
조회
|
조회
|
||||||
</Button>
|
</Button>
|
||||||
<Button className="" size={"sm"} onClick={() => excelClick()}>
|
<Button className="" size={"sm"} onClick={() => excelClick()}>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export default function RswtStat() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
searchRswtStatList(searchYear)
|
searchRswtStatList(searchYear)
|
||||||
}, [searchRswtStatList, searchYear])
|
}, [searchRswtStatList])
|
||||||
|
|
||||||
const excelClick = () => {
|
const excelClick = () => {
|
||||||
downloadExcel({
|
downloadExcel({
|
||||||
|
|||||||
@@ -0,0 +1,143 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useWrStore } from "@/app/store";
|
||||||
|
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||||
|
import { formH1Class } from "@/components/lib/class/comClass";
|
||||||
|
import { safeDate } from "@/components/lib/func/commom";
|
||||||
|
import { DatePicker, FormField, FormUi, SelectBox } from "@common/business_components";
|
||||||
|
import { Button, Checkbox, Input } from "@common/components";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import { useFieldArray } from "react-hook-form";
|
||||||
|
|
||||||
|
export default function BdstAdd({ form, readonly }: { form: any; readonly?: boolean; }) {
|
||||||
|
|
||||||
|
const { code } = useWrStore((state) => {
|
||||||
|
return state;
|
||||||
|
});
|
||||||
|
|
||||||
|
const { fields, append, remove } = useFieldArray({
|
||||||
|
name: "chgBuilding",
|
||||||
|
control: form?.control, // Provide a fallback to avoid errors
|
||||||
|
});
|
||||||
|
|
||||||
|
const plusHist = () => {
|
||||||
|
append({
|
||||||
|
bdstNm: "",
|
||||||
|
daddr: "",
|
||||||
|
bdstUsgCd: "",
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const [selectedIds, setSelectedIds] = useState<string[]>([]);
|
||||||
|
|
||||||
|
const toggleSelect = (id: string) => {
|
||||||
|
setSelectedIds((prev) =>
|
||||||
|
prev.includes(id) ? prev.filter((x) => x !== id) : [...prev, id]
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const removeSelected = () => {
|
||||||
|
const idxsToRemove = fields
|
||||||
|
.map((item, idx) => (selectedIds.includes(item.id) ? idx : -1))
|
||||||
|
.filter((index) => index > -1)
|
||||||
|
.sort((prevIndex, nextIndex) => nextIndex - prevIndex);
|
||||||
|
|
||||||
|
remove(idxsToRemove);
|
||||||
|
setSelectedIds([]);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<h1 className={formH1Class}>중축, 개축, 재축</h1>
|
||||||
|
{!readonly && (
|
||||||
|
<div className="flex justify-end gap-2 mt-4">
|
||||||
|
|
||||||
|
<Button type="button" className="" size={"sm"} onClick={plusHist}>
|
||||||
|
이력추가
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
className="!bg-red-500 text-white"
|
||||||
|
size={"sm"}
|
||||||
|
onClick={removeSelected}
|
||||||
|
>
|
||||||
|
삭제
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{fields.map((field, index) => (
|
||||||
|
<div
|
||||||
|
key={field.id}
|
||||||
|
// className="grid grid-cols-[auto,1fr,1fr,1fr] gap-2 mt-4 items-center"
|
||||||
|
className={`grid ${
|
||||||
|
readonly ? "grid-cols-3" : "grid-cols-[auto,1fr,1fr,1fr]"
|
||||||
|
} gap-2 mt-4 items-center`}
|
||||||
|
>
|
||||||
|
{!readonly && (
|
||||||
|
<div className="col-span-1 flex justify-center mr-4">
|
||||||
|
<Checkbox
|
||||||
|
checked={selectedIds.includes(field.id)}
|
||||||
|
onCheckedChange={() => toggleSelect(field.id)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<div className="">
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name={`chgBuilding.${index}.bdstChgNm`}
|
||||||
|
render={({ field: f }) => (
|
||||||
|
<FormUi label="구분">
|
||||||
|
<SelectBox
|
||||||
|
selectClass={selectClass}
|
||||||
|
selectArray={code.chBuCd}
|
||||||
|
onSelectValue={(val) => f.onChange(val)}
|
||||||
|
value={f.value ?? code.chBuCd[0]?.val}
|
||||||
|
className={""}
|
||||||
|
label={""}
|
||||||
|
/>
|
||||||
|
</FormUi>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="">
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name={`chgBuilding.${index}.archChgPrmsnDt`}
|
||||||
|
render={({ field: f }) => (
|
||||||
|
<FormUi label="허가일">
|
||||||
|
<DatePicker
|
||||||
|
mode="single"
|
||||||
|
field={{
|
||||||
|
value: safeDate(f.value) || new Date(),
|
||||||
|
onChange: (date) => f.onChange(date),
|
||||||
|
}}
|
||||||
|
selectClass="w-full"
|
||||||
|
/>
|
||||||
|
</FormUi>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="">
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name={`chgBuilding.${index}.archChgArea`}
|
||||||
|
render={({ field: f }) => (
|
||||||
|
<FormUi label="면적">
|
||||||
|
<Input
|
||||||
|
placeholder="-"
|
||||||
|
type="text"
|
||||||
|
onChange={(e) => f.onChange(e.target.value)}
|
||||||
|
value={f.value || ''}
|
||||||
|
className={selectClass}
|
||||||
|
/>
|
||||||
|
</FormUi>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
<div className="border-b border-gray-300 my-4"> </div>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -28,28 +28,6 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
|
|||||||
const [useCityCd, setUserCityCd] = useState<SelectDataType[]>([])
|
const [useCityCd, setUserCityCd] = useState<SelectDataType[]>([])
|
||||||
const [useSggCd, setUserSggCd] = useState<SelectDataType[]>([])
|
const [useSggCd, setUserSggCd] = useState<SelectDataType[]>([])
|
||||||
|
|
||||||
const { fields, append, remove } = useFieldArray({
|
|
||||||
name: "chgBuilding",
|
|
||||||
control: form?.control, // Provide a fallback to avoid errors
|
|
||||||
});
|
|
||||||
|
|
||||||
const plusHist = () => {
|
|
||||||
append({
|
|
||||||
bdstNm: "",
|
|
||||||
daddr: "",
|
|
||||||
bdstUsgCd: "",
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const removeSelected = () => {
|
|
||||||
const idxsToRemove = fields
|
|
||||||
.map((item, idx) => (selectedIds.includes(item.id) ? idx : -1))
|
|
||||||
.filter((index) => index > -1)
|
|
||||||
.sort((prevIndex, nextIndex) => nextIndex - prevIndex);
|
|
||||||
|
|
||||||
remove(idxsToRemove);
|
|
||||||
setSelectedIds([]);
|
|
||||||
};
|
|
||||||
|
|
||||||
const [selectSgg, setSelectSgg] = useState<SelectDataType[] | undefined>();
|
const [selectSgg, setSelectSgg] = useState<SelectDataType[] | undefined>();
|
||||||
const [objSearch, setObjSearch] = useState<objSearchType>({
|
const [objSearch, setObjSearch] = useState<objSearchType>({
|
||||||
sgg: "",
|
sgg: "",
|
||||||
@@ -80,9 +58,6 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
|
|||||||
}
|
}
|
||||||
},[form, userSiSggCd, code.cityCd, code.sggCd])
|
},[form, userSiSggCd, code.cityCd, code.sggCd])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const getSelCity = (val: string) => {
|
const getSelCity = (val: string) => {
|
||||||
const data = getCity(val, code.sggCd);
|
const data = getCity(val, code.sggCd);
|
||||||
setSelectSgg(data);
|
setSelectSgg(data);
|
||||||
@@ -110,13 +85,7 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
|
|||||||
return () => subscription?.unsubscribe();
|
return () => subscription?.unsubscribe();
|
||||||
}, [form.form]);
|
}, [form.form]);
|
||||||
|
|
||||||
const [selectedIds, setSelectedIds] = useState<string[]>([]);
|
|
||||||
|
|
||||||
const toggleSelect = (id: string) => {
|
|
||||||
setSelectedIds((prev) =>
|
|
||||||
prev.includes(id) ? prev.filter((x) => x !== id) : [...prev, id]
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() =>{
|
useEffect(() =>{
|
||||||
|
|
||||||
@@ -296,88 +265,7 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h1 className={formH1Class}>중축, 개축, 재축</h1>
|
</>
|
||||||
<div className="flex justify-end gap-2 mt-4">
|
|
||||||
<Button type="button" className="" size={"sm"} onClick={plusHist}>
|
|
||||||
이력추가
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
type="button"
|
|
||||||
className="!bg-red-500 text-white"
|
|
||||||
size={"sm"}
|
|
||||||
onClick={removeSelected}
|
|
||||||
>
|
|
||||||
삭제
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
{fields.map((field, index) => (
|
|
||||||
<div
|
|
||||||
key={field.id}
|
|
||||||
className="grid grid-cols-[auto,1fr,1fr,1fr] gap-2 mt-4 items-center"
|
|
||||||
>
|
|
||||||
<div className="col-span-1 flex justify-center mr-4">
|
|
||||||
<Checkbox
|
|
||||||
checked={selectedIds.includes(field.id)}
|
|
||||||
onCheckedChange={() => toggleSelect(field.id)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="">
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name={`chgBuilding.${index}.bdstChgNm`}
|
|
||||||
render={({ field: f }) => (
|
|
||||||
<FormUi label="구분">
|
|
||||||
<SelectBox
|
|
||||||
selectClass={selectClass}
|
|
||||||
selectArray={code.chBuCd}
|
|
||||||
onSelectValue={(val) => f.onChange(val)}
|
|
||||||
value={f.value ?? code.chBuCd[0]?.val}
|
|
||||||
className={""}
|
|
||||||
label={""}
|
|
||||||
/>
|
|
||||||
</FormUi>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="">
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name={`chgBuilding.${index}.archChgPrmsnDt`}
|
|
||||||
render={({ field: f }) => (
|
|
||||||
<FormUi label="허가일">
|
|
||||||
<DatePicker
|
|
||||||
mode="single"
|
|
||||||
field={{
|
|
||||||
value: safeDate(f.value) || new Date(),
|
|
||||||
onChange: (date) => f.onChange(date),
|
|
||||||
}}
|
|
||||||
selectClass="w-full"
|
|
||||||
/>
|
|
||||||
</FormUi>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="">
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name={`chgBuilding.${index}.archChgArea`}
|
|
||||||
render={({ field: f }) => (
|
|
||||||
<FormUi label="면적">
|
|
||||||
<Input
|
|
||||||
placeholder="-"
|
|
||||||
type="text"
|
|
||||||
onChange={(e) => f.onChange}
|
|
||||||
value={f.value||''}
|
|
||||||
className={selectClass}
|
|
||||||
/>
|
|
||||||
</FormUi>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
<div className="border-b border-gray-300 my-4"> </div>
|
|
||||||
</>
|
|
||||||
) : (
|
) : (
|
||||||
<></>
|
<></>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import { useForm } from "react-hook-form";
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import BdstReg from "../bdstReg/bdstReg";
|
import BdstReg from "../bdstReg/bdstReg";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
|
import BdstAdd from "../bdstReg/bdstAdd";
|
||||||
|
|
||||||
export default function RainRegForm({
|
export default function RainRegForm({
|
||||||
rainForm,
|
rainForm,
|
||||||
@@ -92,9 +93,6 @@ export default function RainRegForm({
|
|||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
useEffect(()=>{
|
|
||||||
console.log("이즈모달", isModal)
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (grntchBdstCertYn === "N") {
|
if (grntchBdstCertYn === "N") {
|
||||||
@@ -601,6 +599,7 @@ export default function RainRegForm({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<BdstAdd form={form} readonly={readonly}></BdstAdd>
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
</form>
|
</form>
|
||||||
</Form>
|
</Form>
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ import {
|
|||||||
import { formH1Class, formH2Class } from "@/components/lib/class/comClass";
|
import { formH1Class, formH2Class } from "@/components/lib/class/comClass";
|
||||||
import {
|
import {
|
||||||
formatCommaNumber,
|
formatCommaNumber,
|
||||||
handleCommaNumberChange,
|
handleMinusNumberChange
|
||||||
handleMinusNumberChange,
|
|
||||||
} from "@/components/lib/func/commom";
|
} from "@/components/lib/func/commom";
|
||||||
import {
|
import {
|
||||||
DatePicker,
|
DatePicker,
|
||||||
@@ -22,8 +21,9 @@ import {
|
|||||||
import { Button, Input, ScrollArea } from "@common/components/ui";
|
import { Button, Input, ScrollArea } from "@common/components/ui";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm, type UseFormReturn } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
import BdstAdd from "../bdstReg/bdstAdd";
|
||||||
import BdstReg from "../bdstReg/bdstReg";
|
import BdstReg from "../bdstReg/bdstReg";
|
||||||
|
|
||||||
export default function RswtrRegForm({
|
export default function RswtrRegForm({
|
||||||
@@ -459,9 +459,6 @@ export default function RswtrRegForm({
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
disabled={grntchBdstCertYn == "N" || grntchBdstCertYn == "D"}
|
disabled={grntchBdstCertYn == "N" || grntchBdstCertYn == "D"}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/>
|
/>
|
||||||
</FormUi>
|
</FormUi>
|
||||||
)
|
)
|
||||||
@@ -488,6 +485,7 @@ export default function RswtrRegForm({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<BdstAdd form={form} readonly={readonly}></BdstAdd>
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
</form>
|
</form>
|
||||||
</Form>
|
</Form>
|
||||||
|
|||||||
@@ -16,11 +16,13 @@
|
|||||||
"@tanstack/react-table": "^8.21.2",
|
"@tanstack/react-table": "^8.21.2",
|
||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
|
"i18next": "^25.3.2",
|
||||||
"lucide-react": "^0.474.0",
|
"lucide-react": "^0.474.0",
|
||||||
"moment": "^2.30.1",
|
"moment": "^2.30.1",
|
||||||
"next": "15.1.7",
|
"next": "15.1.7",
|
||||||
"react-hook-form": "^7.54.2",
|
"react-hook-form": "^7.54.2",
|
||||||
"react-hot-toast": "^2.5.2",
|
"react-hot-toast": "^2.5.2",
|
||||||
|
"react-i18next": "^15.6.0",
|
||||||
"tailwind-merge": "^3.0.1",
|
"tailwind-merge": "^3.0.1",
|
||||||
"tailwindcss-animate": "^1.0.7",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
"tus-js-client": "^4.3.1",
|
"tus-js-client": "^4.3.1",
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"deleteMsg" : "{{name}}가 삭제되었습니다.",
|
||||||
|
"insertMsg": "{{name}}가 저장되었습니다.",
|
||||||
|
"updateMsg": "{{name}}가 수정되었습니다.",
|
||||||
|
"errorMsg": "{{name}} 중 오류가 발생했습니다.",
|
||||||
|
"fileErrMsg": "빈 파일 또는 파일 오류입니다.",
|
||||||
|
"selectErrMsg": "{{name}}을(를) 선택해주세요.",
|
||||||
|
"noChangedErrMsg": "변경사항이 없습니다.",
|
||||||
|
"dateErrMsg": "시작년도를 종료년도 이후로 설정할 수 없습니다.",
|
||||||
|
"fileDateErrMsg": "파일업로드 이전에 등록년도를 작성해주세요.",
|
||||||
|
|
||||||
|
"alreadyInsertedErrMsg": "사업자번호 {{num}}(은)는 이미 등록되었습니다. 다시 등록해주세요.",
|
||||||
|
"saveRowErrMsg": "수정을 원하는 행을 선택하고 저장버튼을 눌러주세요.",
|
||||||
|
"costCalcErrMsg":"공사비 계산 진행 후 저장을 눌러주세요",
|
||||||
|
"maxYearErrMsg": "최대 {{year}}년까지 선택가능합니다.",
|
||||||
|
"checkQtyMsg": "요구수량(M3/d)을 확인해주세요 계산할수 없습니다."
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Generated
+10261
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user