From 1d724e275d6294fd65b51865d8e3396527c7f3b8 Mon Sep 17 00:00:00 2001 From: basssy Date: Tue, 4 Feb 2025 18:14:00 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=84=9C=20=EB=B6=81?= =?UTF-8?q?=EB=A9=B4=EC=84=A4=EC=B9=98=20=EA=B4=80=EB=A0=A8=20=EB=A9=94?= =?UTF-8?q?=EC=84=B8=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/ja.json | 2 ++ src/locales/ko.json | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/locales/ja.json b/src/locales/ja.json index 0951418c..38723da7 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -877,6 +877,7 @@ "estimate.detail.roofCns": "屋根材・仕様施工", "estimate.detail.remarks": "備考", "estimate.detail.fileFlg": "後日資料提出", + "estimate.detail.dragFileGuide": "(※北面設置の場合、ファイル添付が必須です.)", "estimate.detail.header.fileList1": "ファイル添付", "estimate.detail.fileList.btn": "ファイル選択", "estimate.detail.fileList.extCheck": "画像ファイルのみ添付可能です。", @@ -942,6 +943,7 @@ "estimate.detail.save.alertMsg": "保存されました。見積書で製品を変更すると、図面や回路には反映されません。", "estimate.detail.copy.alertMsg": "コピーされました。", "estimate.detail.save.requiredFileUpload": "ファイル添付が必須のアイテムがあります。ファイルを添付するか、後日添付をチェックしてください。", + "estimate.detail.save.requiredNorthArrangementFileUpload": "北面にモジュールを配置した場合、北面配置許可書を必ず添付する必要があります.", "estimate.detail.save.requiredItem": "製品は1つ以上登録する必要があります。", "estimate.detail.save.requiredCharger": "担当者は必須です。", "estimate.detail.save.requiredObjectName": "案件名は必須です。", diff --git a/src/locales/ko.json b/src/locales/ko.json index 9037ade4..5c7c17d6 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -877,6 +877,7 @@ "estimate.detail.roofCns": "지붕재・사양시공", "estimate.detail.remarks": "비고", "estimate.detail.fileFlg": "후일자료제출", + "estimate.detail.dragFileGuide": "(※ 북면설치인 경우, 파일 첨부가 필수입니다.)", "estimate.detail.header.fileList1": "파일첨부", "estimate.detail.fileList.btn": "파일선택", "estimate.detail.fileList.extCheck": "이미지 파일만 첨부 가능합니다.", @@ -942,6 +943,7 @@ "estimate.detail.save.alertMsg": "저장되었습니다. 견적서에서 제품을 변경할 경우 도면 및 회로에 반영되지 않습니다.", "estimate.detail.copy.alertMsg": "복사되었습니다.", "estimate.detail.save.requiredFileUpload": "파일첨부가 필수인 아이템이 있습니다. 파일을 첨부하거나 후일첨부를 체크해주십시오.", + "estimate.detail.save.requiredNorthArrangementFileUpload": "북면에 모듈을 배치한 경우, 북면배치허가서를 반드시 첨부해야 합니다.", "estimate.detail.save.requiredItem": "제품은 1개이상 등록해야 됩니다.", "estimate.detail.save.requiredCharger": "담당자는 필수값 입니다.", "estimate.detail.save.requiredObjectName": "안건명은 필수값 입니다.", From 8299cef5a3f8d4f596c9660b6e58f6bc227dbb36 Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Tue, 4 Feb 2025 18:18:25 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=8Cfix:=20=EB=B0=B0=EA=B2=BD?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=B6=88?= =?UTF-8?q?=EB=9F=AC=EC=98=A4=EA=B8=B0=20=EA=B8=B0=EB=8A=A5=20=EB=B6=80?= =?UTF-8?q?=EB=B6=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/modal/ImgLoad.jsx | 10 +++++----- src/hooks/common/useRefFiles.js | 16 ++++++++++------ src/hooks/usePlan.js | 1 + src/lib/fileAction.js | 3 ++- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/components/floor-plan/modal/ImgLoad.jsx b/src/components/floor-plan/modal/ImgLoad.jsx index 2a5e77aa..341f9b94 100644 --- a/src/components/floor-plan/modal/ImgLoad.jsx +++ b/src/components/floor-plan/modal/ImgLoad.jsx @@ -34,11 +34,11 @@ export default function ImgLoad() { const handleModal = () => { setFloorPlanState({ ...floorPlanState, refFileModalOpen: false, toggleRotate: false }) - setCurrentCanvasPlan({ - ...currentCanvasPlan, - bgImageName: refImage?.name ?? null, - mapPositionAddress, - }) + // setCurrentCanvasPlan({ + // ...currentCanvasPlan, + // bgImageName: refImage?.name ?? null, + // mapPositionAddress, + // }) } useEffect(() => { diff --git a/src/hooks/common/useRefFiles.js b/src/hooks/common/useRefFiles.js index bb079bc7..027a2d87 100644 --- a/src/hooks/common/useRefFiles.js +++ b/src/hooks/common/useRefFiles.js @@ -131,12 +131,16 @@ export function useRefFiles() { // setCurrentCanvasPlan((prev) => ({ ...prev, bgImageName: currentCanvasPlan.id, mapPositionAddress: queryRef.current.value })) } + /** + * 배경 이미지 로드를 위한 세팅 + */ useEffect(() => { if (!currentBgImage) { return } console.log('🚀 ~ useEffect ~ currentBgImage:', currentBgImage) - handleBackImageLoadToCanvas(`plan-images/${currentCanvasPlan.id}.png`) + // handleBackImageLoadToCanvas(`plan-images/${currentCanvasPlan.id}.png`) + handleBackImageLoadToCanvas(currentBgImage) setCurrentCanvasPlan((prev) => ({ ...prev, bgImageName: refImage?.name ?? null, mapPositionAddress: queryRef.current.value })) }, [currentBgImage]) @@ -147,15 +151,15 @@ export function useRefFiles() { const handleUploadImageRefFile = async (file) => { const formData = new FormData() formData.append('file', file) - formData.append('fileName', currentCanvasPlan.id) + // formData.append('fileName', currentCanvasPlan.id) // const res = await post({ url: `${process.env.NEXT_PUBLIC_API_SERVER_PATH}/api/image-upload`, data: formData }) - const res = await post({ url: `http://localhost:3000/api/image-upload`, data: formData }) + const res = await post({ url: `${process.env.NEXT_PUBLIC_HOST_URL}/image/upload`, data: formData }) console.log('🚀 ~ handleUploadImageRefFile ~ res:', res) - const image = await readImage(res.fileNm) - console.log('🚀 ~ handleUploadImageRefFile ~ file:', image) + // const image = await readImage(res.filePath) + // console.log('🚀 ~ handleUploadImageRefFile ~ file:', image) - setCurrentBgImage(image) + setCurrentBgImage(`${process.env.NEXT_PUBLIC_HOST_URL}${res.filePath}`) setRefImage(file) } diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js index b904611d..3691035e 100644 --- a/src/hooks/usePlan.js +++ b/src/hooks/usePlan.js @@ -394,6 +394,7 @@ export function usePlan(params = {}) { canvas, plans, currentCanvasPlan, + setCurrentCanvasPlan, selectedPlan, saveCanvas, handleCurrentPlan, diff --git a/src/lib/fileAction.js b/src/lib/fileAction.js index d2c4cff9..6b531d77 100644 --- a/src/lib/fileAction.js +++ b/src/lib/fileAction.js @@ -72,7 +72,8 @@ const writeImage = async (fileName, file) => { } const readImage = async (fileName) => { - const file = await fs.readFile(`${FILE_PATH}/${fileName}`) + // const file = await fs.readFile(`${FILE_PATH}/${fileName}`) + const file = await fs.readFile(`${process.env.NEXT_PUBLIC_HOST_URL}${fileName}`) // .then((res) => { // console.log('readImage-then', res) // })