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가 다시 나타날 경우 아래 주석풀기 - // 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/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')} + +
+
+
+
+ + +
+
+
+ + +
+
+ +
+
+
+
+
+ + +
+
+ +
+ +
+
+
+
+
+ +
+
+
+ ) +} 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() { <>