물재이용 공통코드 작업
This commit is contained in:
@@ -637,7 +637,7 @@ export function SdmInfoRegForm({
|
||||
}}
|
||||
/>
|
||||
<div className="col-span-1">
|
||||
<Label className="text-xl">수소이온농도(PH)</Label>
|
||||
<Label className="text-xl">수소이온농도(pH)</Label>
|
||||
<div className="flex flex-row items-center gap-2">
|
||||
<Input
|
||||
className="!text-xl w-36"
|
||||
|
||||
@@ -585,7 +585,7 @@ export default function CoMatRvw() {
|
||||
control={form.control}
|
||||
name="ph"
|
||||
render={({ field }) => (
|
||||
<FormUi label="수소이온농도(ph)">
|
||||
<FormUi label="수소이온농도(pH)">
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="relative flex-1 min-w-0">
|
||||
<Input
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { fetchType, getFetchWithCount } from "@/components/lib/api";
|
||||
import type { SelectDataType } from "@common/business_components";
|
||||
|
||||
export const numSize = 12;
|
||||
export const txtSize = 20;
|
||||
|
||||
export const lwCds: Record<string, SelectDataType[]> = {};
|
||||
//export const lwCds: Record<string, SelectDataType[]> = {};
|
||||
export const yn: SelectDataType[] = [
|
||||
{ val: "Y", text: "Y" },
|
||||
{ val: "N", text: "N" },
|
||||
@@ -54,14 +53,14 @@ export const ruseSeCd: SelectDataType[] = [
|
||||
{ val: "개량", text: "개량" },
|
||||
];
|
||||
|
||||
// export const ruseBizMthdCd: SelectDataType[] = [
|
||||
// { val: "재정", text: "재정" },
|
||||
// { val: "민간투자", text: "민간투자" },
|
||||
// { val: "자체", text: "자체" },
|
||||
// ];
|
||||
export const ruseBizMthdCd: SelectDataType[] = [
|
||||
{ val: "재정", text: "재정" },
|
||||
{ val: "민간투자", text: "민간투자" },
|
||||
{ val: "자체", text: "자체" },
|
||||
];
|
||||
|
||||
// 공통 건축물 용도
|
||||
export const bdstUsgCd: SelectDataType[] =lwCds?.bdstUsgCd?.concat(lwCds?.rswtBdstType??[])??[]
|
||||
//export const bdstUsgCd: SelectDataType[] =lwCds?.bdstUsgCd?.concat(lwCds?.rswtBdstType??[])??[]
|
||||
|
||||
// [
|
||||
// { val: "-1", text: "확인불가" },
|
||||
@@ -112,7 +111,7 @@ export const bdstUsgCd: SelectDataType[] =lwCds?.bdstUsgCd?.concat(lwCds?.rswtBd
|
||||
// { val: "45", text: "기타" },
|
||||
// ];
|
||||
|
||||
export const rswtBdstType: SelectDataType[] = lwCds?.rswtBdstType??[]
|
||||
// export const rswtBdstType: SelectDataType[] = lwCds?.rswtBdstType??[]
|
||||
//[
|
||||
// { val: "17", text: "숙박업" },
|
||||
// { val: "18", text: "목욕장업" },
|
||||
@@ -221,7 +220,7 @@ export const chBuCd = [
|
||||
// ];
|
||||
|
||||
//물리화학적처리(스크린, 응집, 침전)/생물학적처리(활성슬러지법 등)/소독(염소, UV 등)/기타
|
||||
export const rswtPrscCdMthdCd = lwCds['rswtPrscCdMthdCd']??[]
|
||||
//export const rswtPrscCdMthdCd = lwCds['rswtPrscCdMthdCd']??[]
|
||||
// {
|
||||
// val: "물리화학적처리(스크린,응집,침전)",
|
||||
// text: "물리화학적처리(스크린,응집,침전)",
|
||||
@@ -389,55 +388,55 @@ export const sewageOutFclttUse = [
|
||||
text: "공업용수",
|
||||
},
|
||||
];
|
||||
const codeMApping = {
|
||||
WR001: "bdstUsgCd",
|
||||
WR002: "rswtBdstType",
|
||||
WR003: "rainFcltCd",
|
||||
WR004: "bdstGrntchClass",
|
||||
WR005: "rswtPrscCdMthdCd", // 아직 디 못바꿈
|
||||
WR006: "orgwtKndCd", //작업 완ㅛ
|
||||
WR007: "ruseMngMtd", // 작업완료
|
||||
WR008: "rusePrcsMthdCd", //w작업완료
|
||||
WR009: "erctUswtrPrcsMeth",//w작업완료
|
||||
WR010: "ruseFcltSpot",// inout은 yn 만 사용해야 함으로 해당 코드는 사용안함.
|
||||
WR011: "pplQulity",
|
||||
WR012: "pplLenght",
|
||||
WR013: "bdstFilterYn", // 사용 불가 yn만 사용해야함으로 해당코드 사용 안함
|
||||
WR014: "rainRswtMng", // 지도점검 등록 시변경
|
||||
WR015: "rainFcltFlowRate", //지도점검 등록 시변경
|
||||
WR016: "dmdUszCd", // 지도점검 등록 시변경
|
||||
WR017: "sewageInFcltUse", //하수재이용 장내
|
||||
WR018: "sewageOutFclttUse", // 하수재이용 장외
|
||||
WR019: "htdPowerMthdCd",
|
||||
WR020: "htdUtztnUsgCd",
|
||||
};
|
||||
export const getCommonUpCd = async () => {
|
||||
const upCd = await getFetchWithCount(
|
||||
fetchType.LOCAL,
|
||||
"/cms-service/api/v1/up-codes?keyword=&upCd=&cdSe=&useYn=Y&siteId=WR&page=0&size=100&sort=string"
|
||||
);
|
||||
// const codeMApping = {
|
||||
// WR001: "bdstUsgCd",
|
||||
// WR002: "rswtBdstType",
|
||||
// WR003: "rainFcltCd",
|
||||
// WR004: "bdstGrntchClass",
|
||||
// WR005: "rswtPrscCdMthdCd", // 아직 디 못바꿈
|
||||
// WR006: "orgwtKndCd", //작업 완ㅛ
|
||||
// WR007: "ruseMngMtd", // 작업완료
|
||||
// WR008: "rusePrcsMthdCd", //w작업완료
|
||||
// WR009: "erctUswtrPrcsMeth",//w작업완료
|
||||
// WR010: "ruseFcltSpot",// inout은 yn 만 사용해야 함으로 해당 코드는 사용안함.
|
||||
// WR011: "pplQulity",
|
||||
// WR012: "pplLenght",
|
||||
// WR013: "bdstFilterYn", // 사용 불가 yn만 사용해야함으로 해당코드 사용 안함
|
||||
// WR014: "rainRswtMng", // 지도점검 등록 시변경
|
||||
// WR015: "rainFcltFlowRate", //지도점검 등록 시변경
|
||||
// WR016: "dmdUszCd", // 지도점검 등록 시변경
|
||||
// WR017: "sewageInFcltUse", //하수재이용 장내
|
||||
// WR018: "sewageOutFclttUse", // 하수재이용 장외
|
||||
// WR019: "htdPowerMthdCd",
|
||||
// WR020: "htdUtztnUsgCd",
|
||||
// };
|
||||
// export const getCommonUpCd = async () => {
|
||||
// const upCd = await getFetchWithCount(
|
||||
// fetchType.LOCAL,
|
||||
// "/cms-service/api/v1/up-codes?keyword=&upCd=&cdSe=&useYn=Y&siteId=WR&page=0&size=100&sort=string"
|
||||
// );
|
||||
|
||||
const upWrCode: string[] = upCd.content
|
||||
.filter((item: any) => item.upCd.slice(0, 2) === "WR")
|
||||
.map((cd: any) => cd.upCd);
|
||||
// const upWrCode: string[] = upCd.content
|
||||
// .filter((item: any) => item.upCd.slice(0, 2) === "WR")
|
||||
// .map((cd: any) => cd.upCd);
|
||||
|
||||
await Promise.all(
|
||||
upWrCode.map(async (cd) => {
|
||||
const mapping = codeMApping[cd as keyof typeof codeMApping];
|
||||
if (!mapping) return;
|
||||
// await Promise.all(
|
||||
// upWrCode.map(async (cd) => {
|
||||
// const mapping = codeMApping[cd as keyof typeof codeMApping];
|
||||
// if (!mapping) return;
|
||||
|
||||
const lwCd = await getFetchWithCount(
|
||||
fetchType.LOCAL,
|
||||
`/cms-service/api/v1/lwpo-cds/up-cd/${cd}`
|
||||
);
|
||||
// const lwCd = await getFetchWithCount(
|
||||
// fetchType.LOCAL,
|
||||
// `/cms-service/api/v1/lwpo-cds/up-cd/${cd}`
|
||||
// );
|
||||
|
||||
const list = Array.isArray(lwCd) ? lwCd : lwCd.content ?? [];
|
||||
// const list = Array.isArray(lwCd) ? lwCd : lwCd.content ?? [];
|
||||
|
||||
lwCds[mapping] = list.map((it: any) => ({
|
||||
text: it.lwpoCdNm,
|
||||
val: it.lwpoCd,
|
||||
}));
|
||||
})
|
||||
);
|
||||
|
||||
};
|
||||
// lwCds[mapping] = list.map((it: any) => ({
|
||||
// text: it.lwpoCdNm,
|
||||
// val: it.lwpoCd,
|
||||
// }));
|
||||
// })
|
||||
// );
|
||||
// console.log('lwCds ', lwCds)
|
||||
// };
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getFetch } from "@/components/lib/api";
|
||||
import { fetchType, getFetch, getFetchWithCount } from "@/components/lib/api";
|
||||
import type {
|
||||
EnvPartSelectDataType,
|
||||
SelectDataType,
|
||||
@@ -7,14 +7,94 @@ import {
|
||||
bdstFilterYn,
|
||||
bdstIncenYn,
|
||||
chBuCd,
|
||||
lwCds,
|
||||
rswtPrscCdMthdCd,
|
||||
ruseBizMthdCd,
|
||||
ruseSeCd,
|
||||
yn,
|
||||
} from "./basicCode";
|
||||
export const btnClass = "p-4 m-2 text-white rounded-sm text-lg font-medium ";
|
||||
|
||||
const laeSecd = "41";
|
||||
export const lwCds: Record<string, SelectDataType[]> = {};
|
||||
|
||||
|
||||
|
||||
const codeMApping = {
|
||||
WR001: "bdstUsgCd",
|
||||
WR002: "rswtBdstType",
|
||||
WR003: "rainFcltCd",
|
||||
WR004: "bdstGrntchClass",
|
||||
WR005: "rswtPrscCdMthdCd", // 아직 디 못바꿈
|
||||
WR006: "orgwtKndCd", //작업 완ㅛ
|
||||
WR007: "ruseMngMtd", // 작업완료
|
||||
WR008: "rusePrcsMthdCd", //w작업완료
|
||||
WR009: "erctUswtrPrcsMeth",//w작업완료
|
||||
WR010: "ruseFcltSpot",// inout은 yn 만 사용해야 함으로 해당 코드는 사용안함.
|
||||
WR011: "pplQulity",
|
||||
WR012: "pplLenght",
|
||||
WR013: "bdstFilterYn", // 사용 불가 yn만 사용해야함으로 해당코드 사용 안함
|
||||
WR014: "rainRswtMng", // 지도점검 등록 시변경
|
||||
WR015: "rainFcltFlowRate", //지도점검 등록 시변경
|
||||
WR016: "dmdUszCd", // 지도점검 등록 시변경
|
||||
WR017: "sewageInFcltUse", //하수재이용 장내
|
||||
WR018: "sewageOutFclttUse", // 하수재이용 장외
|
||||
WR019: "htdPowerMthdCd",
|
||||
WR020: "htdUtztnUsgCd",
|
||||
};
|
||||
export const getCommonUpCd = async (set:any) => {
|
||||
|
||||
try {
|
||||
let lwCdCode :Record<string, SelectDataType[]> = {};
|
||||
const upCd = await getFetchWithCount(
|
||||
fetchType.LOCAL,
|
||||
"/cms-service/api/v1/up-codes?keyword=&upCd=&cdSe=&useYn=Y&siteId=WR&page=0&size=100&sort=string"
|
||||
);
|
||||
|
||||
const upWrCode: string[] = upCd.content
|
||||
.filter((item: any) => item.upCd.slice(0, 2) === "WR")
|
||||
.map((cd: any) => cd.upCd);
|
||||
|
||||
await Promise.all(
|
||||
upWrCode.map(async (cd) => {
|
||||
const mapping = codeMApping[cd as keyof typeof codeMApping];
|
||||
if (!mapping) return;
|
||||
|
||||
const lwCd = await getFetchWithCount(
|
||||
fetchType.LOCAL,
|
||||
`/cms-service/api/v1/lwpo-cds/up-cd/${cd}`
|
||||
);
|
||||
|
||||
const list = Array.isArray(lwCd) ? lwCd : lwCd.content ?? [];
|
||||
|
||||
lwCds[mapping] = list.map((it: any) => ({
|
||||
text: it.lwpoCdNm,
|
||||
val: it.lwpoCd,
|
||||
}));
|
||||
})
|
||||
);
|
||||
lwCdCode=lwCds
|
||||
set((state: comCodeState) => ({
|
||||
code: {
|
||||
...state.code,
|
||||
rainFcltCd: lwCdCode['rainFcltCd']??[],
|
||||
bdstUsgCd: lwCdCode['bdstUsgCd']??[] ,
|
||||
orgwtKndCd: lwCdCode['orgwtKndCd']??[] ,
|
||||
pplQulity: lwCdCode['pplQulity']??[] ,
|
||||
pplLenght: lwCdCode['pplLenght']??[] ,
|
||||
dmdUszCd: lwCdCode['dmdUszCd']??[] ,
|
||||
ruseMngMtd: lwCdCode['ruseMngMtd']??[],
|
||||
rusePrcsMthdCd: lwCdCode['rusePrcsMthdCd']??[],
|
||||
erctUswtrPrcsMeth: lwCdCode['erctUswtrPrcsMeth']??[],
|
||||
bdstGrntchClass: lwCdCode['bdstGrntchClass']??[],
|
||||
htdPowerMthdCd: lwCdCode['htdPowerMthdCd']??[],
|
||||
htdUtztnUsgCd: lwCdCode['htdUtztnUsgCd']??[],
|
||||
rswtBdstType:lwCdCode['rswtBdstType']??[] ,
|
||||
},
|
||||
}));
|
||||
}catch(e){
|
||||
console.log('com code error ', e)
|
||||
}
|
||||
|
||||
};
|
||||
//물재이용 주소 코드: devU01TX0FVVEgyMDI1MDgyNTEwMzkwNDExNjEwNTM=
|
||||
export const buildingType = {
|
||||
RST: "RST",
|
||||
@@ -172,7 +252,7 @@ export type comCodeState = {
|
||||
bdstFilterYn: SelectDataType[];
|
||||
bdstIncenYn: SelectDataType[];
|
||||
bdstGrntchClass: SelectDataType[];
|
||||
rswtPrscCdMthdCd: SelectDataType[];
|
||||
// rswtPrscCdMthdCd: SelectDataType[];
|
||||
htdPowerMthdCd: SelectDataType[];
|
||||
htdUtztnUsgCd: SelectDataType[];
|
||||
rswtBdstType:SelectDataType[];
|
||||
@@ -202,13 +282,13 @@ export const comCodeStateExport: comCodeState = {
|
||||
buildingType: buildingType,
|
||||
ruseMngMtd: lwCds['ruseMngMtd']??[],
|
||||
ruseSeCd: ruseSeCd,
|
||||
ruseBizMthdCd: lwCds['ruseBizMthdCd']??[],
|
||||
ruseBizMthdCd: ruseBizMthdCd,
|
||||
rusePrcsMthdCd: lwCds['rusePrcsMthdCd']??[],
|
||||
erctUswtrPrcsMeth: lwCds['erctUswtrPrcsMeth']??[],
|
||||
bdstFilterYn: bdstFilterYn,
|
||||
bdstIncenYn: bdstIncenYn,
|
||||
bdstGrntchClass: lwCds['bdstGrntchClass']??[],
|
||||
rswtPrscCdMthdCd: rswtPrscCdMthdCd, // 공단연락오면 바꿔야함
|
||||
// rswtPrscCdMthdCd: rswtPrscCdMthdCd, // 공단연락오면 바꿔야함
|
||||
htdPowerMthdCd: lwCds['htdPowerMthdCd']??[],
|
||||
htdUtztnUsgCd: lwCds['htdUtztnUsgCd']??[],
|
||||
userSiSggCd: laeSecd,
|
||||
|
||||
@@ -167,7 +167,7 @@ export const ruseCaseHeadListExport: TableUpperProps[] = [
|
||||
},
|
||||
{
|
||||
id: "grnteWqPh",
|
||||
title: "수소이온농도(ph)",
|
||||
title: "수소이온농도(pH)",
|
||||
visible: true,
|
||||
row: 1,
|
||||
},
|
||||
|
||||
@@ -189,7 +189,7 @@ export const excelToRainChkData = (excelData: any, year: string) => {
|
||||
|
||||
rain.rainyDetails?.forEach((key) => {
|
||||
if (key.ph?.length > 1 && isInvalidNumber(key.ph)) {
|
||||
issues.push(defaultMessage + `PH: 숫자 형식 아님 /입력값:${key.ph}`);
|
||||
issues.push(defaultMessage + `pH: 숫자 형식 아님 /입력값:${key.ph}`);
|
||||
}
|
||||
if (key.trbt?.length > 1 && isInvalidNumber(key.trbt)) {
|
||||
issues.push(
|
||||
|
||||
@@ -152,7 +152,7 @@ export const rainChkgdnHeadListExport: TableUpperProps[] = [
|
||||
{ id: "totalRuseFcltUtztnQnt", title: "연간빗물이용량(m³)" },
|
||||
{
|
||||
id: "ph",
|
||||
title: "수소이온농도(ph)",
|
||||
title: "수소이온농도(pH)",
|
||||
upName: "useQuilty",
|
||||
upSequnce: 1,
|
||||
type: "number",
|
||||
|
||||
@@ -168,7 +168,7 @@ export const rswtChkHeadListExport: TableUpperProps[] = [
|
||||
{ id: "crmty", title: "색도(도)", upName: "useQuilty", upSequnce: 6 ,type: "number"},
|
||||
{ id: "tn", title: "총질소(T-N)(mg/L)", upName: "useQuilty", upSequnce: 7 ,type: "number"},
|
||||
{ id: "tph", title: "총인(T-P)(mg/L)", upName: "useQuilty", upSequnce: 8 ,type: "number"},
|
||||
{ id: "ph", title: "수소이온농도(ph)", upName: "useQuilty", upSequnce: 9,type: "text" },
|
||||
{ id: "ph", title: "수소이온농도(pH)", upName: "useQuilty", upSequnce: 9,type: "text" },
|
||||
{ id: "clIonQnt", title: "염화물(mg/L)", upName: "useQuilty", upSequnce: 10 ,type: "number"},
|
||||
|
||||
{
|
||||
@@ -238,7 +238,7 @@ export const rswtChkHeadListExport: TableUpperProps[] = [
|
||||
},
|
||||
{ id: "tn", title: "T-N", upName: "detailQulity", upSequnce: 8, edit: true },
|
||||
{ id: "tph", title: "T-P", upName: "detailQulity", upSequnce: 9, edit: true },
|
||||
{ id: "ph", title: "PH", upName: "detailQulity", upSequnce: 10, edit: true },
|
||||
{ id: "ph", title: "pH", upName: "detailQulity", upSequnce: 10, edit: true },
|
||||
{
|
||||
id: "clIonQnt",
|
||||
title: "염화물",
|
||||
|
||||
@@ -15,7 +15,7 @@ export const rainChkgdnHeadSttnExport: TableUpperProps[] = [
|
||||
{ id: "totalRuseFcltUtztnQnt", title: "연간빗물이용량(m³)" },
|
||||
{
|
||||
id: "ph",
|
||||
title: "수소이온농도(ph)",
|
||||
title: "수소이온농도(pH)",
|
||||
upName: "useQuilty",
|
||||
upSequnce: 1,
|
||||
type: "number",
|
||||
@@ -153,7 +153,7 @@ export const rswtDetailHeadListExport: TableUpperProps[] = [
|
||||
upName: "detailQulity",
|
||||
upSequnce: 9,
|
||||
},
|
||||
{ id: "ph", title: "PH", upName: "detailQulity", upSequnce: 10 },
|
||||
{ id: "ph", title: "pH", upName: "detailQulity", upSequnce: 10 },
|
||||
{
|
||||
id: "clIonQnt",
|
||||
title: "염화물",
|
||||
|
||||
@@ -64,7 +64,7 @@ export const rswtChkSttnHeadListExport: TableUpperProps[] = [
|
||||
upSequnce: 8,
|
||||
type: "number",
|
||||
},
|
||||
{ id: "ph", title: "수소이온농도(ph)", upName: "useQuilty", upSequnce: 9, type: "text" },
|
||||
{ id: "ph", title: "수소이온농도(pH)", upName: "useQuilty", upSequnce: 9, type: "text" },
|
||||
{
|
||||
id: "clIonQnt",
|
||||
title: "염화물(mg/L)",
|
||||
@@ -132,7 +132,7 @@ export const rswtDetailSttnHeadListExport: TableUpperProps[] = [
|
||||
},
|
||||
{ id: "tn", title: "T-N", upName: "detailQulity", upSequnce: 8},
|
||||
{ id: "tph", title: "T-P", upName: "detailQulity", upSequnce: 9 },
|
||||
{ id: "ph", title: "PH", upName: "detailQulity", upSequnce: 10 },
|
||||
{ id: "ph", title: "pH", upName: "detailQulity", upSequnce: 10 },
|
||||
{
|
||||
id: "clIonQnt",
|
||||
title: "염화물",
|
||||
|
||||
@@ -461,7 +461,7 @@ export const ruseGuranteeHeadListExport: TableUpperProps[] = [
|
||||
{ id: "crmty", title: "색도(도)", visible: true },
|
||||
{ id: "tn", title: "총질소(mg/L)", visible: true },
|
||||
{ id: "tph", title: "총인(mg/L)", visible: true },
|
||||
{ id: "ph", title: "수소이온농도(ph)", visible: true },
|
||||
{ id: "ph", title: "수소이온농도(pH)", visible: true },
|
||||
{ id: "clIonQnt", title: "염화물(mg/L)", visible: true },
|
||||
{ id: "cdtnv", title: "전기전도도(μs/cm)", visible: true },
|
||||
];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { SelectDataType } from "@common/business_components/ui";
|
||||
import type { customRainBdst } from "../../fcltReg/rainReg";
|
||||
import { bdstUsgCd } from "@/app/store/common/code/basicCode";
|
||||
import { lwCds } from "@/app/store/common/code";
|
||||
//TODO: 공통코드시 삭제되니 수정 해야됨
|
||||
export const excelRainSttnParsing = (
|
||||
excel: { data: customRainBdst[] },
|
||||
@@ -16,7 +16,7 @@ export const excelRainSttnParsing = (
|
||||
sggCode.find((sgg) => sgg.val === item.sggCd?.toString())?.text ?? "",
|
||||
item.bdstNm ?? "",
|
||||
item.daddr ?? "",
|
||||
bdstUsgCd.find((cd) => cd.val === item.reuseBuilding?.[0]?.bdstUsgCd.toString())?.text ?? "", //건축물용도
|
||||
lwCds?.bdstUsgCd?.find((cd) => cd.val === item.reuseBuilding?.[0]?.bdstUsgCd.toString())?.text ?? "", //건축물용도
|
||||
String(item.frstArchPrmsnDt ?? ""),
|
||||
String(item.archArea.split('.')[0] === '-1' ? '확인불가' : item.archArea.split('.')[0]),
|
||||
String(item.chgBuilding.length > 0 ? "Y" : "N"),
|
||||
|
||||
@@ -445,7 +445,7 @@ export const rainSttnDetailNodeListExport:CommonTableProps[] = [
|
||||
rowSpan: 1,
|
||||
colSpan: 4
|
||||
},
|
||||
{ id: "ph", title: "PH",
|
||||
{ id: "ph", title: "pH",
|
||||
visible: true,
|
||||
row: 2,
|
||||
rowSpan: 1,
|
||||
@@ -524,7 +524,7 @@ export const rainSttnDetailHeadListExport:CommonTableProps[] = [
|
||||
colSpan: 1
|
||||
},
|
||||
|
||||
{ id: "ph", title: "PH",
|
||||
{ id: "ph", title: "pH",
|
||||
visible: true,
|
||||
row: 1,
|
||||
rowSpan: 1,
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
import { bdstUsgCd } from "@/app/store/common/code/basicCode";
|
||||
import type { SelectDataType } from "@common/business_components/ui";
|
||||
import type { customRswtBdst } from "../../fcltReg/rswtReg";
|
||||
|
||||
|
||||
export const excelRSwtSttnParsing = (
|
||||
excel: { data: customRswtBdst[] },
|
||||
sidoCode: SelectDataType[],
|
||||
sggCode: SelectDataType[]
|
||||
code: Record<string,SelectDataType[]>
|
||||
): string[][] => {
|
||||
const excelExportData: string[][] = [];
|
||||
excel.data.forEach((item) => {
|
||||
console.log("item", item)
|
||||
excelExportData.push([
|
||||
sidoCode.find((sido) => sido.val === item.ctpvCd.toString())?.text ?? "",
|
||||
sggCode.find((sgg) => sgg.val === item.sggCd.toString())?.text ?? "",
|
||||
code.sidoCode?.find((sido) => sido.val === item.ctpvCd.toString())?.text ?? "",
|
||||
code.sggCode?.find((sgg) => sgg.val === item.sggCd.toString())?.text ?? "",
|
||||
item.bdstNm ?? "",
|
||||
item.daddr ?? "",
|
||||
bdstUsgCd.find((cd)=> cd.val === item.reuseBuilding?.[0]?.bdstUsgCd.toString())?.text ?? "", //건축물용도
|
||||
code?.bdstUsgCd?.find((cd)=> cd.val === item.reuseBuilding?.[0]?.bdstUsgCd.toString())?.text ?? "", //건축물용도
|
||||
String(item.frstArchPrmsnDt ?? ""),
|
||||
String(item.archArea.split('.')[0] === '-1' ? '확인불가' : item.archArea.split('.')[0]),
|
||||
// String(item.reuseBuilding?.[0]?.rswtrObj.wtrUsqty ?? "0"), //물사용량
|
||||
|
||||
@@ -31,8 +31,7 @@ export type rswtSttnState = {
|
||||
|
||||
type rswtSttnActions = {
|
||||
rswtSttnInit: (isExcel: boolean, page: number, total: number, con: string, txt: string,
|
||||
sidoCode: SelectDataType[],
|
||||
sggCode: SelectDataType[]) => void;
|
||||
code: Record<string,SelectDataType[]>) => void;
|
||||
rswtSttnSearch: (isExcel: boolean, page: number, total: number, con: string, txt: string,
|
||||
sidoCode: SelectDataType[],
|
||||
sggCode: SelectDataType[]) => void;
|
||||
@@ -60,9 +59,7 @@ export const rswtSttnActionsExport: (set: any) => rswtSttnActions = (
|
||||
set: any
|
||||
) => {
|
||||
return {
|
||||
rswtSttnInit: async (isExcel: boolean, page: number, total: number, con: string, txt: string,
|
||||
sidoCode: SelectDataType[],
|
||||
sggCode: SelectDataType[]) => {
|
||||
rswtSttnInit: async (isExcel: boolean, page: number, total: number, con: string, txt: string, code: Record<string,SelectDataType[]>) => {
|
||||
try {
|
||||
const rswtSttnRes = await getFetchWithCount(
|
||||
fetchType.WR,
|
||||
@@ -73,17 +70,17 @@ export const rswtSttnActionsExport: (set: any) => rswtSttnActions = (
|
||||
(txt ? `/${txt}` : "")
|
||||
);
|
||||
if (isExcel) {
|
||||
const rswtExcel = excelRSwtSttnParsing(rswtSttnRes, sidoCode, sggCode);
|
||||
set((state: rswtSttnState) => {
|
||||
return {
|
||||
...state,
|
||||
rswtSttn: {
|
||||
...state.rswtSttn,
|
||||
excelList: rswtExcel,
|
||||
},
|
||||
};
|
||||
});
|
||||
} else
|
||||
const rswtExcel = excelRSwtSttnParsing(rswtSttnRes, code);
|
||||
set((state: rswtSttnState) => {
|
||||
return {
|
||||
...state,
|
||||
rswtSttn: {
|
||||
...state.rswtSttn,
|
||||
excelList: rswtExcel,
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
set((state: rswtSttnState) => {
|
||||
|
||||
return {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { comCodeState } from "@/app/store/common/code";
|
||||
import { lwCds } from "@/app/store/common/code/basicCode";
|
||||
import { lwCds, type comCodeState } from "@/app/store/common/code";
|
||||
import {
|
||||
filePickedBlob,
|
||||
filePickedBlobArray,
|
||||
@@ -34,12 +33,11 @@ export const getCity = (val: string, sggCd: SelectDataType[]) => {
|
||||
// cd text 넣기
|
||||
export const tableData = (data: any, code: comCodeState) => {
|
||||
const chCode = code.code;
|
||||
|
||||
return data?.map(
|
||||
(item: {
|
||||
sggCd: string;
|
||||
ctpvCd: string;
|
||||
reuseBuilding: { lawTrgtYn: any; bdstUsgCd: any }[];
|
||||
reuseBuilding: { lawTrgtYn: string; bdstUsgCd: string ,grntchBdstCertGrd:string}[];
|
||||
}) => {
|
||||
let returnData = {};
|
||||
const sggText = chCode.sggCd.find(
|
||||
@@ -49,16 +47,25 @@ export const tableData = (data: any, code: comCodeState) => {
|
||||
(cd) => cd.val === String(item.ctpvCd).trim()
|
||||
)?.text;
|
||||
if (item?.reuseBuilding?.length > 0) {
|
||||
const bdsgUsgText = chCode.bdstUsgCd.find(
|
||||
(cd) => Number(cd.val) === item?.reuseBuilding[0]?.bdstUsgCd
|
||||
|
||||
const bdsgUsgText = chCode?.bdstTotalUsgType?.find(
|
||||
(cd) => cd.val === item?.reuseBuilding[0]?.bdstUsgCd
|
||||
)?.text;
|
||||
|
||||
const lawTrgtYn = item?.reuseBuilding[0]?.lawTrgtYn;
|
||||
|
||||
|
||||
const grntchBdstCertGrdText =chCode?.bdstGrntchClass?.find(
|
||||
(cd) => cd.val === item?.reuseBuilding[0]?.grntchBdstCertGrd
|
||||
)?.text;
|
||||
|
||||
returnData = {
|
||||
...item,
|
||||
sggText: sggText ?? "없음",
|
||||
cityText: cityText ?? "없음",
|
||||
bdsgUsgText: bdsgUsgText,
|
||||
lawTrgtYn: lawTrgtYn,
|
||||
grntchBdstCertGrdText:grntchBdstCertGrdText
|
||||
};
|
||||
} else {
|
||||
returnData = {
|
||||
|
||||
@@ -197,7 +197,7 @@ export const getOverLayObj = (fclType: string, data: any,code?:any) => {
|
||||
newObj = {
|
||||
건물용도: code?.bdstUsgCd.find((item) => item.val===String(data?.reuseBuilding[0].bdstUsgCd) )?.text ?? '확인불가',
|
||||
설치완료일: data?.reuseBuilding[0]?.instlCmptnDt ?? '확인불가',
|
||||
"주요 처리공정": code?.rswtPrscCdMthdCd.find((item) => item.val===data?.reuseBuilding[0]?.rswtrObj.filtrTrtmfctProcs)?.text ?? '확인불가',
|
||||
"주요 처리공정": data?.reuseBuilding[0]?.rswtrObj.filtrTrtmfctProcs ?? '확인불가',
|
||||
원수종류: code?.orgwtKndCd.find((item) => item.val === data?.reuseBuilding[0]?.rswtrObj.orgwtKndCd)?.text ?? '확인불가',
|
||||
//이용용도: isCode.filtrTrtmfctUsgCd data?.reuseBuilding[0]?.rswtrObj.altUswtrKndCd ?? '확인불가',
|
||||
};
|
||||
|
||||
+1
-1
@@ -460,7 +460,7 @@ export function BuseWaterQulity({
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-8">
|
||||
<Label className="text-xl">수소이온농도(ph)</Label>
|
||||
<Label className="text-xl">수소이온농도(pH)</Label>
|
||||
<div className="flex flex-row items-center gap-2">
|
||||
<Input
|
||||
className="!text-xl w-28"
|
||||
|
||||
-1
@@ -97,7 +97,6 @@ export default function MngRegFormDetail({
|
||||
const potentialOptions = formHead.selectData
|
||||
? code[formHead.selectData as keyof typeof code]
|
||||
: [];
|
||||
|
||||
return (
|
||||
<SelectBox
|
||||
label={""}
|
||||
|
||||
@@ -10,7 +10,7 @@ import { formH1Class, formH2Class } from "@/components/lib/class/comClass";
|
||||
import {
|
||||
confirmToast,
|
||||
formatCommaNumber,
|
||||
handleMinusNumberChange
|
||||
handleMinusNumberChange,
|
||||
} from "@/components/lib/func/commom";
|
||||
import {
|
||||
DatePicker,
|
||||
@@ -34,21 +34,18 @@ export default function RswtrRegForm({
|
||||
isModal,
|
||||
setIsModal,
|
||||
readonly = false,
|
||||
isMap
|
||||
isMap,
|
||||
}: {
|
||||
rswtForm: customRswtBdst;
|
||||
isModal: boolean;
|
||||
setIsModal?: (isModal: boolean) => void;
|
||||
readonly?: boolean;
|
||||
isMap?: boolean;
|
||||
|
||||
}) {
|
||||
const { code, rswtBdstUpdate, rswtBdstReg } = useWrStore(
|
||||
(state) => state
|
||||
);
|
||||
const { code, rswtBdstUpdate, rswtBdstReg } = useWrStore((state) => state);
|
||||
// const [divStyle, setDivStyle] = useState("h-[53vh]");
|
||||
useEffect(() => {
|
||||
if(isMap){
|
||||
if (isMap) {
|
||||
}
|
||||
}, [isMap]);
|
||||
// const defaultValues: z.infer<typeof rswtZod> = rswtZod.parse({});
|
||||
@@ -64,29 +61,30 @@ export default function RswtrRegForm({
|
||||
"reuseBuilding.0.rswtrObj.filtrTrtmfctProcs",
|
||||
]);
|
||||
|
||||
const { t } = useTranslation('base');
|
||||
const { t } = useTranslation("base");
|
||||
const onSubmit = (values: z.infer<typeof rswtZod>) => {
|
||||
if (isModal) {
|
||||
const handleConfirm = async () => {
|
||||
rswtBdstReg(values, "41");
|
||||
if (setIsModal) setIsModal(false);
|
||||
};
|
||||
confirmToast(t('isInsertMsg'), handleConfirm);
|
||||
|
||||
confirmToast(t("isInsertMsg"), handleConfirm);
|
||||
} else {
|
||||
const handleConfirm = async () => {
|
||||
rswtBdstUpdate(values, "41");
|
||||
};
|
||||
confirmToast(t('isUpdateMsg'), handleConfirm);
|
||||
confirmToast(t("isUpdateMsg"), handleConfirm);
|
||||
}
|
||||
};
|
||||
|
||||
const filtrTrtmfctCpct = form.watch('reuseBuilding.0.rswtrObj.filtrTrtmfctCpct')
|
||||
const filtrTrtmfctCpct = form.watch(
|
||||
"reuseBuilding.0.rswtrObj.filtrTrtmfctCpct"
|
||||
);
|
||||
const cleanRswtData = (raw: any): z.infer<typeof rswtZod> => {
|
||||
const buildings =
|
||||
raw?.reuseBuilding && raw.reuseBuilding.length > 0
|
||||
? raw.reuseBuilding
|
||||
: [{}];
|
||||
raw?.reuseBuilding && raw.reuseBuilding.length > 0
|
||||
? raw.reuseBuilding
|
||||
: [{}];
|
||||
return {
|
||||
...raw,
|
||||
frstArchPrmsnDt: raw?.frstArchPrmsnDt
|
||||
@@ -95,20 +93,21 @@ export default function RswtrRegForm({
|
||||
archChgPrmsnDt: raw?.archChgPrmsnDt
|
||||
? new Date(raw?.archChgPrmsnDt)
|
||||
: null,
|
||||
reuseBuilding:buildings.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 || 'N', // null → "Y"
|
||||
grntchBdstCertYn: item?.grntchBdstCertYn ||'N',
|
||||
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,
|
||||
filtrTrtmfctCpct: item?.rswtrObj?.filtrTrtmfctCpct ?? null,
|
||||
filtrTrtmfctProcs: item?.rswtrObj?.filtrTrtmfctProcs || code.rswtPrscCdMthdCd[0]?.val,
|
||||
filtrTrtmfctProcs:
|
||||
item?.rswtrObj?.filtrTrtmfctProcs||'',
|
||||
orgwtKndCd: item?.rswtrObj?.orgwtKndCd || code.orgwtKndCd[0]?.val,
|
||||
},
|
||||
})),
|
||||
@@ -118,8 +117,8 @@ export default function RswtrRegForm({
|
||||
// console.log(' formform ', form.watch())
|
||||
// },[form.formState])
|
||||
useEffect(() => {
|
||||
console.log(' filtrTrtmfctCpct ', filtrTrtmfctCpct)
|
||||
}, [filtrTrtmfctCpct])
|
||||
console.log(" filtrTrtmfctCpct ", filtrTrtmfctCpct);
|
||||
}, [filtrTrtmfctCpct]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("form errors:", form.formState.errors);
|
||||
@@ -133,7 +132,6 @@ export default function RswtrRegForm({
|
||||
form.setValue("reuseBuilding.0.instlCstSprtAmt", 0);
|
||||
}
|
||||
|
||||
|
||||
if (grntchBdstCertYn === "D") {
|
||||
form.setValue("reuseBuilding.0.grntchBdstCertYr", "0000");
|
||||
form.setValue("reuseBuilding.0.grntchBdstCertNo", "확인불가");
|
||||
@@ -141,7 +139,6 @@ export default function RswtrRegForm({
|
||||
} else if (instlCstSprtYn === "D") {
|
||||
form.setValue("reuseBuilding.0.instlCstSprtAmt", -1);
|
||||
}
|
||||
|
||||
}, [grntchBdstCertYn, instlCstSprtYn, filtrTrtmfctProcs, form]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -149,7 +146,11 @@ export default function RswtrRegForm({
|
||||
}, [rswtForm, form]);
|
||||
|
||||
|
||||
useEffect(() =>{
|
||||
console.log('code orgin ', code)
|
||||
|
||||
console.log('code ', code.orgwtKndCd)
|
||||
},[code])
|
||||
|
||||
return (
|
||||
<div className="!mx-[1.6rem] !p-0r">
|
||||
@@ -176,335 +177,343 @@ export default function RswtrRegForm({
|
||||
</div>
|
||||
</div>
|
||||
{/* <ScrollArea className={divStyle}> */}
|
||||
{isModal && rswtForm != undefined ? <BdstReg form={form} /> : <></>}
|
||||
{isModal ? (
|
||||
<h1 className="pl-3 text-xl col-span-10 mt-4 ">
|
||||
중수도 시설 정보{" "}
|
||||
</h1>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
<h1 className={formH1Class}>기본정보</h1>
|
||||
<div className="grid grid-cols-4 gap-2 mt-4">
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCmptnDt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치완료일">
|
||||
<DatePicker
|
||||
mode="single"
|
||||
field={{
|
||||
value:
|
||||
field.value && !isNaN(new Date(field.value).getTime())
|
||||
? new Date(field.value)
|
||||
: new Date(), // Provide a default Date value
|
||||
onChange: (date) => field.onChange(date),
|
||||
{isModal && rswtForm != undefined ? <BdstReg form={form} /> : <></>}
|
||||
{isModal ? (
|
||||
<h1 className="pl-3 text-xl col-span-10 mt-4 ">
|
||||
중수도 시설 정보{" "}
|
||||
</h1>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
<h1 className={formH1Class}>기본정보</h1>
|
||||
<div className="grid grid-cols-4 gap-2 mt-4">
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCmptnDt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치완료일">
|
||||
<DatePicker
|
||||
mode="single"
|
||||
field={{
|
||||
value:
|
||||
field.value && !isNaN(new Date(field.value).getTime())
|
||||
? new Date(field.value)
|
||||
: new Date(), // Provide a default Date value
|
||||
onChange: (date) => field.onChange(date),
|
||||
}}
|
||||
selectClass={"w-full"}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCst"
|
||||
render={({ field }) => {
|
||||
const value = field.value;
|
||||
const isUnknown = value === null || value === -1; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="설치비(원)">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
value={
|
||||
isUnknown ? "확인불가" : formatCommaNumber(value)
|
||||
}
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
handleMinusNumberChange(e, field.onChange);
|
||||
}}
|
||||
selectClass={"w-full"}
|
||||
readOnly={readonly}
|
||||
maxLength={numSize}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCst"
|
||||
render={({ field }) => {
|
||||
const value = field.value;
|
||||
const isUnknown = value === null || value === -1; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="설치비(원)">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
value={
|
||||
isUnknown ? "확인불가" : formatCommaNumber(value)
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className=" my-4">
|
||||
<h1 className={formH1Class}>중수도 시설 정보</h1>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 gap-1 mt-4">
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rswtrObj.filtrTrtmfctCpct"
|
||||
render={({ field }) => {
|
||||
const value = field.value;
|
||||
const isUnknown = value === null || value === -1; // 또는 Number(value) === -1
|
||||
|
||||
return (
|
||||
<FormUi label="처리시설 용량(m³)">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder=""
|
||||
type="text"
|
||||
value={
|
||||
isUnknown ? "확인불가" : formatCommaNumber(value)
|
||||
}
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
console.log("value");
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
handleMinusNumberChange(e, field.onChange);
|
||||
}}
|
||||
readOnly={readonly}
|
||||
maxLength={numSize}
|
||||
/>
|
||||
</FormUi>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
}}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
handleMinusNumberChange(e, field.onChange);
|
||||
}}
|
||||
readOnly={readonly}
|
||||
maxLength={numSize}
|
||||
/>
|
||||
</FormUi>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className=" my-4">
|
||||
<h1 className={formH1Class}>중수도 시설 정보</h1>
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rswtrObj.orgwtKndCd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="원수 종류">
|
||||
<SelectBox
|
||||
className={""}
|
||||
label={""}
|
||||
selectClass={selectClass}
|
||||
selectArray={code.orgwtKndCd}
|
||||
onSelectValue={readonly ? () => {} : field.onChange}
|
||||
value={field.value ?? code.orgwtKndCd[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rswtrObj.filtrTrtmfctProcs"
|
||||
render={({ field }) => (
|
||||
<FormUi label="주요처리공정">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="ab1234678"
|
||||
type=""
|
||||
value={field.value ?? ""}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
|
||||
<div className="grid grid-cols-12 gap-1 mt-4">
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rswtrObj.filtrTrtmfctCpct"
|
||||
render={({ field }) => {
|
||||
const value = field.value;
|
||||
const isUnknown = value === null || value === -1; // 또는 Number(value) === -1
|
||||
field.onChange(e.target.value);
|
||||
}}
|
||||
maxLength={txtSize}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
return (
|
||||
<FormUi label="처리시설 용량(m³)">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder=""
|
||||
type="text"
|
||||
value={
|
||||
isUnknown ? "확인불가" : formatCommaNumber(value)
|
||||
<div className=" my-2">
|
||||
<h1 className={formH1Class}>인센티브 정보</h1>
|
||||
</div>
|
||||
<div>
|
||||
<h2 className={formH2Class}>설치비(원) 지원</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-2 gap-2 mt-4">
|
||||
<div className="col-span-1">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCstSprtYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치비(원) 지원여부">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.bdstIncenYn}
|
||||
onSelectValue={readonly ? () => {} : field.onChange}
|
||||
value={field.value || code.bdstIncenYn[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-1">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCstSprtAmt"
|
||||
render={({ field }) => {
|
||||
const value = field.value;
|
||||
const isUnknown = value === null || value === -1; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="지원금액(원)">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder=""
|
||||
type="text"
|
||||
readOnly={readonly || isUnknown}
|
||||
value={
|
||||
isUnknown ? "확인불가" : formatCommaNumber(value)
|
||||
}
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
}}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
handleMinusNumberChange(e, field.onChange);
|
||||
}}
|
||||
disabled={
|
||||
instlCstSprtYn === "N" || instlCstSprtYn === "D"
|
||||
}
|
||||
maxLength={numSize}
|
||||
/>
|
||||
</FormUi>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
console.log('value')
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
handleMinusNumberChange(e, field.onChange);
|
||||
}}
|
||||
readOnly={readonly}
|
||||
maxLength={numSize}
|
||||
/>
|
||||
</FormUi>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rswtrObj.orgwtKndCd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="원수 종류">
|
||||
<SelectBox
|
||||
className={""}
|
||||
label={""}
|
||||
selectClass={selectClass}
|
||||
selectArray={code.orgwtKndCd}
|
||||
onSelectValue={readonly ? () => { } : field.onChange}
|
||||
value={field.value ?? code.orgwtKndCd[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rswtrObj.filtrTrtmfctProcs"
|
||||
render={({ field }) => (
|
||||
<FormUi label="주요처리공정">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.rswtPrscCdMthdCd}
|
||||
onSelectValue={readonly ? () => { } : field.onChange}
|
||||
value={field.value || code.rswtPrscCdMthdCd[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<h2 className={formH2Class}>녹색건축물 인증</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-6 gap-2 mt-4">
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증여부">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.bdstIncenYn}
|
||||
onSelectValue={readonly ? () => {} : field.onChange}
|
||||
value={field.value || code.yn[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className=" my-2">
|
||||
<h1 className={formH1Class}>인센티브 정보</h1>
|
||||
</div>
|
||||
<div>
|
||||
<h2 className={formH2Class}>설치비(원) 지원</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-2 gap-2 mt-4">
|
||||
<div className="col-span-1">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCstSprtYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치비(원) 지원여부">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.bdstIncenYn}
|
||||
onSelectValue={readonly ? () => { } : field.onChange}
|
||||
value={field.value || code.bdstIncenYn[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-1">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCstSprtAmt"
|
||||
render={({ field }) => {
|
||||
const value = field.value;
|
||||
const isUnknown = value === null || value === -1; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="지원금액(원)">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder=""
|
||||
type="text"
|
||||
readOnly={readonly || isUnknown}
|
||||
value={
|
||||
isUnknown ? "확인불가" : formatCommaNumber(value)
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertYr"
|
||||
render={({ field }) => {
|
||||
const isUnknown =
|
||||
field.value === null || field.value === "0000"; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="인증년도">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="2024"
|
||||
type=""
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
handleMinusNumberChange(e, field.onChange);
|
||||
}}
|
||||
disabled={instlCstSprtYn === "N" || instlCstSprtYn === "D"}
|
||||
maxLength={numSize}
|
||||
/>
|
||||
</FormUi>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2 className={formH2Class}>녹색건축물 인증</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-6 gap-2 mt-4">
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증여부">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.bdstIncenYn}
|
||||
onSelectValue={readonly ? () => { } : field.onChange}
|
||||
value={field.value || code.yn[0]?.val}
|
||||
readOnly={readonly}
|
||||
}}
|
||||
value={isUnknown ? "확인불가" : (field.value ?? "")}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
if (e.target.value === "확인불가") {
|
||||
field.onChange("0000");
|
||||
} else {
|
||||
field.onChange(e.target.value);
|
||||
}
|
||||
}}
|
||||
disabled={
|
||||
grntchBdstCertYn == "N" || grntchBdstCertYn == "D"
|
||||
}
|
||||
max={4}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertYr"
|
||||
render={({ field }) => {
|
||||
const isUnknown = field.value === null || field.value === "0000"; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="인증년도">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="2024"
|
||||
type=""
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
value={
|
||||
isUnknown ? '확인불가' : field.value ?? ""}
|
||||
onChange={(e) => {
|
||||
if (readonly) return
|
||||
if (e.target.value === '확인불가') {
|
||||
field.onChange('0000');
|
||||
} else {
|
||||
field.onChange(e.target.value);
|
||||
}
|
||||
}}
|
||||
disabled={grntchBdstCertYn == "N" || grntchBdstCertYn == "D"}
|
||||
max={4}
|
||||
/>
|
||||
</FormUi>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertNo"
|
||||
render={({ field }) => {
|
||||
const isUnknown = field.value === null || field.value === "0000"; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="인증번호">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="ab1234678"
|
||||
type=""
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
value={
|
||||
isUnknown ? '확인불가' : field.value ?? ""}
|
||||
onChange={(e) => {
|
||||
if (readonly) return
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertNo"
|
||||
render={({ field }) => {
|
||||
const isUnknown =
|
||||
field.value === null || field.value === "0000"; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="인증번호">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="ab1234678"
|
||||
type=""
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
value={isUnknown ? "확인불가" : (field.value ?? "")}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
|
||||
if (e.target.value === '확인불가') {
|
||||
field.onChange('');
|
||||
} else {
|
||||
field.onChange(e.target.value);
|
||||
}
|
||||
}}
|
||||
disabled={grntchBdstCertYn == "N" || grntchBdstCertYn == "D"}
|
||||
maxLength={txtSize}
|
||||
/>
|
||||
</FormUi>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertGrd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증등급">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.bdstGrntchClass}
|
||||
onSelectValue={readonly ? () => { } : field.onChange}
|
||||
value={field.value || code.bdstGrntchClass[0]?.val}
|
||||
readOnly={readonly}
|
||||
if (e.target.value === "확인불가") {
|
||||
field.onChange("");
|
||||
} else {
|
||||
field.onChange(e.target.value);
|
||||
}
|
||||
}}
|
||||
disabled={
|
||||
grntchBdstCertYn == "N" || grntchBdstCertYn == "D"
|
||||
}
|
||||
maxLength={txtSize}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<BdstAdd form={form} readonly={readonly}></BdstAdd>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertGrd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증등급">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.bdstGrntchClass}
|
||||
onSelectValue={readonly ? () => {} : field.onChange}
|
||||
value={field.value || code.bdstGrntchClass[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<BdstAdd form={form} readonly={readonly}></BdstAdd>
|
||||
{/* </ScrollArea> */}
|
||||
</form>
|
||||
</Form>
|
||||
|
||||
@@ -191,8 +191,7 @@ export function RainFacility({
|
||||
"1000000",
|
||||
String(con),
|
||||
seartchTxt ?? "",
|
||||
code.cityCd,
|
||||
code.sggCd
|
||||
code as unknown as Record<string, SelectDataType[]>
|
||||
);
|
||||
}
|
||||
}}
|
||||
@@ -249,8 +248,7 @@ export function RainFacility({
|
||||
String(rainMapSize),
|
||||
String(con),
|
||||
seartchTxt ?? "",
|
||||
code.cityCd,
|
||||
code.sggCd
|
||||
code as unknown as Record<string, SelectDataType[]>
|
||||
);
|
||||
|
||||
setIsReset(false);
|
||||
|
||||
@@ -187,8 +187,7 @@ export function RswtFacility({
|
||||
"1000000",
|
||||
String(con),
|
||||
seartchTxt ?? "",
|
||||
code.cityCd,
|
||||
code.sggCd
|
||||
code as unknown as Record<string, SelectDataType[]>
|
||||
);
|
||||
}
|
||||
}}
|
||||
@@ -236,8 +235,7 @@ export function RswtFacility({
|
||||
String(rainMapSize),
|
||||
String(con),
|
||||
seartchTxt ?? "",
|
||||
code.cityCd,
|
||||
code.sggCd
|
||||
code as unknown as Record<string, SelectDataType[]>
|
||||
);
|
||||
|
||||
setIsReset(false);
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user