결함 대장 수정중
This commit is contained in:
@@ -109,18 +109,18 @@ export default function CoSttn() {
|
||||
}
|
||||
}, [coSttnRes, code]);
|
||||
|
||||
useEffect(() => {
|
||||
if (coSttn.excelList.length > 0) {
|
||||
if (coSttn.excelList.length === 0) return;
|
||||
excelDownload(
|
||||
coSttn.excelList,
|
||||
"수요처 관리",
|
||||
"sample_coSttn.xlsx",
|
||||
"A1:G1",
|
||||
2
|
||||
);
|
||||
}
|
||||
}, [coSttn.excelList]);
|
||||
// useEffect(() => {
|
||||
// if (coSttn.excelList.length > 0) {
|
||||
// if (coSttn.excelList.length === 0) return;
|
||||
// excelDownload(
|
||||
// coSttn.excelList,
|
||||
// "수요처 관리",
|
||||
// "sample_coSttn.xlsx",
|
||||
// "A1:H1",
|
||||
// 2
|
||||
// );
|
||||
// }
|
||||
// }, [coSttn.excelList]);
|
||||
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ export default function CoSttn() {
|
||||
excelData as [],
|
||||
"수요처 관리",
|
||||
"sample_coSttn.xlsx",
|
||||
"A1:F1",
|
||||
"A1:G1",
|
||||
2
|
||||
);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export default function Home() {
|
||||
chgBuilding: chgBuilding[];
|
||||
}>({ isOpen: false, chgBuilding: [] });
|
||||
|
||||
const { htdflRes } = htdfl;
|
||||
const { htdflRes ,htdflResCount} = htdfl;
|
||||
|
||||
useEffect(() => {
|
||||
if (!htdfl.isInit) {
|
||||
@@ -101,7 +101,7 @@ export default function Home() {
|
||||
<SearchFormLeft>
|
||||
<SearchInput
|
||||
className="col-span-3 my-7 !text-3xl"
|
||||
label="건물명"
|
||||
label="시설명"
|
||||
textValue={searchTxt || ""}
|
||||
setText={(e) => {
|
||||
setSearchTxt(e);
|
||||
@@ -137,9 +137,9 @@ export default function Home() {
|
||||
<UiTable
|
||||
tableData={bdstTable || []}
|
||||
headlist={htdfl.upHeadList}
|
||||
pageSize={100}
|
||||
total={10}
|
||||
headName={"건축물 목록"}
|
||||
pageSize={20}
|
||||
total={htdflResCount}
|
||||
headName={"시설물 목록"}
|
||||
cellClick={(val, headId) => {
|
||||
cellClick(val || undefined, headId);
|
||||
}}
|
||||
|
||||
@@ -29,7 +29,7 @@ export default function Home() {
|
||||
return state;
|
||||
}
|
||||
);
|
||||
const { rainRes,rainResCount } = rain;
|
||||
const { rainRes, rainResCount } = rain;
|
||||
const [rainForm, setRainForm] = useState<customRainBdst>();
|
||||
const [issNewReg, setIsNewReg] = useState<boolean>(false);
|
||||
const [pageNation, setPageNation] = useState(1);
|
||||
@@ -48,26 +48,27 @@ export default function Home() {
|
||||
}, [rain.isInit, initRain]);
|
||||
|
||||
useEffect(() => {
|
||||
if (code.sggCd.length > 0) {
|
||||
if (code.sggCd.length > 0) {
|
||||
if (rainRes && rainRes.length > 0) {
|
||||
const rainData = tableData(rainRes, { code }).map(
|
||||
(item: customRainBdst) => {
|
||||
let archArea =
|
||||
item?.archArea.split(".")[0] !== "-1"
|
||||
? item?.archArea.split(".")[0]
|
||||
: "확인불가";
|
||||
return {
|
||||
...item,
|
||||
archArea: archArea,
|
||||
|
||||
if(rainRes&& rainRes.length>0){
|
||||
bdstChgYn: item.chgBuilding.length > 0 ? "Y" : "N",
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const rainData = tableData(rainRes, { code }).map(
|
||||
(item: customRainBdst) => {
|
||||
let archArea = item?.archArea.split('.')[0]!=='-1'?item?.archArea.split('.')[0]:'확인불가'
|
||||
return {
|
||||
...item,
|
||||
archArea:archArea,
|
||||
|
||||
bdstChgYn: item.chgBuilding.length > 0 ? "Y" : "N",
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
setbdstTable(rainData);
|
||||
}else{
|
||||
setbdstTable([]);
|
||||
}
|
||||
setbdstTable(rainData);
|
||||
} else {
|
||||
setbdstTable([]);
|
||||
}
|
||||
}
|
||||
}, [code, rainRes]);
|
||||
const cellClick: (val: number | undefined, headId: string) => void = (
|
||||
|
||||
@@ -3,6 +3,11 @@ import type { EnvPartSelectDataType, SelectDataType } from "@common/business_com
|
||||
import { bdstFilterYn, bdstGrntchClass, bdstIncenYn, bdstUsgCd, chBuCd, dmdUszCd, erctUswtrPrcsMeth, htdPowerMthdCd, htdUtztnUsgCd, orgwtKndCd, pplLenght, pplQulity, rainFcltCd, rswtPrscCdMthdCd, ruseBizMthdCd, ruseMngMtd, rusePrcsMthdCd, ruseSeCd, yn } from "./basicCode";
|
||||
export const btnClass = "p-4 m-2 text-white rounded-sm text-lg font-medium "
|
||||
|
||||
|
||||
const laeSecd = '41'
|
||||
const ogdpSeCd = '0'
|
||||
|
||||
|
||||
export const buildingType = {
|
||||
RST:"RST",
|
||||
RNB:"RNB",
|
||||
@@ -167,6 +172,8 @@ export type comCodeState = {
|
||||
rswtPrscCdMthdCd:SelectDataType[];
|
||||
htdPowerMthdCd:SelectDataType[]
|
||||
htdUtztnUsgCd:SelectDataType[]
|
||||
userSiSggCd : string;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
@@ -203,6 +210,7 @@ export const comCodeStateExport: comCodeState = {
|
||||
rswtPrscCdMthdCd:rswtPrscCdMthdCd,
|
||||
htdPowerMthdCd:htdPowerMthdCd,
|
||||
htdUtztnUsgCd:htdUtztnUsgCd,
|
||||
userSiSggCd:laeSecd,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import moment from "moment";
|
||||
|
||||
export const excelCoSttnParsing = (data: any[]): string[][] => {
|
||||
const excelExportData: string[][] = [];
|
||||
|
||||
data.forEach((item) => {
|
||||
excelExportData.push([
|
||||
String(item.cityText)??'',
|
||||
|
||||
@@ -177,7 +177,7 @@ export const htdflFacActionsExport: (set: any) => htdflFacSActions = (
|
||||
if (res.status) {
|
||||
toast.success("온배수 건축물 수정이 완료되었습니다.");
|
||||
}
|
||||
const htdflRes = await getFetch(
|
||||
const htdflRes = await getFetchWithCount(
|
||||
"wr",
|
||||
`/drain/facilityList/1/10/${code}`
|
||||
);
|
||||
|
||||
@@ -7,7 +7,7 @@ export const pubFacHeadListExport: TableUpperProps[] = [
|
||||
{ id: "bscFctNm", title: "시설명" },
|
||||
{ id: "addr", title: "위치" },
|
||||
{ id: "efflWqltStndrdNm", title: "지역구분" },
|
||||
{ id: "fctCpc", title: "시설용량" },
|
||||
{ id: "fctCpc", title: "시설용량(m³/일)" },
|
||||
{ id: "ruse", title: "재이용여부" },
|
||||
{ id: "rswtrYn", title: "등록여부" },
|
||||
];
|
||||
|
||||
@@ -28,8 +28,8 @@ const rainyObjSchema = z.object({
|
||||
|
||||
export const rainZod = z.object({
|
||||
bdstInfoPk: z.number().optional(),
|
||||
ctpvCd: z.number().default(0),
|
||||
sggCd: z.number().default(0),
|
||||
ctpvCd: z.number().optional(),
|
||||
sggCd: z.number().optional(),
|
||||
daddr: z.string().default(""),
|
||||
bdstNm: z.string().default(""),
|
||||
frstArchPrmsnDt: z.date().default(() => new Date()),
|
||||
@@ -83,6 +83,7 @@ type rainFacSActions = {
|
||||
rainSearch: (txt:string,pageNation:number,code:string|number) => void;
|
||||
rainBdstReg: (data: customRainBdst, code:string|number) => void;
|
||||
rainBdstUpdate: (data: customRainBdst, code:string|number) => void;
|
||||
|
||||
};
|
||||
|
||||
export type rainFacType = rainFacState & rainFacSActions;
|
||||
|
||||
@@ -11,7 +11,10 @@ export const baseReuseBuildingSchema = z.object({
|
||||
bdstRuseFcltPk: z.number().nullish(),
|
||||
bdstInfoFk: z.number().nullish(),
|
||||
instlCmptnDt: z.coerce.date().default(() => new Date()),
|
||||
instlCst: z.number().nullish(),
|
||||
instlCst: z
|
||||
.number()
|
||||
.max(9_999_999, { message: "최대 9,999,999까지 입력 가능합니다." })
|
||||
.nullish(),
|
||||
operMngCd: z.string().optional().default(""),
|
||||
anlOperCst: z.number().default(0),
|
||||
instlCstSprtYn: z.string().default("Y"),
|
||||
|
||||
@@ -30,8 +30,8 @@ import toast from "react-hot-toast";
|
||||
|
||||
export const rswtZod = z.object({
|
||||
bdstInfoPk: z.number().nullish(),
|
||||
ctpvCd: z.number().default(0),
|
||||
sggCd: z.number().default(0),
|
||||
ctpvCd: z.number(),
|
||||
sggCd: z.number(),
|
||||
daddr: z.string().default(""),
|
||||
bdstNm: z.string().default(""),
|
||||
frstArchPrmsnDt: z.date().default(() => new Date()),
|
||||
@@ -182,7 +182,7 @@ export const rswtFacActionsExport: (set: any) => rswtFacSActions = (
|
||||
const chData = await makeRstr(data);
|
||||
const res = await postFectch("/reuseFc/waterreuseFc", chData);
|
||||
if (res.status===200) {
|
||||
if(data.chgBuilding.length > 0){
|
||||
if(data.chgBuilding ){
|
||||
|
||||
const chPK = res?.data?.bdstInfoPk
|
||||
const makeCh= res.data.chgBuilding.map((item: chgBuilding) =>
|
||||
|
||||
@@ -24,6 +24,10 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
|
||||
return state;
|
||||
});
|
||||
|
||||
const {userSiSggCd } =code
|
||||
const [useCityCd, setUserCityCd] = useState<SelectDataType[]>([])
|
||||
const [useSggCd, setUserSggCd] = useState<SelectDataType[]>([])
|
||||
|
||||
const { fields, append, remove } = useFieldArray({
|
||||
name: "chgBuilding",
|
||||
control: form?.control, // Provide a fallback to avoid errors
|
||||
@@ -52,6 +56,33 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
|
||||
city: "",
|
||||
});
|
||||
|
||||
useEffect(() =>{
|
||||
if(userSiSggCd.length===2 && code.cityCd.length>0){
|
||||
const city = code.cityCd.filter((item) => item.val === userSiSggCd)
|
||||
const sgg = code.sggCd.filter((item) => item.val.slice(0,2) === userSiSggCd )
|
||||
sgg.unshift({text:'전체' , val:'0'})
|
||||
setUserCityCd(city) // Fix: Ensure city is of type SelectDataType[]
|
||||
setUserSggCd(sgg)
|
||||
if (city[0]?.val) {
|
||||
// 여기 중요
|
||||
queueMicrotask(() => {
|
||||
form.setValue("ctpvCd", Number(city[0]?.val), { shouldDirty: true, shouldTouch: true, shouldValidate: true });
|
||||
});
|
||||
}
|
||||
}else if(userSiSggCd.length===5 && code.cityCd.length>0 && code.sggCd.length>0) {
|
||||
const city = code.cityCd.filter((item) => item.val === userSiSggCd.slice(0,2))
|
||||
const sgg = code.sggCd.filter((item) => item.val === userSiSggCd)
|
||||
setUserSggCd(sgg)
|
||||
setUserCityCd(city)
|
||||
form.setValue('ctpvCd',Number(city[0]?.val) )
|
||||
form.setValue('sggCd',Number(sgg[0]?.val) )
|
||||
|
||||
}
|
||||
},[form, userSiSggCd, code.cityCd, code.sggCd])
|
||||
|
||||
|
||||
|
||||
|
||||
const getSelCity = (val: string) => {
|
||||
const data = getCity(val, code.sggCd);
|
||||
setSelectSgg(data);
|
||||
@@ -87,6 +118,12 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
|
||||
);
|
||||
};
|
||||
|
||||
useEffect(() =>{
|
||||
|
||||
console.log('form.formState ', form.watch())
|
||||
|
||||
},[form.formState])
|
||||
|
||||
return (
|
||||
<>
|
||||
<h1 className={formH1Class}> { type !== "HTB"?"건축물 기본 정보": '시설 기본 정보'}</h1>
|
||||
@@ -101,12 +138,11 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
|
||||
className="col-span-3"
|
||||
label={""}
|
||||
selectClass={selectClass}
|
||||
selectArray={code.cityCd}
|
||||
selectArray={useCityCd}
|
||||
onSelectValue={(val) => {
|
||||
getSelCity(String(val));
|
||||
field.onChange(Number(val));
|
||||
}}
|
||||
value={field.value}
|
||||
value={typeof field.value !== "undefined" ? field.value : useCityCd[0]?.val}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -122,9 +158,8 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
|
||||
className="col-span-3"
|
||||
label={""}
|
||||
selectClass={`w-full min-h-[2.9rem] ${selectClass}`}
|
||||
selectArray={selectSgg ? selectSgg : code.sggCd || []}
|
||||
selectArray={useSggCd}
|
||||
onSelectValue={(val) => {
|
||||
getSgg(val);
|
||||
field.onChange(Number(val));
|
||||
}}
|
||||
value={field.value}
|
||||
|
||||
@@ -61,7 +61,7 @@ export default function HtdflRegForm({
|
||||
if (setIsModal) setIsModal(false);
|
||||
} else {
|
||||
|
||||
htdflBdstUpdate(values, "41");
|
||||
htdflBdstUpdate(values, "0");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ export default function RainRegForm({
|
||||
const defaultValues: z.infer<typeof rainZod> = rainZod.parse({});
|
||||
const form = useForm<z.infer<typeof rainZod>>({
|
||||
resolver: zodResolver(rainZod),
|
||||
defaultValues: defaultValues,
|
||||
// defaultValues: defaultValues,
|
||||
});
|
||||
const instlCst = form.watch(`reuseBuilding.0.instlCst`);
|
||||
|
||||
|
||||
@@ -41,11 +41,11 @@ export default function RswtrRegForm({
|
||||
(state) => state
|
||||
);
|
||||
|
||||
const defaultValues: z.infer<typeof rswtZod> = rswtZod.parse({});
|
||||
// const defaultValues: z.infer<typeof rswtZod> = rswtZod.parse({});
|
||||
|
||||
const form = useForm<z.infer<typeof rswtZod>>({
|
||||
resolver: zodResolver(rswtZod),
|
||||
defaultValues: defaultValues,
|
||||
// defaultValues: defaultValues,
|
||||
});
|
||||
|
||||
const [grntchBdstCertYn, instlCstSprtYn, filtrTrtmfctProcs] = form.watch([
|
||||
|
||||
@@ -4,7 +4,12 @@ import {
|
||||
selectClass,
|
||||
type customRainBdst,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { ScrollArea, SelectBox, UiTable, type SelectDataType } from "@common/business_components";
|
||||
import {
|
||||
ScrollArea,
|
||||
SelectBox,
|
||||
UiTable,
|
||||
type SelectDataType,
|
||||
} from "@common/business_components";
|
||||
import { Button, Input, Label } from "@common/components";
|
||||
import { useEffect, useState } from "react";
|
||||
import { getCity, tableData } from "@/components/lib/func/commom";
|
||||
@@ -15,83 +20,117 @@ import RswtrRegForm from "@/components/ui/form/fcltReg/rswtrReg/rswtrRegForm";
|
||||
import HtdflRegForm from "@/components/ui/form/fcltReg/htdflReg/htdflRegForm";
|
||||
|
||||
export type objSearchType = {
|
||||
sgg: string|number;
|
||||
city: string|number;
|
||||
};
|
||||
sgg: string | number;
|
||||
city: string | number;
|
||||
};
|
||||
//RNB(빗물), RST(중수도), HTB(온배수)
|
||||
type MoType = 'RNB' | 'RST' | 'HTB'; // 여기에 'htdf' 추가
|
||||
type MoType = "RNB" | "RST" | "HTB"; // 여기에 'htdf' 추가
|
||||
|
||||
type BdstTypeMap = {
|
||||
type BdstTypeMap = {
|
||||
RNB: customRainBdst;
|
||||
RST: customRswtBdst;
|
||||
HTB: customRswtBdst; // 해야해// 아직 아노딤
|
||||
HTB: customRswtBdst; // 해야해// 아직 아노딤
|
||||
};
|
||||
|
||||
interface BdstRegProps<T extends MoType> {
|
||||
interface BdstRegProps<T extends MoType> {
|
||||
moType: T;
|
||||
isModal:boolean;
|
||||
isModal: boolean;
|
||||
siSggCode?: string;
|
||||
setIsModal?: (open: boolean) => void;
|
||||
}
|
||||
|
||||
export function BdstReg<T extends MoType>({ moType,setIsModal,isModal }: BdstRegProps<T>) {
|
||||
const { rain, code, bdst,findBdst } = useWrStore((state) => {
|
||||
export function BdstReg<T extends MoType>({
|
||||
moType,
|
||||
setIsModal,
|
||||
siSggCode,
|
||||
isModal,
|
||||
}: BdstRegProps<T>) {
|
||||
const { rain, code, bdst, findBdst } = useWrStore((state) => {
|
||||
return state;
|
||||
});
|
||||
|
||||
const { userSiSggCd } = code;
|
||||
|
||||
const [bdstTable, setbdstTable] = useState<BdstTypeMap[T][]>();
|
||||
const [rainBdstForm, setRainBdstForm] = useState<BdstTypeMap[T]>({} as BdstTypeMap[T]);
|
||||
const [searchTxt, setSearchTxt] = useState<string>()
|
||||
const [selectSgg, setSelectSgg] = useState<SelectDataType[] | []>()
|
||||
const [objSearch, setObjSearch] = useState<objSearchType>({sgg:"",city:""});
|
||||
const [rainBdstForm, setRainBdstForm] = useState<BdstTypeMap[T]>(
|
||||
{} as BdstTypeMap[T]
|
||||
);
|
||||
const [searchTxt, setSearchTxt] = useState<string>();
|
||||
const [selectSgg, setSelectSgg] = useState<SelectDataType[] | []>();
|
||||
const [objSearch, setObjSearch] = useState<objSearchType>({
|
||||
sgg: "",
|
||||
city: "",
|
||||
});
|
||||
const [useCityCd, setUserCityCd] = useState<SelectDataType[]>([]);
|
||||
const [useSggCd, setUserSggCd] = useState<SelectDataType[]>([]);
|
||||
const [dataCode, setDataCode] = useState<string>();
|
||||
|
||||
const getSelCity = (val: string | number) => {
|
||||
const cityValue = String(val); // Ensure val is treated as a string
|
||||
const data = getCity(cityValue, code.sggCd);
|
||||
const searchBdst = (searchTxt: string | undefined) => {
|
||||
let data = objSearch.city;
|
||||
|
||||
setSelectSgg(data);
|
||||
// getSgg(data[0]?.val || "");
|
||||
setObjSearch({ city: cityValue, sgg: '' });
|
||||
if (objSearch.sgg !== "" && objSearch.sgg !== "0") {
|
||||
data = objSearch.sgg;
|
||||
}
|
||||
//RNB(빗물), RST(중수도), HTB(온배수)
|
||||
findBdst(String(data), searchTxt || "", moType);
|
||||
};
|
||||
|
||||
const getSgg = (val: string | number) => {
|
||||
setObjSearch({...objSearch,sgg: String(val)})
|
||||
};
|
||||
|
||||
const searchBdst=(searchTxt: string | undefined)=>{
|
||||
let data =objSearch.city;
|
||||
if(objSearch.city==="" ){
|
||||
|
||||
data = String(code.cityCd[0]?.val)
|
||||
}
|
||||
if(objSearch.sgg !=="" ){
|
||||
data = objSearch.sgg
|
||||
}
|
||||
|
||||
//RNB(빗물), RST(중수도), HTB(온배수)
|
||||
findBdst(String(data), searchTxt || "",moType )
|
||||
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (code.sggCd.length > 0) {
|
||||
|
||||
setbdstTable( tableData(bdst.bdstBase, { code }));
|
||||
}
|
||||
}, [ bdst]);
|
||||
const bdstData = bdst.bdstBase.map((bdst) => {
|
||||
let archArea =
|
||||
bdst?.archArea.split(".")[0] !== "-1"
|
||||
? bdst?.archArea.split(".")[0]
|
||||
: "확인불가";
|
||||
return {
|
||||
...bdst,
|
||||
archArea: archArea,
|
||||
};
|
||||
});
|
||||
setbdstTable(tableData(bdstData, { code }));
|
||||
}
|
||||
}, [bdst]);
|
||||
|
||||
useEffect(() => {
|
||||
if (userSiSggCd.length === 2 && code.cityCd.length > 0) {
|
||||
const city = code.cityCd.filter((item) => item.val === userSiSggCd);
|
||||
const sgg = code.sggCd.filter(
|
||||
(item) => item.val.slice(0, 2) === userSiSggCd
|
||||
);
|
||||
sgg.unshift({ text: "전체", val: "0" });
|
||||
setUserCityCd(city); // Fix: Ensure city is of type SelectDataType[]
|
||||
setObjSearch({ ...objSearch, city: String(city[0]?.val) });
|
||||
setUserSggCd(sgg);
|
||||
} else if (
|
||||
userSiSggCd.length === 5 &&
|
||||
code.cityCd.length > 0 &&
|
||||
code.sggCd.length > 0
|
||||
) {
|
||||
const city = code.cityCd.filter(
|
||||
(item) => item.val === userSiSggCd.slice(0, 2)
|
||||
);
|
||||
setUserCityCd(city);
|
||||
const sgg = code.sggCd.filter((item) => item.val === userSiSggCd);
|
||||
setUserSggCd(sgg);
|
||||
setObjSearch({ city: String(city[0]?.val), sgg: String(sgg[0]?.val) });
|
||||
}
|
||||
}, [userSiSggCd, code.cityCd, code.sggCd]);
|
||||
|
||||
const tableClick: (val: number | undefined , headId:string) => void = (val ,headId) => {
|
||||
|
||||
if(val!==undefined && bdst?.bdstBase.length>0){
|
||||
const data:BdstTypeMap[T] =bdst?.bdstBase[val]
|
||||
if (data) {
|
||||
setRainBdstForm(data);
|
||||
}
|
||||
const tableClick: (val: number | undefined, headId: string) => void = (
|
||||
val,
|
||||
headId
|
||||
) => {
|
||||
if (val !== undefined && bdst?.bdstBase.length > 0) {
|
||||
const data: BdstTypeMap[T] = bdst?.bdstBase[val];
|
||||
if (data) {
|
||||
setRainBdstForm(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(()=>{
|
||||
setbdstTable([]) // 초기화 작업
|
||||
},[])
|
||||
useEffect(() => {
|
||||
setbdstTable([]); // 초기화 작업
|
||||
}, []);
|
||||
return (
|
||||
<>
|
||||
<div className="grid grid-cols-12 gap-4 mt-4 items-center">
|
||||
@@ -99,31 +138,50 @@ export function BdstReg<T extends MoType>({ moType,setIsModal,isModal }: BdstReg
|
||||
className="col-span-3 h-full"
|
||||
label={"시도"}
|
||||
selectClass={selectClass}
|
||||
selectArray={code.cityCd || []}
|
||||
onSelectValue={getSelCity}
|
||||
>
|
||||
{""}
|
||||
</SelectBox>
|
||||
selectArray={useCityCd}
|
||||
onSelectValue={(val) => {
|
||||
setObjSearch({ ...objSearch, city: String(val) });
|
||||
}}
|
||||
value={objSearch.city || useCityCd[0]?.val}
|
||||
></SelectBox>
|
||||
<SelectBox
|
||||
className="col-span-3 h-full"
|
||||
label={"시군구"}
|
||||
selectClass={selectClass}
|
||||
selectArray={selectSgg || []}
|
||||
onSelectValue={getSgg}
|
||||
value={objSearch.sgg || ""}
|
||||
selectArray={useSggCd || []}
|
||||
onSelectValue={(val) => {
|
||||
if (val) setObjSearch({ ...objSearch, sgg: String(val) });
|
||||
}}
|
||||
value={objSearch.sgg || useSggCd[0]?.val}
|
||||
>
|
||||
{" "}
|
||||
</SelectBox>
|
||||
<Label className="w-full text-xl text-gray-600 text-right">시설명</Label>
|
||||
<Input className="w-full h-full !text-xl col-span-2 col-start-8" type="text" value={searchTxt || ''} onChange={(e) => setSearchTxt(e.target.value)}/>
|
||||
<Button className="" size={"sm"} onClick={()=>{searchBdst(searchTxt)}}>조회</Button>
|
||||
<Label className="w-full text-xl text-gray-600 text-right">
|
||||
시설명
|
||||
</Label>
|
||||
<Input
|
||||
className="w-full h-full !text-xl col-span-2 col-start-8"
|
||||
type="text"
|
||||
value={searchTxt || ""}
|
||||
onChange={(e) => setSearchTxt(e.target.value)}
|
||||
/>
|
||||
<Button
|
||||
className=""
|
||||
size={"sm"}
|
||||
onClick={() => {
|
||||
searchBdst(searchTxt);
|
||||
}}
|
||||
>
|
||||
조회
|
||||
</Button>
|
||||
</div>
|
||||
<div className="border-t border-gray-300 my-4"></div>
|
||||
<div className="h-auto">
|
||||
<h1 className="text-2xl font-medium text-label pl-8">
|
||||
건축물 목록
|
||||
<span className="!text-2xl text-base text-blue-500">
|
||||
(유의 사항: 신규등록하려는 건축물이 목록에 없을 경우 하단 건축물 정보에 추가하여 주시기 바랍니다.)
|
||||
(유의 사항: 신규등록하려는 건축물이 목록에 없을 경우 하단 건축물
|
||||
정보에 추가하여 주시기 바랍니다.)
|
||||
</span>
|
||||
</h1>
|
||||
<ScrollArea className="h-[30vh]">
|
||||
@@ -134,24 +192,40 @@ export function BdstReg<T extends MoType>({ moType,setIsModal,isModal }: BdstReg
|
||||
pageSize={-10}
|
||||
total={-1}
|
||||
headName={undefined}
|
||||
cellClick={(idx, headId) => (tableClick(idx, headId || ""))}
|
||||
cellClick={(idx, headId) => tableClick(idx, headId || "")}
|
||||
onPageChange={function (page: number): void {
|
||||
throw new Error("Function not implemented.");
|
||||
}}>
|
||||
</UiTable>
|
||||
}}
|
||||
></UiTable>
|
||||
</div>
|
||||
</ScrollArea>
|
||||
<div className="border-t border-gray-300 my-4"></div>
|
||||
{/* <ScrollArea className="h-[40vh]"> */}
|
||||
<div>
|
||||
{ moType === 'RNB'?
|
||||
<RainRegForm rainForm={rainBdstForm as customRainBdst} isModal={isModal} setIsModal={setIsModal} />
|
||||
:moType==='RST'
|
||||
? <RswtrRegForm rswtForm={rainBdstForm as customRswtBdst} isModal={isModal} setIsModal={(open) =>{setIsModal && setIsModal(open)}}></RswtrRegForm>
|
||||
:<HtdflRegForm htdflForm={rainBdstForm as unknown as customHtdflBdst} isModal={true} setIsModal={(open) =>{setIsModal && setIsModal(open)}}></HtdflRegForm>
|
||||
}
|
||||
|
||||
</div>
|
||||
<div>
|
||||
{moType === "RNB" ? (
|
||||
<RainRegForm
|
||||
rainForm={rainBdstForm as customRainBdst}
|
||||
isModal={isModal}
|
||||
setIsModal={setIsModal}
|
||||
/>
|
||||
) : moType === "RST" ? (
|
||||
<RswtrRegForm
|
||||
rswtForm={rainBdstForm as customRswtBdst}
|
||||
isModal={isModal}
|
||||
setIsModal={(open) => {
|
||||
setIsModal && setIsModal(open);
|
||||
}}
|
||||
></RswtrRegForm>
|
||||
) : (
|
||||
<HtdflRegForm
|
||||
htdflForm={rainBdstForm as unknown as customHtdflBdst}
|
||||
isModal={true}
|
||||
setIsModal={(open) => {
|
||||
setIsModal && setIsModal(open);
|
||||
}}
|
||||
></HtdflRegForm>
|
||||
)}
|
||||
</div>
|
||||
{/* </ScrollArea> */}
|
||||
</div>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user