From 99886ad61e50c3d979790889f5f4d8634b699d84 Mon Sep 17 00:00:00 2001 From: basssy Date: Wed, 21 May 2025 09:29:16 +0900 Subject: [PATCH] =?UTF-8?q?#1053=20=EB=AC=BC=EA=B1=B4=ED=99=94=EB=A9=B4=20?= =?UTF-8?q?=EB=8B=B4=EB=8B=B9=EC=9E=90=20=EC=9E=90=EB=A6=AC=EC=88=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/management/StuffDetail.jsx | 26 ++++++++----------- .../estimate/useEstimateController.js | 23 +++++++--------- src/locales/ja.json | 2 +- src/locales/ko.json | 2 +- 4 files changed, 22 insertions(+), 31 deletions(-) diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index 2eef9813..d07d0d3e 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -1362,10 +1362,11 @@ export default function StuffDetail() { } if (params?.receiveUser !== '') { - if (checkLength(params?.receiveUser.trim()) > 10) { + if (checkLength(params?.receiveUser.trim()) > 40) { return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert', icon: 'warning' }) } } + //로그인이 2차점인데 otherSaleStoreId가 없으면 알럿 if (session.storeLvl !== '1') { if (params.saleStoreLevel === '1') { @@ -1435,20 +1436,15 @@ export default function StuffDetail() { } } + /** + * 전각20자 (반각40자) + */ const checkLength = (value) => { - let str = new String(value) - let _byte = 0 - if (str.length !== 0) { - for (let i = 0; i < str.length; i++) { - let str2 = str.charAt(i) - if (encodeURIComponent(str2).length > 4) { - _byte += 2 - } else { - _byte++ - } - } - } - return _byte + let fullWidthLength = value.replace(/[^\uFF01-\uFF5E]/g, '').length + let halfWidthLength = value.replace(/[\uFF01-\uFF5E]/g, '').length + + let totalLength = fullWidthLength * 2 + halfWidthLength + return totalLength } // 임시저장 const onTempSave = async () => { @@ -1498,7 +1494,7 @@ export default function StuffDetail() { // 담당자 자리수 체크 if (params?.receiveUser !== '') { - if (checkLength(params?.receiveUser.trim()) > 10) { + if (checkLength(params?.receiveUser.trim()) > 40) { return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert', icon: 'warning' }) } } diff --git a/src/hooks/floorPlan/estimate/useEstimateController.js b/src/hooks/floorPlan/estimate/useEstimateController.js index a4c83fe7..412211f1 100644 --- a/src/hooks/floorPlan/estimate/useEstimateController.js +++ b/src/hooks/floorPlan/estimate/useEstimateController.js @@ -449,7 +449,7 @@ export const useEstimateController = (planNo, flag) => { icon: 'warning', }) } else { - if (checkLength(copyReceiveUser.trim()) > 10) { + if (checkLength(copyReceiveUser.trim()) > 40) { return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert', icon: 'warning' }) } } @@ -489,20 +489,15 @@ export const useEstimateController = (planNo, flag) => { }) } + /** + * 전각20자 (반각40자) + */ const checkLength = (value) => { - let str = new String(value) - let _byte = 0 - if (str.length !== 0) { - for (let i = 0; i < str.length; i++) { - let str2 = str.charAt(i) - if (encodeURIComponent(str2).length > 4) { - _byte += 2 - } else { - _byte++ - } - } - } - return _byte + let fullWidthLength = value.replace(/[^\uFF01-\uFF5E]/g, '').length + let halfWidthLength = value.replace(/[\uFF01-\uFF5E]/g, '').length + + let totalLength = fullWidthLength * 2 + halfWidthLength + return totalLength } return { diff --git a/src/locales/ja.json b/src/locales/ja.json index 7593b6b6..725cc1b6 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -732,7 +732,7 @@ "stuff.detail.tooltip.surfaceType": "塩害地域の定義は各メーカーの設置マニュアルをご確認ください", "stuff.detail.tempSave.message0": "一時保存されました。 物件番号を取得するには、保存ボタンを押して下さい。,", "stuff.detail.tempSave.message1": "一時保存されました。物件番号を取得するには、必須項目をすべて入力してください。", - "stuff.detail.tempSave.message2": "担当者名は10桁以下で入力してください。", + "stuff.detail.tempSave.message2": "担当者名は全角20文字(半角40文字)以下で入力してください.", "stuff.detail.tempSave.message3": "二次販売店を選択してください。", "stuff.detail.confirm.message1": "販売店情報を変更すると、設計依頼文書番号が削除されます。変更しますか?", "stuff.detail.delete.message1": "仕様が確定したものは削除できません。", diff --git a/src/locales/ko.json b/src/locales/ko.json index e7ab9711..c34b4faf 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -733,7 +733,7 @@ "stuff.detail.tooltip.surfaceType": "염해지역 정의는 각 메이커의 설치 매뉴얼을 확인해주십시오", "stuff.detail.tempSave.message0": "임시저장 되었습니다. 물건번호를 획득하려면 저장버튼을 눌러주십시오.", "stuff.detail.tempSave.message1": "임시저장 되었습니다. 물건번호를 획득하려면 필수 항목을 모두 입력해 주십시오.", - "stuff.detail.tempSave.message2": "담당자이름은 10자리 이하로 입력해 주십시오.", + "stuff.detail.tempSave.message2": "담당자이름은 전각20자(반각40자) 이하로 입력해 주십시오.", "stuff.detail.tempSave.message3": "2차 판매점을 선택해주세요.", "stuff.detail.confirm.message1": "판매점 정보를 변경하면 설계의뢰 문서번호가 삭제됩니다. 변경하시겠습니까?", "stuff.detail.delete.message1": "사양이 확정된 물건은 삭제할 수 없습니다.",