wr: modal toast 변경

This commit is contained in:
2026-04-06 10:15:27 +09:00
parent 5cb0719297
commit 09de176d16
9 changed files with 45 additions and 12 deletions
@@ -1,3 +1,6 @@
/**
* map 시설물 layer > 하수처리시설 modal
*/
import { useWrStore } from "@/app/store";
import { btnClass } from "@/app/store/common/code";
import { pbnMapTableSize } from "@/app/store/map/pbnstMap";
@@ -1,3 +1,6 @@
/**
* map 시설물 layer > 온배수시설 modal
*/
import { useWrStore } from "@/app/store";
import { htdfMapSize } from "@/app/store/map/htdflMap";
import { rainMapSize } from "@/app/store/map/rainMap";
@@ -1,3 +1,6 @@
/**
* map 시설물 layer > 빗물이용시설 modal
*/
import { useWrStore } from "@/app/store";
import { rainMapSize } from "@/app/store/map/rainMap";
import type { customRainBdst } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
@@ -1,3 +1,6 @@
/**
* map 시설물 layer > 중수도시설 modal
*/
import { useWrStore } from "@/app/store";
import { rainMapSize } from "@/app/store/map/rainMap";
import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
@@ -1,3 +1,6 @@
/**
* map 시설물 layer > 하수재이용시설 modal
*/
import { useWrStore } from "@/app/store";
import { btnClass } from "@/app/store/common/code";
import { ruseMapSize } from "@/app/store/map/ruseMap";
@@ -1,3 +1,6 @@
/**
* 재이용실적등록> 하수재이용 실적등록 파일등록 modal
*/
import { excelToPbnPrfData } from "@/app/store/prfmncReg/pbnstPrfmncReg/excel";
import { pbnPrfRegExcelZod } from "@/app/store/prfmncReg/pbnstPrfmncReg/headList";
import type {
@@ -17,8 +20,9 @@ import { Button, Input } from "@common/components/ui";
import { zodResolver } from "@hookform/resolvers/zod";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import toast from "react-hot-toast";
// import toast from "react-hot-toast";
import type { z } from "zod";
import { useAlertStore } from "@/src/shared/lib";
export default function PbnPrfExcelModal({
data,
@@ -29,6 +33,7 @@ export default function PbnPrfExcelModal({
setIsExcelOPen: (open: boolean) => void;
setModalExcelData: (excelData: PrfType) => void;
}) {
const alert = useAlertStore((state) => state.setMessage);
const [file, setFile] = useState<File | null>(null);
const [excelData, setExcelData] = useState<PrfType[]>();
const form = useForm<z.infer<typeof pbnPrfRegExcelZod>>({
@@ -65,7 +70,8 @@ export default function PbnPrfExcelModal({
if (file) {
const isFile = file;
if (form.getValues("ym").length < 1) {
toast.error("파일업로드 이전에 등록년도를 작성해주세요 ");
// toast.error("파일업로드 이전에 등록년도를 작성해주세요 ");
alert("파일업로드 이전에 등록년도를 작성해주세요 ");
setFile(null);
return;
}
@@ -8,9 +8,10 @@ import { Button, Input } from "@common/components/ui";
import { zodResolver } from "@hookform/resolvers/zod";
import { useState } from "react";
import { useForm } from "react-hook-form";
import toast from "react-hot-toast";
// import toast from "react-hot-toast";
import type { z } from "zod";
import { useConfirm } from "@frontend-opensource/use-react-hooks";
import { useAlertStore } from "@/src/shared/lib";
export default function CoRegExcel({
isModal,
@@ -18,6 +19,7 @@ export default function CoRegExcel({
isModal: (open: boolean) => void;
}) {
const { confirm } = useConfirm();
const alert = useAlertStore((state) => state.setMessage);
const { ldrmnt, loadingOpen } = useWrStore((state) => state);
const { isLoading } = ldrmnt;
const form = useForm<z.infer<typeof coRegExcel>>({
@@ -76,11 +78,12 @@ export default function CoRegExcel({
await ldrmntRegData(array);
isModal(false);
loadingOpen(false);
toast.success(`잠재수요처 등록이 요청되었습니다.`);
} catch (e) {
// toast.success(`잠재수요처 등록이 요청되었습니다.`);
alert("잠재수요처 등록이 요청되었습니다.");
} catch (e: any) {
console.log(e);
loadingOpen(false);
alert(e);
// alert(e.message);
return true;
}
})
@@ -90,7 +93,8 @@ export default function CoRegExcel({
});
} else {
loadingOpen(false);
toast.error(`엑셀 파일을 선택해 주세요.`);
// toast.error(`엑셀 파일을 선택해 주세요.`);
alert("엑셀 파일을 선택해 주세요.");
}
};
@@ -18,7 +18,8 @@ import {
} from "@common/business_components";
import { Button, Input, Label } from "@common/components";
import { useEffect, useState } from "react";
import toast from "react-hot-toast";
// import toast from "react-hot-toast";
import { useAlertStore } from "@/src/shared/lib";
export type objSearchType = {
sgg: string | number;
@@ -47,7 +48,7 @@ export function BdstReg<T extends MoType>({
const { code, bdst, auth, findBdst } = useWrStore((state) => {
return state;
});
const alert = useAlertStore((state) => state.setMessage);
const { laeSeCd } = auth;
const [bdstTable, setBdstTable] = useState<BdstTypeMap[T][]>();
@@ -73,7 +74,8 @@ export function BdstReg<T extends MoType>({
findBdst(String(data), searchTxt || "", moType);
}else{
toast.error("시도 또는 시군구를 선택하여 주십시오.");
// toast.error("시도 또는 시군구를 선택하여 주십시오.");
alert("시도 또는 시군구를 선택하여 주십시오.");
}
};
@@ -1,3 +1,6 @@
/**
* 재이용시설등록 > 하수재이용시설등록 - 취수하수처리장 추가 modal
*/
"use client";
import { useWrStore } from "@/app/store";
import type {
@@ -12,7 +15,8 @@ import { Button } from "@common/business_components/ui/table/lib/button";
import { Input } from "@common/components/ui";
import { ArrowLeft, ArrowRight } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import toast from "react-hot-toast";
// import toast from "react-hot-toast";
import { useAlertStore } from "@/src/shared/lib";
export default function FcOrgwtsRegModal({
onRightSet,
@@ -23,6 +27,7 @@ export default function FcOrgwtsRegModal({
closeModal?: (val: boolean) => void;
initTableData?: any[];
}) {
const alert = useAlertStore((state) => state.setMessage);
const { code, pbnst, getSwtrmtFcltNm, searchFclts } = useWrStore(
(state) => state
);
@@ -53,7 +58,8 @@ export default function FcOrgwtsRegModal({
closeModal?.(false)
}
else {
toast.error("취수하수처리장 목록을 선택해주세요.")
// toast.error("취수하수처리장 목록을 선택해주세요.");
alert("취수하수처리장 목록을 선택해주세요.");
}
}