Compare commits
No commits in common. "8a5bd9f505bcc907f5ee61905b2acf13aad59002" and "83b27582f7413ea5bd46316d9b887c92008dc342" have entirely different histories.
8a5bd9f505
...
83b27582f7
@ -2,13 +2,9 @@
|
|||||||
|
|
||||||
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()
|
||||||
@ -29,7 +25,6 @@ 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>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -136,20 +136,8 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
|
|||||||
this.on('removed', () => {
|
this.on('removed', () => {
|
||||||
// const children = getAllRelatedObjects(this.id, this.canvas)
|
// const children = getAllRelatedObjects(this.id, this.canvas)
|
||||||
const children = this.canvas.getObjects().filter((obj) => obj.parentId === this.id)
|
const children = this.canvas.getObjects().filter((obj) => obj.parentId === this.id)
|
||||||
|
|
||||||
children.forEach((child) => {
|
children.forEach((child) => {
|
||||||
this.canvas.remove(child)
|
this.canvas.remove(child)
|
||||||
|
|
||||||
//그룹일때
|
|
||||||
if (child.hasOwnProperty('_objects')) {
|
|
||||||
child._objects.forEach((obj) => {
|
|
||||||
if (obj.hasOwnProperty('texts')) {
|
|
||||||
obj.texts.forEach((text) => {
|
|
||||||
this.canvas?.remove(text)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -89,11 +89,11 @@ export default function CanvasMenu(props) {
|
|||||||
const selectedRoofMaterial = useRecoilValue(selectedRoofMaterialSelector)
|
const selectedRoofMaterial = useRecoilValue(selectedRoofMaterialSelector)
|
||||||
|
|
||||||
//견적서버튼 노출용
|
//견적서버튼 노출용
|
||||||
const [docDownButtonStyle, setDocDownButtonStyle] = useState('') //문서 다운로드 버튼
|
const [buttonStyle1, setButtonStyle1] = useState('') //문서 다운로드 버튼
|
||||||
const [saveButtonStyle, setSaveButtonStyle] = useState('') //저장 버튼
|
const [buttonStyle2, setButtonStyle2] = useState('') //저장 버튼
|
||||||
const [resetButtonStyle, setResetButtonStyle] = useState('') //초기화 버튼
|
const [buttonStyle3, setButtonStyle3] = useState('') //초기화 버튼
|
||||||
const [copyButtonStyle, setCopyButtonStyle] = useState('') //견적서 복사 버튼
|
const [buttonStyle4, setButtonStyle4] = useState('') //견적서 복사 버튼
|
||||||
const [lockButtonStyle, setLockButtonStyle] = useState('') //잠금 버튼
|
const [buttonStyle5, setButtonStyle5] = useState('') //잠금 버튼
|
||||||
|
|
||||||
const setFloorPlanObjectNo = useSetRecoilState(floorPlanObjectState) //견적서 화면용 물건번호리코일
|
const setFloorPlanObjectNo = useSetRecoilState(floorPlanObjectState) //견적서 화면용 물건번호리코일
|
||||||
|
|
||||||
@ -442,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) => {
|
||||||
setDocDownButtonStyle(style)
|
setButtonStyle1(style)
|
||||||
setSaveButtonStyle(style)
|
setButtonStyle2(style)
|
||||||
setResetButtonStyle(style)
|
setButtonStyle3(style)
|
||||||
setCopyButtonStyle(style)
|
setButtonStyle4(style)
|
||||||
setLockButtonStyle(style)
|
setButtonStyle5(style)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleButtonStyles = (tempFlg, lockFlg, docNo) => {
|
const handleButtonStyles = (tempFlg, lockFlg, docNo) => {
|
||||||
if (tempFlg === '1') {
|
if (tempFlg === '1') {
|
||||||
setAllButtonStyles('none')
|
setAllButtonStyles('none')
|
||||||
setSaveButtonStyle('')
|
setButtonStyle2('')
|
||||||
} else if (tempFlg === '0' && lockFlg === '0') {
|
} else if (tempFlg === '0' && lockFlg === '0') {
|
||||||
setAllButtonStyles('')
|
setAllButtonStyles('')
|
||||||
} else {
|
} else {
|
||||||
setDocDownButtonStyle('')
|
setButtonStyle1('')
|
||||||
setSaveButtonStyle('none')
|
setButtonStyle2('none')
|
||||||
setResetButtonStyle('none')
|
setButtonStyle3('none')
|
||||||
setCopyButtonStyle('')
|
setButtonStyle4('')
|
||||||
setLockButtonStyle('')
|
setButtonStyle5('')
|
||||||
}
|
}
|
||||||
if (!docNo) {
|
if (!docNo) {
|
||||||
setDocDownButtonStyle('none')
|
setButtonStyle1('none')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -513,11 +513,11 @@ export default function CanvasMenu(props) {
|
|||||||
|
|
||||||
// 문서다운로드 팝업에서 다운로드 하면 문서 잠금
|
// 문서다운로드 팝업에서 다운로드 하면 문서 잠금
|
||||||
const docDownPopLockFlg = () => {
|
const docDownPopLockFlg = () => {
|
||||||
setDocDownButtonStyle('')
|
setButtonStyle1('')
|
||||||
setSaveButtonStyle('none')
|
setButtonStyle2('none')
|
||||||
setResetButtonStyle('none')
|
setButtonStyle3('none')
|
||||||
setCopyButtonStyle('')
|
setButtonStyle4('')
|
||||||
setLockButtonStyle('')
|
setButtonStyle5('')
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -627,22 +627,17 @@ 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
|
<button type="button" style={{ display: buttonStyle1 }} className="btn-frame gray ico-flx" onClick={() => setEstimatePopupOpen(true)}>
|
||||||
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: saveButtonStyle }} className="btn-frame gray ico-flx" onClick={handleEstimateSubmit}>
|
<button type="button" style={{ display: buttonStyle2 }} 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: resetButtonStyle }}
|
style={{ display: buttonStyle3 }}
|
||||||
className="btn-frame gray ico-flx"
|
className="btn-frame gray ico-flx"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
handleEstimateReset()
|
handleEstimateReset()
|
||||||
@ -655,7 +650,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: copyButtonStyle }}
|
style={{ display: buttonStyle4 }}
|
||||||
className="btn-frame gray ico-flx"
|
className="btn-frame gray ico-flx"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setEstimateCopyPopupOpen(true)
|
setEstimateCopyPopupOpen(true)
|
||||||
@ -667,7 +662,7 @@ export default function CanvasMenu(props) {
|
|||||||
)}
|
)}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
style={{ display: lockButtonStyle }}
|
style={{ display: buttonStyle5 }}
|
||||||
className="btn-frame gray ico-flx"
|
className="btn-frame gray ico-flx"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
handleEstimateLockController(estimateRecoilState)
|
handleEstimateLockController(estimateRecoilState)
|
||||||
|
|||||||
@ -6,14 +6,7 @@ import PitchModule from '@/components/floor-plan/modal/basic/step/pitch/PitchMod
|
|||||||
import PitchPlacement from '@/components/floor-plan/modal/basic/step/pitch/PitchPlacement'
|
import PitchPlacement from '@/components/floor-plan/modal/basic/step/pitch/PitchPlacement'
|
||||||
import Placement from '@/components/floor-plan/modal/basic/step/Placement'
|
import Placement from '@/components/floor-plan/modal/basic/step/Placement'
|
||||||
import { useRecoilValue, useRecoilState } from 'recoil'
|
import { useRecoilValue, useRecoilState } from 'recoil'
|
||||||
import {
|
import { canvasSettingState, canvasState, checkedModuleState, isManualModuleLayoutSetupState, isManualModuleSetupState } from '@/store/canvasAtom'
|
||||||
canvasSettingState,
|
|
||||||
canvasState,
|
|
||||||
checkedModuleState,
|
|
||||||
isManualModuleLayoutSetupState,
|
|
||||||
isManualModuleSetupState,
|
|
||||||
toggleManualSetupModeState,
|
|
||||||
} from '@/store/canvasAtom'
|
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientation'
|
import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientation'
|
||||||
import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting'
|
import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting'
|
||||||
@ -45,7 +38,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
const [isClosePopup, setIsClosePopup] = useState({ close: false, id: 0 })
|
const [isClosePopup, setIsClosePopup] = useState({ close: false, id: 0 })
|
||||||
const [checkedModules, setCheckedModules] = useRecoilState(checkedModuleState)
|
const [checkedModules, setCheckedModules] = useRecoilState(checkedModuleState)
|
||||||
|
|
||||||
const [manualSetupMode, setManualSetupMode] = useRecoilState(toggleManualSetupModeState)
|
const [manualSetupMode, setManualSetupMode] = useState('')
|
||||||
|
|
||||||
const [layoutSetup, setLayoutSetup] = useState([{}])
|
const [layoutSetup, setLayoutSetup] = useState([{}])
|
||||||
|
|
||||||
@ -97,6 +90,13 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
setTabNum(tabNum + 1)
|
setTabNum(tabNum + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const placementRef = {
|
||||||
|
isChidori: useRef('false'),
|
||||||
|
setupLocation: useRef('eaves'),
|
||||||
|
}
|
||||||
|
|
||||||
|
const layoutSetupRef = useRef([])
|
||||||
|
|
||||||
const placementFlatRef = {
|
const placementFlatRef = {
|
||||||
setupLocation: useRef('south'),
|
setupLocation: useRef('south'),
|
||||||
}
|
}
|
||||||
@ -143,17 +143,13 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (basicSetting.roofSizeSet !== '3') {
|
if (basicSetting.roofSizeSet !== '3') {
|
||||||
if (manualSetupMode.indexOf('manualSetup') > -1) {
|
if (manualSetupMode.indexOf('manualSetup') > -1) {
|
||||||
manualModuleSetup()
|
manualModuleSetup(placementRef)
|
||||||
} else if (manualSetupMode.indexOf('manualLayoutSetup') > -1) {
|
} else if (manualSetupMode.indexOf('manualLayoutSetup') > -1) {
|
||||||
manualModuleLayoutSetup(layoutSetup)
|
manualModuleLayoutSetup(layoutSetupRef)
|
||||||
} else if (manualSetupMode.indexOf('off') > -1) {
|
|
||||||
manualModuleSetup()
|
|
||||||
manualModuleLayoutSetup(layoutSetup)
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
manualFlatroofModuleSetup(placementFlatRef)
|
manualFlatroofModuleSetup(placementFlatRef)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isClosePopup.close) {
|
if (isClosePopup.close) {
|
||||||
closePopup(isClosePopup.id)
|
closePopup(isClosePopup.id)
|
||||||
}
|
}
|
||||||
@ -161,13 +157,12 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isManualModuleLayoutSetup) {
|
if (isManualModuleLayoutSetup) {
|
||||||
manualModuleLayoutSetup(layoutSetup)
|
manualModuleLayoutSetup(layoutSetupRef)
|
||||||
}
|
}
|
||||||
}, [layoutSetup])
|
}, [layoutSetup])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsManualModuleSetup(false)
|
setIsManualModuleSetup(false)
|
||||||
setIsManualModuleLayoutSetup(false)
|
|
||||||
}, [checkedModules])
|
}, [checkedModules])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -185,7 +180,13 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
{/*배치면 초기설정 - 입력방법: 복시도 입력 || 실측값 입력*/}
|
{/*배치면 초기설정 - 입력방법: 복시도 입력 || 실측값 입력*/}
|
||||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && tabNum === 2 && <Module setTabNum={setTabNum} />}
|
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && tabNum === 2 && <Module setTabNum={setTabNum} />}
|
||||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && tabNum === 3 && (
|
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && tabNum === 3 && (
|
||||||
<Placement setTabNum={setTabNum} layoutSetup={layoutSetup} setLayoutSetup={setLayoutSetup} />
|
<Placement
|
||||||
|
setTabNum={setTabNum}
|
||||||
|
ref={placementRef}
|
||||||
|
layoutSetupRef={layoutSetupRef}
|
||||||
|
layoutSetup={layoutSetup}
|
||||||
|
setLayoutSetup={setLayoutSetup}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/*배치면 초기설정 - 입력방법: 육지붕*/}
|
{/*배치면 초기설정 - 입력방법: 육지붕*/}
|
||||||
@ -217,7 +218,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
<button className={`btn-frame modal mr5 ${isManualModuleLayoutSetup ? 'act' : ''}`} onClick={handleManualModuleLayoutSetup}>
|
<button className={`btn-frame modal mr5 ${isManualModuleLayoutSetup ? 'act' : ''}`} onClick={handleManualModuleLayoutSetup}>
|
||||||
레아이웃 수동설치
|
레아이웃 수동설치
|
||||||
</button>
|
</button>
|
||||||
<button className="btn-frame modal act" onClick={() => autoModuleSetup()}>
|
<button className="btn-frame modal act" onClick={() => autoModuleSetup(placementRef)}>
|
||||||
{getMessage('modal.module.basic.setting.auto.placement')}
|
{getMessage('modal.module.basic.setting.auto.placement')}
|
||||||
</button>
|
</button>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -1,23 +1,20 @@
|
|||||||
import { forwardRef, useEffect, useState } from 'react'
|
import { forwardRef, useEffect, useState } from 'react'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting'
|
import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting'
|
||||||
import {
|
import { checkedModuleState, currentCanvasPlanState, isManualModuleLayoutSetupState, isManualModuleSetupState } from '@/store/canvasAtom'
|
||||||
checkedModuleState,
|
|
||||||
isManualModuleLayoutSetupState,
|
|
||||||
isManualModuleSetupState,
|
|
||||||
moduleSetupOptionState,
|
|
||||||
toggleManualSetupModeState,
|
|
||||||
} from '@/store/canvasAtom'
|
|
||||||
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'
|
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'
|
||||||
import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
|
import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
|
||||||
import { isObjectNotEmpty } from '@/util/common-utils'
|
import { isObjectNotEmpty } from '@/util/common-utils'
|
||||||
|
|
||||||
const Placement = forwardRef((props, refs) => {
|
const Placement = forwardRef((props, refs) => {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
|
const [isChidori, setIsChidori] = useState(false)
|
||||||
const [isChidoriNotAble, setIsChidoriNotAble] = useState(false)
|
const [isChidoriNotAble, setIsChidoriNotAble] = useState(false)
|
||||||
|
|
||||||
|
const [setupLocation, setSetupLocation] = useState('eaves')
|
||||||
|
const [isMaxSetup, setIsMaxSetup] = useState('false')
|
||||||
const [selectedItems, setSelectedItems] = useState({})
|
const [selectedItems, setSelectedItems] = useState({})
|
||||||
|
|
||||||
const [selectedModules, setSelectedModules] = useRecoilState(selectedModuleState)
|
const [selectedModules, setSelectedModules] = useRecoilState(selectedModuleState)
|
||||||
|
|
||||||
const setCheckedModules = useSetRecoilState(checkedModuleState)
|
const setCheckedModules = useSetRecoilState(checkedModuleState)
|
||||||
@ -29,9 +26,6 @@ const Placement = forwardRef((props, refs) => {
|
|||||||
//언마운트시 버튼 초기화
|
//언마운트시 버튼 초기화
|
||||||
const setIsManualModuleSetup = useSetRecoilState(isManualModuleSetupState)
|
const setIsManualModuleSetup = useSetRecoilState(isManualModuleSetupState)
|
||||||
const setIsManualModuleLayoutSetup = useSetRecoilState(isManualModuleLayoutSetupState)
|
const setIsManualModuleLayoutSetup = useSetRecoilState(isManualModuleLayoutSetupState)
|
||||||
const setManualSetupMode = useSetRecoilState(toggleManualSetupModeState)
|
|
||||||
|
|
||||||
const [moduleSetupOption, setModuleSetupOption] = useRecoilState(moduleSetupOptionState) //모듈 설치 옵션
|
|
||||||
|
|
||||||
//모듈 배치면 생성
|
//모듈 배치면 생성
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -47,7 +41,6 @@ const Placement = forwardRef((props, refs) => {
|
|||||||
return () => {
|
return () => {
|
||||||
setIsManualModuleSetup(false)
|
setIsManualModuleSetup(false)
|
||||||
setIsManualModuleLayoutSetup(false)
|
setIsManualModuleLayoutSetup(false)
|
||||||
setManualSetupMode('off')
|
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
@ -67,6 +60,7 @@ const Placement = forwardRef((props, refs) => {
|
|||||||
setSelectedItems(initCheckedModule)
|
setSelectedItems(initCheckedModule)
|
||||||
setSelectedModules(moduleSelectionData.module)
|
setSelectedModules(moduleSelectionData.module)
|
||||||
props.setLayoutSetup(moduleSelectionData.module.itemList.map((item) => ({ moduleId: item.itemId, col: 0, row: 0 })))
|
props.setLayoutSetup(moduleSelectionData.module.itemList.map((item) => ({ moduleId: item.itemId, col: 0, row: 0 })))
|
||||||
|
props.layoutSetupRef.current = moduleSelectionData.module.itemList.map((item) => ({ moduleId: item.itemId, col: 0, row: 0 }))
|
||||||
}
|
}
|
||||||
|
|
||||||
//모듈 배치면 생성
|
//모듈 배치면 생성
|
||||||
@ -98,21 +92,23 @@ const Placement = forwardRef((props, refs) => {
|
|||||||
|
|
||||||
const handleChangeChidori = (e) => {
|
const handleChangeChidori = (e) => {
|
||||||
const bool = e.target.value === 'true' ? true : false
|
const bool = e.target.value === 'true' ? true : false
|
||||||
setModuleSetupOption({ ...moduleSetupOption, isChidori: bool })
|
setIsChidori(bool)
|
||||||
|
refs.isChidori.current = e.target.value
|
||||||
//변경하면 수동 다 꺼짐
|
|
||||||
setIsManualModuleSetup(false)
|
|
||||||
setIsManualModuleLayoutSetup(false)
|
|
||||||
setManualSetupMode('off')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSetupLocation = (e) => {
|
const handleSetupLocation = (e) => {
|
||||||
setModuleSetupOption({ ...moduleSetupOption, setupLocation: e.target.value })
|
setSetupLocation(e.target.value)
|
||||||
|
refs.setupLocation.current = e.target.value
|
||||||
|
}
|
||||||
|
|
||||||
//변경하면 수동 다 꺼짐
|
const handleMaxSetup = (e) => {
|
||||||
setIsManualModuleSetup(false)
|
if (e.target.checked) {
|
||||||
setIsManualModuleLayoutSetup(false)
|
setIsMaxSetup('true')
|
||||||
setManualSetupMode('off')
|
refs.isMaxSetup.current = 'true'
|
||||||
|
} else {
|
||||||
|
setIsMaxSetup('false')
|
||||||
|
refs.isMaxSetup.current = 'false'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//체크된 모듈 아이디 추출
|
//체크된 모듈 아이디 추출
|
||||||
@ -124,6 +120,7 @@ const Placement = forwardRef((props, refs) => {
|
|||||||
const newLayoutSetup = [...props.layoutSetup]
|
const newLayoutSetup = [...props.layoutSetup]
|
||||||
newLayoutSetup[index] = { ...newLayoutSetup[index], moduleId: itemId, [e.target.name]: Number(e.target.value) }
|
newLayoutSetup[index] = { ...newLayoutSetup[index], moduleId: itemId, [e.target.name]: Number(e.target.value) }
|
||||||
props.setLayoutSetup(newLayoutSetup)
|
props.setLayoutSetup(newLayoutSetup)
|
||||||
|
props.layoutSetupRef.current[index] = { ...props.layoutSetupRef.current[index], moduleId: itemId, [e.target.name]: Number(e.target.value) }
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -210,7 +207,7 @@ const Placement = forwardRef((props, refs) => {
|
|||||||
type="radio"
|
type="radio"
|
||||||
name="radio01"
|
name="radio01"
|
||||||
id="ra01"
|
id="ra01"
|
||||||
checked={moduleSetupOption.isChidori}
|
checked={isChidori}
|
||||||
disabled={isChidoriNotAble}
|
disabled={isChidoriNotAble}
|
||||||
value={'true'}
|
value={'true'}
|
||||||
onChange={(e) => handleChangeChidori(e)}
|
onChange={(e) => handleChangeChidori(e)}
|
||||||
@ -218,14 +215,7 @@ const Placement = forwardRef((props, refs) => {
|
|||||||
<label htmlFor="ra01">{getMessage('modal.module.basic.setting.module.placement.do')}</label>
|
<label htmlFor="ra01">{getMessage('modal.module.basic.setting.module.placement.do')}</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="d-check-radio pop">
|
<div className="d-check-radio pop">
|
||||||
<input
|
<input type="radio" name="radio02" id="ra02" checked={!isChidori} value={'false'} onChange={(e) => handleChangeChidori(e)} />
|
||||||
type="radio"
|
|
||||||
name="radio02"
|
|
||||||
id="ra02"
|
|
||||||
checked={!moduleSetupOption.isChidori}
|
|
||||||
value={'false'}
|
|
||||||
onChange={(e) => handleChangeChidori(e)}
|
|
||||||
/>
|
|
||||||
<label htmlFor="ra02">{getMessage('modal.module.basic.setting.module.placement.do.not')}</label>
|
<label htmlFor="ra02">{getMessage('modal.module.basic.setting.module.placement.do.not')}</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -235,12 +225,24 @@ const Placement = forwardRef((props, refs) => {
|
|||||||
<div className="self-item-th">{getMessage('modal.module.basic.setting.module.placement.arrangement.standard')}</div>
|
<div className="self-item-th">{getMessage('modal.module.basic.setting.module.placement.arrangement.standard')}</div>
|
||||||
<div className="self-item-td">
|
<div className="self-item-td">
|
||||||
<div className="pop-form-radio">
|
<div className="pop-form-radio">
|
||||||
|
<div className="d-check-radio pop">
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
name="radio03"
|
||||||
|
id="ra03"
|
||||||
|
checked={setupLocation === 'center'}
|
||||||
|
value={'center'}
|
||||||
|
onChange={handleSetupLocation}
|
||||||
|
disabled={isMultiModule}
|
||||||
|
/>
|
||||||
|
<label htmlFor="ra03">{getMessage('modal.module.basic.setting.module.placement.arrangement.standard.center')}</label>
|
||||||
|
</div>
|
||||||
<div className="d-check-radio pop">
|
<div className="d-check-radio pop">
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
name="radio04"
|
name="radio04"
|
||||||
id="ra04"
|
id="ra04"
|
||||||
checked={moduleSetupOption.setupLocation === 'eaves'}
|
checked={setupLocation === 'eaves'}
|
||||||
value={'eaves'}
|
value={'eaves'}
|
||||||
onChange={handleSetupLocation}
|
onChange={handleSetupLocation}
|
||||||
/>
|
/>
|
||||||
@ -251,7 +253,7 @@ const Placement = forwardRef((props, refs) => {
|
|||||||
type="radio"
|
type="radio"
|
||||||
name="radio05"
|
name="radio05"
|
||||||
id="ra05"
|
id="ra05"
|
||||||
checked={moduleSetupOption.setupLocation === 'ridge'}
|
checked={setupLocation === 'ridge'}
|
||||||
value={'ridge'}
|
value={'ridge'}
|
||||||
onChange={handleSetupLocation}
|
onChange={handleSetupLocation}
|
||||||
disabled={isMultiModule}
|
disabled={isMultiModule}
|
||||||
|
|||||||
@ -51,8 +51,7 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
// const { trigger: setCircuitData } = useCanvasPopupStatusController(4)
|
// const { trigger: setCircuitData } = useCanvasPopupStatusController(4)
|
||||||
// const [stepUpListData, setStepUpListData] = useRecoilState(stepUpListDataState)
|
// const [stepUpListData, setStepUpListData] = useRecoilState(stepUpListDataState)
|
||||||
const [stepUpListData, setStepUpListData] = useState([])
|
const [stepUpListData, setStepUpListData] = useState([])
|
||||||
const [seletedMainOption, setSeletedMainOption] = useState(null)
|
const [seletedOption, setSeletedOption] = useState(null)
|
||||||
const [seletedSubOption, setSeletedSubOption] = useState(null)
|
|
||||||
const { setModuleStatisticsData } = useCircuitTrestle()
|
const { setModuleStatisticsData } = useCircuitTrestle()
|
||||||
const { handleCanvasToPng } = useImgLoader()
|
const { handleCanvasToPng } = useImgLoader()
|
||||||
|
|
||||||
@ -79,7 +78,6 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
getRoofSurfaceList,
|
getRoofSurfaceList,
|
||||||
getModuleList,
|
getModuleList,
|
||||||
removeNotAllocationModules,
|
removeNotAllocationModules,
|
||||||
resetCircuits,
|
|
||||||
} = useCircuitTrestle()
|
} = useCircuitTrestle()
|
||||||
// const { trigger: moduleSelectedDataTrigger } = useCanvasPopupStatusController(2)
|
// const { trigger: moduleSelectedDataTrigger } = useCanvasPopupStatusController(2)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -94,13 +92,6 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
// selectedModels,
|
// selectedModels,
|
||||||
// pcsCheck,
|
// pcsCheck,
|
||||||
// })
|
// })
|
||||||
|
|
||||||
return () => {
|
|
||||||
const moduleSetupSurfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
|
||||||
if (moduleSetupSurfaces.some((surface) => !surface.isComplete)) {
|
|
||||||
resetCircuits()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
// 수동할당 시 모듈 삭제
|
// 수동할당 시 모듈 삭제
|
||||||
@ -454,7 +445,6 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
allocationType,
|
allocationType,
|
||||||
circuitAllocationType,
|
circuitAllocationType,
|
||||||
setCircuitAllocationType,
|
setCircuitAllocationType,
|
||||||
selectedMaker,
|
|
||||||
selectedModels,
|
selectedModels,
|
||||||
setSelectedModels,
|
setSelectedModels,
|
||||||
getSelectedPcsItemList,
|
getSelectedPcsItemList,
|
||||||
@ -465,27 +455,23 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
onValuesSelected: handleStepUpValuesSelected, // 선택된 값들을 처리하는 함수
|
onValuesSelected: handleStepUpValuesSelected, // 선택된 값들을 처리하는 함수
|
||||||
stepUpListData,
|
stepUpListData,
|
||||||
setStepUpListData,
|
setStepUpListData,
|
||||||
seletedMainOption,
|
seletedOption,
|
||||||
setSeletedMainOption,
|
setSeletedOption,
|
||||||
seletedSubOption,
|
|
||||||
setSeletedSubOption,
|
|
||||||
getModuleList,
|
getModuleList,
|
||||||
setModuleStatisticsData,
|
setModuleStatisticsData,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 승압설정 목록 조회
|
// 승압설정 목록 조회
|
||||||
const getStepUpListData = () => {
|
const getStepUpListData = () => {
|
||||||
const pcs = []
|
return stepUpListData[0].pcsItemList.map((item) => {
|
||||||
console.log(stepUpListData)
|
|
||||||
stepUpListData[0].pcsItemList.map((item, index) => {
|
|
||||||
return item.serQtyList
|
return item.serQtyList
|
||||||
.filter((serQty) => serQty.selected)
|
.filter((serQty) => serQty.selected)
|
||||||
.forEach((serQty) => {
|
.map((serQty) => {
|
||||||
pcs.push({
|
return {
|
||||||
pcsMkrCd: item.pcsMkrCd,
|
pcsMkrCd: item.pcsMkrCd,
|
||||||
pcsSerCd: item.pcsSerCd,
|
pcsSerCd: item.pcsSerCd,
|
||||||
pcsItemId: item.itemId,
|
pcsItemId: item.itemId,
|
||||||
pscOptCd: getPcsOptCd(index),
|
pscOptCd: seletedOption.code,
|
||||||
paralQty: serQty.paralQty,
|
paralQty: serQty.paralQty,
|
||||||
connections: item.connList?.length
|
connections: item.connList?.length
|
||||||
? [
|
? [
|
||||||
@ -494,43 +480,9 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
: [],
|
: [],
|
||||||
})
|
}
|
||||||
// return {
|
})[0]
|
||||||
// pcsMkrCd: item.pcsMkrCd,
|
|
||||||
// pcsSerCd: item.pcsSerCd,
|
|
||||||
// pcsItemId: item.itemId,
|
|
||||||
// pscOptCd: getPcsOptCd(index),
|
|
||||||
// paralQty: serQty.paralQty,
|
|
||||||
// connections: item.connList?.length
|
|
||||||
// ? [
|
|
||||||
// {
|
|
||||||
// connItemId: item.connList[0].itemId,
|
|
||||||
// },
|
|
||||||
// ]
|
|
||||||
// : [],
|
|
||||||
// }
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
return pcs
|
|
||||||
}
|
|
||||||
|
|
||||||
const getPcsOptCd = (index) => {
|
|
||||||
console.log(selectedModels)
|
|
||||||
console.log(seletedMainOption)
|
|
||||||
console.log(seletedSubOption)
|
|
||||||
if (selectedModels.some((model) => model.pcsSerParallelYn === 'Y')) {
|
|
||||||
if (selectedModels.length > 1) {
|
|
||||||
if (index === 0) {
|
|
||||||
return seletedMainOption.code
|
|
||||||
} else {
|
|
||||||
return seletedSubOption.code
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return seletedMainOption.code
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return seletedMainOption.code
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleStepUp = () => {
|
const handleStepUp = () => {
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import { useRecoilState } from 'recoil'
|
|||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilValue } from 'recoil'
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
|
|
||||||
export const PCS_MKR_MULTI_TYPE = {
|
const PCS_MKR_MULTI_TYPE = {
|
||||||
MULTI: 'MULTI',
|
MULTI: 'MULTI',
|
||||||
SINGLE_P: 'SINGLE-P',
|
SINGLE_P: 'SINGLE-P',
|
||||||
SINGLE_N: 'SINGLE-N',
|
SINGLE_N: 'SINGLE-N',
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import { POLYGON_TYPE } from '@/common/common'
|
|||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
import { circuitNumDisplaySelector } from '@/store/settingAtom'
|
import { circuitNumDisplaySelector } from '@/store/settingAtom'
|
||||||
import { fontSelector } from '@/store/fontAtom'
|
import { fontSelector } from '@/store/fontAtom'
|
||||||
import { PCS_MKR_MULTI_TYPE } from './PowerConditionalSelect'
|
|
||||||
|
|
||||||
export default function StepUp(props) {
|
export default function StepUp(props) {
|
||||||
const {
|
const {
|
||||||
@ -23,11 +22,8 @@ export default function StepUp(props) {
|
|||||||
allocationType,
|
allocationType,
|
||||||
stepUpListData,
|
stepUpListData,
|
||||||
setStepUpListData,
|
setStepUpListData,
|
||||||
seletedMainOption,
|
seletedOption,
|
||||||
setSeletedMainOption,
|
setSeletedOption,
|
||||||
seletedSubOption,
|
|
||||||
setSeletedSubOption,
|
|
||||||
selectedMaker,
|
|
||||||
selectedModels,
|
selectedModels,
|
||||||
setSelectedModels,
|
setSelectedModels,
|
||||||
getSelectedPcsItemList,
|
getSelectedPcsItemList,
|
||||||
@ -46,14 +42,17 @@ export default function StepUp(props) {
|
|||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
const selectedModules = useRecoilValue(selectedModuleState)
|
const selectedModules = useRecoilValue(selectedModuleState)
|
||||||
const [optCodes, setOptCodes] = useState([])
|
const [optCodes, setOptCodes] = useState([])
|
||||||
const [mainOptions, setMainOptions] = useState([])
|
|
||||||
const [subOptions, setSubOptions] = useState([])
|
|
||||||
|
|
||||||
const [selectedRows, setSelectedRows] = useState({})
|
const [selectedRows, setSelectedRows] = useState({})
|
||||||
const [isManualSelection, setIsManualSelection] = useState({})
|
const [isManualSelection, setIsManualSelection] = useState({})
|
||||||
|
|
||||||
const isDisplayCircuitNumber = useRecoilValue(circuitNumDisplaySelector)
|
const isDisplayCircuitNumber = useRecoilValue(circuitNumDisplaySelector)
|
||||||
const circuitNumberText = useRecoilValue(fontSelector('circuitNumberText'))
|
const circuitNumberText = useRecoilValue(fontSelector('circuitNumberText'))
|
||||||
|
// useCanvasPopupStatusController(6)
|
||||||
|
// const canvasPopupStatusState = useRecoilValue(canvasPopupStatusStore)
|
||||||
|
// if (Object.keys(canvasPopupStatusState[6]).length !== 0) {
|
||||||
|
// console.log('🚀 ~ useEffect ~ canvasPopupStatusState :', canvasPopupStatusState)
|
||||||
|
// }
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (allocationType === 'auto') {
|
if (allocationType === 'auto') {
|
||||||
@ -80,11 +79,6 @@ export default function StepUp(props) {
|
|||||||
/**
|
/**
|
||||||
* PCS 자동 승압설정 정보 조회
|
* PCS 자동 승압설정 정보 조회
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const isMultiOptions = () => {
|
|
||||||
return selectedModels.some((model) => model.pcsSerParallelYn === 'Y')
|
|
||||||
}
|
|
||||||
|
|
||||||
const fetchAutoStepUpData = async () => {
|
const fetchAutoStepUpData = async () => {
|
||||||
try {
|
try {
|
||||||
const params = {
|
const params = {
|
||||||
@ -93,6 +87,7 @@ export default function StepUp(props) {
|
|||||||
roofSurfaceList: props.getRoofSurfaceList() /** 지붕면 목록 */,
|
roofSurfaceList: props.getRoofSurfaceList() /** 지붕면 목록 */,
|
||||||
pcsItemList: props.getSelectedPcsItemList() /** PCS 아이템 목록 */,
|
pcsItemList: props.getSelectedPcsItemList() /** PCS 아이템 목록 */,
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 회로 구성 가능 여부 체크 통과 시 승압설정 정보 조회 */
|
/** 회로 구성 가능 여부 체크 통과 시 승압설정 정보 조회 */
|
||||||
getPcsVoltageStepUpList(params).then((res) => {
|
getPcsVoltageStepUpList(params).then((res) => {
|
||||||
if (res?.result.resultCode === 'S' && res?.data) {
|
if (res?.result.resultCode === 'S' && res?.data) {
|
||||||
@ -103,29 +98,12 @@ export default function StepUp(props) {
|
|||||||
setStepUpListData(stepUpListData)
|
setStepUpListData(stepUpListData)
|
||||||
|
|
||||||
/** PCS 옵션 조회 */
|
/** PCS 옵션 조회 */
|
||||||
// const formattedOptCodes = formatOptionCodes(res.data.optionList)
|
const formattedOptCodes = formatOptionCodes(res.data.optionList)
|
||||||
// setOptCodes(formattedOptCodes)
|
setOptCodes(formattedOptCodes)
|
||||||
// setSeletedOption(formattedOptCodes[0])
|
setSeletedOption(formattedOptCodes[0])
|
||||||
|
|
||||||
/** 캔버스에 회로 정보 적용 */
|
/** 캔버스에 회로 정보 적용 */
|
||||||
// 병설일때 pcs 있으면 setSubOpsions, 없으면 setMainOptions
|
stepUpListData[0].pcsItemList.forEach((pcsItem) => {
|
||||||
console.log('stepUpListData', stepUpListData)
|
|
||||||
stepUpListData[0].pcsItemList.forEach((pcsItem, index) => {
|
|
||||||
const optionList = formatOptionCodes(pcsItem.optionList)
|
|
||||||
if (isMultiOptions()) {
|
|
||||||
if (index === 0) {
|
|
||||||
setMainOptions(optionList)
|
|
||||||
setSeletedMainOption(optionList[0])
|
|
||||||
} else {
|
|
||||||
setSubOptions(optionList)
|
|
||||||
setSeletedSubOption(optionList[0])
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (index === 0) {
|
|
||||||
setMainOptions(optionList)
|
|
||||||
setSeletedMainOption(optionList[0])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const selectedSerQty = pcsItem.serQtyList.find((serQty) => serQty.selected)
|
const selectedSerQty = pcsItem.serQtyList.find((serQty) => serQty.selected)
|
||||||
if (selectedSerQty) {
|
if (selectedSerQty) {
|
||||||
selectedSerQty.roofSurfaceList.forEach((roofSurface) => {
|
selectedSerQty.roofSurfaceList.forEach((roofSurface) => {
|
||||||
@ -187,6 +165,12 @@ export default function StepUp(props) {
|
|||||||
*/
|
*/
|
||||||
const fetchPassiStepUpData = async () => {
|
const fetchPassiStepUpData = async () => {
|
||||||
try {
|
try {
|
||||||
|
// 1-1 2-2
|
||||||
|
// canvas
|
||||||
|
// .getObjects()
|
||||||
|
// .filter((obj) => obj.name === POLYGON_TYPE.MODULE && obj.circuit)
|
||||||
|
// .map((module) => module.circuitNumber)
|
||||||
|
|
||||||
/** 모듈 데이터 가져오기 */
|
/** 모듈 데이터 가져오기 */
|
||||||
const modules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE)
|
const modules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE)
|
||||||
|
|
||||||
@ -224,21 +208,6 @@ export default function StepUp(props) {
|
|||||||
const pcsItemListWithSerQty = res.data.pcsItemList.map((pcsItem, index) => {
|
const pcsItemListWithSerQty = res.data.pcsItemList.map((pcsItem, index) => {
|
||||||
const pcsData = pcsSummary[selectedModels[index].id] || { circuits: {}, totalModules: 0 }
|
const pcsData = pcsSummary[selectedModels[index].id] || { circuits: {}, totalModules: 0 }
|
||||||
const circuitCounts = Object.values(pcsData.circuits)
|
const circuitCounts = Object.values(pcsData.circuits)
|
||||||
const optionList = formatOptionCodes(pcsItem.optionList)
|
|
||||||
if (isMultiOptions()) {
|
|
||||||
if (index === 0) {
|
|
||||||
setMainOptions(optionList)
|
|
||||||
setSeletedMainOption(optionList[0])
|
|
||||||
} else {
|
|
||||||
setSubOptions(optionList)
|
|
||||||
setSeletedSubOption(optionList[0])
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (index === 0) {
|
|
||||||
setMainOptions(optionList)
|
|
||||||
setSeletedMainOption(optionList[0])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return {
|
return {
|
||||||
...pcsItem,
|
...pcsItem,
|
||||||
serQtyList: [
|
serQtyList: [
|
||||||
@ -265,9 +234,9 @@ export default function StepUp(props) {
|
|||||||
setStepUpListData(stepUpListData)
|
setStepUpListData(stepUpListData)
|
||||||
|
|
||||||
/** PCS 옵션 조회 */
|
/** PCS 옵션 조회 */
|
||||||
// const formattedOptCodes = formatOptionCodes(res.data.optionList)
|
const formattedOptCodes = formatOptionCodes(res.data.optionList)
|
||||||
// setOptCodes(formattedOptCodes)
|
setOptCodes(formattedOptCodes)
|
||||||
// setSeletedOption(formattedOptCodes[0])
|
setSeletedOption(formattedOptCodes[0])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -280,9 +249,9 @@ export default function StepUp(props) {
|
|||||||
*/
|
*/
|
||||||
const formatOptionCodes = (optionList = []) => {
|
const formatOptionCodes = (optionList = []) => {
|
||||||
return optionList?.map((opt) => ({
|
return optionList?.map((opt) => ({
|
||||||
code: opt.pcsOptCd ?? '',
|
code: opt.pcsOptCd ? opt.pcsOptCd : '',
|
||||||
name: opt.pcsOptNm ?? '',
|
name: opt.pcsOptNm ? opt.pcsOptNm : '',
|
||||||
nameJp: opt.pcsOptNmJp ?? '',
|
nameJp: opt.pcsOptNmJp ? opt.pcsOptNmJp : '',
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,9 +274,9 @@ export default function StepUp(props) {
|
|||||||
*/
|
*/
|
||||||
const formatOptionList = (optionList = []) => {
|
const formatOptionList = (optionList = []) => {
|
||||||
return optionList?.map((option) => ({
|
return optionList?.map((option) => ({
|
||||||
pcsOptCd: option.pcsOptCd ?? '',
|
pcsOptCd: option.pcsOptCd ? option.pcsOptCd : '',
|
||||||
pcsOptNm: option.pcsOptNm ?? '',
|
pcsOptNm: option.pcsOptNm ? option.pcsOptNm : '',
|
||||||
pcsOptNmJp: option.pcsOptNmJp ?? '',
|
pcsOptNmJp: option.pcsOptNmJp ? option.pcsOptNmJp : '',
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,7 +293,6 @@ export default function StepUp(props) {
|
|||||||
uniqueIndex: `${item.itemId}_${index}`, // 고유 식별자 추가(동일한 PCS를 구분)
|
uniqueIndex: `${item.itemId}_${index}`, // 고유 식별자 추가(동일한 PCS를 구분)
|
||||||
connList: formatConnList(item.connList),
|
connList: formatConnList(item.connList),
|
||||||
serQtyList: formatSerQtyList(item.serQtyList),
|
serQtyList: formatSerQtyList(item.serQtyList),
|
||||||
optionList: item.optionList ?? [],
|
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -335,12 +303,12 @@ export default function StepUp(props) {
|
|||||||
if (!connList) return [] // null인 경우 빈 배열 반환
|
if (!connList) return [] // null인 경우 빈 배열 반환
|
||||||
|
|
||||||
return connList?.map((conn) => ({
|
return connList?.map((conn) => ({
|
||||||
connAllowCur: conn.connAllowCur ?? 0,
|
connAllowCur: conn.connAllowCur ? conn.connAllowCur : 0,
|
||||||
connMaxParalCnt: conn.connMaxParalCnt ?? 0,
|
connMaxParalCnt: conn.connMaxParalCnt ? conn.connMaxParalCnt : 0,
|
||||||
goodsNo: conn.goodsNo ?? '',
|
goodsNo: conn.goodsNo ? conn.goodsNo : '',
|
||||||
itemId: conn.itemId ?? '',
|
itemId: conn.itemId ? conn.itemId : '',
|
||||||
itemNm: conn.itemNm ?? '',
|
itemNm: conn.itemNm ? conn.itemNm : '',
|
||||||
vstuParalCnt: conn.vstuParalCnt ?? 0,
|
vstuParalCnt: conn.vstuParalCnt ? conn.vstuParalCnt : 0,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,10 +318,10 @@ export default function StepUp(props) {
|
|||||||
const formatSerQtyList = (serQtyList = []) => {
|
const formatSerQtyList = (serQtyList = []) => {
|
||||||
return serQtyList?.map((qty) => ({
|
return serQtyList?.map((qty) => ({
|
||||||
code: uuidv4(),
|
code: uuidv4(),
|
||||||
serQty: qty.serQty ?? 0,
|
serQty: qty.serQty ? qty.serQty : 0,
|
||||||
paralQty: qty.paralQty ?? 0,
|
paralQty: qty.paralQty ? qty.paralQty : 0,
|
||||||
rmdYn: qty.rmdYn ?? 'N',
|
rmdYn: qty.rmdYn ? qty.rmdYn : 'N',
|
||||||
usePossYn: qty.usePossYn ?? 'Y',
|
usePossYn: qty.usePossYn ? qty.usePossYn : 'Y',
|
||||||
roofSurfaceList: formatRoofSurfaceList(qty.roofSurfaceList),
|
roofSurfaceList: formatRoofSurfaceList(qty.roofSurfaceList),
|
||||||
selected: qty.rmdYn === 'Y',
|
selected: qty.rmdYn === 'Y',
|
||||||
}))
|
}))
|
||||||
@ -365,8 +333,8 @@ export default function StepUp(props) {
|
|||||||
const formatRoofSurfaceList = (roofSurfaceList = []) => {
|
const formatRoofSurfaceList = (roofSurfaceList = []) => {
|
||||||
return roofSurfaceList?.map((rsf) => ({
|
return roofSurfaceList?.map((rsf) => ({
|
||||||
moduleList: formatModuleList(rsf.moduleList),
|
moduleList: formatModuleList(rsf.moduleList),
|
||||||
roofSurface: rsf.roofSurface ?? '',
|
roofSurface: rsf.roofSurface ? rsf.roofSurface : '',
|
||||||
roofSurfaceId: rsf.roofSurfaceId ?? '',
|
roofSurfaceId: rsf.roofSurfaceId ? rsf.roofSurfaceId : '',
|
||||||
roofSurfaceIncl: rsf.roofSurfaceIncl ? +rsf.roofSurfaceIncl : '',
|
roofSurfaceIncl: rsf.roofSurfaceIncl ? +rsf.roofSurfaceIncl : '',
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
@ -376,10 +344,10 @@ export default function StepUp(props) {
|
|||||||
*/
|
*/
|
||||||
const formatModuleList = (moduleList = []) => {
|
const formatModuleList = (moduleList = []) => {
|
||||||
return moduleList?.map((module) => ({
|
return moduleList?.map((module) => ({
|
||||||
circuit: module.circuit ?? '',
|
circuit: module.circuit ? module.circuit : '',
|
||||||
itemId: module.itemId ?? '',
|
itemId: module.itemId ? module.itemId : '',
|
||||||
pcsItemId: module.pcsItemId ?? '',
|
pcsItemId: module.pcsItemId ? module.pcsItemId : '',
|
||||||
uniqueId: module.uniqueId ?? '',
|
uniqueId: module.uniqueId ? module.uniqueId : '',
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -448,9 +416,9 @@ export default function StepUp(props) {
|
|||||||
setStepUpListData(stepUpListData)
|
setStepUpListData(stepUpListData)
|
||||||
|
|
||||||
/** PCS 옵션 조회 */
|
/** PCS 옵션 조회 */
|
||||||
// const formattedOptCodes = formatOptionCodes(res.data.optionList)
|
const formattedOptCodes = formatOptionCodes(res.data.optionList)
|
||||||
// setOptCodes(formattedOptCodes)
|
setOptCodes(formattedOptCodes)
|
||||||
// setSeletedOption(formattedOptCodes[0])
|
setSeletedOption(formattedOptCodes[0])
|
||||||
} else {
|
} else {
|
||||||
swalFire({ text: getMessage('common.message.send.error') })
|
swalFire({ text: getMessage('common.message.send.error') })
|
||||||
}
|
}
|
||||||
@ -564,37 +532,7 @@ export default function StepUp(props) {
|
|||||||
<>
|
<>
|
||||||
<div className="properties-setting-wrap outer">
|
<div className="properties-setting-wrap outer">
|
||||||
<div className="circuit-title-sel">
|
<div className="circuit-title-sel">
|
||||||
<p className="circuit-title">{getMessage('modal.circuit.trestle.setting.step.up.allocation.select.monitor')}</p>
|
<div className="outline-form">
|
||||||
<div className="circuit-sel-wrap">
|
|
||||||
<div className="grid-select mr10">
|
|
||||||
{mainOptions.length > 0 && (
|
|
||||||
<QSelectBox
|
|
||||||
options={mainOptions}
|
|
||||||
value={seletedMainOption}
|
|
||||||
sourceKey="code"
|
|
||||||
targetKey="code"
|
|
||||||
showKey="name"
|
|
||||||
onChange={(e) => setSeletedMainOption(e)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
{isMultiOptions() && selectedModels.length === 2 && (
|
|
||||||
<div className="grid-select ">
|
|
||||||
{subOptions.length > 0 && (
|
|
||||||
<QSelectBox
|
|
||||||
options={subOptions}
|
|
||||||
value={seletedSubOption}
|
|
||||||
sourceKey="code"
|
|
||||||
targetKey="code"
|
|
||||||
showKey="name"
|
|
||||||
onChange={(e) => setSeletedSubOption(e)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* <div className="outline-form">
|
|
||||||
<span className="mr10" style={{ width: 'auto' }}>
|
<span className="mr10" style={{ width: 'auto' }}>
|
||||||
{getMessage('modal.circuit.trestle.setting.step.up.allocation.select.monitor')}
|
{getMessage('modal.circuit.trestle.setting.step.up.allocation.select.monitor')}
|
||||||
</span>
|
</span>
|
||||||
@ -613,7 +551,7 @@ export default function StepUp(props) {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div> */}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="slope-wrap">
|
<div className="slope-wrap">
|
||||||
|
|||||||
@ -46,10 +46,6 @@ 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,
|
||||||
|
|||||||
@ -1,71 +0,0 @@
|
|||||||
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>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -283,17 +283,17 @@ export default function StuffDetail() {
|
|||||||
autoHeight: true,
|
autoHeight: true,
|
||||||
cellStyle: { justifyContent: 'center' },
|
cellStyle: { justifyContent: 'center' },
|
||||||
cellRenderer: (params) => {
|
cellRenderer: (params) => {
|
||||||
let estimateDetailButtonStyle = ''
|
let buttonStyle = ''
|
||||||
let docDownButtonStyle = ''
|
let buttonStyle2 = ''
|
||||||
if (params.value == null) {
|
if (params.value == null) {
|
||||||
estimateDetailButtonStyle = 'none'
|
buttonStyle = 'none'
|
||||||
docDownButtonStyle = 'none'
|
buttonStyle2 = 'none'
|
||||||
} else {
|
} else {
|
||||||
if (params?.data?.createSaleStoreId === 'T01' && session?.storeId !== 'T01') {
|
if (params?.data?.createSaleStoreId === 'T01' && session?.storeId !== 'T01') {
|
||||||
estimateDetailButtonStyle = 'none'
|
buttonStyle = 'none'
|
||||||
}
|
}
|
||||||
if (params?.data?.tempFlg === '1' || !params?.data?.docNo) {
|
if (params?.data?.tempFlg === '1' || !params?.data?.docNo) {
|
||||||
docDownButtonStyle = 'none'
|
buttonStyle2 = 'none'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,7 +301,7 @@ export default function StuffDetail() {
|
|||||||
<>
|
<>
|
||||||
<div className="grid-cell-btn">
|
<div className="grid-cell-btn">
|
||||||
<button
|
<button
|
||||||
style={{ display: estimateDetailButtonStyle }}
|
style={{ display: buttonStyle }}
|
||||||
type="button"
|
type="button"
|
||||||
className="grid-btn"
|
className="grid-btn"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@ -315,7 +315,7 @@ export default function StuffDetail() {
|
|||||||
{getMessage('stuff.detail.planGrid.btn1')}
|
{getMessage('stuff.detail.planGrid.btn1')}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
style={{ display: docDownButtonStyle }}
|
style={{ display: buttonStyle2 }}
|
||||||
type="button"
|
type="button"
|
||||||
className="grid-btn"
|
className="grid-btn"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -640,13 +640,13 @@ export const useTrestle = () => {
|
|||||||
//surfaces.pcses들을 배열로 묶는다
|
//surfaces.pcses들을 배열로 묶는다
|
||||||
const pcses = surfaces[0].pcses.filter((pcs) => pcs !== null && pcs !== undefined)
|
const pcses = surfaces[0].pcses.filter((pcs) => pcs !== null && pcs !== undefined)
|
||||||
|
|
||||||
// surfaces.forEach((surface, index) => {
|
surfaces.forEach((surface, index) => {
|
||||||
// if (index !== 0) {
|
if (index !== 0) {
|
||||||
// if (surface.pcses) {
|
if (surface.pcses) {
|
||||||
// pcses.concat(surface.pcses)
|
pcses.concat(surface.pcses)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// })
|
})
|
||||||
|
|
||||||
const allModules = surfaces.map((surface) => surface.modules).flat()
|
const allModules = surfaces.map((surface) => surface.modules).flat()
|
||||||
// 모듈 파라미터 생성
|
// 모듈 파라미터 생성
|
||||||
|
|||||||
@ -64,10 +64,9 @@ 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)
|
||||||
|
|||||||
@ -1034,6 +1034,5 @@
|
|||||||
"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": "보補助線の作成を完了しますか?",
|
"want.to.complete.auxiliary.creation": "보補助線の作成を完了しますか?"
|
||||||
"module.layout.setup.has.zero.value": "モジュールの列、行を入力してください."
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1034,6 +1034,5 @@
|
|||||||
"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": "보조선 작성을 완료하시겠습니까?",
|
"want.to.complete.auxiliary.creation": "보조선 작성을 완료하시겠습니까?"
|
||||||
"module.layout.setup.has.zero.value": "모듈의 열, 행을 입력해 주세요."
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -389,16 +389,3 @@ export const isManualModuleLayoutSetupState = atom({
|
|||||||
key: 'isManualModuleLayoutSetupState',
|
key: 'isManualModuleLayoutSetupState',
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
export const moduleSetupOptionState = atom({
|
|
||||||
key: 'moduleSetupOptionState',
|
|
||||||
default: {
|
|
||||||
isChidori: false, //치조 안함
|
|
||||||
setupLocation: 'eaves', //처마
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
export const toggleManualSetupModeState = atom({
|
|
||||||
key: 'toggleManualSetupModeState',
|
|
||||||
default: '',
|
|
||||||
})
|
|
||||||
|
|||||||
@ -27,15 +27,3 @@ export const contextPopupPositionState = atom({
|
|||||||
},
|
},
|
||||||
dangerouslyAllowMutability: true,
|
dangerouslyAllowMutability: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
/** 팝업 스피너 상태 */
|
|
||||||
export const popSpinnerState = atom({
|
|
||||||
key: 'popSpinnerStore',
|
|
||||||
default: false,
|
|
||||||
})
|
|
||||||
|
|
||||||
/** 프로미스 팝업 상태 - 테스트용(삭제 예정) */
|
|
||||||
export const promisePopupState = atom({
|
|
||||||
key: 'promisePopupStore',
|
|
||||||
default: false,
|
|
||||||
})
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user