fix: 하수관로 자체 입력 정보 undefeinde 에러 수정
This commit is contained in:
@@ -120,20 +120,20 @@ const BaseLayout = ({
|
||||
|
||||
setIsLoadingAreaData(true);
|
||||
try {
|
||||
const queryParamsZone = new URLSearchParams({
|
||||
lyrTypeNm: 'tb_ms_swage_prcs_zone',
|
||||
page: '0',
|
||||
size: '100000',
|
||||
sort: 'string',
|
||||
});
|
||||
const cqlFiltersZone: string[] = [];
|
||||
if (sigungu.val && sigungu.val !== '0') {
|
||||
// console.log("시군구 코드", sigungu.val);
|
||||
cqlFiltersZone.push(`sgg_cd='${sigungu.val}'`);
|
||||
}
|
||||
if (cqlFiltersZone.length > 0) {
|
||||
queryParamsZone.append('cqlFiter', cqlFiltersZone.join(' and '));
|
||||
}
|
||||
// const queryParamsZone = new URLSearchParams({
|
||||
// lyrTypeNm: 'tb_ms_swage_prcs_zone',
|
||||
// page: '0',
|
||||
// size: '100000',
|
||||
// sort: 'string',
|
||||
// });
|
||||
// const cqlFiltersZone: string[] = [];
|
||||
// if (sigungu.val && sigungu.val !== '0') {
|
||||
// // console.log("시군구 코드", sigungu.val);
|
||||
// cqlFiltersZone.push(`sgg_cd='${sigungu.val}'`);
|
||||
// }
|
||||
// if (cqlFiltersZone.length > 0) {
|
||||
// queryParamsZone.append('cqlFiter', cqlFiltersZone.join(' and '));
|
||||
// }
|
||||
|
||||
const queryParamsFacility = new URLSearchParams({
|
||||
lyrTypeNm: 'tb_il_swage_prcs_fclt',
|
||||
@@ -149,20 +149,20 @@ const BaseLayout = ({
|
||||
queryParamsFacility.append('cqlFiter', cqlFiltersFacility.join(' and ')); // API 명세에 따라 cqlFilter 또는 cqlFiter
|
||||
}
|
||||
|
||||
console.log("BaseLayout API URL for Zones:", `v1/fclts?${queryParamsZone.toString()}`);
|
||||
// console.log("BaseLayout API URL for Zones:", `v1/fclts?${queryParamsZone.toString()}`);
|
||||
console.log("BaseLayout API URL for Facilities:", `v1/fclts?${queryParamsFacility.toString()}`);
|
||||
|
||||
const [zoneRes, facilityRes] = await Promise.all([
|
||||
getData(`v1/fclts?${queryParamsZone.toString()}`),
|
||||
getData(`v1/fclts?${queryParamsFacility.toString()}`)
|
||||
]);
|
||||
|
||||
const zones = (zoneRes.data || []).map((item: any) => ({
|
||||
text: item.swtrmtZoneNm || item.name || `구역 ${item.id || item.gid || item.objectid}`,
|
||||
val: item.fid || item.id || item.gid || item.objectid
|
||||
}));
|
||||
setProcessingZoneOptions([defaultOption, ...zones]);
|
||||
console.log("BaseLayout Fetched Processing Zones:", [defaultOption, ...zones]);
|
||||
// const [zoneRes, facilityRes] = await Promise.all([
|
||||
// getData(`v1/fclts?${queryParamsZone.toString()}`),
|
||||
// getData(`v1/fclts?${queryParamsFacility.toString()}`)
|
||||
// ]);
|
||||
const facilityRes = await getData(`v1/fclts?${queryParamsFacility.toString()}`);
|
||||
// const zones = (zoneRes.data || []).map((item: any) => ({
|
||||
// text: item.swtrmtZoneNm || item.name || `구역 ${item.id || item.gid || item.objectid}`,
|
||||
// val: item.fid || item.id || item.gid || item.objectid
|
||||
// }));
|
||||
// setProcessingZoneOptions([defaultOption, ...zones]);
|
||||
// console.log("BaseLayout Fetched Processing Zones:", [defaultOption, ...zones]);
|
||||
|
||||
|
||||
const facilities = (facilityRes.data || []).map((item: any) => ({
|
||||
|
||||
@@ -129,7 +129,7 @@ export function VerticalTable({
|
||||
<input
|
||||
id={head.id}
|
||||
type="text"
|
||||
value={String(formData[head.id]) ?? ""}
|
||||
value={""}
|
||||
onChange={(e) => handleInputChange(head.id, e.target.value)}
|
||||
className="w-full text-xl border-radius-0 border border-gray-300 rounded-sm px-2 py-1"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user