Merge commit 'd910dcce914269169efd14079c8dc4222a807bc8'
This commit is contained in:
@@ -27,3 +27,5 @@ NEXT_PUBLIC_ACCESS_TOKEN = access-token
|
||||
NEXT_PUBLIC_REFRESH_TOKEN = refresh-token
|
||||
NEXT_PUBLIC_NGII_URL = https://map.ngii.go.kr/openapi/Gettile.do?apiKey=04trYP9_xwLAfALjwZ-B8g
|
||||
NEXT_PUBLIC_SEWERAGE_API_URL=http://con.mind-one.co.kr:11083/sewerage-service/api # 개발 서버 API
|
||||
NEXT_PUBLIC_FINDADRESS_URL=https://business.juso.go.kr/addrlink/addrLinkApi.do
|
||||
NEXT_PUBLIC_WR_ADDRESS_KEY = devU01TX0FVVEgyMDI1MDgyNTEwMzkwNDExNjEwNTM=
|
||||
|
||||
@@ -16,6 +16,12 @@ NEXT_PUBLIC_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver
|
||||
NEXT_PUBLIC_NGII_URL = https://map.ngii.go.kr/openapi/Gettile.do?apiKey=04trYP9_xwLAfALjwZ-B8g
|
||||
|
||||
|
||||
|
||||
|
||||
NEXT_PUBLIC_FINDADRESS_URL=https://business.juso.go.kr/addrlink/addrLinkApi.do
|
||||
NEXT_PUBLIC_WR_ADDRESS_KEY = devU01TX0FVVEgyMDI1MDgyNTEwMzkwNDExNjEwNTM=
|
||||
|
||||
|
||||
NEXT_PUBLIC_SEWERAGE_API_URL=http://con.mind-one.co.kr:11083/sewerage-service/api # 개발 서버 API
|
||||
#NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.128:8883/sewerage-service/api # 최용성
|
||||
#NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.66:8883/sewerage-service/api # 박이정
|
||||
|
||||
@@ -16,6 +16,9 @@ NEXT_PUBLIC_NGII_URL = http://10.98.25.94:18080/openapi/Gettile.do?apiKey=BDE2BE
|
||||
NEXT_PUBLIC_SEWERAGE_API_URL = http://apigateway.iipbs-dev.svc.cluster.local:8000/sewerage-service/api
|
||||
|
||||
|
||||
NEXT_PUBLIC_FINDADRESS_URL=https://business.juso.go.kr/addrlink/addrLinkApi.do
|
||||
NEXT_PUBLIC_WR_ADDRESS_KEY = U01TXOFVVEgyMDI1MDgyODE0MTAxNzExNjEyMjA=
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ export const ruseBizMthdCd: SelectDataType[] = [
|
||||
{ val: "자체", text: "자체" },
|
||||
];
|
||||
|
||||
//공통 건축물 용도
|
||||
// 공통 건축물 용도
|
||||
export const bdstUsgCd: SelectDataType[] = [
|
||||
{ val: "-1", text: "확인불가" },
|
||||
{ val: "1", text: "운동장" },
|
||||
@@ -71,67 +71,67 @@ export const bdstUsgCd: SelectDataType[] = [
|
||||
{ val: "14", text: "골프장" },
|
||||
{ val: "15", text: "대규모점포" },
|
||||
{ val: "16", text: "기타" },
|
||||
{ text: "숙박업", val: "17" },
|
||||
{ text: "목욕장업", val: "18" },
|
||||
{ text: "공장", val: "19" },
|
||||
{ text: "발전시설", val: "20" },
|
||||
{ text: "관광단지개발사업", val: "21" },
|
||||
{ text: "도시개발사업", val: "22" },
|
||||
{ text: "산업단지개발사업", val: "23" },
|
||||
{ text: "택지개발사업", val: "24" },
|
||||
{ text: "대규모점포(대형마트)", val: "25" },
|
||||
{ text: "대규모점포(전문점)", val: "26" },
|
||||
{ text: "대규모점포(백화점)", val: "27" },
|
||||
{ text: "대규모점포(쇼핑센터)", val: "28" },
|
||||
{ text: "대규모점포(복합쇼핑몰)", val: "29" },
|
||||
{ text: "물류시설", val: "30" },
|
||||
{ text: "운수시설(여객자동차터미널)", val: "31" },
|
||||
{ text: "운수시설(철도시설)", val: "32" },
|
||||
{ text: "운수시설(공항시설)", val: "33" },
|
||||
{ text: "운수시설(항만시설)", val: "34" },
|
||||
{ text: "업무시설(공공업무시설)", val: "35" },
|
||||
{ text: "업무시설(금융업소)", val: "36" },
|
||||
{ text: "업무시설(사무소)", val: "37" },
|
||||
{ text: "업무시설(결혼상담소 등 소개업소)", val: "38" },
|
||||
{ text: "업무시설(출판사)", val: "39" },
|
||||
{ text: "업무시설(신문사)", val: "40" },
|
||||
{ text: "업무시설(오피스텔)", val: "41" },
|
||||
{ text: "교정시설", val: "42" },
|
||||
{ text: "방송국", val: "43" },
|
||||
{ text: "전신전화국", val: "44" },
|
||||
{ text: "기타", val: "45" },
|
||||
{ val: "17", text: "숙박업" },
|
||||
{ val: "18", text: "목욕장업" },
|
||||
{ val: "19", text: "공장" },
|
||||
{ val: "20", text: "발전시설" },
|
||||
{ val: "21", text: "관광단지개발사업" },
|
||||
{ val: "22", text: "도시개발사업" },
|
||||
{ val: "23", text: "산업단지개발사업" },
|
||||
{ val: "24", text: "택지개발사업" },
|
||||
{ val: "25", text: "대규모점포(대형마트)" },
|
||||
{ val: "26", text: "대규모점포(전문점)" },
|
||||
{ val: "27", text: "대규모점포(백화점)" },
|
||||
{ val: "28", text: "대규모점포(쇼핑센터)" },
|
||||
{ val: "29", text: "대규모점포(복합쇼핑몰)" },
|
||||
{ val: "30", text: "물류시설" },
|
||||
{ val: "31", text: "운수시설(여객자동차터미널)" },
|
||||
{ val: "32", text: "운수시설(철도시설)" },
|
||||
{ val: "33", text: "운수시설(공항시설)" },
|
||||
{ val: "34", text: "운수시설(항만시설)" },
|
||||
{ val: "35", text: "업무시설(공공업무시설)" },
|
||||
{ val: "36", text: "업무시설(금융업소)" },
|
||||
{ val: "37", text: "업무시설(사무소)" },
|
||||
{ val: "38", text: "업무시설(결혼상담소 등 소개업소)" },
|
||||
{ val: "39", text: "업무시설(출판사)" },
|
||||
{ val: "40", text: "업무시설(신문사)" },
|
||||
{ val: "41", text: "업무시설(오피스텔)" },
|
||||
{ val: "42", text: "교정시설" },
|
||||
{ val: "43", text: "방송국" },
|
||||
{ val: "44", text: "전신전화국" },
|
||||
{ val: "45", text: "기타" },
|
||||
];
|
||||
|
||||
export const rswtBdstType: SelectDataType[] = [
|
||||
{ text: "숙박업", val: "17" },
|
||||
{ text: "목욕장업", val: "18" },
|
||||
{ text: "공장", val: "19" },
|
||||
{ text: "발전시설", val: "20" },
|
||||
{ text: "관광단지개발사업", val: "21" },
|
||||
{ text: "도시개발사업", val: "22" },
|
||||
{ text: "산업단지개발사업", val: "23" },
|
||||
{ text: "택지개발사업", val: "24" },
|
||||
{ text: "대규모점포(대형마트)", val: "25" },
|
||||
{ text: "대규모점포(전문점)", val: "26" },
|
||||
{ text: "대규모점포(백화점)", val: "27" },
|
||||
{ text: "대규모점포(쇼핑센터)", val: "28" },
|
||||
{ text: "대규모점포(복합쇼핑몰)", val: "29" },
|
||||
{ text: "물류시설", val: "30" },
|
||||
{ text: "운수시설(여객자동차터미널)", val: "31" },
|
||||
{ text: "운수시설(철도시설)", val: "32" },
|
||||
{ text: "운수시설(공항시설)", val: "33" },
|
||||
{ text: "운수시설(항만시설)", val: "34" },
|
||||
{ text: "업무시설(공공업무시설)", val: "35" },
|
||||
{ text: "업무시설(금융업소)", val: "36" },
|
||||
{ text: "업무시설(사무소)", val: "37" },
|
||||
{ text: "업무시설(결혼상담소 등 소개업소)", val: "38" },
|
||||
{ text: "업무시설(출판사)", val: "39" },
|
||||
{ text: "업무시설(신문사)", val: "40" },
|
||||
{ text: "업무시설(오피스텔)", val: "41" },
|
||||
{ text: "교정시설", val: "42" },
|
||||
{ text: "방송국", val: "43" },
|
||||
{ text: "전신전화국", val: "44" },
|
||||
{ text: "기타", val: "45" },
|
||||
{ val: "17", text: "숙박업" },
|
||||
{ val: "18", text: "목욕장업" },
|
||||
{ val: "19", text: "공장" },
|
||||
{ val: "20", text: "발전시설" },
|
||||
{ val: "21", text: "관광단지개발사업" },
|
||||
{ val: "22", text: "도시개발사업" },
|
||||
{ val: "23", text: "산업단지개발사업" },
|
||||
{ val: "24", text: "택지개발사업" },
|
||||
{ val: "25", text: "대규모점포(대형마트)" },
|
||||
{ val: "26", text: "대규모점포(전문점)" },
|
||||
{ val: "27", text: "대규모점포(백화점)" },
|
||||
{ val: "28", text: "대규모점포(쇼핑센터)" },
|
||||
{ val: "29", text: "대규모점포(복합쇼핑몰)" },
|
||||
{ val: "30", text: "물류시설" },
|
||||
{ val: "31", text: "운수시설(여객자동차터미널)" },
|
||||
{ val: "32", text: "운수시설(철도시설)" },
|
||||
{ val: "33", text: "운수시설(공항시설)" },
|
||||
{ val: "34", text: "운수시설(항만시설)" },
|
||||
{ val: "35", text: "업무시설(공공업무시설)" },
|
||||
{ val: "36", text: "업무시설(금융업소)" },
|
||||
{ val: "37", text: "업무시설(사무소)" },
|
||||
{ val: "38", text: "업무시설(결혼상담소 등 소개업소)" },
|
||||
{ val: "39", text: "업무시설(출판사)" },
|
||||
{ val: "40", text: "업무시설(신문사)" },
|
||||
{ val: "41", text: "업무시설(오피스텔)" },
|
||||
{ val: "42", text: "교정시설" },
|
||||
{ val: "43", text: "방송국" },
|
||||
{ val: "44", text: "전신전화국" },
|
||||
{ val: "45", text: "기타" },
|
||||
];
|
||||
|
||||
export const orgwtKndCd = [
|
||||
@@ -186,6 +186,7 @@ export const pplLenght = [
|
||||
];
|
||||
|
||||
export const rainFcltCd = [
|
||||
{ val: "10", text: "확인불가" },
|
||||
{ val: "01", text: "지붕" },
|
||||
{ val: "02", text: "건물옥상" },
|
||||
{ val: "03", text: "골프장 연못" },
|
||||
@@ -195,7 +196,6 @@ export const rainFcltCd = [
|
||||
{ val: "07", text: "태양광패널" },
|
||||
{ val: "08", text: "연못" },
|
||||
{ val: "09", text: "기타" },
|
||||
{ val: "10", text: "확인불가" },
|
||||
];
|
||||
|
||||
|
||||
|
||||
@@ -17,15 +17,15 @@ const hdtflObjSchema = z.object({
|
||||
.string()
|
||||
.min(1, { message: validationMessages.required("에너지원 종류") }),
|
||||
fclCpct: z
|
||||
.number()
|
||||
.positive({ message: validationMessages.required("시설 용량") }),
|
||||
.number().nullish(),
|
||||
//.positive({ message: validationMessages.required("시설 용량") }),
|
||||
plwtYn: z.enum(["Y", "N"]).default("Y"),
|
||||
orgwtWtritSpt: z
|
||||
.string()
|
||||
.min(1, { message: validationMessages.required("원수 취수 지점") }),
|
||||
.string().nullish(),
|
||||
// .min(1, { message: validationMessages.required("원수 취수 지점") }),
|
||||
orgwtOcrnProcs: z
|
||||
.string()
|
||||
.min(1, { message: validationMessages.required("원수 발생 공정") }),
|
||||
.string().nullish(),
|
||||
// .min(1, { message: validationMessages.required("원수 발생 공정") }),
|
||||
wtritEntrcTp: z
|
||||
.number()
|
||||
.max(100, { message: "온도는 100이상이 될 수 없습니다." })
|
||||
@@ -33,12 +33,12 @@ const hdtflObjSchema = z.object({
|
||||
amtgnr: z.number().default(0),
|
||||
prcsProcsYn: z.enum(["Y", "N"]).default("Y"),
|
||||
prcsFcltCpct: z
|
||||
.number()
|
||||
.positive({ message: validationMessages.required("처리시설 용량") }),
|
||||
.number().nullish(),
|
||||
// .positive({ message: validationMessages.required("처리시설 용량") }),
|
||||
fmYn: z.string().default(""),
|
||||
utztnCpct: z
|
||||
.number()
|
||||
.positive({ message: validationMessages.required("이용 용량") }),
|
||||
.number().nullish(),
|
||||
// .positive({ message: validationMessages.required("이용 용량") }),
|
||||
utztnUsg: z
|
||||
.string()
|
||||
.min(1, { message: validationMessages.required("이용 용도") }),
|
||||
|
||||
@@ -19,14 +19,9 @@ export const baseReuseBuildingSchema = z.object({
|
||||
instlCstSprtYn: z.string().default("Y"),
|
||||
instlCstSprtAmt: z.number().nullish(),
|
||||
grntchBdstCertYn: z.string().default("Y"),
|
||||
grntchBdstCertYr: z
|
||||
.string()
|
||||
.max(4, { message: validationMessages.yearFormat })
|
||||
.refine(
|
||||
(year) => year.length === 0 || /^\d{4}$/.test(year),
|
||||
{
|
||||
message: validationMessages.yearFormat,
|
||||
}
|
||||
grntchBdstCertYr: z.string().refine(
|
||||
(val) => val === "" || /^\d{4}$/.test(val),
|
||||
{ message: "연도는 빈값 또는 4자리 숫자여야 합니다." }
|
||||
),
|
||||
grntchBdstCertNo: z.string().default(""),
|
||||
grntchBdstCertGrd: z.string().default(""),
|
||||
@@ -59,7 +54,7 @@ export const chgBuildingSchema = z.object({
|
||||
export const htdflReuseBuildingSchema = z.object({
|
||||
bdstRuseFcltSn: z.number().nullish(),
|
||||
bdstInfoSn: z.number().nullish(),
|
||||
instlCmptnDt: z.coerce.date().default(() => new Date()),
|
||||
//instlCmptnDt: z.coerce.date().default(() => new Date()),
|
||||
instlCst: z.number().nullish(),
|
||||
operMngCd: z.string().optional().nullish(),
|
||||
anlOperCst: z.number().default(0),
|
||||
|
||||
@@ -14,7 +14,7 @@ const rswtrObjSchema = z.object({
|
||||
//wtrUsqty: z.number({ required_error: validationMessages.required("물사용량(m³)") }).positive({ message: validationMessages.required("물사용량(m³)") }),
|
||||
//oblgTrgtWtrUsqty: z.number().nullish().default(0),
|
||||
orgwtKndCd: z.string({ required_error: validationMessages.requiredSelect("원수 종류") }).min(1, { message: validationMessages.requiredSelect("원수 종류") }),
|
||||
filtrTrtmfctCpct: z.number({ required_error: validationMessages.required("처리시설 용량") }),
|
||||
filtrTrtmfctCpct: z.number().nullish(),
|
||||
filtrTrtmfctProcs: z.string({ required_error: validationMessages.required("주요처리공정") }).min(1, { message: validationMessages.required("주요처리공정") }),
|
||||
filtrTrtmfctUsgCd: z.string().default("").nullish(),
|
||||
rswtrUsqty: z.number().default(0),
|
||||
|
||||
@@ -21,7 +21,7 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
|
||||
const { userSiSggCd } = code;
|
||||
const [useCityCd, setUserCityCd] = useState<SelectDataType[]>([]);
|
||||
const [useSggCd, setUserSggCd] = useState<SelectDataType[]>([]);
|
||||
|
||||
const [initDaddr, setInitDaddr] = useState<string>();
|
||||
|
||||
useEffect(() => {
|
||||
if (userSiSggCd.length === 2 && code.cityCd.length > 0) {
|
||||
@@ -56,6 +56,7 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
|
||||
form.setValue("ctpvCd", Number(city[0]?.val));
|
||||
form.setValue("sggCd", Number(sgg[0]?.val));
|
||||
}
|
||||
|
||||
}, [form, userSiSggCd, code.cityCd, code.sggCd]);
|
||||
|
||||
|
||||
@@ -67,9 +68,16 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
|
||||
return () => subscription?.unsubscribe();
|
||||
}, [form.form]);
|
||||
|
||||
// useEffect(() => {
|
||||
// console.log("form ", form.watch());
|
||||
// }, [form.formState]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
console.log("form.formState ", form.watch("archArea"));
|
||||
}, [form.formState]);
|
||||
const bdstInfoSn = form.getValues("bdstInfoSn");
|
||||
if(bdstInfoSn&&bdstInfoSn>0)
|
||||
setInitDaddr(form.getValues("daddr"));
|
||||
}, [form.getValues("bdstInfoSn")]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -166,7 +174,7 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
|
||||
/> */}
|
||||
<div>
|
||||
<SearchInputAddress
|
||||
initValue={undefined}
|
||||
initValue={initDaddr}
|
||||
setRtnData={(rtnData: addressType) => {
|
||||
console.log("rtnData", rtnData);
|
||||
field.onChange(rtnData.roadAddrPart1);
|
||||
|
||||
@@ -78,6 +78,10 @@ export default function HtdflRegForm({
|
||||
};
|
||||
|
||||
const cleanHtdflData = (raw: any): z.infer<typeof hdtflZod> => {
|
||||
const buildings =
|
||||
raw?.reuseBuilding && raw.reuseBuilding.length > 0
|
||||
? raw.reuseBuilding
|
||||
: [{}];
|
||||
return {
|
||||
...raw,
|
||||
frstArchPrmsnDt: new Date(raw?.frstArchPrmsnDt || null),
|
||||
@@ -92,7 +96,7 @@ export default function HtdflRegForm({
|
||||
: new Date(item?.archChgPrmsnDt),
|
||||
bdstChgNm: item?.bdstChgNm ?? "", // null → ""
|
||||
})),
|
||||
reuseBuilding: (raw?.reuseBuilding || []).map((item: any) => ({
|
||||
reuseBuilding:buildings.map((item: any) => ({
|
||||
...item,
|
||||
instlCmptnDt: new Date(item?.instlCmptnDt),
|
||||
htdflObj: {
|
||||
|
||||
@@ -84,13 +84,14 @@ export default function RainRegForm({
|
||||
typeof item?.grntchBdstCertYr === "string"
|
||||
? item?.grntchBdstCertYr
|
||||
: "", // null → ""
|
||||
bdstUsgCd: item?.bdstUsgCd ?? Number("-1"), // null → "-1"
|
||||
instlCstSprtYn: item?.instlCstSprtYn ?? "Y", // null → "Y"
|
||||
grntchBdstCertYn: item?.grntchBdstCertYn ?? "Y",
|
||||
grntchBdstCertYn: item?.grntchBdstCertYn ?? "D",
|
||||
rainyObj: {
|
||||
...item?.rainyObj,
|
||||
pntfColKnd:item.rainyObj?.pntfColKnd??'확인불가',
|
||||
pntfColKnd:item.rainyObj?.pntfColKnd??rainFcltCd[0]?.val??'',
|
||||
filtrTrtmfctPrs:item.rainyObj?.filtrTrtmfctPrs??'',
|
||||
filtrTrtmfctYn: item?.rainyObj?.filtrTrtmfctYn ?? "Y",
|
||||
filtrTrtmfctYn: item?.rainyObj?.filtrTrtmfctYn ?? "D",
|
||||
},
|
||||
})),
|
||||
};
|
||||
@@ -98,7 +99,7 @@ export default function RainRegForm({
|
||||
|
||||
useEffect(() => {
|
||||
if (grntchBdstCertYn === "N") {
|
||||
form.setValue("reuseBuilding.0.grntchBdstCertYr", "");
|
||||
form.setValue("reuseBuilding.0.grntchBdstCertYr", '');
|
||||
form.setValue("reuseBuilding.0.grntchBdstCertNo", "");
|
||||
form.setValue("reuseBuilding.0.grntchBdstCertGrd", "");
|
||||
} else if (instlCstSprtYn === "N") {
|
||||
@@ -298,7 +299,10 @@ export default function RainRegForm({
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={rainFcltCd}
|
||||
onSelectValue={readonly ? () => { } : field.onChange}
|
||||
onSelectValue={ (item) =>{
|
||||
if(readonly) return;
|
||||
field.onChange(item)
|
||||
} }
|
||||
value={field.value ?? rainFcltCd[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
@@ -521,8 +525,7 @@ export default function RainRegForm({
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertYr"
|
||||
render={({ field }) => {
|
||||
const isUnknown =
|
||||
field.value === null || field.value === "0000"; // 또는 Number(value) === -1
|
||||
const isUnknown = field.value === null || field.value === "0000"; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="인증년도">
|
||||
<Input
|
||||
@@ -535,7 +538,7 @@ export default function RainRegForm({
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
value={isUnknown ? "확인불가" : (field.value ?? "")}
|
||||
value={isUnknown ? "확인불가" : (field.value ?? '9999')}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
if (e.target.value === "확인불가") {
|
||||
|
||||
@@ -83,8 +83,10 @@ export default function RswtrRegForm({
|
||||
|
||||
const filtrTrtmfctCpct = form.watch('reuseBuilding.0.rswtrObj.filtrTrtmfctCpct')
|
||||
const cleanRswtData = (raw: any): z.infer<typeof rswtZod> => {
|
||||
|
||||
console.log('raw ', raw)
|
||||
const buildings =
|
||||
raw?.reuseBuilding && raw.reuseBuilding.length > 0
|
||||
? raw.reuseBuilding
|
||||
: [{}];
|
||||
return {
|
||||
...raw,
|
||||
frstArchPrmsnDt: raw?.frstArchPrmsnDt
|
||||
@@ -93,14 +95,15 @@ export default function RswtrRegForm({
|
||||
archChgPrmsnDt: raw?.archChgPrmsnDt
|
||||
? new Date(raw?.archChgPrmsnDt)
|
||||
: null,
|
||||
reuseBuilding: (raw?.reuseBuilding || []).map((item: any) => ({
|
||||
reuseBuilding:buildings.map((item: any) => ({
|
||||
...item,
|
||||
instlCmptnDt: item?.instlCmptnDt
|
||||
? new Date(item.instlCmptnDt)
|
||||
: new Date(), // item?.instlCmptnDt가 유효하지 않으면 현재 날짜로 초기화
|
||||
operMngCd: item?.operMngCd || "", // null → ""
|
||||
instlCstSprtYn: item?.instlCstSprtYn || code.yn[0]?.val, // null → "Y"
|
||||
grntchBdstCertYn: item?.grntchBdstCertYn || code.yn[0]?.val,
|
||||
instlCstSprtYn: item?.instlCstSprtYn || 'N', // null → "Y"
|
||||
grntchBdstCertYn: item?.grntchBdstCertYn ||'N',
|
||||
bdstUsgCd: item?.bdstUsgCd ?? Number("-1"), // null → "-1"
|
||||
rswtrObj: {
|
||||
...item?.rswtrObj,
|
||||
filtrTrtmfctYn: item?.rainyObj?.filtrTrtmfctYn || code.yn[0]?.val,
|
||||
@@ -145,6 +148,9 @@ export default function RswtrRegForm({
|
||||
if (rswtZod) form.reset(cleanRswtData(rswtForm));
|
||||
}, [rswtForm, form]);
|
||||
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<div className="!mx-[1.6rem] !p-0r">
|
||||
<Form {...form}>
|
||||
@@ -291,7 +297,7 @@ export default function RswtrRegForm({
|
||||
selectClass={selectClass}
|
||||
selectArray={code.orgwtKndCd}
|
||||
onSelectValue={readonly ? () => { } : field.onChange}
|
||||
value={field.value || code.orgwtKndCd[0]?.val}
|
||||
value={field.value ?? code.orgwtKndCd[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
|
||||
@@ -49,8 +49,8 @@ export function BdstReg<T extends MoType>({
|
||||
|
||||
const { userSiSggCd } = code;
|
||||
|
||||
const [bdstTable, setbdstTable] = useState<BdstTypeMap[T][]>();
|
||||
const [rainBdstForm, setRainBdstForm] = useState<BdstTypeMap[T]>(
|
||||
const [bdstTable, setBdstTable] = useState<BdstTypeMap[T][]>();
|
||||
const [bdstForm, setBdstForm] = useState<BdstTypeMap[T]>(
|
||||
{} as BdstTypeMap[T]
|
||||
);
|
||||
const [searchTxt, setSearchTxt] = useState<string>();
|
||||
@@ -83,7 +83,7 @@ export function BdstReg<T extends MoType>({
|
||||
archArea: archArea,
|
||||
};
|
||||
});
|
||||
setbdstTable(tableData(bdstData, { code }));
|
||||
setBdstTable(tableData(bdstData, { code }));
|
||||
}
|
||||
}, [bdst]);
|
||||
|
||||
@@ -118,13 +118,13 @@ export function BdstReg<T extends MoType>({
|
||||
if (val !== undefined && bdst?.bdstBase.length > 0) {
|
||||
const data: BdstTypeMap[T] = bdst?.bdstBase[val];
|
||||
if (data) {
|
||||
setRainBdstForm(data);
|
||||
setBdstForm(data);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setbdstTable([]); // 초기화 작업
|
||||
setBdstTable([]); // 초기화 작업
|
||||
}, []);
|
||||
return (
|
||||
<>
|
||||
@@ -200,13 +200,13 @@ export function BdstReg<T extends MoType>({
|
||||
<div>
|
||||
{moType === "RNB" ? (
|
||||
<RainRegForm
|
||||
rainForm={rainBdstForm as customRainBdst}
|
||||
rainForm={bdstForm as customRainBdst}
|
||||
isModal={isModal}
|
||||
setIsModal={setIsModal}
|
||||
/>
|
||||
) : moType === "RST" ? (
|
||||
<RswtrRegForm
|
||||
rswtForm={rainBdstForm as customRswtBdst}
|
||||
rswtForm={bdstForm as customRswtBdst}
|
||||
isModal={isModal}
|
||||
setIsModal={(open?: boolean) => {
|
||||
if (setIsModal && open) {
|
||||
@@ -216,7 +216,7 @@ export function BdstReg<T extends MoType>({
|
||||
></RswtrRegForm>
|
||||
) : (
|
||||
<HtdflRegForm
|
||||
htdflForm={rainBdstForm as unknown as customHtdflBdst}
|
||||
htdflForm={bdstForm as unknown as customHtdflBdst}
|
||||
isModal={true}
|
||||
setIsModal={(open?: boolean) => {
|
||||
if (setIsModal && open) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from "@/components/lib/func/commom";
|
||||
|
||||
import {
|
||||
DatePicker,
|
||||
// DatePicker,
|
||||
FormField,
|
||||
FormUi,
|
||||
SelectBox,
|
||||
@@ -24,6 +24,7 @@ import {
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@common/components/ui";
|
||||
import moment from "moment";
|
||||
import React from "react";
|
||||
|
||||
type RuseMngTableProps = {
|
||||
@@ -49,14 +50,17 @@ const RuseMngTableForm = React.forwardRef<any, RuseMngTableProps>(
|
||||
form,
|
||||
formNm,
|
||||
indexBiz,
|
||||
readonly= false
|
||||
readonly = false,
|
||||
},
|
||||
ref
|
||||
) => {
|
||||
return (
|
||||
<>
|
||||
<Table key={`${formNm}-table-${indexMng}-${indexBiz}`} variant="secondary"
|
||||
ref={ref}>
|
||||
<Table
|
||||
key={`${formNm}-table-${indexMng}-${indexBiz}`}
|
||||
variant="secondary"
|
||||
ref={ref}
|
||||
>
|
||||
<TableHeader className="font-bold">
|
||||
{upHeadList ? (
|
||||
headMakeprfmnc(headList, upHeadList)
|
||||
@@ -76,20 +80,20 @@ const RuseMngTableForm = React.forwardRef<any, RuseMngTableProps>(
|
||||
|
||||
<TableBody>
|
||||
{tableData.map((item, i) => (
|
||||
<TableRow key={`${item.id }-${i}` } >
|
||||
<TableRow key={`${item.id}-${i}`}>
|
||||
{headList.map((head, j) => (
|
||||
<TableCell
|
||||
key={`${head.id}-${j}`}
|
||||
className="text-center whitespace-nowrap"
|
||||
onClick={() => { }}
|
||||
onClick={() => {}}
|
||||
>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name={
|
||||
typeof indexMng === "number" &&
|
||||
indexMng >= 0 &&
|
||||
typeof indexBiz === "number" &&
|
||||
indexBiz >= 0
|
||||
indexMng >= 0 &&
|
||||
typeof indexBiz === "number" &&
|
||||
indexBiz >= 0
|
||||
? `items.${indexMng}.fcBizs.${indexBiz}.${formNm}.${i}.${head.id}`
|
||||
: typeof indexMng === "number" && indexMng >= 0
|
||||
? `items.${indexMng}.${formNm}.${i}.${head.id}`
|
||||
@@ -99,7 +103,7 @@ const RuseMngTableForm = React.forwardRef<any, RuseMngTableProps>(
|
||||
<FormUi label="">
|
||||
{head.edit === true ? (
|
||||
<Input
|
||||
className={`${head.type === "number" ? "text-right" : "text-center"} !text-xl`}
|
||||
className={`${head.type === "number" ? "text-right" : "text-center"} text-gray-600`}
|
||||
type="text"
|
||||
onChange={(txt) => {
|
||||
if (head.type === "number") {
|
||||
@@ -113,8 +117,10 @@ const RuseMngTableForm = React.forwardRef<any, RuseMngTableProps>(
|
||||
? formatCommaNumber(field.value)
|
||||
: field.value || ""
|
||||
}
|
||||
readOnly={readonly|| head.readonly ? true : false}
|
||||
maxLength={head.maxLength?head.maxLength:15}
|
||||
readOnly={
|
||||
readonly || head.readonly ? true : false
|
||||
}
|
||||
maxLength={head.maxLength ? head.maxLength : 15}
|
||||
/>
|
||||
) : head.type === "select" ? (
|
||||
<SelectBox
|
||||
@@ -134,23 +140,38 @@ const RuseMngTableForm = React.forwardRef<any, RuseMngTableProps>(
|
||||
field.onChange(val);
|
||||
}
|
||||
}}
|
||||
readOnly={ readonly||head.readonly ? true : false}
|
||||
// Disabled prop removed as SelectBox does not support it
|
||||
readOnly={
|
||||
readonly || head.readonly ? true : false
|
||||
}
|
||||
// Disabled prop removed as SelectBox does not support it
|
||||
></SelectBox>
|
||||
) : head.type === "date" ? (
|
||||
<DatePicker
|
||||
mode="single"
|
||||
field={{
|
||||
value:
|
||||
typeof field.value === "string"
|
||||
? new Date(field.value)
|
||||
: field.value,
|
||||
onChange: (date: Date | undefined) => {
|
||||
console.log("date", date);
|
||||
field.onChange(date); // readonly 상태가 아닐 때만 값 변경
|
||||
},
|
||||
// <DatePicker
|
||||
// mode="single"
|
||||
// field={{
|
||||
// value:
|
||||
// typeof field.value === "string"
|
||||
// ? new Date(field.value)
|
||||
// : field.value,
|
||||
// onChange: (date: Date | undefined) => {
|
||||
// console.log("date", date);
|
||||
// field.onChange(date); // readonly 상태가 아닐 때만 값 변경
|
||||
// },
|
||||
// }}
|
||||
// selectClass={"w-full"}
|
||||
// readOnly={readonly||head.readonly ? true : false}
|
||||
// />
|
||||
<Input
|
||||
type="date"
|
||||
onChange={(e) => {
|
||||
// 브라우저에서 선택한 값은 "YYYY-MM-DD"
|
||||
const date = new Date(e.target.value); // e.g. "2025-06-01"
|
||||
field.onChange(date);
|
||||
}}
|
||||
selectClass={"w-full"}
|
||||
value={
|
||||
field.value? moment(field.value, "YYYYMMDD").format( "YYYY-MM-DD"): ""
|
||||
}
|
||||
className={"w-full text-gray-600"}
|
||||
readOnly={readonly||head.readonly ? true : false}
|
||||
/>
|
||||
) : head.type === "checkbox" ? (
|
||||
@@ -158,22 +179,19 @@ const RuseMngTableForm = React.forwardRef<any, RuseMngTableProps>(
|
||||
className=""
|
||||
checked={field.value || false}
|
||||
onCheckedChange={(checked) => {
|
||||
if(readonly || head.readonly) {
|
||||
if (readonly || head.readonly) {
|
||||
return;
|
||||
}else{
|
||||
} else {
|
||||
field.onChange(checked);
|
||||
}
|
||||
}}
|
||||
></Checkbox>
|
||||
) : (
|
||||
(
|
||||
|
||||
<span className="text-black">{
|
||||
head.type === "number"
|
||||
<span className="text-black">
|
||||
{head.type === "number"
|
||||
? formatCommaNumber(field.value)
|
||||
: field.value || ""
|
||||
}</span>
|
||||
)
|
||||
: field.value || ""}
|
||||
</span>
|
||||
)}
|
||||
</FormUi>
|
||||
)}
|
||||
|
||||
@@ -10,6 +10,8 @@ const LX_GEOSERVER_URL = process.env.NEXT_PUBLIC_LX_GEOSERVER_URL || "";
|
||||
const SEWERAGE_API_URL = process.env.NEXT_PUBLIC_SEWERAGE_API_URL || "";
|
||||
const REUSE_API_URL = process.env.NEXT_PUBLIC_WR_SERVER_API_URL || "";
|
||||
const OPERATION_API_URL = process.env.NEXT_PUBLIC_FO_SERVER_API_URL || "";
|
||||
const BUSINESS_JUSO_API_URL = process.env.NEXT_PUBLIC_FINDADRESS_URL || "";
|
||||
const AdressKey = process.env.NEXT_PUBLIC_WR_ADDRESS_KEY || "";
|
||||
|
||||
export function middleware(req: NextRequest) {
|
||||
const pathname = req.nextUrl.pathname;
|
||||
@@ -148,6 +150,24 @@ export function middleware(req: NextRequest) {
|
||||
return NextResponse.rewrite(new URL(newUrl));
|
||||
}
|
||||
|
||||
|
||||
if (pathname.startsWith("/bussiness-juso-service")) {
|
||||
console.log('AdressKey ', AdressKey)
|
||||
const params = new URLSearchParams({
|
||||
currentPage: "1", // 원하는 페이지
|
||||
countPerPage: "5", // 페이지당 결과 수
|
||||
keyword: searchParams.get("keyword") || "", // 검색어(주소)
|
||||
confmKey: AdressKey, // 인증키 인터넷용 패쇄망용은 따로 발급 필요 즉 middleware에서 치환해서 사용해야할듯
|
||||
resultType: "json", // 결과 형식 기본은 xml
|
||||
});
|
||||
const newUrl = `${BUSINESS_JUSO_API_URL}?${params.toString()}`;
|
||||
console.log(`[Middleware] Request to business.juso.go.kr`);
|
||||
console.log(req.url);
|
||||
console.log(`[Middleware] Rewriting from '/business.juso.go.kr' path to: ${newUrl}`);
|
||||
return NextResponse.rewrite(new URL(newUrl));
|
||||
}
|
||||
|
||||
|
||||
return NextResponse.next();
|
||||
}
|
||||
|
||||
@@ -161,6 +181,7 @@ export const config = {
|
||||
"/sewerage-service/:path*",
|
||||
"/reuse-service/:path*",
|
||||
"/operation-service/:path*",
|
||||
"/bussiness-juso-service/:path*",
|
||||
"/"
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user