노후관로 분석 - 서울, 부산 전체 조회 조건 수정

This commit is contained in:
kiminchan
2026-05-12 10:06:17 +09:00
parent 3302f7e8e0
commit 446bd83210
2 changed files with 13 additions and 5 deletions
@@ -11,7 +11,7 @@ export const AGED_PIPE_LAYER_TYPE = "tb_ms_swage_ppl";
export const AGED_PIPE_DEFAULT_ELAPSED_YEARS = 30;
export const AGED_PIPE_PAGE_SIZE = 10;
export const AGED_PIPE_MIN_ZOOM = 14;
export const AGED_PIPE_INVALID_INSTALL_YMD_PREFIXES = ["19000101", "19990101"];
export const AGED_PIPE_INVALID_INSTALL_YMD_PREFIXES = ["19000101"];
export type AgedPipeFilters = {
elapsedYears: number;
@@ -46,6 +46,12 @@ export const AGED_PIPE_DEFAULT_FILTERS: AgedPipeFilters = {
sggCd: "0",
};
const normalizeRegionFilterCode = (value: unknown, prefixLength: number) => {
const digits = String(value ?? "").replace(/[^0-9]/g, "");
if (digits === "" || digits === "0") return "0";
return digits.length > prefixLength ? digits.slice(0, prefixLength) : digits;
};
export const AGED_PIPE_LIST_HEADLIST = [
{ id: "rowNumber", title: "NO", widthPercent: 6 },
{ id: "fcltMngNo", title: "시설관리번호", widthPercent: 18 },
@@ -82,6 +88,8 @@ export const normalizeAgedPipeFilters = (filters: AgedPipeFilters): AgedPipeFilt
return {
...filters,
ctpvCd: normalizeRegionFilterCode(filters.ctpvCd, 2),
sggCd: normalizeRegionFilterCode(filters.sggCd, 5),
elapsedYears:
Number.isFinite(elapsedYears) && elapsedYears >= 1 && elapsedYears <= 100
? elapsedYears
+4 -4
View File
@@ -33,8 +33,8 @@ export const fetchCtpv = async (set: (state: any) => void) => {
const list = res.features
.map((f: any) => ({
text: f.properties.mctpv_korn_nm,
val: f.properties.mctpv_cd,
text: String(f.properties.mctpv_korn_nm ?? "").trim(),
val: String(f.properties.mctpv_cd ?? "").trim(),
}))
.sort((a:any, b:any) => {
// 커스텀 순서 정의
@@ -83,8 +83,8 @@ export const fetchSgg = async (set: (state: any) => void) => {
const list = res.features
.map((f: any) => ({
text: f.properties.sgg_korn_nm,
val: f.properties.sgg_cd,
text: String(f.properties.sgg_korn_nm ?? "").trim(),
val: String(f.properties.sgg_cd ?? "").trim(),
}))
.sort((a:any, b:any) => a.text.localeCompare(b.text, 'ko'));