From 8a91646d6c338db5266a4c3f3632bc1e0c9543de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Thu, 20 Feb 2025 10:15:06 +0900 Subject: [PATCH 1/4] =?UTF-8?q?-=20=EC=84=A0=EC=86=8D=EC=84=B1=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=20=EC=83=89=20=EC=B6=94=EA=B0=80=20-=201=EC=B0=A8=20?= =?UTF-8?q?=ED=86=B5=ED=95=A9=ED=85=8C=EC=8A=A4=ED=8A=B8(Integration=20Tes?= =?UTF-8?q?t)=20#788=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../surface/useRoofLinePropertySetting.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/hooks/surface/useRoofLinePropertySetting.js b/src/hooks/surface/useRoofLinePropertySetting.js index 22fde4b6..ba5eedee 100644 --- a/src/hooks/surface/useRoofLinePropertySetting.js +++ b/src/hooks/surface/useRoofLinePropertySetting.js @@ -12,6 +12,7 @@ const LINE_COLOR = { GABLE: '#3FBAE6', RIDGE: '#9e9e9e', DEFAULT: '#000000', + ACTIVE: '#EA10AC', } export function useRoofLinePropertySetting(id, roof) { @@ -23,9 +24,9 @@ export function useRoofLinePropertySetting(id, roof) { const { getMessage } = useMessage() useEffect(() => { - if (currentObject) { + if (currentObject && currentObject.name === 'roofLine') { currentObject.set({ - stroke: '#EA10AC', + stroke: LINE_COLOR.ACTIVE, strokeWidth: 4, }) } @@ -35,17 +36,18 @@ export function useRoofLinePropertySetting(id, roof) { roof.lines.forEach((line) => { canvas.add(line) line.set({ - stroke: '#000000', + stroke: LINE_COLOR.DEFAULT, strokeWidth: 4, visible: true, + name: 'roofLine', }) line.bringToFront() - // line.setViewLengthText(false) }) canvas.renderAll() } const handleSetEaves = () => { + if (!currentObject) return currentObject.set({ attributes: { ...currentObject.attributes, @@ -60,6 +62,7 @@ export function useRoofLinePropertySetting(id, roof) { } const handleSetGable = () => { + if (!currentObject) return currentObject.set({ attributes: { ...currentObject.attributes, @@ -74,6 +77,7 @@ export function useRoofLinePropertySetting(id, roof) { } const handleSetRidge = () => { + if (!currentObject) return currentObject.set({ attributes: { ...currentObject.attributes, @@ -93,7 +97,11 @@ export function useRoofLinePropertySetting(id, roof) { } const lastLine = history.current.pop() - delete lastLine.attributes + // delete lastLine.attributes + lastLine.attributes = { + ...lastLine.attributes, + type: null, + } lastLine.set({ stroke: LINE_COLOR.DEFAULT, strokeWidth: 4, From e688b54b128a737fe6588188efbf823bae64425d Mon Sep 17 00:00:00 2001 From: changkyu choi Date: Thu, 20 Feb 2025 11:21:56 +0900 Subject: [PATCH 2/4] =?UTF-8?q?roofMaterials=20=EB=A1=9C=EB=93=9C=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/option/useCanvasSetting.js | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index 08ac6470..f8217c36 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -140,7 +140,6 @@ export function useCanvasSetting() { const selectedRoofMaterial = useRecoilValue(selectedRoofMaterialSelector) // 선택된 지붕재 정보 const { floorPlanState } = useContext(FloorPlanContext) // 플랜 상태 const { closeAll } = usePopup() // 팝업 닫기 - const [isRoofMaterialsLoaded, setIsRoofMaterialsLoaded] = useState(false) // roofMaterials 로드 상태 확인 useEffect(() => { const tempFetchRoofMaterials = !fetchRoofMaterials @@ -152,15 +151,6 @@ export function useCanvasSetting() { } }, []) - /** - * roofMaterials가 변경될 때마다 로드 상태 업데이트 - */ - useEffect(() => { - if (roofMaterials.length > 0) { - setIsRoofMaterialsLoaded(true) - } - }, [roofMaterials]) - /** * 지붕재 초기세팅 */ @@ -319,23 +309,6 @@ export function useCanvasSetting() { */ const fetchBasicSettings = async (planNo, openPoint) => { try { - /* roofMaterials가 로드될 때까지 대기 후 실행 */ - if (!isRoofMaterialsLoaded) { - /* roofMaterials가 아직 로드되지 않았다면 */ - await new Promise((resolve) => { - /* 새로운 Promise 생성 */ - const checkInterval = setInterval(() => { - /* 100ms마다 체크하는 인터벌 설정 */ - console.log('roofMaterials loading... ', roofMaterials.length) - if (roofMaterials.length > 0) { - /* roofMaterials가 로드되었다면 */ - clearInterval(checkInterval) // 인터벌 중지 - resolve() // Promise 완료 - } - }, 100) - }) - } - await get({ url: `/api/canvas-management/canvas-basic-settings/by-object/${correntObjectNo}/${planNo}`, }).then((res) => { @@ -942,6 +915,7 @@ export function useCanvasSetting() { setAdsorptionRange, fetchSettings, fetchBasicSettings, + basicSettingCopySave, frontSettings, globalFont, setGlobalFont, From 95fee6154f0e2dc73ba666a5fccf7534978790e8 Mon Sep 17 00:00:00 2001 From: basssy Date: Thu, 20 Feb 2025 11:23:27 +0900 Subject: [PATCH 3/4] #792 --- src/components/estimate/Estimate.jsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index f4214e68..deb95caf 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -1129,6 +1129,14 @@ export default function Estimate({}) { setSpecialNoteFirstFlg(false) }, [estimateContextState.resetFlag]) + useEffect(() => { + if (estimateContextState?.itemList.length > 0) { + const tempList = estimateContextState.itemList.filter((item) => !displayItemList.some((resItem) => resItem.itemId === item.itemId)) + if (tempList.length > 0) { + setDisplayItemList((prevList) => [...prevList, ...tempList]) + } + } + }, [estimateContextState]) return (
From 7a58841dbd52d949b74176854fb7c698886a012e Mon Sep 17 00:00:00 2001 From: changkyu choi Date: Thu, 20 Feb 2025 12:41:34 +0900 Subject: [PATCH 4/4] =?UTF-8?q?basicSettingCopySave=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/option/useCanvasSetting.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index f8217c36..179b2221 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -915,7 +915,6 @@ export function useCanvasSetting() { setAdsorptionRange, fetchSettings, fetchBasicSettings, - basicSettingCopySave, frontSettings, globalFont, setGlobalFont,