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/common/draggable/WithDraggable.jsx b/src/components/common/draggable/WithDraggable.jsx
index 49552eac..9a51358c 100644
--- a/src/components/common/draggable/WithDraggable.jsx
+++ b/src/components/common/draggable/WithDraggable.jsx
@@ -2,9 +2,13 @@
import { useState } from 'react'
import Draggable from 'react-draggable'
+import PopSpinner from '../spinner/PopSpinner'
+import { popSpinnerState } from '@/store/popupAtom'
+import { useRecoilState } from 'recoil'
export default function WithDraggable({ isShow, children, pos = { x: 0, y: 0 }, handle = '', className = '', hasFooter = true, isHidden = false }) {
const [position, setPosition] = useState(pos)
+ const [popSpinnerStore, setPopSpinnerStore] = useRecoilState(popSpinnerState)
const handleOnDrag = (e, data) => {
e.stopPropagation()
@@ -25,6 +29,7 @@ export default function WithDraggable({ isShow, children, pos = { x: 0, y: 0 },
{children}
{hasFooter &&
}
+ {popSpinnerStore &&
}
)}
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가 다시 나타날 경우 주석 풀기 */}
{/* 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/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
diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx
index 66dbf43a..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) //견적서 화면용 물건번호리코일
@@ -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',
@@ -447,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')
}
}
@@ -518,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 (
@@ -632,17 +627,22 @@ export default function CanvasMenu(props) {
>
{getMessage('stuff.search.btn.register')}
-
@@ -85,7 +89,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/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/components/footer/PromisePopup.jsx b/src/components/footer/PromisePopup.jsx
new file mode 100644
index 00000000..feb400e1
--- /dev/null
+++ b/src/components/footer/PromisePopup.jsx
@@ -0,0 +1,71 @@
+import React, { useEffect } from 'react'
+import { popSpinnerState, promisePopupState } from '@/store/popupAtom'
+import { useRecoilState } from 'recoil'
+import WithDraggable from '../common/draggable/WithDraggable'
+import { useMessage } from '@/hooks/useMessage'
+
+export default function PromisePopup() {
+ const { getMessage } = useMessage()
+ const [promisePopupStore, setPromisePopupStore] = useRecoilState(promisePopupState)
+ const [popSpinnerStore, setPopSpinnerStore] = useRecoilState(popSpinnerState)
+
+ const handleSpinner = () => {
+ setPopSpinnerStore(true)
+ setTimeout(() => {
+ setPopSpinnerStore(false)
+ }, 1000)
+ }
+
+ return (
+
+ setPromisePopupStore(false)} />
+
+
+
+ {getMessage('modal.image.load.size.rotate')}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {getMessage('common.finish')}
+
+
+
+
+
+
+ {getMessage('common.finish')}
+
+
+
+
+ )
+}
diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx
index 06a9b35a..9f9dfdbf 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
@@ -282,17 +283,17 @@ export default function StuffDetail() {
autoHeight: true,
cellStyle: { justifyContent: 'center' },
cellRenderer: (params) => {
- let buttonStyle = ''
- let buttonStyle2 = ''
+ let estimateDetailButtonStyle = ''
+ let docDownButtonStyle = ''
if (params.value == null) {
- buttonStyle = 'none'
- buttonStyle2 = 'none'
+ estimateDetailButtonStyle = 'none'
+ docDownButtonStyle = 'none'
} else {
if (params?.data?.createSaleStoreId === 'T01' && session?.storeId !== 'T01') {
- buttonStyle = 'none'
+ estimateDetailButtonStyle = 'none'
}
if (params?.data?.tempFlg === '1' || !params?.data?.docNo) {
- buttonStyle2 = 'none'
+ docDownButtonStyle = 'none'
}
}
@@ -300,7 +301,7 @@ export default function StuffDetail() {
<>
{
@@ -314,7 +315,7 @@ export default function StuffDetail() {
{getMessage('stuff.detail.planGrid.btn1')}
{
@@ -370,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 })
},
@@ -387,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..d509a1e0 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,18 @@ export const useEstimateController = (planNo, flag) => {
}
}
} else {
+ 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 +393,7 @@ export const useEstimateController = (planNo, flag) => {
estimateData.estimateOption = estimateOptions
// console.log('최종아이템:::', estimateData.itemList)
+
if (fileList?.length > 0) {
estimateData.fileList = fileList
} else {
@@ -413,7 +421,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 +431,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'),
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()
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/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/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)
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/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,
},
})
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,
+})
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
}
|