하수재이용/빗물/중수도/온배수 등록 페이지 전체적인 레이아웃 수정
This commit is contained in:
@@ -29,7 +29,7 @@ import {
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function LdrmntCoSttn() {
|
||||
@@ -46,7 +46,6 @@ export default function LdrmntCoSttn() {
|
||||
const [excelData, setExcelData] = useState<any[]>();
|
||||
const [resetPage, isResetPage] = useState(false);
|
||||
const { t } = useTranslation('base');
|
||||
// const [isExcelDownload, setIsExcelDownload] = useState(false);
|
||||
|
||||
const excelClick = useCallback(() => {
|
||||
excelDownload(
|
||||
@@ -81,20 +80,20 @@ export default function LdrmntCoSttn() {
|
||||
const excelDownloadClick = useCallback(() => {
|
||||
const cityNm = computeCityNm();
|
||||
ldrmntSearch(true, 1, String(ldrmntResCount), cityNm, searchTxt || "");
|
||||
// setIsExcelDownload(true);
|
||||
}, [objSearch, searchTxt, code, ldrmntSearch, computeCityNm, ldrmntResCount]);
|
||||
|
||||
useEffect(() => {
|
||||
if (/*isExcelDownload &&*/ excelData && excelData.length > 0) {
|
||||
if (excelData && excelData.length > 0) {
|
||||
downloadExcel({
|
||||
data: excelData,
|
||||
fileName: "잠재수요처 관리",
|
||||
sheetNameArray: ["Sheet1"],
|
||||
headerRange: "A1:F1"
|
||||
});
|
||||
// setIsExcelDownload(false);
|
||||
} else {
|
||||
toast.error(t('excelDownErrMsg'));
|
||||
}
|
||||
}, [excelData, /*isExcelDownload*/]);
|
||||
}, [excelData]);
|
||||
|
||||
const [isExcelOpen, setIsExcelOpen] = useState<{
|
||||
isModal: boolean;
|
||||
|
||||
@@ -10,11 +10,10 @@ import {
|
||||
ScrollArea,
|
||||
SearchDiv,
|
||||
SearchFormLeft,
|
||||
SearchFormRight,
|
||||
SearchInput,
|
||||
Title,
|
||||
UiModal,
|
||||
UiTable,
|
||||
UiTable
|
||||
} from "@common/business_components";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button } from "@common/components";
|
||||
@@ -97,15 +96,13 @@ export default function Home() {
|
||||
<SearchDiv>
|
||||
<SearchFormLeft>
|
||||
<SearchInput
|
||||
className="col-span-3 my-7 !text-3xl"
|
||||
className="col-span-3 !text-3xl"
|
||||
label="시설명"
|
||||
textValue={searchTxt || ""}
|
||||
setText={(e) => {
|
||||
setSearchTxt(e);
|
||||
}}
|
||||
/>
|
||||
</SearchFormLeft>
|
||||
<SearchFormRight>
|
||||
<div className="flex flex-row space-x-2 items-center">
|
||||
<Button
|
||||
size={"sm"}
|
||||
@@ -123,7 +120,9 @@ export default function Home() {
|
||||
신규등록
|
||||
</Button>
|
||||
</div>
|
||||
</SearchFormRight>
|
||||
</SearchFormLeft>
|
||||
{/* <SearchFormRight>
|
||||
</SearchFormRight> */}
|
||||
</SearchDiv>
|
||||
</div>
|
||||
</div>
|
||||
@@ -146,7 +145,7 @@ export default function Home() {
|
||||
</div>
|
||||
<div className="col-span-2 max-h-full">
|
||||
<ListDiv>
|
||||
<ScrollArea className="h-[60vh]">
|
||||
<ScrollArea className="h-[65vh]">
|
||||
<HtdflRegForm
|
||||
htdflForm={htdflForm ?? ({} as customHtdflBdst)}
|
||||
isModal={false}
|
||||
|
||||
@@ -271,7 +271,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
<SearchDiv>
|
||||
<SearchFormLeft>
|
||||
<SearchInput
|
||||
className={"col-span-3 my-7 !text-3xl"}
|
||||
className={"col-span-3 !text-3xl"}
|
||||
label="시설명"
|
||||
textValue={searchTxt || ""}
|
||||
setText={(e) => {
|
||||
@@ -316,10 +316,10 @@ export default function PublicReuseFaciltyInsert() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-8 gap-4 h-full">
|
||||
<div className="grid grid-cols-8 gap-4">
|
||||
<div className="col-span-5 h-full min-h-0">
|
||||
<ListDiv className="min-h-0">
|
||||
<ScrollArea className="h-[60vh]">
|
||||
{/* <ScrollArea className="h-[60vh]"> */}
|
||||
{" "}
|
||||
{/* 높이 조정 */}
|
||||
<UiTable
|
||||
@@ -332,7 +332,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
onPageChange={setPageNation}
|
||||
resetPageNo={resetPage}
|
||||
/>
|
||||
</ScrollArea>
|
||||
{/* </ScrollArea> */}
|
||||
</ListDiv>
|
||||
</div>
|
||||
<ListDiv className="col-span-3 pr-6">
|
||||
|
||||
@@ -86,7 +86,7 @@ export default function Home() {
|
||||
<SearchDiv>
|
||||
<SearchFormLeft>
|
||||
<SearchInput
|
||||
className={"col-span-3 my-7 !text-3xl"}
|
||||
className={"col-span-3 !text-3xl"}
|
||||
label="건물명"
|
||||
textValue={searchTxt || ""}
|
||||
setText={(e) => {
|
||||
@@ -139,7 +139,7 @@ export default function Home() {
|
||||
</div>
|
||||
<div className="col-span-2 max-h-full">
|
||||
<ListDiv className="">
|
||||
<ScrollArea className="h-[60vh]">
|
||||
<ScrollArea className="h-[65vh]">
|
||||
<RainRegForm
|
||||
rainForm={rainForm ?? ({} as customRainBdst)}
|
||||
isModal={false}
|
||||
|
||||
@@ -9,11 +9,10 @@ import {
|
||||
ScrollArea,
|
||||
SearchDiv,
|
||||
SearchFormLeft,
|
||||
SearchFormRight,
|
||||
SearchInput,
|
||||
Title,
|
||||
UiModal,
|
||||
UiTable,
|
||||
UiTable
|
||||
} from "@common/business_components";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button } from "@common/components";
|
||||
@@ -94,19 +93,17 @@ export default function Home() {
|
||||
<SearchDiv>
|
||||
<SearchFormLeft>
|
||||
<SearchInput
|
||||
className="col-span-3 my-7"
|
||||
className="col-span-3"
|
||||
label="건물명"
|
||||
textValue={searchTxt || ""}
|
||||
setText={(e) => {
|
||||
setSearchTxt(e);
|
||||
}}
|
||||
/>
|
||||
</SearchFormLeft>
|
||||
<SearchFormRight>
|
||||
<div className="flex flex-row space-x-2">
|
||||
<div className="flex flex-row space-x-2 items-center">
|
||||
<Button
|
||||
size={"sm"}
|
||||
className="mr-4 "
|
||||
className=""
|
||||
onClick={() => {
|
||||
rswtBdstSearch(searchTxt || "", pageNation, "41");
|
||||
}}
|
||||
@@ -121,7 +118,9 @@ export default function Home() {
|
||||
신규등록
|
||||
</Button>
|
||||
</div>
|
||||
</SearchFormRight>
|
||||
</SearchFormLeft>
|
||||
{/* <SearchFormRight>
|
||||
</SearchFormRight> */}
|
||||
</SearchDiv>
|
||||
</div>
|
||||
</div>
|
||||
@@ -137,12 +136,13 @@ export default function Home() {
|
||||
headName={"건축물 목록"}
|
||||
cellClick={cellClick}
|
||||
onPageChange={setPageNation}
|
||||
index={0}
|
||||
></UiTable>
|
||||
</ListDiv>
|
||||
</div>
|
||||
<div className="col-span-2 max-h-full">
|
||||
<ListDiv>
|
||||
<ScrollArea className="h-[60vh]">
|
||||
<ListDiv className="">
|
||||
<ScrollArea className="h-[65vh]">
|
||||
<RswtrRegForm
|
||||
rswtForm={rswtForm ?? ({} as customRswtBdst)}
|
||||
isModal={false}
|
||||
|
||||
@@ -118,7 +118,7 @@ export const htdflFacStateExport: htdflFacState = {
|
||||
|
||||
const initFetch = async (code: string) => {
|
||||
|
||||
let url = `/drain/facilityList/1/10`
|
||||
let url = `/drain/facilityList/1/11`
|
||||
|
||||
url+=`/${code}`
|
||||
|
||||
@@ -134,7 +134,7 @@ export const htdflFacActionsExport: (set: any) => htdflFacSActions = (
|
||||
try {
|
||||
const htdflRes = await getFetchWithCount(
|
||||
"wr",
|
||||
`/drain/facilityList/${pageNation}/10/${code}`
|
||||
`/drain/facilityList/${pageNation}/11/${code}`
|
||||
);
|
||||
return set((state: htdflFacState) => ({
|
||||
...state,
|
||||
@@ -176,7 +176,7 @@ export const htdflFacActionsExport: (set: any) => htdflFacSActions = (
|
||||
}
|
||||
const htdflRes = await getFetchWithCount(
|
||||
"wr",
|
||||
`/drain/facilityList/1/10/${code}`
|
||||
`/drain/facilityList/1/11/${code}`
|
||||
);
|
||||
set((state: htdflFacState) => ({
|
||||
...state,
|
||||
@@ -219,7 +219,7 @@ export const htdflFacActionsExport: (set: any) => htdflFacSActions = (
|
||||
}
|
||||
},htdflNmSearch :async(code:string | number, fcltNm:string) =>{
|
||||
try {
|
||||
const htdflRes = await getFetchWithCount("wr", `/drain/facilityList/1/10/${code}/${fcltNm}`);
|
||||
const htdflRes = await getFetchWithCount("wr", `/drain/facilityList/1/11/${code}/${fcltNm}`);
|
||||
set((state: htdflFacState) => {
|
||||
return {
|
||||
...state,
|
||||
|
||||
@@ -105,7 +105,7 @@ const checkWrRegList = async () => {
|
||||
const hasuListFetch = async (page: string, sggOrCity: string, searchTxt?:string) => {
|
||||
const checkWrRegListRes = await checkWrRegList();
|
||||
|
||||
let url = `/prcsFclt/ruseInfo/${page ? page : 1}/10/A/${sggOrCity? sggOrCity : "11"}/0/1/SW`;
|
||||
let url = `/prcsFclt/ruseInfo/${page ? page : 1}/11/A/${sggOrCity? sggOrCity : "11"}/0/1/SW`;
|
||||
|
||||
|
||||
const data = checkWrRegListRes.filter((item:string) => item !== "")
|
||||
|
||||
@@ -99,7 +99,7 @@ export const rainFacStateExport: rainFacState = {
|
||||
|
||||
const initFetch = async (code: string | number) => {
|
||||
// const rainRes =await getFetch("wr", `/reuseFc/rainyInfoList/1/10/${code}`);
|
||||
const rainRes =await getFetchWithCount("wr", `/reuseFc/rainyInfoList/1/10/${code}`);
|
||||
const rainRes = await getFetchWithCount("wr", `/reuseFc/rainyInfoList/1/11/${code}`);
|
||||
return rainRes;
|
||||
};
|
||||
export const rainFacActionsExport: (set: any) => rainFacSActions = (
|
||||
@@ -108,7 +108,7 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = (
|
||||
return {
|
||||
getRainData: async (pageNation: number, code: string | number) => {
|
||||
try {
|
||||
const rainRes =await getFetchWithCount("wr", `/reuseFc/rainyInfoList/${pageNation}/10/${code}`);
|
||||
const rainRes = await getFetchWithCount("wr", `/reuseFc/rainyInfoList/${pageNation}/11/${code}`);
|
||||
|
||||
// 여기서 상태 업데이트
|
||||
return set((state: rainFacState) => ({
|
||||
@@ -149,7 +149,7 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = (
|
||||
try {
|
||||
|
||||
// const rainRes = await getFetch('wr' , `/reuseFc/rainyInfoList/${pageNation}/20/41` +(txt? `/${txt}`:''))
|
||||
const rainRes = await getFetchWithCount('wr' , `/reuseFc/rainyInfoList/${pageNation}/20/41` +(txt? `/${txt}`:''))
|
||||
const rainRes = await getFetchWithCount('wr', `/reuseFc/rainyInfoList/${pageNation}/11/41` + (txt ? `/${txt}` : ''))
|
||||
console.log("rainRes", rainRes)
|
||||
set((state: rainFacState) => {
|
||||
return {
|
||||
@@ -160,7 +160,8 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = (
|
||||
isInit: false,
|
||||
},
|
||||
};
|
||||
})}
|
||||
})
|
||||
}
|
||||
catch (erTxt) {
|
||||
console.log("error", erTxt)
|
||||
}
|
||||
@@ -213,10 +214,38 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = (
|
||||
try {
|
||||
const chData = await makeMdfr(data);
|
||||
const res = await putFectch("/reuseFc/rainyInfo", chData);
|
||||
console.log("res", res)
|
||||
console.log("data", data)
|
||||
if (res.status === 200) {
|
||||
toast.success("수정이 완료되었습니다.");
|
||||
if (data.chgBuilding.length > 0) {
|
||||
const chPK = data?.bdstInfoSn;
|
||||
console.log("chPK", chPK)
|
||||
const makeCh = data.chgBuilding.map((item: chgBuilding) =>
|
||||
({
|
||||
...item,
|
||||
bdstInfoSn: chPK,
|
||||
})
|
||||
);
|
||||
console.log("makeCh", makeCh)
|
||||
const chch = await postFectch("/reuseFc/chgBuilding", makeCh);
|
||||
console.log("chch", chch)
|
||||
|
||||
if (chch.status === 200) {
|
||||
toast.success("건축물 수정이 완료되었습니다.");
|
||||
} else {
|
||||
toast.error("건축물 증축/개축/중축 오류입니다.");
|
||||
}
|
||||
} else {
|
||||
toast.success("건축물 수정이 완료되었습니다.");
|
||||
}
|
||||
} else {
|
||||
toast.error("건축물 수정이 완료되었습니다.");
|
||||
}
|
||||
|
||||
// }
|
||||
// toast.success("수정이 완료되었습니다.");
|
||||
|
||||
// }
|
||||
const rainRes = await initFetch(code);
|
||||
set((state: rainFacState) => ({
|
||||
...state,
|
||||
@@ -233,5 +262,6 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = (
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ export const rswtFacStateExport: rswtFacState = {
|
||||
};
|
||||
|
||||
const initFetch = async (code: string | number) => {
|
||||
const rswtRes = await getFetchWithCount("wr", `/reuseFc/waterreuseFc/1/10/${code}`);
|
||||
const rswtRes = await getFetchWithCount("wr", `/reuseFc/waterreuseFc/1/11/${code}`);
|
||||
return rswtRes;
|
||||
};
|
||||
export const rswtFacActionsExport: (set: any) => rswtFacSActions = (
|
||||
@@ -99,7 +99,7 @@ export const rswtFacActionsExport: (set: any) => rswtFacSActions = (
|
||||
try {
|
||||
const rswtRes = await getFetchWithCount(
|
||||
"wr",
|
||||
`/reuseFc/waterreuseFc/${pageNation}/10/${code}` +
|
||||
`/reuseFc/waterreuseFc/${pageNation}/11/${code}` +
|
||||
(txt ? `/${txt}` : "")
|
||||
);
|
||||
set((state: rswtFacState) => {
|
||||
@@ -121,7 +121,7 @@ export const rswtFacActionsExport: (set: any) => rswtFacSActions = (
|
||||
try {
|
||||
const rswtRes = await getFetchWithCount(
|
||||
"wr",
|
||||
`/reuseFc/waterreuseFc/${pageNation}/10/${code}`
|
||||
`/reuseFc/waterreuseFc/${pageNation}/11/${code}`
|
||||
);
|
||||
console.log(pageNation);
|
||||
// 여기서 상태 업데이트
|
||||
@@ -159,7 +159,27 @@ export const rswtFacActionsExport: (set: any) => rswtFacSActions = (
|
||||
const chData = await makeMdfr(data);
|
||||
const res = await putFectch("/reuseFc/waterreuseFc", chData);
|
||||
if (res.status === 200) {
|
||||
if (data.chgBuilding.length > 0) {
|
||||
const chPK = data?.bdstInfoSn;
|
||||
const makeCh = data.chgBuilding.map((item: chgBuilding) =>
|
||||
({
|
||||
...item,
|
||||
bdstInfoSn: chPK,
|
||||
})
|
||||
);
|
||||
const chch = await postFectch("/reuseFc/chgBuilding", makeCh);
|
||||
|
||||
if (chch.status === 200) {
|
||||
toast.success("중수도 건축물 수정이 완료되었습니다.");
|
||||
} else {
|
||||
toast.error("중수도 건축물 증축/개축/중축 오류입니다.");
|
||||
}
|
||||
} else {
|
||||
toast.success("중수도 건축물 수정이 완료되었습니다.");
|
||||
}
|
||||
} else {
|
||||
toast.error("중수도 건축물 수정이 완료되었습니다.");
|
||||
}
|
||||
const rswtRes = await initFetch(code);
|
||||
set((state: rswtFacState) => ({
|
||||
...state,
|
||||
@@ -170,7 +190,7 @@ export const rswtFacActionsExport: (set: any) => rswtFacSActions = (
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
}
|
||||
|
||||
} catch (errorUpdate) {
|
||||
toast.error("중수도 건축물 수정 오류입니다.");
|
||||
console.error(errorUpdate);
|
||||
|
||||
@@ -104,7 +104,7 @@ export default function HtdflRegForm({
|
||||
} else if (readonly === true) {
|
||||
setDivStyle("h-[62vh]")
|
||||
} else {
|
||||
setDivStyle("h-[53vh]")
|
||||
setDivStyle("h-[57vh]")
|
||||
}
|
||||
}, [isModal, readonly]);
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ export default function RainRegForm({
|
||||
} else if (readonly === true) {
|
||||
setDivStyle("h-[62vh]")
|
||||
} else {
|
||||
setDivStyle("h-[53vh]")
|
||||
setDivStyle("h-[57vh]")
|
||||
}
|
||||
}, [isModal, readonly]);
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ export default function RswtrRegForm({
|
||||
} else if (readonly === true) {
|
||||
setDivStyle("h-[62vh]")
|
||||
} else {
|
||||
setDivStyle("h-[53vh]")
|
||||
setDivStyle("h-[57vh]")
|
||||
}
|
||||
}, [isModal, readonly]);
|
||||
// const defaultValues: z.infer<typeof rswtZod> = rswtZod.parse({});
|
||||
|
||||
Reference in New Issue
Block a user