건축물 변경이력 삭제

This commit is contained in:
leedj312
2025-07-14 16:38:16 +09:00
parent 2085b78231
commit b806134cb4
2 changed files with 9 additions and 64 deletions
@@ -1,12 +1,10 @@
"use client";
import { useWrStore } from "@/app/store";
import {
type chgBuilding,
type customRainBdst,
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import { tableData } from "@/components/lib/func/commom";
import RainRegForm from "@/components/ui/form/fcltReg/rainReg/rainRegForm";
import BdstChgModal from "@/components/ui/modal/fcltReg/bdstChgModal/bdstChgModal";
import { BdstReg } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal";
import {
ContentsDiv,
@@ -35,10 +33,6 @@ export default function Home() {
const [pageNation, setPageNation] = useState(1);
const [bdstTable, setbdstTable] = useState<customRainBdst[]>();
const [searchTxt, setSearchTxt] = useState<string>();
const [bdstChgProps, setBdstChgProps] = useState<{
isOpen: boolean;
chgBuilding: chgBuilding[];
}>({ isOpen: false, chgBuilding: [] });
useEffect(() => {
setIsNewReg(false);
@@ -60,7 +54,6 @@ export default function Home() {
...item,
archArea: archArea,
bdstChgYn: item.chgBuilding.length > 0 ? "Y" : "N",
};
}
);
@@ -71,27 +64,18 @@ export default function Home() {
}
}
}, [code, rainRes]);
const cellClick: (val: number | undefined, headId: string) => void = (
val,
headId
const cellClick: (val: number | undefined) => void = (
val
) => {
if (val !== undefined) {
setRainForm(rainRes[val]);
}
if (headId === "bdstChgYn" && val !== undefined) {
if (
rainRes[val]?.bdstInfoPk != null &&
rainRes[val]?.chgBuilding.length > 0
) {
bdstChgModal(rainRes[val].chgBuilding);
}
}
};
const bdstChgModal = (chgBuilding: chgBuilding[]) => {
setBdstChgProps({ isOpen: true, chgBuilding: chgBuilding });
};
// const bdstChgModal = (chgBuilding: chgBuilding[]) => {
// setBdstChgProps({ isOpen: true, chgBuilding: chgBuilding });
// };
useEffect(() => {
getRainData(pageNation, "41");
@@ -149,8 +133,8 @@ export default function Home() {
pageSize={20}
total={rainResCount}
headName={"건축물 목록"}
cellClick={(val, headId) => {
cellClick(val, headId);
cellClick={(val) => {
cellClick(val);
}}
onPageChange={setPageNation}
></UiTable>
@@ -183,17 +167,6 @@ export default function Home() {
}}
/>
<UiModal
bodyClass={""}
open={bdstChgProps.isOpen}
body={
<BdstChgModal chgBuilding={bdstChgProps.chgBuilding}></BdstChgModal>
}
onOpenChange={(open) => {
setBdstChgProps({ ...bdstChgProps, isOpen: open });
}}
/>
<Toaster position="top-center" />
</ContentsDiv>
</>
@@ -1,10 +1,8 @@
"use client";
import { useWrStore } from "@/app/store";
import type { chgBuilding } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
import { tableData } from "@/components/lib/func/commom";
import RswtrRegForm from "@/components/ui/form/fcltReg/rswtrReg/rswtrRegForm";
import BdstChgModal from "@/components/ui/modal/fcltReg/bdstChgModal/bdstChgModal";
import { BdstReg } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal";
import {
ContentsDiv,
@@ -32,10 +30,6 @@ export default function Home() {
const [pageNation, setPageNation] = useState(1);
const [selectVal, setSelect] = useState<number>();
const [bdstTable, setbdstTable] = useState<customRswtBdst[]>();
const [bdstChgProps, setBdstChgProps] = useState<{
isOpen: boolean;
chgBuilding: chgBuilding[];
}>({ isOpen: false, chgBuilding: [] });
const { rswtRes, rswtResCount } = rswt;
useEffect(() => {
if (!rswt.isInit) {
@@ -77,28 +71,16 @@ export default function Home() {
}, [rswtRes, selectVal]);
const cellClick: (val: number | undefined, headId: string) => void = (
val,
headId
val
) => {
if ((bdstTable ?? []).length > 0 && val !== undefined) {
{
setSelect(val);
// setRswtForm(rswtRes[val]);
}
}
if (headId === "bdstChgYn" && val !== undefined) {
if (
rswtRes[val]?.bdstInfoPk != null &&
rswtRes[val]?.chgBuilding?.length > 0
) {
bdstChgModal(rswtRes[val].chgBuilding);
}
}
};
const bdstChgModal = (chgBuilding: chgBuilding[]) => {
setBdstChgProps({ isOpen: true, chgBuilding: chgBuilding });
};
useEffect(() => {
getRswtBdstData(pageNation, "41");
}, [pageNation]);
@@ -184,16 +166,6 @@ export default function Home() {
setIsNewReg(open);
}}
/>
<UiModal
bodyClass={""}
open={bdstChgProps.isOpen}
body={
<BdstChgModal chgBuilding={bdstChgProps.chgBuilding}></BdstChgModal>
}
onOpenChange={(open) => {
setBdstChgProps({ ...bdstChgProps, isOpen: open });
}}
/>
<Toaster position="top-center" />
</ContentsDiv>