diff --git a/src/app/api/image/canvas/route.js b/src/app/api/image/canvas/route.js
index 9f4e3f52..b96e079f 100644
--- a/src/app/api/image/canvas/route.js
+++ b/src/app/api/image/canvas/route.js
@@ -95,16 +95,11 @@ const resizeImage = async (image) => {
const scaleY = targetImageHeight / image.bitmap.height
let scale = Math.min(scaleX, scaleY) // 비율 유지하면서 최대한 크게
- // scale 저장 (나중에 전체 확대에 사용)
- const originalScale = scale
-
let finalWidth = Math.round(image.bitmap.width * scale)
let finalHeight = Math.round(image.bitmap.height * scale)
- if (scale >= 0.6) {
- // 실제 리사이즈 실행
- image.resize({ w: finalWidth, h: finalHeight })
- }
+ // 항상 리사이즈 실행 (scale >= 0.6 조건 제거)
+ image.resize({ w: finalWidth, h: finalHeight })
//배경 이미지를 생성
const mixedImage = new Jimp({ width: convertStandardWidth, height: convertStandardHeight, color: 0xffffffff })
@@ -119,14 +114,7 @@ const resizeImage = async (image) => {
opacityDest: 1,
})
- // scale이 0.8 이하인 경우 완성된 이미지를 전체적으로 확대
- if (originalScale <= 0.8) {
- const enlargeRatio = 1.5 // 50% 확대
- const newWidth = Math.round(mixedImage.bitmap.width * enlargeRatio)
- const newHeight = Math.round(mixedImage.bitmap.height * enlargeRatio)
-
- mixedImage.resize({ w: newWidth, h: newHeight })
- }
+ // 1.5x 확대 로직 제거 - 이미지가 템플릿 크기를 초과하지 않도록 함
return mixedImage
}
diff --git a/src/components/auth/Join.jsx b/src/components/auth/Join.jsx
index 4c080f00..f414cd62 100644
--- a/src/components/auth/Join.jsx
+++ b/src/components/auth/Join.jsx
@@ -33,6 +33,11 @@ export default function Join() {
// 가입 신청 유효성 검사
const joinValidation = (formData) => {
+
+ // 전화번호/FAX 정규식 (일본 형식: 0으로 시작, 하이픈 포함)
+ const telRegex = /^0\d{1,4}-\d{1,4}-\d{4}$/
+
+
// 판매대리점 정보 - 판매대리점명
const storeQcastNm = formData.get('storeQcastNm')
if (!isObjectNotEmpty(storeQcastNm)) {
@@ -65,12 +70,34 @@ export default function Join() {
return false
}
+
// 판매대리점 정보 - 전화번호
const telNo = formData.get('telNo')
if (!isObjectNotEmpty(telNo)) {
alert(getMessage('common.message.required.data', [getMessage('join.sub1.telNo')]))
telNoRef.current.focus()
return false
+ } else if (!telRegex.test(telNo)) {
+ alert(getMessage('join.validation.check1', [getMessage('join.sub1.telNo')]))
+ telNoRef.current.focus()
+ return false
+ }
+
+ //
+ // // 판매대리점 정보 - 전화번호
+ // const telNo = formData.get('telNo')
+ // if (!isObjectNotEmpty(telNo)) {
+ // alert(getMessage('common.message.required.data', [getMessage('join.sub1.telNo')]))
+ // telNoRef.current.focus()
+ // return false
+ // }
+
+ // 판매대리점 정보 - FAX 번호
+ const fax = formData.get('fax')
+ if (!isObjectNotEmpty(fax)) {
+ alert(getMessage('common.message.required.data', [getMessage('join.sub1.fax')]))
+ faxRef.current.focus()
+ return false
}
const bizNo = formData.get('bizNo')
@@ -122,16 +149,38 @@ export default function Join() {
}
// 담당자 정보 - 전화번호
+ // const userTelNo = formData.get('userTelNo')
+ // if (!isObjectNotEmpty(userTelNo)) {
+ // alert(getMessage('common.message.required.data', [getMessage('join.sub2.telNo')]))
+ // userTelNoRef.current.focus()
+ // return false
+ // }
+
+
const userTelNo = formData.get('userTelNo')
if (!isObjectNotEmpty(userTelNo)) {
- alert(getMessage('common.message.required.data', [getMessage('join.sub2.telNo')]))
+ alert(getMessage('common.message.required.data', [getMessage('join.sub1.telNo')]))
userTelNoRef.current.focus()
return false
+ } else if (!telRegex.test(userTelNo)) {
+ alert(getMessage('join.validation.check1', [getMessage('join.sub1.telNo')]))
+ userTelNoRef.current.focus()
+ return false
+ }
+
+ // 담당자 정보 - FAX 번호
+ const userFax = formData.get('userFax')
+ if (!isObjectNotEmpty(userFax)) {
+ alert(getMessage('common.message.required.data', [getMessage('join.sub2.fax')]))
+ userFaxRef.current.focus()
+ return false
}
return true
}
+
+
// 가입 신청
const joinProcess = async (e) => {
e.preventDefault()
@@ -288,7 +337,8 @@ export default function Join() {
name="telNo"
className="input-light"
maxLength={15}
- onChange={inputNumberCheck}
+ placeholder={getMessage('join.sub1.telNo_placeholder')}
+ onChange={inputTelNumberCheck}
ref={telNoRef}
/>
@@ -296,7 +346,7 @@ export default function Join() {
{/* FAX 번호 */}
- | {getMessage('join.sub2.fax')} |
+ {getMessage('join.sub2.fax')}* |
{
+ if (inputRef.current) {
+ inputRef.current.focus()
+ inputRef.current.setSelectionRange(newDisplayValue.length, newDisplayValue.length)
+ }
+ })
+ return // 블록 처리 로직 완료 후 종료
+ }
+ }
+ }
+
// maxLength 체크
if (maxLength > 0) {
const currentLength = (calculator.currentOperand || '').length + (calculator.previousOperand || '').length + (calculator.operation || '').length
diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx
index ee2fab4b..9107dde0 100644
--- a/src/components/estimate/Estimate.jsx
+++ b/src/components/estimate/Estimate.jsx
@@ -2039,7 +2039,11 @@ export default function Estimate({}) {
}
}}
menuPlacement={'auto'}
- getOptionLabel={(x) => x.itemName + ' (' + x.itemNo + ')'}
+ getOptionLabel={(x) => {
+ // 메뉴 리스트에 보이는 텍스트 디코딩
+ const doc = new DOMParser().parseFromString(x.itemName, 'text/html');
+ return (doc.documentElement.textContent || x.itemName) + ' (' + x.itemNo + ')';
+ }}
getOptionValue={(x) => x.itemNo}
components={{
SingleValue: ({ children, ...props }) => {
@@ -2048,13 +2052,21 @@ export default function Estimate({}) {
}}
isClearable={false}
isDisabled={!!item?.paDispOrder}
- value={displayItemList.filter(function (option) {
- if (item.itemNo === '') {
- return false
- } else {
- return option.itemId === item.itemId
+ value={(() => {
+ const selectedOption = displayItemList.find((option) => {
+ return item.itemNo !== '' && option.itemId === item.itemId;
+ });
+
+ if (selectedOption) {
+ // 현재 선택된 값의 itemName을 실시간으로 디코딩하여 전달
+ const doc = new DOMParser().parseFromString(selectedOption.itemName, 'text/html');
+ return {
+ ...selectedOption,
+ itemName: doc.documentElement.textContent || selectedOption.itemName
+ };
}
- })}
+ return null;
+ })()}
/>
) : (
|