대민 디자인 수정

This commit is contained in:
jyha00
2025-07-24 17:37:46 +09:00
parent c4750d9652
commit 79bc10cdce
7 changed files with 444 additions and 418 deletions
@@ -420,7 +420,6 @@ export function SdmInfoRegForm({ form, onCheckboxChange, facilityName }: SdmInfo
name: "rmrk",
label: "비고",
formIndex: 1,
required: true,
component: (field) => (
<Input
placeholder="비고를 입력하세요"
@@ -11,6 +11,23 @@ import * as z from "zod";
export function SdmLoginForm() {
const { actionLogin, initializeCommonData } = useDmStore((state) => state);
const [isBznmTotNoDisabled, setIsBznmTotNoDisabled] = useState(false);
const formatBusinessNumber = (value: string) => {
// 숫자만 추출
const digitsOnly = value.replace(/\D/g, "");
// 10자리까지만 처리
const limitedDigits = digitsOnly.slice(0, 10);
// 3-2-5 형식으로 포맷팅
if (limitedDigits.length <= 3) {
return limitedDigits;
} else if (limitedDigits.length <= 5) {
return `${limitedDigits.slice(0, 3)}-${limitedDigits.slice(3)}`;
} else {
return `${limitedDigits.slice(0, 3)}-${limitedDigits.slice(3, 5)}-${limitedDigits.slice(5)}`;
}
};
// 스키마를 useMemo로 최적화
const sdmLoginFormSchema = useMemo(() => z.object({
@@ -79,7 +96,12 @@ export function SdmLoginForm() {
placeholder="사업자등록번호를 입력하세요"
type="text"
className="!mt-5 !mb-5 !text-xl text-gray-600"
{...field}
{...field}
value={formatBusinessNumber(field.value as string)}
onChange={(e) => {
const dmdId = e.target.value.replace(/\D/g, "").slice(0, 10);
field.onChange(dmdId);
}}
/>
)
},