From 91be8396b14a980dd5870d1530696b8578847e11 Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Fri, 14 Mar 2025 15:04:22 +0900 Subject: [PATCH 01/11] =?UTF-8?q?fix:=20=EB=B2=88=EC=97=AD=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 개발자 확인용 한글 제거 처리 --- .../floor-plan/modal/wallLineOffset/type/Offset.jsx | 2 +- src/hooks/roofcover/useAuxiliaryDrawing.js | 7 +++++-- src/hooks/roofcover/useOuterLineWall.js | 4 ++-- src/hooks/roofcover/useWallLineOffsetSetting.js | 2 +- src/hooks/surface/usePlacementShapeDrawing.js | 4 ++-- src/locales/ja.json | 3 ++- src/locales/ko.json | 3 ++- src/util/qpolygon-utils.js | 6 +++--- 8 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/components/floor-plan/modal/wallLineOffset/type/Offset.jsx b/src/components/floor-plan/modal/wallLineOffset/type/Offset.jsx index 418a9419..16036485 100644 --- a/src/components/floor-plan/modal/wallLineOffset/type/Offset.jsx +++ b/src/components/floor-plan/modal/wallLineOffset/type/Offset.jsx @@ -23,7 +23,7 @@ export default function Offset({ length1Ref, arrow1Ref, currentWallLineRef }) { const keyDown = (e) => { if (currentWallLineRef.current === null) { - alert('보조선을 먼저 선택하세요') + // alert('보조선을 먼저 선택하세요') return } diff --git a/src/hooks/roofcover/useAuxiliaryDrawing.js b/src/hooks/roofcover/useAuxiliaryDrawing.js index 7863aea0..6023bce8 100644 --- a/src/hooks/roofcover/useAuxiliaryDrawing.js +++ b/src/hooks/roofcover/useAuxiliaryDrawing.js @@ -22,6 +22,7 @@ import { useSwal } from '@/hooks/useSwal' import { usePopup } from '@/hooks/usePopup' import { calculateAngle, isSamePoint } from '@/util/qpolygon-utils' import { POLYGON_TYPE } from '@/common/common' +import { useMessage } from '../useMessage' // 보조선 작성 export function useAuxiliaryDrawing(id, isUseEffect = true) { @@ -34,6 +35,7 @@ export function useAuxiliaryDrawing(id, isUseEffect = true) { const { swalFire } = useSwal() const { getAdsorptionPoints } = useAdsorptionPoint() const { closePopup } = usePopup() + const { getMessage } = useMessage() const adsorptionRange = useRecoilValue(adsorptionRangeState) @@ -411,7 +413,7 @@ export function useAuxiliaryDrawing(id, isUseEffect = true) { const length1Value = length1Ref.current.value if (diagonalLength <= length1Value) { - alert('대각선 길이는 직선 길이보다 길어야 합니다.') + // alert('대각선 길이는 직선 길이보다 길어야 합니다.') return } @@ -832,7 +834,8 @@ export function useAuxiliaryDrawing(id, isUseEffect = true) { } const handleFix = () => { - if (!confirm('보조선 작성을 완료하시겠습니까?')) { + // if (!confirm('보조선 작성을 완료하시겠습니까?')) { + if (!confirm(getMessage('want.to.complete.auxiliary.creation'))) { return } diff --git a/src/hooks/roofcover/useOuterLineWall.js b/src/hooks/roofcover/useOuterLineWall.js index 7e94f074..bced656b 100644 --- a/src/hooks/roofcover/useOuterLineWall.js +++ b/src/hooks/roofcover/useOuterLineWall.js @@ -567,7 +567,7 @@ export function useOuterLineWall(id, propertiesId) { const length1Value = length1Ref.current.value if (diagonalLength <= length1Value) { - alert('대각선 길이는 직선 길이보다 길어야 합니다.') + // alert('대각선 길이는 직선 길이보다 길어야 합니다.') return } @@ -890,7 +890,7 @@ export function useOuterLineWall(id, propertiesId) { }) if (isAllRightAngle) { - alert('부정확한 다각형입니다.') + // alert('부정확한 다각형입니다.') return } diff --git a/src/hooks/roofcover/useWallLineOffsetSetting.js b/src/hooks/roofcover/useWallLineOffsetSetting.js index 22af0f49..01fbec09 100644 --- a/src/hooks/roofcover/useWallLineOffsetSetting.js +++ b/src/hooks/roofcover/useWallLineOffsetSetting.js @@ -192,7 +192,7 @@ export function useWallLineOffsetSetting(id) { const handleSave = () => { if (currentWallLineRef.current === null) { - alert('보조선을 먼저 선택하세요') + // alert('보조선을 먼저 선택하세요') return } switch (type) { diff --git a/src/hooks/surface/usePlacementShapeDrawing.js b/src/hooks/surface/usePlacementShapeDrawing.js index 983583ba..b1e92f90 100644 --- a/src/hooks/surface/usePlacementShapeDrawing.js +++ b/src/hooks/surface/usePlacementShapeDrawing.js @@ -564,7 +564,7 @@ export function usePlacementShapeDrawing(id) { const length1Value = length1Ref.current.value if (diagonalLength <= length1Value) { - alert('대각선 길이는 직선 길이보다 길어야 합니다.') + // alert('대각선 길이는 직선 길이보다 길어야 합니다.') return } @@ -886,7 +886,7 @@ export function usePlacementShapeDrawing(id) { }) if (isAllRightAngle) { - alert('부정확한 다각형입니다.') + // alert('부정확한 다각형입니다.') return } diff --git a/src/locales/ja.json b/src/locales/ja.json index d839315d..0028a047 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -1033,5 +1033,6 @@ "canvas.infomation.text": "数字は [半角] 入力のみ可能です。", "roof.exceed.count": "屋根材は4つまで選択可能です。", "outerLine.property.fix": "外壁線の属性設定 を完了しますか?", - "outerLine.property.close": "外壁線の属性設定 を終了しますか?" + "outerLine.property.close": "外壁線の属性設定 を終了しますか?", + "want.to.complete.auxiliary.creation": "보補助線の作成を完了しますか?" } diff --git a/src/locales/ko.json b/src/locales/ko.json index 0d00105b..4c051305 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -1033,5 +1033,6 @@ "canvas.infomation.text": "숫자는 [반각] 입력만 가능합니다.", "roof.exceed.count": "지붕재는 4개까지 선택 가능합니다.", "outerLine.property.fix": "외벽선 속성 설정을 완료하시겠습니까?", - "outerLine.property.close": "외벽선 속성 설정을 종료하시겠습니까?" + "outerLine.property.close": "외벽선 속성 설정을 종료하시겠습니까?", + "want.to.complete.auxiliary.creation": "보조선 작성을 완료하시겠습니까?" } diff --git a/src/util/qpolygon-utils.js b/src/util/qpolygon-utils.js index 348f1291..cded90ee 100644 --- a/src/util/qpolygon-utils.js +++ b/src/util/qpolygon-utils.js @@ -320,7 +320,7 @@ export const drawGabledRoof = (roofId, canvas, textMode) => { const wallLines = canvas?.getObjects().find((object) => object.name === POLYGON_TYPE.WALL && object.attributes.roofId === roof.id).lines const hasNonParallelLines = roofLines.filter((line) => line.x1 !== line.x2 && line.y1 !== line.y2) if (hasNonParallelLines.length > 0) { - alert('대각선이 존재합니다.') + // alert('대각선이 존재합니다.') return } @@ -648,7 +648,7 @@ export const drawShedRoof = (roofId, canvas, textMode) => { const roof = canvas?.getObjects().find((object) => object.id === roofId) const hasNonParallelLines = roof.lines.filter((line) => Math.abs(line.x1 - line.x2) > 1 && Math.abs(line.y1 - line.y2) > 1) if (hasNonParallelLines.length > 0) { - alert('대각선이 존재합니다.') + // alert('대각선이 존재합니다.') return } @@ -739,7 +739,7 @@ export const drawRidgeRoof = (roofId, canvas, textMode) => { //Math.abs(line.x1 - line.x2) > 1 && Math.abs(line.y1 - line.y2) > 1 const hasNonParallelLines = roof.lines.filter((line) => Big(line.x1).minus(Big(line.x2)).gt(1) && Big(line.y1).minus(Big(line.y2)).gt(1)) if (hasNonParallelLines.length > 0) { - alert('대각선이 존재합니다.') + // alert('대각선이 존재ㄴ합니다.') return } From 89a7708529afef0291f88c681b078fb2a761d5f9 Mon Sep 17 00:00:00 2001 From: basssy Date: Fri, 14 Mar 2025 15:41:34 +0900 Subject: [PATCH 02/11] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=EC=83=81=EC=84=B8=20?= =?UTF-8?q?=ED=94=8C=EB=9E=9C=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EA=B7=B8?= =?UTF-8?q?=EB=A6=AC=EB=93=9C=20moduleModel=20=ED=97=A4=EB=8D=94=20autoHei?= =?UTF-8?q?ght=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/management/StuffDetail.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index 06a9b35a..b3e73597 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -140,6 +140,7 @@ export default function StuffDetail() { headerName: getMessage('stuff.detail.planGridHeader.moduleModel'), flex: 1, wrapText: true, + autoHeight: true, cellStyle: { alignItems: 'flex-start' /* 좌측정렬*/, cursor: 'pointer' }, cellRenderer: (params) => { let origin = params.value From b57c3fe94306c912bb35a620443729c25a22983e Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 14 Mar 2025 17:06:57 +0900 Subject: [PATCH 03/11] add toFixed attribute in QPolygon --- src/common/common.js | 1 + src/components/fabric/QPolygon.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/common.js b/src/common/common.js index 0fa678db..d82d43f0 100644 --- a/src/common/common.js +++ b/src/common/common.js @@ -202,6 +202,7 @@ export const SAVE_KEY = [ 'fontStyle', 'fontWeight', 'dormerAttributes', + 'toFixed', ] export const OBJECT_PROTOTYPE = [fabric.Line.prototype, fabric.Polygon.prototype, fabric.Triangle.prototype, fabric.Group.prototype] diff --git a/src/components/fabric/QPolygon.js b/src/components/fabric/QPolygon.js index a075b776..85bb03dd 100644 --- a/src/components/fabric/QPolygon.js +++ b/src/components/fabric/QPolygon.js @@ -23,6 +23,7 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, { initOptions: null, direction: null, arrow: null, + toFixed: 1, initialize: function (points, options, canvas) { this.lines = [] this.texts = [] @@ -33,11 +34,12 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, { this.innerLines = [] this.children = [] this.separatePolygon = [] + this.toFixed = options.toFixed ?? 1 // 소수점 전부 제거 points.forEach((point) => { - point.x = Number(point.x.toFixed(1)) - point.y = Number(point.y.toFixed(1)) + point.x = Number(point.x.toFixed(this.toFixed)) + point.y = Number(point.y.toFixed(this.toFixed)) }) options.selectable = options.selectable ?? true options.sort = options.sort ?? true From 3762b6b81eb806bba6f29f2182215504c4aa0f88 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 14 Mar 2025 17:19:14 +0900 Subject: [PATCH 04/11] =?UTF-8?q?canvasSize=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../floor-plan/modal/setting01/planSize/PlanSizeSetting.jsx | 6 +++--- src/hooks/option/useCanvasSetting.js | 3 +++ src/store/canvasAtom.js | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/floor-plan/modal/setting01/planSize/PlanSizeSetting.jsx b/src/components/floor-plan/modal/setting01/planSize/PlanSizeSetting.jsx index 1d4b1e58..10f9adc1 100644 --- a/src/components/floor-plan/modal/setting01/planSize/PlanSizeSetting.jsx +++ b/src/components/floor-plan/modal/setting01/planSize/PlanSizeSetting.jsx @@ -49,7 +49,7 @@ export default function PlanSizeSetting(props) { setPlanSizeSettingMode((prev) => { return { ...prev, - [name]: Number(value), + [name]: Number(value) / 10, } }) } @@ -72,7 +72,7 @@ export default function PlanSizeSetting(props) { type="text" className="input-origin block" name={`originHorizon`} - value={planSizeSettingMode.originHorizon} + value={planSizeSettingMode.originHorizon * 10} onChange={(e) => onlyNumberInputChange(e, changeInput)} /> @@ -85,7 +85,7 @@ export default function PlanSizeSetting(props) { type="text" className="input-origin block" name={`originVertical`} - value={planSizeSettingMode.originVertical} + value={planSizeSettingMode.originVertical * 10} onChange={(e) => onlyNumberInputChange(e, changeInput)} /> diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index 539c43ec..76f42075 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -612,6 +612,9 @@ export function useCanvasSetting(executeEffect = true) { /** 도면크기 설정 */ setPlanSizeSettingMode({ ...planSizeSettingMode, originHorizon: res.originHorizon, originVertical: res.originVertical }) + canvas.setWidth(res.originHorizon) + canvas.setHeight(res.originVertical) + canvas.renderAll() /** 데이터 설정 */ setSettingModalFirstOptions({ diff --git a/src/store/canvasAtom.js b/src/store/canvasAtom.js index 772e55be..ddeed03d 100644 --- a/src/store/canvasAtom.js +++ b/src/store/canvasAtom.js @@ -43,7 +43,7 @@ export const fontSizeState = atom({ export const canvasSizeState = atom({ key: 'canvasSize', default: { - vertical: 1000, + vertical: 1600, horizontal: 1600, }, }) From 20b90d0df66f44025b66225cb714e12140302c85 Mon Sep 17 00:00:00 2001 From: basssy Date: Fri, 14 Mar 2025 17:26:59 +0900 Subject: [PATCH 05/11] #900 YJSS --- src/components/estimate/Estimate.jsx | 39 +++++-------------- src/components/floor-plan/CanvasMenu.jsx | 5 --- src/components/management/StuffDetail.jsx | 2 + .../estimate/useEstimateController.js | 25 +++++++----- 4 files changed, 26 insertions(+), 45 deletions(-) diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index 38ff2289..a44af878 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -480,10 +480,6 @@ export default function Estimate({}) { //Pricing 버튼 const handlePricing = async (showPriceCd) => { - //todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요 - if (estimateContextState.estimateType === 'YJSS') { - return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' }) - } const param = { saleStoreId: session.storeId, sapSalesStoreCd: session.custCd, @@ -699,14 +695,10 @@ export default function Estimate({}) { /* 케이블 select 변경시 */ const onChangeDisplayCableItem = (value, itemList) => { - //todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요 - if (estimateContextState.estimateType === 'YJSS') { - return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' }) - } itemList.map((item, index) => { if (item.dispCableFlg === '1') { if (value !== '') { - onChangeDisplayItem(value, item.dispOrder, index) + onChangeDisplayItem(value, item.dispOrder, index, true) } } }) @@ -714,11 +706,7 @@ export default function Estimate({}) { } // 아이템 자동완성 검색시 아이템 추가/변경시 - const onChangeDisplayItem = (itemId, dispOrder, index) => { - //todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요 - if (estimateContextState.estimateType === 'YJSS') { - return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' }) - } + const onChangeDisplayItem = (itemId, dispOrder, index, flag) => { const param = { itemId: itemId, coldZoneFlg: estimateContextState?.coldRegionFlg, @@ -748,7 +736,7 @@ export default function Estimate({}) { updates.itemGroup = res.itemGroup updates.delFlg = '0' // 삭제플래그 0 updates.saleTotPrice = (res.salePrice * estimateContextState.itemList[index].amount).toString() - updates.amount = '' + updates.amount = flag ? estimateContextState.itemList[index].amount : '' updates.openFlg = res.openFlg if (estimateContextState.estimateType === 'YJSS') { @@ -1032,7 +1020,6 @@ export default function Estimate({}) { }) let dispCableFlgCnt = 0 estimateContextState.itemList.forEach((item) => { - // console.log('YJSS::::::::', item) if (item.delFlg === '0') { let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', '')) || 0 let salePrice @@ -1068,7 +1055,6 @@ export default function Estimate({}) { } if (item.dispCableFlg === '1') { - // console.log('YJSS22222::::::::', item) dispCableFlgCnt++ setCableItem(item.itemId) } @@ -1356,7 +1342,7 @@ export default function Estimate({}) {
- {/*
+
-
*/} +
{ - //todo: 추후 YJSS가 다시 나타날 경우 아래 주석풀기 - // setHandlePricingFlag(true) + setHandlePricingFlag(true) setEstimateContextState({ estimateType: e.target.value }) }} /> @@ -1677,9 +1662,8 @@ export default function Estimate({}) {
- {/* //todo: 추후 YJSS가 다시 나타날 경우 주석 풀기 */} {/* YJOD면 아래영역 숨김 */} - {/*
+
@@ -1714,7 +1698,7 @@ export default function Estimate({}) {
-
*/} +
{/* 제품정보 끝 */} {/* 가격표시영역시작 */}
@@ -1871,7 +1855,7 @@ export default function Estimate({}) { options={originDisplayItemList} onChange={(e) => { if (isObjectNotEmpty(e)) { - onChangeDisplayItem(e.itemId, item.dispOrder, index) + onChangeDisplayItem(e.itemId, item.dispOrder, index, false) } }} menuPlacement={'auto'} @@ -1895,11 +1879,6 @@ export default function Estimate({}) { classNamePrefix="custom" placeholder="Select" options={cableItemList} - onChange={(e) => { - if (isObjectNotEmpty(e)) { - onChangeDisplayItem(e.clRefChr1, item.dispOrder, index) - } - }} menuPlacement={'auto'} getOptionLabel={(x) => x.clRefChr3} getOptionValue={(x) => x.clRefChr1} diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index 66dbf43a..e10d9ebc 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -365,11 +365,6 @@ export default function CanvasMenu(props) { // 견적서 초기화 버튼 const handleEstimateReset = () => { - //todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요 - if (estimateRecoilState.estimateType === 'YJSS') { - return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' }) - } - swalFire({ text: getMessage('estimate.detail.reset.confirmMsg'), type: 'confirm', diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index b3e73597..b5020d5b 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -371,6 +371,7 @@ export default function StuffDetail() { swalFire({ text: getMessage('stuff.detail.header.notExistObjectNo'), type: 'alert', + icon: 'error', confirmFn: () => { router.push('/management/stuff', { scroll: false }) }, @@ -388,6 +389,7 @@ export default function StuffDetail() { swalFire({ text: getMessage('stuff.detail.header.notExistObjectNo'), type: 'alert', + icon: 'error', confirmFn: () => { router.push('/management/stuff', { scroll: false }) }, diff --git a/src/hooks/floorPlan/estimate/useEstimateController.js b/src/hooks/floorPlan/estimate/useEstimateController.js index 1b957e0a..c326a964 100644 --- a/src/hooks/floorPlan/estimate/useEstimateController.js +++ b/src/hooks/floorPlan/estimate/useEstimateController.js @@ -166,11 +166,6 @@ export const useEstimateController = (planNo, flag) => { //견적서 저장 const handleEstimateSubmit = async () => { - //todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요 - if (estimateData.estimateType === 'YJSS') { - return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' }) - } - //0. 필수체크 let flag = true let originFileFlg = false @@ -300,6 +295,19 @@ export const useEstimateController = (planNo, flag) => { } } } else { + //견적서를 복사하면 API에서 봄컴포넌트는 salePrice, unitPrice를 0으로 내려옴..front에서 처리 + if (item.salePrice === null) { + item.salePrice = '0' + } else if (isNaN(item.salePrice)) { + item.salePrice = '0' + } + + if (item.unitPrice === null) { + item.unitPrice = '0' + } else if (isNaN(item.unitPrice)) { + item.unitPrice = '0' + } + //봄 컴포넌트 제품은 0으로 item.openFlg = '0' } @@ -386,6 +394,7 @@ export const useEstimateController = (planNo, flag) => { estimateData.estimateOption = estimateOptions // console.log('최종아이템:::', estimateData.itemList) + if (fileList?.length > 0) { estimateData.fileList = fileList } else { @@ -413,7 +422,7 @@ export const useEstimateController = (planNo, flag) => { }) } catch (e) { setIsGlobalLoading(false) - console.log('error::::::::::::', e.response.data.message) + console.error('error::::::::::::', e.response.data.message) } } @@ -423,10 +432,6 @@ export const useEstimateController = (planNo, flag) => { * T01관리자 계정 및 1차판매점에게만 제공 */ const handleEstimateCopy = async (sendPlanNo, copyReceiveUser, saleStoreId, otherSaleStoreId, setEstimateCopyPopupOpen) => { - //todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요 - if (estimateData.estimateType === 'YJSS') { - return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' }) - } if (saleStoreId === '') { return swalFire({ text: getMessage('estimate.detail.productFeaturesPopup.requiredStoreId'), From 0956bcc4ad6f8ddd9bd7aca8be39dac931535829 Mon Sep 17 00:00:00 2001 From: basssy Date: Fri, 14 Mar 2025 17:55:58 +0900 Subject: [PATCH 06/11] =?UTF-8?q?=EC=A3=BC=EC=84=9D=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/floorPlan/estimate/useEstimateController.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hooks/floorPlan/estimate/useEstimateController.js b/src/hooks/floorPlan/estimate/useEstimateController.js index c326a964..d509a1e0 100644 --- a/src/hooks/floorPlan/estimate/useEstimateController.js +++ b/src/hooks/floorPlan/estimate/useEstimateController.js @@ -295,7 +295,6 @@ export const useEstimateController = (planNo, flag) => { } } } else { - //견적서를 복사하면 API에서 봄컴포넌트는 salePrice, unitPrice를 0으로 내려옴..front에서 처리 if (item.salePrice === null) { item.salePrice = '0' } else if (isNaN(item.salePrice)) { From 69e56a7297dc2ca6125f9372ca0e705d96bdaf61 Mon Sep 17 00:00:00 2001 From: yjnoh Date: Fri, 14 Mar 2025 18:18:58 +0900 Subject: [PATCH 07/11] =?UTF-8?q?=EB=AA=A8=EB=93=88=EC=88=98=EB=8F=99?= =?UTF-8?q?=EC=84=A4=EC=B9=98=20=ED=9D=A1=EC=B0=A9=EC=A0=90=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/module/useModuleBasicSetting.js | 139 +++++++++++++--------- 1 file changed, 83 insertions(+), 56 deletions(-) diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js index 3d90038e..5db1963e 100644 --- a/src/hooks/module/useModuleBasicSetting.js +++ b/src/hooks/module/useModuleBasicSetting.js @@ -1,7 +1,7 @@ import { useState } from 'react' import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil' import { canvasSettingState, canvasState, checkedModuleState, currentObjectState, isManualModuleSetupState } from '@/store/canvasAtom' -import { rectToPolygon, polygonToTurfPolygon, calculateVisibleModuleHeight, getDegreeByChon } from '@/util/canvas-util' +import { rectToPolygon, polygonToTurfPolygon, calculateVisibleModuleHeight, getDegreeByChon, toFixedWithoutRounding } from '@/util/canvas-util' import { basicSettingState, roofDisplaySelector } from '@/store/settingAtom' import offsetPolygon, { calculateAngle, createLinesFromPolygon } from '@/util/qpolygon-utils' import { QPolygon } from '@/components/fabric/QPolygon' @@ -424,6 +424,8 @@ export function useModuleBasicSetting(tabNum) { * 확인 후 셀을 이동시킴 */ const manualModuleSetup = (placementRef) => { + console.log('isManualModuleSetup', isManualModuleSetup) + const moduleSetupSurfaces = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) //모듈설치면를 가져옴 if (isManualModuleSetup) { @@ -493,20 +495,20 @@ export function useModuleBasicSetting(tabNum) { const points = [ { - x: Number(mousePoint.x.toFixed(1)) + Number((width / 2).toFixed(1)), - y: Number(mousePoint.y.toFixed(1)) - Number((height / 2).toFixed(1)), + x: toFixedWithoutRounding(mousePoint.x, 2) + toFixedWithoutRounding(width / 2, 2), + y: toFixedWithoutRounding(mousePoint.y, 2) - toFixedWithoutRounding(height / 2, 2), }, { - x: Number(mousePoint.x.toFixed(1)) + Number((width / 2).toFixed(1)), - y: Number(mousePoint.y.toFixed(1)) + Number((height / 2).toFixed(1)), + x: toFixedWithoutRounding(mousePoint.x, 2) + toFixedWithoutRounding(width / 2, 2), + y: toFixedWithoutRounding(mousePoint.y, 2) + toFixedWithoutRounding(height / 2, 2), }, { - x: Number(mousePoint.x.toFixed(1)) - Number((width / 2).toFixed(1)), - y: Number(mousePoint.y.toFixed(1)) - Number((height / 2).toFixed(1)), + x: toFixedWithoutRounding(mousePoint.x, 2) - toFixedWithoutRounding(width / 2, 2), + y: toFixedWithoutRounding(mousePoint.y, 2) - toFixedWithoutRounding(height / 2, 2), }, { - x: Number(mousePoint.x.toFixed(1)) - Number((width / 2).toFixed(1)), - y: Number(mousePoint.y.toFixed(1)) + Number((height / 2).toFixed(1)), + x: toFixedWithoutRounding(mousePoint.x, 2) - toFixedWithoutRounding(width / 2, 2), + y: toFixedWithoutRounding(mousePoint.y, 2) + toFixedWithoutRounding(height / 2, 2), }, ] @@ -522,10 +524,10 @@ export function useModuleBasicSetting(tabNum) { fill: 'white', stroke: 'black', strokeWidth: 0.3, - width: Number(width.toFixed(1)), - height: Number(height.toFixed(1)), - left: Number(mousePoint.x.toFixed(1) - Number((width / 2).toFixed(1))), - top: Number(mousePoint.y.toFixed(1) - Number((height / 2).toFixed(1))), + width: toFixedWithoutRounding(width, 2), + height: toFixedWithoutRounding(height, 2), + left: toFixedWithoutRounding(mousePoint.x, 2) - toFixedWithoutRounding(width / 2, 2), + top: toFixedWithoutRounding(mousePoint.y, 2) - toFixedWithoutRounding(height / 2, 2), selectable: false, lockMovementX: true, lockMovementY: true, @@ -546,7 +548,7 @@ export function useModuleBasicSetting(tabNum) { /** * 스냅기능 */ - let snapDistance = flowDirection === 'south' || flowDirection === 'north' ? 5 : 5 + let snapDistance = flowDirection === 'south' || flowDirection === 'north' ? 70 : 40 let trestleSnapDistance = 15 let intvHor = @@ -558,67 +560,84 @@ export function useModuleBasicSetting(tabNum) { ? moduleSetupSurfaces[i].trestleDetail.moduleIntvlVer / 10 : moduleSetupSurfaces[i].trestleDetail.moduleIntvlHor / 10 - const trestleLeft = Number(moduleSetupSurfaces[i].left.toFixed(1)) - Number((moduleSetupSurfaces[i].width / 2).toFixed(1)) - const trestleTop = Number(moduleSetupSurfaces[i].top.toFixed(1)) - Number((moduleSetupSurfaces[i].height / 2).toFixed(1)) - const trestleRight = Number(moduleSetupSurfaces[i].left.toFixed(1)) + Number((moduleSetupSurfaces[i].width / 2).toFixed(1)) - const trestleBottom = Number(moduleSetupSurfaces[i].top.toFixed(1)) + Number((moduleSetupSurfaces[i].height / 2).toFixed(1)) + const trestleLeft = toFixedWithoutRounding(moduleSetupSurfaces[i].left, 2) - toFixedWithoutRounding(moduleSetupSurfaces[i].width / 2, 2) + const trestleTop = toFixedWithoutRounding(moduleSetupSurfaces[i].top, 2) - toFixedWithoutRounding(moduleSetupSurfaces[i].height / 2, 2) + const trestleRight = + toFixedWithoutRounding(moduleSetupSurfaces[i].left, 2) + toFixedWithoutRounding(moduleSetupSurfaces[i].width / 2, 2) + const trestleBottom = + toFixedWithoutRounding(moduleSetupSurfaces[i].top, 2) + toFixedWithoutRounding(moduleSetupSurfaces[i].height / 2, 2) const bigCenterY = (trestleTop + trestleTop + moduleSetupSurfaces[i].height) / 2 // 이동하는 모듈의 경계 좌표 - const smallLeft = Number(tempModule.left.toFixed(1)) - const smallTop = Number(tempModule.top.toFixed(1)) - const smallRight = smallLeft + Number(tempModule.width.toFixed(1)) - const smallBottom = smallTop + Number(tempModule.height.toFixed(1)) - const smallCenterX = smallLeft + Number((tempModule.width / 2).toFixed(1)) - const smallCenterY = smallTop + Number((tempModule.height / 2).toFixed(1)) + const smallLeft = toFixedWithoutRounding(tempModule.left, 2) + const smallTop = toFixedWithoutRounding(tempModule.top, 2) + const smallRight = smallLeft + toFixedWithoutRounding(tempModule.width, 2) + const smallBottom = smallTop + toFixedWithoutRounding(tempModule.height, 2) + const smallCenterX = smallLeft + toFixedWithoutRounding(tempModule.width / 2, 2) + const smallCenterY = smallTop + toFixedWithoutRounding(tempModule.height / 2, 2) /** * 미리 깔아놓은 셀이 있을때 셀에 흡착됨 */ if (manualDrawModules) { manualDrawModules.forEach((cell) => { - const holdCellLeft = cell.left - const holdCellTop = cell.top - const holdCellRight = holdCellLeft + Number(cell.width.toFixed(1)) - const holdCellBottom = holdCellTop + Number(cell.height.toFixed(1)) - const holdCellCenterX = holdCellLeft + Number((cell.width / 2).toFixed(1)) - const holdCellCenterY = holdCellTop + Number((cell.height / 2).toFixed(1)) + const holdCellLeft = toFixedWithoutRounding(cell.left, 2) + const holdCellTop = toFixedWithoutRounding(cell.top, 2) + const holdCellRight = holdCellLeft + toFixedWithoutRounding(cell.width, 2) + const holdCellBottom = holdCellTop + toFixedWithoutRounding(cell.height, 2) + const holdCellCenterX = holdCellLeft + toFixedWithoutRounding(cell.width / 2, 2) + const holdCellCenterY = holdCellTop + toFixedWithoutRounding(cell.height / 2, 2) + + //가운데 -> 가운대 + if (Math.abs(smallCenterX - holdCellCenterX) < snapDistance) { + tempModule.left = holdCellCenterX - toFixedWithoutRounding(width / 2, 2) + } + + //왼쪽 -> 가운데 + if (Math.abs(smallLeft - holdCellCenterX) < snapDistance) { + // console.log('holdCellCenterX', holdCellCenterX) + // console.log('smallLeft', smallLeft) + + // console.log('모듈 센터에 스냅') + tempModule.left = holdCellCenterX + intvHor / 2 + + // console.log('tempModule.left', tempModule.left) + } + // 오른쪽 -> 가운데 + if (Math.abs(smallRight - holdCellCenterX) < snapDistance) { + tempModule.left = holdCellCenterX - width - intvHor / 2 + } //설치된 셀에 좌측에 스냅 if (Math.abs(smallRight - holdCellLeft) < snapDistance) { + // console.log('모듈 좌측 스냅') tempModule.left = holdCellLeft - width - intvHor } //설치된 셀에 우측에 스냅 if (Math.abs(smallLeft - holdCellRight) < snapDistance) { + // console.log('모듈 우측 스냅') tempModule.left = holdCellRight + intvHor } - //설치된 셀에 위쪽에 스냅 - if (Math.abs(smallBottom - holdCellTop) < snapDistance) { + if (Math.abs(smallBottom - holdCellTop) < 10) { tempModule.top = holdCellTop - height - intvVer } //설치된 셀에 밑쪽에 스냅 - if (Math.abs(smallTop - holdCellBottom) < snapDistance) { + if (Math.abs(smallTop - holdCellBottom) < 10) { tempModule.top = holdCellBottom + intvVer } - //가운데 -> 가운데 - if (Math.abs(smallCenterX - holdCellCenterX) < snapDistance) { - tempModule.left = holdCellCenterX - Number((width / 2).toFixed(1)) - } - //왼쪽 -> 가운데 - if (Math.abs(smallLeft - holdCellCenterX) < snapDistance) { - tempModule.left = holdCellCenterX + intvHor - } - // 오른쪽 -> 가운데 - if (Math.abs(smallRight - holdCellCenterX) < snapDistance) { - tempModule.left = holdCellCenterX - width - intvHor + + //설치된 셀에 윗쪽에 스냅 + if (Math.abs(smallTop - holdCellTop) < 10) { + tempModule.top = holdCellTop } + //세로 가운데 -> 가운데 - if (Math.abs(smallCenterY - holdCellCenterY) < snapDistance) { - tempModule.top = holdCellCenterY - Number((height / 2).toFixed(1)) - } + // if (Math.abs(smallCenterY - holdCellCenterY) < snapDistance) { + // tempModule.top = holdCellCenterY - toFixedWithoutRounding(height / 2, 1) + // } // //위쪽 -> 가운데 // if (Math.abs(smallTop - holdCellCenterY) < cellSnapDistance) { // tempModule.top = holdCellCenterY @@ -700,13 +719,19 @@ export function useModuleBasicSetting(tabNum) { if (!inside) return if (tempModule) { const rectPoints = [ - { x: Number(tempModule.left.toFixed(1)), y: Number(tempModule.top.toFixed(1)) }, - { x: Number(tempModule.left.toFixed(1)) + Number(tempModule.width.toFixed(1)), y: Number(tempModule.top.toFixed(1)) }, + { x: toFixedWithoutRounding(tempModule.left, 2), y: toFixedWithoutRounding(tempModule.top, 2) }, { - x: Number(tempModule.left.toFixed(1)) + Number(tempModule.width.toFixed(1)), - y: Number(tempModule.top.toFixed(1)) + Number(tempModule.height.toFixed(1)), + x: toFixedWithoutRounding(tempModule.left, 2) + toFixedWithoutRounding(tempModule.width, 2), + y: toFixedWithoutRounding(tempModule.top, 2), + }, + { + x: toFixedWithoutRounding(tempModule.left, 2) + toFixedWithoutRounding(tempModule.width, 2), + y: toFixedWithoutRounding(tempModule.top, 2) + toFixedWithoutRounding(tempModule.height, 2), + }, + { + x: toFixedWithoutRounding(tempModule.left, 2), + y: toFixedWithoutRounding(tempModule.top, 2) + toFixedWithoutRounding(tempModule.height, 2), }, - { x: Number(tempModule.left.toFixed(1)), y: Number(tempModule.top.toFixed(1)) + Number(tempModule.height.toFixed(1)) }, ] tempModule.set({ points: rectPoints }) @@ -743,11 +768,13 @@ export function useModuleBasicSetting(tabNum) { let manualModule = new QPolygon(tempModule.points, { ...moduleOptions, moduleInfo: checkedModule[0], - left: Number(tempModule.left.toFixed(1)), - top: Number(tempModule.top.toFixed(1)), - width: Number(tempModule.width.toFixed(1)), - height: Number(tempModule.height.toFixed(1)), + left: toFixedWithoutRounding(tempModule.left, 2), + top: toFixedWithoutRounding(tempModule.top, 2), + width: toFixedWithoutRounding(tempModule.width, 2), + height: toFixedWithoutRounding(tempModule.height, 2), + toFixed: 2, }) + canvas?.add(manualModule) manualDrawModules.push(manualModule) setModuleStatisticsData() From 222dca6d14a4347ea7348c289196cd9c6d272931 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 14 Mar 2025 18:21:00 +0900 Subject: [PATCH 08/11] =?UTF-8?q?=EB=A7=A5=EC=8A=A4=2010=EB=A7=8C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../floor-plan/modal/setting01/planSize/PlanSizeSetting.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/floor-plan/modal/setting01/planSize/PlanSizeSetting.jsx b/src/components/floor-plan/modal/setting01/planSize/PlanSizeSetting.jsx index 10f9adc1..629b45d0 100644 --- a/src/components/floor-plan/modal/setting01/planSize/PlanSizeSetting.jsx +++ b/src/components/floor-plan/modal/setting01/planSize/PlanSizeSetting.jsx @@ -46,6 +46,10 @@ export default function PlanSizeSetting(props) { const changeInput = (value, e) => { const { name } = e.target + if (Number(value) > 100000) { + value = 100000 + } + setPlanSizeSettingMode((prev) => { return { ...prev, From a18ae6518d178d0bb176ca26bb28c85417dcf0e5 Mon Sep 17 00:00:00 2001 From: basssy Date: Mon, 17 Mar 2025 10:30:38 +0900 Subject: [PATCH 09/11] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=20=EC=83=81=EC=84=B8?= =?UTF-8?q?=20&=20=EA=B2=AC=EC=A0=81=EC=84=9C=20=EC=83=81=EC=84=B8=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=EB=AA=85=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasMenu.jsx | 59 ++++++++++++----------- src/components/management/StuffDetail.jsx | 16 +++--- 2 files changed, 40 insertions(+), 35 deletions(-) diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index e10d9ebc..0d9ddc0a 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -89,11 +89,11 @@ export default function CanvasMenu(props) { const selectedRoofMaterial = useRecoilValue(selectedRoofMaterialSelector) //견적서버튼 노출용 - const [buttonStyle1, setButtonStyle1] = useState('') //문서 다운로드 버튼 - const [buttonStyle2, setButtonStyle2] = useState('') //저장 버튼 - const [buttonStyle3, setButtonStyle3] = useState('') //초기화 버튼 - const [buttonStyle4, setButtonStyle4] = useState('') //견적서 복사 버튼 - const [buttonStyle5, setButtonStyle5] = useState('') //잠금 버튼 + const [docDownButtonStyle, setDocDownButtonStyle] = useState('') //문서 다운로드 버튼 + const [saveButtonStyle, setSaveButtonStyle] = useState('') //저장 버튼 + const [resetButtonStyle, setResetButtonStyle] = useState('') //초기화 버튼 + const [copyButtonStyle, setCopyButtonStyle] = useState('') //견적서 복사 버튼 + const [lockButtonStyle, setLockButtonStyle] = useState('') //잠금 버튼 const setFloorPlanObjectNo = useSetRecoilState(floorPlanObjectState) //견적서 화면용 물건번호리코일 @@ -442,28 +442,28 @@ export default function CanvasMenu(props) { }, [estimateContextState?.createUser, estimateContextState?.tempFlg, estimateContextState?.lockFlg, estimateContextState.docNo]) const setAllButtonStyles = (style) => { - setButtonStyle1(style) - setButtonStyle2(style) - setButtonStyle3(style) - setButtonStyle4(style) - setButtonStyle5(style) + setDocDownButtonStyle(style) + setSaveButtonStyle(style) + setResetButtonStyle(style) + setCopyButtonStyle(style) + setLockButtonStyle(style) } const handleButtonStyles = (tempFlg, lockFlg, docNo) => { if (tempFlg === '1') { setAllButtonStyles('none') - setButtonStyle2('') + setSaveButtonStyle('') } else if (tempFlg === '0' && lockFlg === '0') { setAllButtonStyles('') } else { - setButtonStyle1('') - setButtonStyle2('none') - setButtonStyle3('none') - setButtonStyle4('') - setButtonStyle5('') + setDocDownButtonStyle('') + setSaveButtonStyle('none') + setResetButtonStyle('none') + setCopyButtonStyle('') + setLockButtonStyle('') } if (!docNo) { - setButtonStyle1('none') + setDocDownButtonStyle('none') } } @@ -513,11 +513,11 @@ export default function CanvasMenu(props) { // 문서다운로드 팝업에서 다운로드 하면 문서 잠금 const docDownPopLockFlg = () => { - setButtonStyle1('') - setButtonStyle2('none') - setButtonStyle3('none') - setButtonStyle4('') - setButtonStyle5('') + setDocDownButtonStyle('') + setSaveButtonStyle('none') + setResetButtonStyle('none') + setCopyButtonStyle('') + setLockButtonStyle('') } return ( @@ -627,17 +627,22 @@ export default function CanvasMenu(props) { > {getMessage('stuff.search.btn.register')} - - +
+ + + +
+ +
+ + + ) +} diff --git a/src/store/popupAtom.js b/src/store/popupAtom.js index 8cba0bdc..72acaee5 100644 --- a/src/store/popupAtom.js +++ b/src/store/popupAtom.js @@ -27,3 +27,15 @@ export const contextPopupPositionState = atom({ }, dangerouslyAllowMutability: true, }) + +/** 팝업 스피너 상태 */ +export const popSpinnerState = atom({ + key: 'popSpinnerStore', + default: false, +}) + +/** 프로미스 팝업 상태 - 테스트용(삭제 예정) */ +export const promisePopupState = atom({ + key: 'promisePopupStore', + default: false, +}) From 4d19788c52e6a2bd45e76c3424c05d5de1af11eb Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Mon, 17 Mar 2025 11:10:13 +0900 Subject: [PATCH 11/11] =?UTF-8?q?#909=20-=20=EA=B0=80=EB=8C=80=20=EC=84=A4?= =?UTF-8?q?=EC=B9=98=20=ED=9B=84=20=EA=B2=AC=EC=A0=81=EC=84=9C=20=EB=B0=94?= =?UTF-8?q?=EB=A1=9C=EA=B0=80=EA=B8=B0=20=EA=B8=B0=EB=8A=A5=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useEstimate.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hooks/useEstimate.js b/src/hooks/useEstimate.js index ac1f5c07..fae0b558 100644 --- a/src/hooks/useEstimate.js +++ b/src/hooks/useEstimate.js @@ -64,9 +64,10 @@ export function useEstimate() { // 캔버스 저장 await saveCanvas(false) + setIsGlobalLoading(false) /* 견적서 저장이 완료되면 견적서 페이지로 이동 */ - moveEstimate(planNo, objectNo) + // moveEstimate(planNo, objectNo) }) .catch((error) => { setIsGlobalLoading(false)