Merge branch 'dev' of ssh://git.jetbrains.space/nalpari/q-cast-iii/qcast-front into qcast-pub

This commit is contained in:
김민식 2025-03-17 14:12:19 +09:00
commit 65e77ad2ed
22 changed files with 273 additions and 156 deletions

View File

@ -202,6 +202,7 @@ export const SAVE_KEY = [
'fontStyle', 'fontStyle',
'fontWeight', 'fontWeight',
'dormerAttributes', 'dormerAttributes',
'toFixed',
] ]
export const OBJECT_PROTOTYPE = [fabric.Line.prototype, fabric.Polygon.prototype, fabric.Triangle.prototype, fabric.Group.prototype] export const OBJECT_PROTOTYPE = [fabric.Line.prototype, fabric.Polygon.prototype, fabric.Triangle.prototype, fabric.Group.prototype]

View File

@ -2,9 +2,13 @@
import { useState } from 'react' import { useState } from 'react'
import Draggable from 'react-draggable' 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 }) { export default function WithDraggable({ isShow, children, pos = { x: 0, y: 0 }, handle = '', className = '', hasFooter = true, isHidden = false }) {
const [position, setPosition] = useState(pos) const [position, setPosition] = useState(pos)
const [popSpinnerStore, setPopSpinnerStore] = useRecoilState(popSpinnerState)
const handleOnDrag = (e, data) => { const handleOnDrag = (e, data) => {
e.stopPropagation() e.stopPropagation()
@ -25,6 +29,7 @@ export default function WithDraggable({ isShow, children, pos = { x: 0, y: 0 },
<div className={`modal-pop-wrap ${className}`} style={{ visibility: isHidden ? 'hidden' : 'visible' }}> <div className={`modal-pop-wrap ${className}`} style={{ visibility: isHidden ? 'hidden' : 'visible' }}>
{children} {children}
{hasFooter && <WithDraggableFooter />} {hasFooter && <WithDraggableFooter />}
{popSpinnerStore && <PopSpinner />}
</div> </div>
</Draggable> </Draggable>
)} )}

View File

@ -480,10 +480,6 @@ export default function Estimate({}) {
//Pricing //Pricing
const handlePricing = async (showPriceCd) => { 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 = { const param = {
saleStoreId: session.storeId, saleStoreId: session.storeId,
sapSalesStoreCd: session.custCd, sapSalesStoreCd: session.custCd,
@ -699,14 +695,10 @@ export default function Estimate({}) {
/* 케이블 select 변경시 */ /* 케이블 select 변경시 */
const onChangeDisplayCableItem = (value, itemList) => { 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) => { itemList.map((item, index) => {
if (item.dispCableFlg === '1') { if (item.dispCableFlg === '1') {
if (value !== '') { 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) => { const onChangeDisplayItem = (itemId, dispOrder, index, flag) => {
//todo: YJSS swalFire
if (estimateContextState.estimateType === 'YJSS') {
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
}
const param = { const param = {
itemId: itemId, itemId: itemId,
coldZoneFlg: estimateContextState?.coldRegionFlg, coldZoneFlg: estimateContextState?.coldRegionFlg,
@ -748,7 +736,7 @@ export default function Estimate({}) {
updates.itemGroup = res.itemGroup updates.itemGroup = res.itemGroup
updates.delFlg = '0' // 0 updates.delFlg = '0' // 0
updates.saleTotPrice = (res.salePrice * estimateContextState.itemList[index].amount).toString() updates.saleTotPrice = (res.salePrice * estimateContextState.itemList[index].amount).toString()
updates.amount = '' updates.amount = flag ? estimateContextState.itemList[index].amount : ''
updates.openFlg = res.openFlg updates.openFlg = res.openFlg
if (estimateContextState.estimateType === 'YJSS') { if (estimateContextState.estimateType === 'YJSS') {
@ -1032,7 +1020,6 @@ export default function Estimate({}) {
}) })
let dispCableFlgCnt = 0 let dispCableFlgCnt = 0
estimateContextState.itemList.forEach((item) => { estimateContextState.itemList.forEach((item) => {
// console.log('YJSS::::::::', item)
if (item.delFlg === '0') { if (item.delFlg === '0') {
let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', '')) || 0 let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', '')) || 0
let salePrice let salePrice
@ -1068,7 +1055,6 @@ export default function Estimate({}) {
} }
if (item.dispCableFlg === '1') { if (item.dispCableFlg === '1') {
// console.log('YJSS22222::::::::', item)
dispCableFlgCnt++ dispCableFlgCnt++
setCableItem(item.itemId) setCableItem(item.itemId)
} }
@ -1356,7 +1342,7 @@ export default function Estimate({}) {
</th> </th>
<td colSpan={3}> <td colSpan={3}>
<div className="radio-wrap"> <div className="radio-wrap">
{/* <div className="d-check-radio light mr10"> <div className="d-check-radio light mr10">
<input <input
type="radio" type="radio"
name="estimateType" name="estimateType"
@ -1370,7 +1356,7 @@ export default function Estimate({}) {
}} }}
/> />
<label htmlFor="YJSS">{getMessage('estimate.detail.estimateType.yjss')}</label> <label htmlFor="YJSS">{getMessage('estimate.detail.estimateType.yjss')}</label>
</div> */} </div>
<div className="d-check-radio light"> <div className="d-check-radio light">
<input <input
type="radio" type="radio"
@ -1379,8 +1365,7 @@ export default function Estimate({}) {
value={'YJOD'} value={'YJOD'}
checked={estimateContextState?.estimateType === 'YJOD' ? true : false} checked={estimateContextState?.estimateType === 'YJOD' ? true : false}
onChange={(e) => { onChange={(e) => {
//todo: YJSS setHandlePricingFlag(true)
// setHandlePricingFlag(true)
setEstimateContextState({ estimateType: e.target.value }) setEstimateContextState({ estimateType: e.target.value })
}} }}
/> />
@ -1677,9 +1662,8 @@ export default function Estimate({}) {
</div> </div>
</div> </div>
</div> </div>
{/* //todo: 추후 YJSS가 다시 나타날 경우 주석 풀기 */}
{/* YJOD면 아래영역 숨김 */} {/* YJOD면 아래영역 숨김 */}
{/* <div className="common-table bt-able" style={{ display: estimateContextState?.estimateType === 'YJSS' ? '' : 'none' }}> <div className="common-table bt-able" style={{ display: estimateContextState?.estimateType === 'YJSS' ? '' : 'none' }}>
<table> <table>
<colgroup> <colgroup>
<col style={{ width: '160px' }} /> <col style={{ width: '160px' }} />
@ -1714,7 +1698,7 @@ export default function Estimate({}) {
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> */} </div>
{/* 제품정보 끝 */} {/* 제품정보 끝 */}
{/* 가격표시영역시작 */} {/* 가격표시영역시작 */}
<div className="estimate-product-option"> <div className="estimate-product-option">
@ -1871,7 +1855,7 @@ export default function Estimate({}) {
options={originDisplayItemList} options={originDisplayItemList}
onChange={(e) => { onChange={(e) => {
if (isObjectNotEmpty(e)) { if (isObjectNotEmpty(e)) {
onChangeDisplayItem(e.itemId, item.dispOrder, index) onChangeDisplayItem(e.itemId, item.dispOrder, index, false)
} }
}} }}
menuPlacement={'auto'} menuPlacement={'auto'}
@ -1895,11 +1879,6 @@ export default function Estimate({}) {
classNamePrefix="custom" classNamePrefix="custom"
placeholder="Select" placeholder="Select"
options={cableItemList} options={cableItemList}
onChange={(e) => {
if (isObjectNotEmpty(e)) {
onChangeDisplayItem(e.clRefChr1, item.dispOrder, index)
}
}}
menuPlacement={'auto'} menuPlacement={'auto'}
getOptionLabel={(x) => x.clRefChr3} getOptionLabel={(x) => x.clRefChr3}
getOptionValue={(x) => x.clRefChr1} getOptionValue={(x) => x.clRefChr1}

View File

@ -23,6 +23,7 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
initOptions: null, initOptions: null,
direction: null, direction: null,
arrow: null, arrow: null,
toFixed: 1,
initialize: function (points, options, canvas) { initialize: function (points, options, canvas) {
this.lines = [] this.lines = []
this.texts = [] this.texts = []
@ -33,11 +34,12 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
this.innerLines = [] this.innerLines = []
this.children = [] this.children = []
this.separatePolygon = [] this.separatePolygon = []
this.toFixed = options.toFixed ?? 1
// 소수점 전부 제거 // 소수점 전부 제거
points.forEach((point) => { points.forEach((point) => {
point.x = Number(point.x.toFixed(1)) point.x = Number(point.x.toFixed(this.toFixed))
point.y = Number(point.y.toFixed(1)) point.y = Number(point.y.toFixed(this.toFixed))
}) })
options.selectable = options.selectable ?? true options.selectable = options.selectable ?? true
options.sort = options.sort ?? true options.sort = options.sort ?? true

View File

@ -89,11 +89,11 @@ export default function CanvasMenu(props) {
const selectedRoofMaterial = useRecoilValue(selectedRoofMaterialSelector) const selectedRoofMaterial = useRecoilValue(selectedRoofMaterialSelector)
// //
const [buttonStyle1, setButtonStyle1] = useState('') // const [docDownButtonStyle, setDocDownButtonStyle] = useState('') //
const [buttonStyle2, setButtonStyle2] = useState('') // const [saveButtonStyle, setSaveButtonStyle] = useState('') //
const [buttonStyle3, setButtonStyle3] = useState('') // const [resetButtonStyle, setResetButtonStyle] = useState('') //
const [buttonStyle4, setButtonStyle4] = useState('') // const [copyButtonStyle, setCopyButtonStyle] = useState('') //
const [buttonStyle5, setButtonStyle5] = useState('') // const [lockButtonStyle, setLockButtonStyle] = useState('') //
const setFloorPlanObjectNo = useSetRecoilState(floorPlanObjectState) // const setFloorPlanObjectNo = useSetRecoilState(floorPlanObjectState) //
@ -365,11 +365,6 @@ export default function CanvasMenu(props) {
// //
const handleEstimateReset = () => { const handleEstimateReset = () => {
//todo: YJSS swalFire
if (estimateRecoilState.estimateType === 'YJSS') {
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
}
swalFire({ swalFire({
text: getMessage('estimate.detail.reset.confirmMsg'), text: getMessage('estimate.detail.reset.confirmMsg'),
type: 'confirm', type: 'confirm',
@ -447,28 +442,28 @@ export default function CanvasMenu(props) {
}, [estimateContextState?.createUser, estimateContextState?.tempFlg, estimateContextState?.lockFlg, estimateContextState.docNo]) }, [estimateContextState?.createUser, estimateContextState?.tempFlg, estimateContextState?.lockFlg, estimateContextState.docNo])
const setAllButtonStyles = (style) => { const setAllButtonStyles = (style) => {
setButtonStyle1(style) setDocDownButtonStyle(style)
setButtonStyle2(style) setSaveButtonStyle(style)
setButtonStyle3(style) setResetButtonStyle(style)
setButtonStyle4(style) setCopyButtonStyle(style)
setButtonStyle5(style) setLockButtonStyle(style)
} }
const handleButtonStyles = (tempFlg, lockFlg, docNo) => { const handleButtonStyles = (tempFlg, lockFlg, docNo) => {
if (tempFlg === '1') { if (tempFlg === '1') {
setAllButtonStyles('none') setAllButtonStyles('none')
setButtonStyle2('') setSaveButtonStyle('')
} else if (tempFlg === '0' && lockFlg === '0') { } else if (tempFlg === '0' && lockFlg === '0') {
setAllButtonStyles('') setAllButtonStyles('')
} else { } else {
setButtonStyle1('') setDocDownButtonStyle('')
setButtonStyle2('none') setSaveButtonStyle('none')
setButtonStyle3('none') setResetButtonStyle('none')
setButtonStyle4('') setCopyButtonStyle('')
setButtonStyle5('') setLockButtonStyle('')
} }
if (!docNo) { if (!docNo) {
setButtonStyle1('none') setDocDownButtonStyle('none')
} }
} }
@ -518,11 +513,11 @@ export default function CanvasMenu(props) {
// //
const docDownPopLockFlg = () => { const docDownPopLockFlg = () => {
setButtonStyle1('') setDocDownButtonStyle('')
setButtonStyle2('none') setSaveButtonStyle('none')
setButtonStyle3('none') setResetButtonStyle('none')
setButtonStyle4('') setCopyButtonStyle('')
setButtonStyle5('') setLockButtonStyle('')
} }
return ( return (
@ -632,17 +627,22 @@ export default function CanvasMenu(props) {
> >
<span className="name">{getMessage('stuff.search.btn.register')}</span> <span className="name">{getMessage('stuff.search.btn.register')}</span>
</button> </button>
<button type="button" style={{ display: buttonStyle1 }} className="btn-frame gray ico-flx" onClick={() => setEstimatePopupOpen(true)}> <button
type="button"
style={{ display: docDownButtonStyle }}
className="btn-frame gray ico-flx"
onClick={() => setEstimatePopupOpen(true)}
>
<span className="ico ico01"></span> <span className="ico ico01"></span>
<span className="name">{getMessage('plan.menu.estimate.docDown')}</span> <span className="name">{getMessage('plan.menu.estimate.docDown')}</span>
</button> </button>
<button type="button" style={{ display: buttonStyle2 }} className="btn-frame gray ico-flx" onClick={handleEstimateSubmit}> <button type="button" style={{ display: saveButtonStyle }} className="btn-frame gray ico-flx" onClick={handleEstimateSubmit}>
<span className="ico ico02"></span> <span className="ico ico02"></span>
<span className="name">{getMessage('plan.menu.estimate.save')}</span> <span className="name">{getMessage('plan.menu.estimate.save')}</span>
</button> </button>
<button <button
type="button" type="button"
style={{ display: buttonStyle3 }} style={{ display: resetButtonStyle }}
className="btn-frame gray ico-flx" className="btn-frame gray ico-flx"
onClick={() => { onClick={() => {
handleEstimateReset() handleEstimateReset()
@ -655,7 +655,7 @@ export default function CanvasMenu(props) {
{estimateRecoilState?.docNo !== null && (sessionState.storeId === 'T01' || sessionState.storeLvl === '1') && ( {estimateRecoilState?.docNo !== null && (sessionState.storeId === 'T01' || sessionState.storeLvl === '1') && (
<button <button
type="button" type="button"
style={{ display: buttonStyle4 }} style={{ display: copyButtonStyle }}
className="btn-frame gray ico-flx" className="btn-frame gray ico-flx"
onClick={() => { onClick={() => {
setEstimateCopyPopupOpen(true) setEstimateCopyPopupOpen(true)
@ -667,7 +667,7 @@ export default function CanvasMenu(props) {
)} )}
<button <button
type="button" type="button"
style={{ display: buttonStyle5 }} style={{ display: lockButtonStyle }}
className="btn-frame gray ico-flx" className="btn-frame gray ico-flx"
onClick={() => { onClick={() => {
handleEstimateLockController(estimateRecoilState) handleEstimateLockController(estimateRecoilState)

View File

@ -46,10 +46,14 @@ export default function PlanSizeSetting(props) {
const changeInput = (value, e) => { const changeInput = (value, e) => {
const { name } = e.target const { name } = e.target
if (Number(value) > 100000) {
value = 100000
}
setPlanSizeSettingMode((prev) => { setPlanSizeSettingMode((prev) => {
return { return {
...prev, ...prev,
[name]: Number(value), [name]: Number(value) / 10,
} }
}) })
} }
@ -72,7 +76,7 @@ export default function PlanSizeSetting(props) {
type="text" type="text"
className="input-origin block" className="input-origin block"
name={`originHorizon`} name={`originHorizon`}
value={planSizeSettingMode.originHorizon} value={planSizeSettingMode.originHorizon * 10}
onChange={(e) => onlyNumberInputChange(e, changeInput)} onChange={(e) => onlyNumberInputChange(e, changeInput)}
/> />
</div> </div>
@ -85,7 +89,7 @@ export default function PlanSizeSetting(props) {
type="text" type="text"
className="input-origin block" className="input-origin block"
name={`originVertical`} name={`originVertical`}
value={planSizeSettingMode.originVertical} value={planSizeSettingMode.originVertical * 10}
onChange={(e) => onlyNumberInputChange(e, changeInput)} onChange={(e) => onlyNumberInputChange(e, changeInput)}
/> />
</div> </div>

View File

@ -23,7 +23,7 @@ export default function Offset({ length1Ref, arrow1Ref, currentWallLineRef }) {
const keyDown = (e) => { const keyDown = (e) => {
if (currentWallLineRef.current === null) { if (currentWallLineRef.current === null) {
alert('보조선을 먼저 선택하세요') // alert(' ')
return return
} }

View File

@ -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 (
<WithDraggable isShow={promisePopupStore} pos={{ x: 1000, y: 200 }} className="r">
<WithDraggable.Header title={'popup promise test'} onClose={() => setPromisePopupStore(false)} />
<WithDraggable.Body>
<div className="img-flex-box">
<span className="normal-font mr10">{getMessage('modal.image.load.size.rotate')}</span>
<label className="toggle-btn">
<input type="checkbox" checked={true} value="1" />
<span className="slider"></span>
</label>
</div>
<div className="img-load-from">
<div className="img-load-item">
<div className="d-check-radio pop">
<input type="radio" name="radio03" id="ra06" value={'1'} />
<label htmlFor="ra06">{getMessage('common.input.file')}</label>
</div>
<div className="img-flex-box">
<div className="img-edit-wrap">
<label className="img-edit-btn" htmlFor="img_file">
<span className="img-edit"></span>
{getMessage('common.load')}
</label>
<input type="file" id="img_file" style={{ display: 'none' }} />
</div>
<div className="img-name-wrap">
<input type="text" className="input-origin al-l" value={'test'} readOnly />
</div>
</div>
</div>
<div className="img-load-item">
<div className="d-check-radio pop">
<input type="radio" name="radio03" id="ra07" value={'2'} />
<label htmlFor="ra07">{getMessage('common.input.address.load')}</label>
</div>
<div className="img-flex-box for-address">
<input type="text" className="input-origin al-l mr10" placeholder={'住所入力'} value={'test'} />
<div className="img-edit-wrap">
<button className={`img-edit-btn`}>{getMessage('common.finish')}</button>
</div>
</div>
</div>
</div>
<div className="grid-btn-wrap">
<button className="btn-frame modal act" onClick={handleSpinner}>
{getMessage('common.finish')}
</button>
</div>
</WithDraggable.Body>
</WithDraggable>
)
}

View File

@ -140,6 +140,7 @@ export default function StuffDetail() {
headerName: getMessage('stuff.detail.planGridHeader.moduleModel'), headerName: getMessage('stuff.detail.planGridHeader.moduleModel'),
flex: 1, flex: 1,
wrapText: true, wrapText: true,
autoHeight: true,
cellStyle: { alignItems: 'flex-start' /* 좌측정렬*/, cursor: 'pointer' }, cellStyle: { alignItems: 'flex-start' /* 좌측정렬*/, cursor: 'pointer' },
cellRenderer: (params) => { cellRenderer: (params) => {
let origin = params.value let origin = params.value
@ -282,17 +283,17 @@ export default function StuffDetail() {
autoHeight: true, autoHeight: true,
cellStyle: { justifyContent: 'center' }, cellStyle: { justifyContent: 'center' },
cellRenderer: (params) => { cellRenderer: (params) => {
let buttonStyle = '' let estimateDetailButtonStyle = ''
let buttonStyle2 = '' let docDownButtonStyle = ''
if (params.value == null) { if (params.value == null) {
buttonStyle = 'none' estimateDetailButtonStyle = 'none'
buttonStyle2 = 'none' docDownButtonStyle = 'none'
} else { } else {
if (params?.data?.createSaleStoreId === 'T01' && session?.storeId !== 'T01') { if (params?.data?.createSaleStoreId === 'T01' && session?.storeId !== 'T01') {
buttonStyle = 'none' estimateDetailButtonStyle = 'none'
} }
if (params?.data?.tempFlg === '1' || !params?.data?.docNo) { if (params?.data?.tempFlg === '1' || !params?.data?.docNo) {
buttonStyle2 = 'none' docDownButtonStyle = 'none'
} }
} }
@ -300,7 +301,7 @@ export default function StuffDetail() {
<> <>
<div className="grid-cell-btn"> <div className="grid-cell-btn">
<button <button
style={{ display: buttonStyle }} style={{ display: estimateDetailButtonStyle }}
type="button" type="button"
className="grid-btn" className="grid-btn"
onClick={() => { onClick={() => {
@ -314,7 +315,7 @@ export default function StuffDetail() {
{getMessage('stuff.detail.planGrid.btn1')} {getMessage('stuff.detail.planGrid.btn1')}
</button> </button>
<button <button
style={{ display: buttonStyle2 }} style={{ display: docDownButtonStyle }}
type="button" type="button"
className="grid-btn" className="grid-btn"
onClick={() => { onClick={() => {
@ -370,6 +371,7 @@ export default function StuffDetail() {
swalFire({ swalFire({
text: getMessage('stuff.detail.header.notExistObjectNo'), text: getMessage('stuff.detail.header.notExistObjectNo'),
type: 'alert', type: 'alert',
icon: 'error',
confirmFn: () => { confirmFn: () => {
router.push('/management/stuff', { scroll: false }) router.push('/management/stuff', { scroll: false })
}, },
@ -387,6 +389,7 @@ export default function StuffDetail() {
swalFire({ swalFire({
text: getMessage('stuff.detail.header.notExistObjectNo'), text: getMessage('stuff.detail.header.notExistObjectNo'),
type: 'alert', type: 'alert',
icon: 'error',
confirmFn: () => { confirmFn: () => {
router.push('/management/stuff', { scroll: false }) router.push('/management/stuff', { scroll: false })
}, },

View File

@ -166,11 +166,6 @@ export const useEstimateController = (planNo, flag) => {
//견적서 저장 //견적서 저장
const handleEstimateSubmit = async () => { const handleEstimateSubmit = async () => {
//todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요
if (estimateData.estimateType === 'YJSS') {
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
}
//0. 필수체크 //0. 필수체크
let flag = true let flag = true
let originFileFlg = false let originFileFlg = false
@ -300,6 +295,18 @@ export const useEstimateController = (planNo, flag) => {
} }
} }
} else { } 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으로 //봄 컴포넌트 제품은 0으로
item.openFlg = '0' item.openFlg = '0'
} }
@ -386,6 +393,7 @@ export const useEstimateController = (planNo, flag) => {
estimateData.estimateOption = estimateOptions estimateData.estimateOption = estimateOptions
// console.log('최종아이템:::', estimateData.itemList) // console.log('최종아이템:::', estimateData.itemList)
if (fileList?.length > 0) { if (fileList?.length > 0) {
estimateData.fileList = fileList estimateData.fileList = fileList
} else { } else {
@ -413,7 +421,7 @@ export const useEstimateController = (planNo, flag) => {
}) })
} catch (e) { } catch (e) {
setIsGlobalLoading(false) 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차판매점에게만 제공 * T01관리자 계정 1차판매점에게만 제공
*/ */
const handleEstimateCopy = async (sendPlanNo, copyReceiveUser, saleStoreId, otherSaleStoreId, setEstimateCopyPopupOpen) => { 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 === '') { if (saleStoreId === '') {
return swalFire({ return swalFire({
text: getMessage('estimate.detail.productFeaturesPopup.requiredStoreId'), text: getMessage('estimate.detail.productFeaturesPopup.requiredStoreId'),

View File

@ -1,7 +1,7 @@
import { useState } from 'react' import { useState } from 'react'
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil' import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'
import { canvasSettingState, canvasState, checkedModuleState, currentObjectState, isManualModuleSetupState } from '@/store/canvasAtom' 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 { basicSettingState, roofDisplaySelector } from '@/store/settingAtom'
import offsetPolygon, { calculateAngle, createLinesFromPolygon } from '@/util/qpolygon-utils' import offsetPolygon, { calculateAngle, createLinesFromPolygon } from '@/util/qpolygon-utils'
import { QPolygon } from '@/components/fabric/QPolygon' import { QPolygon } from '@/components/fabric/QPolygon'
@ -424,6 +424,8 @@ export function useModuleBasicSetting(tabNum) {
* 확인 셀을 이동시킴 * 확인 셀을 이동시킴
*/ */
const manualModuleSetup = (placementRef) => { const manualModuleSetup = (placementRef) => {
console.log('isManualModuleSetup', isManualModuleSetup)
const moduleSetupSurfaces = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) //모듈설치면를 가져옴 const moduleSetupSurfaces = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) //모듈설치면를 가져옴
if (isManualModuleSetup) { if (isManualModuleSetup) {
@ -493,20 +495,20 @@ export function useModuleBasicSetting(tabNum) {
const points = [ const points = [
{ {
x: Number(mousePoint.x.toFixed(1)) + Number((width / 2).toFixed(1)), x: toFixedWithoutRounding(mousePoint.x, 2) + toFixedWithoutRounding(width / 2, 2),
y: Number(mousePoint.y.toFixed(1)) - Number((height / 2).toFixed(1)), y: toFixedWithoutRounding(mousePoint.y, 2) - toFixedWithoutRounding(height / 2, 2),
}, },
{ {
x: Number(mousePoint.x.toFixed(1)) + Number((width / 2).toFixed(1)), x: toFixedWithoutRounding(mousePoint.x, 2) + toFixedWithoutRounding(width / 2, 2),
y: Number(mousePoint.y.toFixed(1)) + Number((height / 2).toFixed(1)), y: toFixedWithoutRounding(mousePoint.y, 2) + toFixedWithoutRounding(height / 2, 2),
}, },
{ {
x: Number(mousePoint.x.toFixed(1)) - Number((width / 2).toFixed(1)), x: toFixedWithoutRounding(mousePoint.x, 2) - toFixedWithoutRounding(width / 2, 2),
y: Number(mousePoint.y.toFixed(1)) - Number((height / 2).toFixed(1)), y: toFixedWithoutRounding(mousePoint.y, 2) - toFixedWithoutRounding(height / 2, 2),
}, },
{ {
x: Number(mousePoint.x.toFixed(1)) - Number((width / 2).toFixed(1)), x: toFixedWithoutRounding(mousePoint.x, 2) - toFixedWithoutRounding(width / 2, 2),
y: Number(mousePoint.y.toFixed(1)) + Number((height / 2).toFixed(1)), y: toFixedWithoutRounding(mousePoint.y, 2) + toFixedWithoutRounding(height / 2, 2),
}, },
] ]
@ -522,10 +524,10 @@ export function useModuleBasicSetting(tabNum) {
fill: 'white', fill: 'white',
stroke: 'black', stroke: 'black',
strokeWidth: 0.3, strokeWidth: 0.3,
width: Number(width.toFixed(1)), width: toFixedWithoutRounding(width, 2),
height: Number(height.toFixed(1)), height: toFixedWithoutRounding(height, 2),
left: Number(mousePoint.x.toFixed(1) - Number((width / 2).toFixed(1))), left: toFixedWithoutRounding(mousePoint.x, 2) - toFixedWithoutRounding(width / 2, 2),
top: Number(mousePoint.y.toFixed(1) - Number((height / 2).toFixed(1))), top: toFixedWithoutRounding(mousePoint.y, 2) - toFixedWithoutRounding(height / 2, 2),
selectable: false, selectable: false,
lockMovementX: true, lockMovementX: true,
lockMovementY: 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 trestleSnapDistance = 15
let intvHor = let intvHor =
@ -558,67 +560,84 @@ export function useModuleBasicSetting(tabNum) {
? moduleSetupSurfaces[i].trestleDetail.moduleIntvlVer / 10 ? moduleSetupSurfaces[i].trestleDetail.moduleIntvlVer / 10
: moduleSetupSurfaces[i].trestleDetail.moduleIntvlHor / 10 : moduleSetupSurfaces[i].trestleDetail.moduleIntvlHor / 10
const trestleLeft = Number(moduleSetupSurfaces[i].left.toFixed(1)) - Number((moduleSetupSurfaces[i].width / 2).toFixed(1)) const trestleLeft = toFixedWithoutRounding(moduleSetupSurfaces[i].left, 2) - toFixedWithoutRounding(moduleSetupSurfaces[i].width / 2, 2)
const trestleTop = Number(moduleSetupSurfaces[i].top.toFixed(1)) - Number((moduleSetupSurfaces[i].height / 2).toFixed(1)) const trestleTop = toFixedWithoutRounding(moduleSetupSurfaces[i].top, 2) - toFixedWithoutRounding(moduleSetupSurfaces[i].height / 2, 2)
const trestleRight = Number(moduleSetupSurfaces[i].left.toFixed(1)) + Number((moduleSetupSurfaces[i].width / 2).toFixed(1)) const trestleRight =
const trestleBottom = Number(moduleSetupSurfaces[i].top.toFixed(1)) + Number((moduleSetupSurfaces[i].height / 2).toFixed(1)) 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 bigCenterY = (trestleTop + trestleTop + moduleSetupSurfaces[i].height) / 2
// 이동하는 모듈의 경계 좌표 // 이동하는 모듈의 경계 좌표
const smallLeft = Number(tempModule.left.toFixed(1)) const smallLeft = toFixedWithoutRounding(tempModule.left, 2)
const smallTop = Number(tempModule.top.toFixed(1)) const smallTop = toFixedWithoutRounding(tempModule.top, 2)
const smallRight = smallLeft + Number(tempModule.width.toFixed(1)) const smallRight = smallLeft + toFixedWithoutRounding(tempModule.width, 2)
const smallBottom = smallTop + Number(tempModule.height.toFixed(1)) const smallBottom = smallTop + toFixedWithoutRounding(tempModule.height, 2)
const smallCenterX = smallLeft + Number((tempModule.width / 2).toFixed(1)) const smallCenterX = smallLeft + toFixedWithoutRounding(tempModule.width / 2, 2)
const smallCenterY = smallTop + Number((tempModule.height / 2).toFixed(1)) const smallCenterY = smallTop + toFixedWithoutRounding(tempModule.height / 2, 2)
/** /**
* 미리 깔아놓은 셀이 있을때 셀에 흡착됨 * 미리 깔아놓은 셀이 있을때 셀에 흡착됨
*/ */
if (manualDrawModules) { if (manualDrawModules) {
manualDrawModules.forEach((cell) => { manualDrawModules.forEach((cell) => {
const holdCellLeft = cell.left const holdCellLeft = toFixedWithoutRounding(cell.left, 2)
const holdCellTop = cell.top const holdCellTop = toFixedWithoutRounding(cell.top, 2)
const holdCellRight = holdCellLeft + Number(cell.width.toFixed(1)) const holdCellRight = holdCellLeft + toFixedWithoutRounding(cell.width, 2)
const holdCellBottom = holdCellTop + Number(cell.height.toFixed(1)) const holdCellBottom = holdCellTop + toFixedWithoutRounding(cell.height, 2)
const holdCellCenterX = holdCellLeft + Number((cell.width / 2).toFixed(1)) const holdCellCenterX = holdCellLeft + toFixedWithoutRounding(cell.width / 2, 2)
const holdCellCenterY = holdCellTop + Number((cell.height / 2).toFixed(1)) 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) { if (Math.abs(smallRight - holdCellLeft) < snapDistance) {
// console.log('모듈 좌측 스냅')
tempModule.left = holdCellLeft - width - intvHor tempModule.left = holdCellLeft - width - intvHor
} }
//설치된 셀에 우측에 스냅 //설치된 셀에 우측에 스냅
if (Math.abs(smallLeft - holdCellRight) < snapDistance) { if (Math.abs(smallLeft - holdCellRight) < snapDistance) {
// console.log('모듈 우측 스냅')
tempModule.left = holdCellRight + intvHor tempModule.left = holdCellRight + intvHor
} }
//설치된 셀에 위쪽에 스냅 //설치된 셀에 위쪽에 스냅
if (Math.abs(smallBottom - holdCellTop) < snapDistance) { if (Math.abs(smallBottom - holdCellTop) < 10) {
tempModule.top = holdCellTop - height - intvVer tempModule.top = holdCellTop - height - intvVer
} }
//설치된 셀에 밑쪽에 스냅 //설치된 셀에 밑쪽에 스냅
if (Math.abs(smallTop - holdCellBottom) < snapDistance) { if (Math.abs(smallTop - holdCellBottom) < 10) {
tempModule.top = holdCellBottom + intvVer tempModule.top = holdCellBottom + intvVer
} }
//가운데 -> 가운데
if (Math.abs(smallCenterX - holdCellCenterX) < snapDistance) { //설치된 셀에 윗쪽에 스냅
tempModule.left = holdCellCenterX - Number((width / 2).toFixed(1)) if (Math.abs(smallTop - holdCellTop) < 10) {
} tempModule.top = holdCellTop
//왼쪽 -> 가운데
if (Math.abs(smallLeft - holdCellCenterX) < snapDistance) {
tempModule.left = holdCellCenterX + intvHor
}
// 오른쪽 -> 가운데
if (Math.abs(smallRight - holdCellCenterX) < snapDistance) {
tempModule.left = holdCellCenterX - width - intvHor
} }
//세로 가운데 -> 가운데 //세로 가운데 -> 가운데
if (Math.abs(smallCenterY - holdCellCenterY) < snapDistance) { // if (Math.abs(smallCenterY - holdCellCenterY) < snapDistance) {
tempModule.top = holdCellCenterY - Number((height / 2).toFixed(1)) // tempModule.top = holdCellCenterY - toFixedWithoutRounding(height / 2, 1)
} // }
// //위쪽 -> 가운데 // //위쪽 -> 가운데
// if (Math.abs(smallTop - holdCellCenterY) < cellSnapDistance) { // if (Math.abs(smallTop - holdCellCenterY) < cellSnapDistance) {
// tempModule.top = holdCellCenterY // tempModule.top = holdCellCenterY
@ -700,13 +719,19 @@ export function useModuleBasicSetting(tabNum) {
if (!inside) return if (!inside) return
if (tempModule) { if (tempModule) {
const rectPoints = [ const rectPoints = [
{ x: Number(tempModule.left.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)) },
{ {
x: Number(tempModule.left.toFixed(1)) + Number(tempModule.width.toFixed(1)), x: toFixedWithoutRounding(tempModule.left, 2) + toFixedWithoutRounding(tempModule.width, 2),
y: Number(tempModule.top.toFixed(1)) + Number(tempModule.height.toFixed(1)), 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 }) tempModule.set({ points: rectPoints })
@ -743,11 +768,13 @@ export function useModuleBasicSetting(tabNum) {
let manualModule = new QPolygon(tempModule.points, { let manualModule = new QPolygon(tempModule.points, {
...moduleOptions, ...moduleOptions,
moduleInfo: checkedModule[0], moduleInfo: checkedModule[0],
left: Number(tempModule.left.toFixed(1)), left: toFixedWithoutRounding(tempModule.left, 2),
top: Number(tempModule.top.toFixed(1)), top: toFixedWithoutRounding(tempModule.top, 2),
width: Number(tempModule.width.toFixed(1)), width: toFixedWithoutRounding(tempModule.width, 2),
height: Number(tempModule.height.toFixed(1)), height: toFixedWithoutRounding(tempModule.height, 2),
toFixed: 2,
}) })
canvas?.add(manualModule) canvas?.add(manualModule)
manualDrawModules.push(manualModule) manualDrawModules.push(manualModule)
setModuleStatisticsData() setModuleStatisticsData()

View File

@ -612,6 +612,9 @@ export function useCanvasSetting(executeEffect = true) {
/** 도면크기 설정 */ /** 도면크기 설정 */
setPlanSizeSettingMode({ ...planSizeSettingMode, originHorizon: res.originHorizon, originVertical: res.originVertical }) setPlanSizeSettingMode({ ...planSizeSettingMode, originHorizon: res.originHorizon, originVertical: res.originVertical })
canvas.setWidth(res.originHorizon)
canvas.setHeight(res.originVertical)
canvas.renderAll()
/** 데이터 설정 */ /** 데이터 설정 */
setSettingModalFirstOptions({ setSettingModalFirstOptions({

View File

@ -22,6 +22,7 @@ import { useSwal } from '@/hooks/useSwal'
import { usePopup } from '@/hooks/usePopup' import { usePopup } from '@/hooks/usePopup'
import { calculateAngle, isSamePoint } from '@/util/qpolygon-utils' import { calculateAngle, isSamePoint } from '@/util/qpolygon-utils'
import { POLYGON_TYPE } from '@/common/common' import { POLYGON_TYPE } from '@/common/common'
import { useMessage } from '../useMessage'
// 보조선 작성 // 보조선 작성
export function useAuxiliaryDrawing(id, isUseEffect = true) { export function useAuxiliaryDrawing(id, isUseEffect = true) {
@ -34,6 +35,7 @@ export function useAuxiliaryDrawing(id, isUseEffect = true) {
const { swalFire } = useSwal() const { swalFire } = useSwal()
const { getAdsorptionPoints } = useAdsorptionPoint() const { getAdsorptionPoints } = useAdsorptionPoint()
const { closePopup } = usePopup() const { closePopup } = usePopup()
const { getMessage } = useMessage()
const adsorptionRange = useRecoilValue(adsorptionRangeState) const adsorptionRange = useRecoilValue(adsorptionRangeState)
@ -411,7 +413,7 @@ export function useAuxiliaryDrawing(id, isUseEffect = true) {
const length1Value = length1Ref.current.value const length1Value = length1Ref.current.value
if (diagonalLength <= length1Value) { if (diagonalLength <= length1Value) {
alert('대각선 길이는 직선 길이보다 길어야 합니다.') // alert('대각선 길이는 직선 길이보다 길어야 합니다.')
return return
} }
@ -832,7 +834,8 @@ export function useAuxiliaryDrawing(id, isUseEffect = true) {
} }
const handleFix = () => { const handleFix = () => {
if (!confirm('보조선 작성을 완료하시겠습니까?')) { // if (!confirm('보조선 작성을 완료하시겠습니까?')) {
if (!confirm(getMessage('want.to.complete.auxiliary.creation'))) {
return return
} }

View File

@ -567,7 +567,7 @@ export function useOuterLineWall(id, propertiesId) {
const length1Value = length1Ref.current.value const length1Value = length1Ref.current.value
if (diagonalLength <= length1Value) { if (diagonalLength <= length1Value) {
alert('대각선 길이는 직선 길이보다 길어야 합니다.') // alert('대각선 길이는 직선 길이보다 길어야 합니다.')
return return
} }
@ -890,7 +890,7 @@ export function useOuterLineWall(id, propertiesId) {
}) })
if (isAllRightAngle) { if (isAllRightAngle) {
alert('부정확한 다각형입니다.') // alert('부정확한 다각형입니다.')
return return
} }

View File

@ -192,7 +192,7 @@ export function useWallLineOffsetSetting(id) {
const handleSave = () => { const handleSave = () => {
if (currentWallLineRef.current === null) { if (currentWallLineRef.current === null) {
alert('보조선을 먼저 선택하세요') // alert('보조선을 먼저 선택하세요')
return return
} }
switch (type) { switch (type) {

View File

@ -564,7 +564,7 @@ export function usePlacementShapeDrawing(id) {
const length1Value = length1Ref.current.value const length1Value = length1Ref.current.value
if (diagonalLength <= length1Value) { if (diagonalLength <= length1Value) {
alert('대각선 길이는 직선 길이보다 길어야 합니다.') // alert('대각선 길이는 직선 길이보다 길어야 합니다.')
return return
} }
@ -886,7 +886,7 @@ export function usePlacementShapeDrawing(id) {
}) })
if (isAllRightAngle) { if (isAllRightAngle) {
alert('부정확한 다각형입니다.') // alert('부정확한 다각형입니다.')
return return
} }

View File

@ -64,9 +64,10 @@ export function useEstimate() {
// 캔버스 저장 // 캔버스 저장
await saveCanvas(false) await saveCanvas(false)
setIsGlobalLoading(false)
/* 견적서 저장이 완료되면 견적서 페이지로 이동 */ /* 견적서 저장이 완료되면 견적서 페이지로 이동 */
moveEstimate(planNo, objectNo) // moveEstimate(planNo, objectNo)
}) })
.catch((error) => { .catch((error) => {
setIsGlobalLoading(false) setIsGlobalLoading(false)

View File

@ -1033,5 +1033,6 @@
"canvas.infomation.text": "数字は [半角] 入力のみ可能です。", "canvas.infomation.text": "数字は [半角] 入力のみ可能です。",
"roof.exceed.count": "屋根材は4つまで選択可能です。", "roof.exceed.count": "屋根材は4つまで選択可能です。",
"outerLine.property.fix": "外壁線の属性設定 を完了しますか?", "outerLine.property.fix": "外壁線の属性設定 を完了しますか?",
"outerLine.property.close": "外壁線の属性設定 を終了しますか?" "outerLine.property.close": "外壁線の属性設定 を終了しますか?",
"want.to.complete.auxiliary.creation": "보補助線の作成を完了しますか?"
} }

View File

@ -1033,5 +1033,6 @@
"canvas.infomation.text": "숫자는 [반각] 입력만 가능합니다.", "canvas.infomation.text": "숫자는 [반각] 입력만 가능합니다.",
"roof.exceed.count": "지붕재는 4개까지 선택 가능합니다.", "roof.exceed.count": "지붕재는 4개까지 선택 가능합니다.",
"outerLine.property.fix": "외벽선 속성 설정을 완료하시겠습니까?", "outerLine.property.fix": "외벽선 속성 설정을 완료하시겠습니까?",
"outerLine.property.close": "외벽선 속성 설정을 종료하시겠습니까?" "outerLine.property.close": "외벽선 속성 설정을 종료하시겠습니까?",
"want.to.complete.auxiliary.creation": "보조선 작성을 완료하시겠습니까?"
} }

View File

@ -43,7 +43,7 @@ export const fontSizeState = atom({
export const canvasSizeState = atom({ export const canvasSizeState = atom({
key: 'canvasSize', key: 'canvasSize',
default: { default: {
vertical: 1000, vertical: 1600,
horizontal: 1600, horizontal: 1600,
}, },
}) })

View File

@ -27,3 +27,15 @@ export const contextPopupPositionState = atom({
}, },
dangerouslyAllowMutability: true, dangerouslyAllowMutability: true,
}) })
/** 팝업 스피너 상태 */
export const popSpinnerState = atom({
key: 'popSpinnerStore',
default: false,
})
/** 프로미스 팝업 상태 - 테스트용(삭제 예정) */
export const promisePopupState = atom({
key: 'promisePopupStore',
default: false,
})

View File

@ -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 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) const hasNonParallelLines = roofLines.filter((line) => line.x1 !== line.x2 && line.y1 !== line.y2)
if (hasNonParallelLines.length > 0) { if (hasNonParallelLines.length > 0) {
alert('대각선이 존재합니다.') // alert('대각선이 존재합니다.')
return return
} }
@ -648,7 +648,7 @@ export const drawShedRoof = (roofId, canvas, textMode) => {
const roof = canvas?.getObjects().find((object) => object.id === roofId) 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) const hasNonParallelLines = roof.lines.filter((line) => Math.abs(line.x1 - line.x2) > 1 && Math.abs(line.y1 - line.y2) > 1)
if (hasNonParallelLines.length > 0) { if (hasNonParallelLines.length > 0) {
alert('대각선이 존재합니다.') // alert('대각선이 존재합니다.')
return 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 //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)) 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) { if (hasNonParallelLines.length > 0) {
alert('대각선이 존재합니다.') // alert('대각선이 존재ㄴ합니다.')
return return
} }