From edcb51e224b5f56d886b1fc3ca8796d3cde2deed Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 4 Mar 2025 14:59:39 +0900 Subject: [PATCH 01/10] =?UTF-8?q?#695=20=EC=A7=80=EB=B6=95=EC=9E=AC=20?= =?UTF-8?q?=ED=9D=90=EB=A6=84=20=ED=99=95=EC=9D=B8=20=EC=9A=94=EC=B2=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/usePolygon.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/hooks/usePolygon.js b/src/hooks/usePolygon.js index 3e706b84..3bb004cf 100644 --- a/src/hooks/usePolygon.js +++ b/src/hooks/usePolygon.js @@ -755,10 +755,7 @@ export const usePolygon = () => { // innerLine이 세팅이 안되어있는경우 찾아서 세팅한다. if (!innerLines || innerLines.length === 0) { - let innerLineTypes = [] - Object.keys(LINE_TYPE.SUBLINE).forEach((key, value) => { - innerLineTypes.push(LINE_TYPE.SUBLINE[key]) - }) + let innerLineTypes = Object.keys(LINE_TYPE.SUBLINE).map((key, value) => LINE_TYPE.SUBLINE[key]) polygon.innerLines = canvas .getObjects() .filter( @@ -1102,6 +1099,8 @@ export const usePolygon = () => { } }) + // blue로 생성된 것들은 대표라인이 될 수 없음. + representLines = representLines.filter((line) => line.stroke !== 'blue') // representLines중 가장 긴 line을 찾는다. representLines.forEach((line) => { if (!representLine) { From 6a0072b0588bbb1cd772528afb58191aa616477c Mon Sep 17 00:00:00 2001 From: basssy Date: Tue, 4 Mar 2025 15:28:43 +0900 Subject: [PATCH 02/10] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=84=9C=20=EC=B2=A8?= =?UTF-8?q?=EB=B6=80=ED=8C=8C=EC=9D=BC=20ppt,=20pptx=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/estimate/EstimateFileUploader.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/estimate/EstimateFileUploader.jsx b/src/components/estimate/EstimateFileUploader.jsx index c02d4637..b02daef1 100644 --- a/src/components/estimate/EstimateFileUploader.jsx +++ b/src/components/estimate/EstimateFileUploader.jsx @@ -28,6 +28,8 @@ export default function EstimateFileUploader({ uploadFiles, setUploadFiles }) { 'application/pdf', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-excel', + 'application/vnd.openxmlformats-officedocument.presentationml.presentation', // PPTX 형식 + 'application/vnd.ms-powerpoint', // PPT 형식 ] Array.from(e.target.files).forEach((file) => { //엑셀, pdf, 이미지 @@ -61,6 +63,8 @@ export default function EstimateFileUploader({ uploadFiles, setUploadFiles }) { 'application/pdf', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-excel', + 'application/vnd.openxmlformats-officedocument.presentationml.presentation', // PPTX 형식 + 'application/vnd.ms-powerpoint', // PPT 형식 ] Array.from(e.dataTransfer.files).forEach((file) => { From d031c0d6e000d4d9d6e597e5007ab92e3caae1ab Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 4 Mar 2025 16:46:11 +0900 Subject: [PATCH 03/10] =?UTF-8?q?directionText=20=EA=B8=B0=EC=A1=B4=20?= =?UTF-8?q?=EC=9E=88=EB=8D=98=20=EB=82=B4=EC=9A=A9=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasMenu.jsx | 5 ++- src/hooks/module/useOrientation.js | 5 +++ src/hooks/usePolygon.js | 47 +++++++++++++----------- 3 files changed, 33 insertions(+), 24 deletions(-) diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index 63ecdef3..4ce1ec27 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -159,7 +159,7 @@ export default function CanvasMenu(props) { roof.set({ selectable: true }) setSurfaceShapePattern(roof, null, false, roof.roofMaterial) delete roof.moduleCompass - drawDirectionArrow(roof) + drawDirectionArrow(roof, false) }) } @@ -184,13 +184,13 @@ export default function CanvasMenu(props) { break case 'surface': const modules = canvas.getObjects().filter((module) => module.name === POLYGON_TYPE.MODULE) + initRoofs() if (modules.length > 0) { swalFire({ text: getMessage('module.delete.confirm'), type: 'confirm', confirmFn: () => { //해당 메뉴 이동시 배치면 삭제 - initRoofs() const moduleSurfacesArray = canvas .getObjects() @@ -204,6 +204,7 @@ export default function CanvasMenu(props) { moduleSurfacesArray.forEach((moduleSurface) => { canvas.remove(moduleSurface) }) + canvas.renderAll() onClickNav(menu) } diff --git a/src/hooks/module/useOrientation.js b/src/hooks/module/useOrientation.js index 9e57c687..9119398d 100644 --- a/src/hooks/module/useOrientation.js +++ b/src/hooks/module/useOrientation.js @@ -27,6 +27,11 @@ export function useOrientation() { setCompasDeg(0) } const roofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF) + + roofs.forEach((roof) => { + delete roof.directionText + }) + roofs.forEach((roof) => { roof.set({ moduleCompass: isNaN(compasDeg) ? 0 : compasDeg, diff --git a/src/hooks/usePolygon.js b/src/hooks/usePolygon.js index 3bb004cf..04507c17 100644 --- a/src/hooks/usePolygon.js +++ b/src/hooks/usePolygon.js @@ -172,8 +172,9 @@ export const usePolygon = () => { /** * poolygon의 방향에 따라 화살표를 추가한다. * @param polygon + * @param showDirectionText */ - const drawDirectionArrow = (polygon) => { + const drawDirectionArrow = (polygon, showDirectionText = true) => { if (polygon.points.length < 3) { return } @@ -319,17 +320,16 @@ export const usePolygon = () => { pitch: polygon.roofMaterial?.pitch ?? 4, parentId: polygon.id, }) - arrow.setViewLengthText(false) polygon.arrow = arrow polygon.canvas.add(arrow) polygon.canvas.renderAll() - drawDirectionStringToArrow2(polygon) + drawDirectionStringToArrow2(polygon, showDirectionText) // drawDirectionStringToArrow() } //arrow의 compass 값으로 방향 글자 설정 필요 - const drawDirectionStringToArrow2 = (polygon) => { + const drawDirectionStringToArrow2 = (polygon, showDirectionText) => { const { direction, surfaceCompass, moduleCompass, arrow } = polygon if (moduleCompass === null || moduleCompass === undefined) { const textObj = new fabric.Text(`${currentAngleType === ANGLE_TYPE.SLOPE ? arrow.pitch : getDegreeByChon(arrow.pitch)}${pitchText}`, { @@ -510,24 +510,27 @@ export const usePolygon = () => { text = text + (sameDirectionCnt.length + 1) polygon.set('directionText', text) - const textObj = new fabric.Text(`${text} (${currentAngleType === ANGLE_TYPE.SLOPE ? arrow.pitch : getDegreeByChon(arrow.pitch)}${pitchText})`, { - fontFamily: flowFontOptions.fontFamily.value, - fontWeight: flowFontOptions.fontWeight.value.toLowerCase().includes('bold') ? 'bold' : 'normal', - fontStyle: flowFontOptions.fontWeight.value.toLowerCase().includes('italic') ? 'italic' : 'normal', - fontSize: flowFontOptions.fontSize.value, - fill: flowFontOptions.fontColor.value, - pitch: arrow.pitch, - originX: 'center', - originY: 'center', - name: 'flowText', - originText: text, - selectable: false, - left: arrow.stickeyPoint.x, - top: arrow.stickeyPoint.y, - parent: arrow, - parentId: arrow.id, - visible: isFlowDisplay, - }) + const textObj = new fabric.Text( + `${showDirectionText && text} (${currentAngleType === ANGLE_TYPE.SLOPE ? arrow.pitch : getDegreeByChon(arrow.pitch)}${pitchText})`, + { + fontFamily: flowFontOptions.fontFamily.value, + fontWeight: flowFontOptions.fontWeight.value.toLowerCase().includes('bold') ? 'bold' : 'normal', + fontStyle: flowFontOptions.fontWeight.value.toLowerCase().includes('italic') ? 'italic' : 'normal', + fontSize: flowFontOptions.fontSize.value, + fill: flowFontOptions.fontColor.value, + pitch: arrow.pitch, + originX: 'center', + originY: 'center', + name: 'flowText', + originText: text, + selectable: false, + left: arrow.stickeyPoint.x, + top: arrow.stickeyPoint.y, + parent: arrow, + parentId: arrow.id, + visible: isFlowDisplay, + }, + ) polygon.canvas.add(textObj) } From 81d04ff25a4a917faefd4310c8e7fd7d3c519b73 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 4 Mar 2025 16:58:17 +0900 Subject: [PATCH 04/10] =?UTF-8?q?=EB=B3=B5=EC=82=AC=EB=90=9C=20object=20?= =?UTF-8?q?=EC=82=AC=EC=9D=B4=EC=A6=88=20=EB=B3=80=EA=B2=BD=20=EC=8B=9C=20?= =?UTF-8?q?=EA=B8=B8=EC=9D=B4=20=EB=B0=98=EC=98=81=20=EC=95=88=EB=90=98?= =?UTF-8?q?=EB=8A=94=20=ED=98=84=EC=83=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/common/useCommonUtils.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hooks/common/useCommonUtils.js b/src/hooks/common/useCommonUtils.js index dbad7a88..8ecb912b 100644 --- a/src/hooks/common/useCommonUtils.js +++ b/src/hooks/common/useCommonUtils.js @@ -17,6 +17,7 @@ export function useCommonUtils() { const { addCanvasMouseEventListener, addDocumentEventListener, initEvent } = useEvent() const dimensionSettings = useRecoilValue(dimensionLineSettingsState) const dimensionLineTextFont = useRecoilValue(fontSelector('dimensionLineText')) + const lengthTextFont = useRecoilValue(fontSelector('lengthText')) const commonTextFont = useRecoilValue(fontSelector('commonText')) const [commonUtils, setCommonUtilsState] = useRecoilState(commonUtilsState) const { addPopup } = usePopup() @@ -561,6 +562,7 @@ export function useCommonUtils() { obj.clone((cloned) => { clonedObj = cloned + clonedObj.fontSize = lengthTextFont.fontSize.value }) addCanvasMouseEventListener('mouse:move', (e) => { @@ -595,6 +597,7 @@ export function useCommonUtils() { //배치면일 경우 if (obj.name === 'roof') { clonedObj.setCoords() + clonedObj.fire('modified') clonedObj.fire('polygonMoved') clonedObj.set({ direction: obj.direction, directionText: obj.directionText, roofMaterial: obj.roofMaterial }) From ec284a5fe2abb31fe23d2bb4ef39e3087dbdf1d3 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 4 Mar 2025 17:18:41 +0900 Subject: [PATCH 05/10] =?UTF-8?q?directionText=20=EC=9A=B0=EC=84=A0=20?= =?UTF-8?q?=EC=A3=BC=EC=84=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/module/useOrientation.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hooks/module/useOrientation.js b/src/hooks/module/useOrientation.js index 9119398d..cef2b5a6 100644 --- a/src/hooks/module/useOrientation.js +++ b/src/hooks/module/useOrientation.js @@ -28,9 +28,9 @@ export function useOrientation() { } const roofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF) - roofs.forEach((roof) => { - delete roof.directionText - }) + /*roofs.forEach((roof) => { + roof.directionText = null + })*/ roofs.forEach((roof) => { roof.set({ From 6c6ba0eb72781541f5f5f12f991043d2550d19f2 Mon Sep 17 00:00:00 2001 From: basssy Date: Tue, 4 Mar 2025 17:19:43 +0900 Subject: [PATCH 06/10] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=20=EB=8F=84=EB=A9=B4?= =?UTF-8?q?=EC=9E=91=EC=84=B1=20=EB=B2=84=ED=8A=BC=20=EC=BB=A8=ED=8A=B8?= =?UTF-8?q?=EB=A1=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/management/StuffSubHeader.jsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/management/StuffSubHeader.jsx b/src/components/management/StuffSubHeader.jsx index f130b729..c22f4cb8 100644 --- a/src/components/management/StuffSubHeader.jsx +++ b/src/components/management/StuffSubHeader.jsx @@ -23,7 +23,7 @@ export default function StuffSubHeader({ type }) { const setFloorPlanObjectNo = useSetRecoilState(floorPlanObjectState) - const { managementState } = useContext(GlobalDataContext) + const { managementState, setManagementState } = useContext(GlobalDataContext) const [buttonStyle, setButtonStyle] = useState('') @@ -31,17 +31,20 @@ export default function StuffSubHeader({ type }) { useEffect(() => { window.scrollTo(0, 0) + setManagementState({}) }, []) useEffect(() => { - if (isObjectNotEmpty(managementState)) { - if (managementState?.createSaleStoreId === 'T01') { - if (session?.storeId !== 'T01') { - setButtonStyle('none') + if (type === 'detail') { + if (isObjectNotEmpty(managementState)) { + if (managementState?.createSaleStoreId === 'T01') { + if (session?.storeId !== 'T01') { + setButtonStyle('none') + } } } } - }, [managementState?.createSaleStoreId]) + }, [type, managementState]) const searchParams = useSearchParams() const objectNo = searchParams.get('objectNo') //url에서 물건번호 꺼내서 바로 set From bc07fc9e047526e980590322349140fb3828e821 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 4 Mar 2025 17:51:26 +0900 Subject: [PATCH 07/10] =?UTF-8?q?module=EC=9D=B4=20=EC=97=86=EC=9D=84=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0=EC=97=90=EB=8A=94=20directionText=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/module/useOrientation.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hooks/module/useOrientation.js b/src/hooks/module/useOrientation.js index cef2b5a6..649d8f79 100644 --- a/src/hooks/module/useOrientation.js +++ b/src/hooks/module/useOrientation.js @@ -27,10 +27,12 @@ export function useOrientation() { setCompasDeg(0) } const roofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF) - - /*roofs.forEach((roof) => { - roof.directionText = null - })*/ + const hasModules = canvas.getObjects().some((obj) => obj.name === 'module') + if (!hasModules) { + roofs.forEach((roof) => { + delete roof.directionText + }) + } roofs.forEach((roof) => { roof.set({ From 89f5c2d708d7a36e2cf53c56a56bed4de07c5317 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 4 Mar 2025 18:15:13 +0900 Subject: [PATCH 08/10] =?UTF-8?q?-=20=EA=B2=AC=EC=A0=81=EC=84=9C=20API=20c?= =?UTF-8?q?ircuitItemList=20=EB=82=B4=EC=9A=A9=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modal/circuitTrestle/CircuitTrestleSetting.jsx | 4 ++-- src/hooks/module/useTrestle.js | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index 981201ec..e0d32bbc 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -563,8 +563,8 @@ export default function CircuitTrestleSetting({ id }) { goodsNo: model.goodsNo, serQtyList: [ { - serQty: result[index + 1].maxValue, - paralQty: result[index + 1].count, + serQty: result[(index + 1).toString()] ? result[(index + 1).toString()].maxValue : 0, + paralQty: result[(index + 1).toString()] ? result[(index + 1).toString()].count : 0, rmdYn: 'Y', usePossYn: 'Y', roofSurfaceList: canvas diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 73fca74e..b122a19e 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -9,6 +9,7 @@ import { basicSettingState, trestleDisplaySelector } from '@/store/settingAtom' import { useSwal } from '@/hooks/useSwal' import { useContext } from 'react' import { QcastContext } from '@/app/QcastProvider' +import { useCircuitTrestle } from '@/hooks/useCirCuitTrestle' // 모듈간 같은 행, 열의 마진이 10 이하인 경우는 같은 행, 열로 간주 const MODULE_MARGIN = 10 @@ -22,6 +23,9 @@ export const useTrestle = () => { const isTrestleDisplay = useRecoilValue(trestleDisplaySelector) const { swalFire } = useSwal() const { setIsGlobalLoading } = useContext(QcastContext) + + const { getSelectedPcsItemList } = useCircuitTrestle() + const apply = () => { const notAllocationModules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE && !obj.circuit) if (notAllocationModules.length > 0) { @@ -723,11 +727,7 @@ export const useTrestle = () => { // circuitItemList 중복제거 circuitItemList = circuitItemList.filter((item, index) => circuitItemList.indexOf(item) === index) - circuitItemList = circuitItemList.map((circuitId) => { - return { - itemId: circuitId, - } - }) + circuitItemList = getSelectedPcsItemList() return { itemList, northArrangement, roofSurfaceList, circuitItemList } } From 087d43cc15b61b24eeefb2ac783aa2f1ac1cff2f Mon Sep 17 00:00:00 2001 From: basssy Date: Wed, 5 Mar 2025 10:13:33 +0900 Subject: [PATCH 09/10] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=84=9C=20=EC=95=88?= =?UTF-8?q?=EA=B1=B4=EB=AA=85Omit=20select=20isClearable=20true?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/estimate/Estimate.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index 3810bd7b..da241db1 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -1263,7 +1263,7 @@ export default function Estimate({}) { }} getOptionLabel={(x) => x.clCodeNm} getOptionValue={(x) => x.clCode} - isClearable={false} + isClearable={true} isSearchable={false} value={honorificCodeList.filter(function (option) { return option.clCodeNm === estimateContextState.objectNameOmit From 0a24c23bf15c0b05d24153b92207b5216e613076 Mon Sep 17 00:00:00 2001 From: basssy Date: Wed, 5 Mar 2025 12:29:54 +0900 Subject: [PATCH 10/10] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=84=9C=EB=B3=B5?= =?UTF-8?q?=EC=82=AC=ED=8C=9D=EC=97=85=20=EB=8B=B4=EB=8B=B9=EC=9E=90?= =?UTF-8?q?=EB=AA=85=20default=20value=20session=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/estimate/popup/EstimateCopyPop.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/estimate/popup/EstimateCopyPop.jsx b/src/components/estimate/popup/EstimateCopyPop.jsx index 3bc25c74..564a1aae 100644 --- a/src/components/estimate/popup/EstimateCopyPop.jsx +++ b/src/components/estimate/popup/EstimateCopyPop.jsx @@ -106,7 +106,7 @@ export default function EstimateCopyPop({ planNo, setEstimateCopyPopupOpen }) { useEffect(() => { if (estimateContextState?.charger) { - setCopyReceiveUser(estimateContextState.charger) + setCopyReceiveUser(session?.userNm) } }, [estimateContextState?.charger])