sn: 도시침수예방사업 사업명 필수

This commit is contained in:
2026-10-06 13:15:32 +09:00
parent 11d0378060
commit 0c77ed9bba
5 changed files with 29 additions and 24 deletions
@@ -93,7 +93,7 @@ const DETAIL_FIELDS = [
] as const;
type BasicKey = (typeof BASIC_FIELDS)[number][0];
/** 저장 전에 반드시 입력해야 하는 항목이다. 시도는 별도 선택이라 region 키로 관리한다. */
const REQUIRED_BASIC_KEYS = new Set<string>(["seqNo", "dsgnYmd"]);
const REQUIRED_BASIC_KEYS = new Set<string>(["seqNo", "dsgnYmd", "bizNm"]);
type FieldErrorKey = BasicKey | "region" | `soa-${string}`;
/** 금액·면적 입력의 DB 자릿수 규칙이다. intDigits 는 정수부, scale 은 소수부 한계다. */
@@ -390,6 +390,7 @@ export function CtyFldngPrvtnBizFormPage({ id }: { id?: string }) {
if (!String(form.ctpvNm ?? "").trim()) nextErrors.region = "시도는 필수입니다.";
if (form.seqNo === null || form.seqNo === undefined || String(form.seqNo) === "")
nextErrors.seqNo = "사업순번은 필수입니다.";
if (!String(form.bizNm ?? "").trim()) nextErrors.bizNm = "사업명은 필수입니다.";
if (!String(form.dsgnYmd ?? "").trim())
nextErrors.dsgnYmd = "지정일은 필수입니다.";
else if (!validDate(form.dsgnYmd))
@@ -478,7 +479,7 @@ export function CtyFldngPrvtnBizFormPage({ id }: { id?: string }) {
key={key}
id={fieldId}
label={label}
required={key === "bizNm" || REQUIRED_BASIC_KEYS.has(key)}
required={REQUIRED_BASIC_KEYS.has(key)}
error={fieldErrors[key]}
span={span}
>
@@ -76,9 +76,9 @@ const toFloodMapFrequencyCode = (value: number) => {
};
const HEADS: UiHeadProps[] = [
{ id: "rowNo", title: "순번", widthPercent: 6 },
{ id: "ctpvNm", title: "시도", widthPercent: 8 },
{ id: "sggNm", title: "시군구", widthPercent: 9 },
{ id: "rowNo", title: "순번", widthPercent: 5 },
{ id: "ctpvNm", title: "시도", widthPercent: 7 },
{ id: "sggNm", title: "시군구", widthPercent: 8 },
{
id: "analysisDateTimeDisplay",
title: "분석시각",
@@ -87,33 +87,33 @@ const HEADS: UiHeadProps[] = [
{
id: "rainBeginningDateTimeDisplay",
title: "강우시작시각",
widthPercent: 16,
widthPercent: 13,
},
{
id: "observedAccumulatedRainfallDisplay",
title: "관측 누적강수량(mm)",
widthPercent: 13,
widthPercent: 11,
align: "right",
},
{
id: "predictionHourDisplay",
title: "예측시간",
widthPercent: 9,
widthPercent: 7,
},
{
id: "predictedAccumulatedRainfallDisplay",
title: "예측 누적강수량(mm)",
widthPercent: 15,
widthPercent: 12,
align: "right",
},
{
id: "exceededFrequencyYearDisplay",
title: "초과 빈도(년)",
widthPercent: 10,
widthPercent: 8,
align: "right",
},
{ id: "floodRiskGrade", title: "침수위험도", widthPercent: 10 },
{ id: "probabilityRainfallDisplay", title: "확률강우량", widthPercent: 10 },
{ id: "floodRiskGrade", title: "침수위험도", widthPercent: 8 },
{ id: "probabilityRainfallDisplay", title: "확률강우량", widthPercent: 8 },
];
/** 날짜·시각의 뒷부분이 잘리지 않도록 전체 표시할 목록 열이다. */
@@ -43,7 +43,8 @@ type MapPopupDataTableProps<T extends Record<string, unknown>> = {
headId: string,
rowIndex: number,
) => ReactNode | undefined;
fullTextHeadIds?: string[]; /** 시각처럼 뒤쪽이 잘리면 의미가 달라지는 열은 고정 너비 없이 말줄임만 해제한다. */
/** 시각처럼 뒤쪽이 잘리면 의미가 달라지는 열의 말줄임을 해제한다. */
fullTextHeadIds?: string[];
sort?: UiTableSort;
onSortChange?: (sort: UiTableSort | undefined) => void;
};
@@ -144,15 +145,18 @@ export default function MapPopupDataTable<T extends Record<string, unknown>>({
head.align === "left" || head.align === "right"
? head.align
: "center",
width: head.widthPercent,
...(fullTextHeadIds?.includes(head.id)
? {
"data-sn-cell-wrap": "",
style: {
whiteSpace: "nowrap",
},
}
? { "data-sn-cell-wrap": "" }
: {}),
style: {
width:
head.widthPercent != null
? `${head.widthPercent}%`
: undefined,
...(fullTextHeadIds?.includes(head.id)
? { whiteSpace: "nowrap" }
: {}),
},
} as ColumnDef<T>["meta"],
})),
[