dev #435
@ -1,4 +1,4 @@
|
||||
import { POLYGON_TYPE, MODULE_SETUP_TYPE } from '@/common/common'
|
||||
import { MODULE_SETUP_TYPE, POLYGON_TYPE } from '@/common/common'
|
||||
import WithDraggable from '@/components/common/draggable/WithDraggable'
|
||||
import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientation'
|
||||
import PitchPlacement from '@/components/floor-plan/modal/basic/step/pitch/PitchPlacement'
|
||||
@ -74,6 +74,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
const { trigger: trestleTrigger } = useCanvasPopupStatusController(2)
|
||||
const { trigger: placementTrigger } = useCanvasPopupStatusController(3)
|
||||
const [roofsStore, setRoofsStore] = useRecoilState(roofsState)
|
||||
const [isFold, setIsFold] = useState(false)
|
||||
|
||||
// const { initEvent } = useContext(EventContext)
|
||||
const { manualModuleSetup, autoModuleSetup, manualFlatroofModuleSetup, autoFlatroofModuleSetup, manualModuleLayoutSetup, restoreModuleInstArea } =
|
||||
@ -282,35 +283,42 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
|
||||
return (
|
||||
<WithDraggable isShow={true} pos={pos} className={basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' ? 'll' : 'lx-2'}>
|
||||
<WithDraggable.Header title={getMessage('plan.menu.module.circuit.setting.default')} onClose={() => handleClosePopup(id)} />
|
||||
<WithDraggable.Header
|
||||
title={getMessage('plan.menu.module.circuit.setting.default')}
|
||||
isFold={isFold}
|
||||
onClose={() => handleClosePopup(id)}
|
||||
onFold={() => setIsFold(!isFold)}
|
||||
/>
|
||||
<WithDraggable.Body>
|
||||
<div className="roof-module-tab">
|
||||
<div className={`module-tab-bx act`}>{getMessage('modal.module.basic.setting.orientation.setting')}</div>
|
||||
<span className={`tab-arr ${tabNum !== 1 ? 'act' : ''}`}></span>
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && (
|
||||
<>
|
||||
<div className={`module-tab-bx ${tabNum !== 1 ? 'act' : ''}`}>{getMessage('modal.module.basic.setting.module.setting')}</div>
|
||||
<span className={`tab-arr ${tabNum === 3 ? 'act' : ''}`}></span>
|
||||
<div className={`module-tab-bx ${tabNum === 3 ? 'act' : ''}`}>{getMessage('modal.module.basic.setting.module.placement')}</div>
|
||||
</>
|
||||
<div style={{ display: isFold ? 'none' : 'block' }}>
|
||||
<div className="roof-module-tab">
|
||||
<div className={`module-tab-bx act`}>{getMessage('modal.module.basic.setting.orientation.setting')}</div>
|
||||
<span className={`tab-arr ${tabNum !== 1 ? 'act' : ''}`}></span>
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && (
|
||||
<>
|
||||
<div className={`module-tab-bx ${tabNum !== 1 ? 'act' : ''}`}>{getMessage('modal.module.basic.setting.module.setting')}</div>
|
||||
<span className={`tab-arr ${tabNum === 3 ? 'act' : ''}`}></span>
|
||||
<div className={`module-tab-bx ${tabNum === 3 ? 'act' : ''}`}>{getMessage('modal.module.basic.setting.module.placement')}</div>
|
||||
</>
|
||||
)}
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet == '3' && (
|
||||
<>
|
||||
<div className={`module-tab-bx ${tabNum === 2 ? 'act' : ''}`}>{getMessage('modal.module.basic.setting.module.placement')}</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
{tabNum === 1 && <Orientation ref={orientationRef} {...orientationProps} />}
|
||||
{/*배치면 초기설정 - 입력방법: 복시도 입력 || 실측값 입력*/}
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && tabNum === 2 && <Trestle ref={trestleRef} {...trestleProps} />}
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && tabNum === 3 && (
|
||||
<Placement setTabNum={setTabNum} layoutSetup={layoutSetup} setLayoutSetup={setLayoutSetup} />
|
||||
)}
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet == '3' && (
|
||||
<>
|
||||
<div className={`module-tab-bx ${tabNum === 2 ? 'act' : ''}`}>{getMessage('modal.module.basic.setting.module.placement')}</div>
|
||||
</>
|
||||
{/*배치면 초기설정 - 입력방법: 육지붕*/}
|
||||
{/* {basicSetting.roofSizeSet && basicSetting.roofSizeSet == '3' && tabNum === 3 && <PitchModule setTabNum={setTabNum} />} */}
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet == '3' && tabNum === 2 && (
|
||||
<PitchPlacement setTabNum={setTabNum} ref={placementFlatRef} />
|
||||
)}
|
||||
</div>
|
||||
{tabNum === 1 && <Orientation ref={orientationRef} {...orientationProps} />}
|
||||
{/*배치면 초기설정 - 입력방법: 복시도 입력 || 실측값 입력*/}
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && tabNum === 2 && <Trestle ref={trestleRef} {...trestleProps} />}
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && tabNum === 3 && (
|
||||
<Placement setTabNum={setTabNum} layoutSetup={layoutSetup} setLayoutSetup={setLayoutSetup} />
|
||||
)}
|
||||
{/*배치면 초기설정 - 입력방법: 육지붕*/}
|
||||
{/* {basicSetting.roofSizeSet && basicSetting.roofSizeSet == '3' && tabNum === 3 && <PitchModule setTabNum={setTabNum} />} */}
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet == '3' && tabNum === 2 && (
|
||||
<PitchPlacement setTabNum={setTabNum} ref={placementFlatRef} />
|
||||
)}
|
||||
|
||||
<div className="grid-btn-wrap">
|
||||
{/* {tabNum === 1 && <button className="btn-frame modal mr5">{getMessage('modal.common.save')}</button>} */}
|
||||
|
||||
@ -20,8 +20,8 @@ import { useEstimate } from '@/hooks/useEstimate'
|
||||
import { useCircuitTrestle } from '@/hooks/useCirCuitTrestle'
|
||||
import { useImgLoader } from '@/hooks/floorPlan/useImgLoader'
|
||||
import { QcastContext } from '@/app/QcastProvider'
|
||||
import { fabric } from 'fabric'
|
||||
import { fontSelector } from '@/store/fontAtom'
|
||||
import { fabric } from 'fabric'
|
||||
|
||||
const ALLOCATION_TYPE = {
|
||||
AUTO: 'auto',
|
||||
@ -59,6 +59,9 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
const passivityCircuitAllocationRef = useRef()
|
||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||
|
||||
const originCanvasViewPortTransform = useRef([])
|
||||
const [isFold, setIsFold] = useState(false)
|
||||
|
||||
const {
|
||||
makers,
|
||||
setMakers,
|
||||
@ -83,6 +86,7 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
} = useCircuitTrestle()
|
||||
// const { trigger: moduleSelectedDataTrigger } = useCanvasPopupStatusController(2)
|
||||
useEffect(() => {
|
||||
originCanvasViewPortTransform.current = [...canvas.viewportTransform]
|
||||
if (!managementState) {
|
||||
}
|
||||
// setCircuitData({
|
||||
@ -171,15 +175,12 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
})
|
||||
}
|
||||
|
||||
canvas.renderAll()
|
||||
|
||||
// roof polygon들의 중간점 계산
|
||||
const roofPolygons = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
||||
let x, y
|
||||
x = canvas.width / 2
|
||||
y = canvas.height / 2
|
||||
|
||||
|
||||
canvas.zoomToPoint(new fabric.Point(x, y), 0.4)
|
||||
|
||||
changeFontSize('lengthText', '28')
|
||||
changeFontSize('circuitNumber', '28')
|
||||
changeFontSize('flowText', '28')
|
||||
@ -188,9 +189,12 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
|
||||
// 캡쳐 후 처리
|
||||
const afterCapture = (type) => {
|
||||
setCanvasZoom(100)
|
||||
canvas.set({ zoom: 1 })
|
||||
canvas.viewportTransform = [1, 0, 0, 1, 0, 0]
|
||||
if (originCanvasViewPortTransform.current[0] !== 1) {
|
||||
setCanvasZoom(Number((originCanvasViewPortTransform.current[0] * 100).toFixed(0)))
|
||||
}
|
||||
canvas.viewportTransform = [...originCanvasViewPortTransform.current]
|
||||
canvas.renderAll()
|
||||
|
||||
changeFontSize('lengthText', lengthText.fontSize.value)
|
||||
changeFontSize('circuitNumber', circuitNumberText.fontSize.value)
|
||||
changeFontSize('flowText', flowText.fontSize.value)
|
||||
@ -788,20 +792,28 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
|
||||
return (
|
||||
<WithDraggable isShow={true} pos={{ x: 50, y: 230 }} className="l-2">
|
||||
<WithDraggable.Header title={getMessage('modal.circuit.trestle.setting')} onClose={() => handleClose()} />
|
||||
<WithDraggable.Header
|
||||
title={getMessage('modal.circuit.trestle.setting')}
|
||||
onClose={() => handleClose()}
|
||||
isFold={isFold}
|
||||
onFold={() => setIsFold(!isFold)}
|
||||
/>
|
||||
<WithDraggable.Body>
|
||||
<div className="roof-module-tab">
|
||||
<div className={`module-tab-bx act`}>{getMessage('modal.circuit.trestle.setting.power.conditional.select')}</div>
|
||||
<span className={`tab-arr ${tabNum === 2 ? 'act' : ''}`}></span>
|
||||
<div className={`module-tab-bx ${tabNum === 2 ? 'act' : ''}`}>
|
||||
{getMessage('modal.circuit.trestle.setting.circuit.allocation')}({getMessage('modal.circuit.trestle.setting.step.up.allocation')})
|
||||
<div style={{ display: isFold ? 'none' : 'block' }}>
|
||||
<div className="roof-module-tab">
|
||||
<div className={`module-tab-bx act`}>{getMessage('modal.circuit.trestle.setting.power.conditional.select')}</div>
|
||||
<span className={`tab-arr ${tabNum === 2 ? 'act' : ''}`}></span>
|
||||
<div className={`module-tab-bx ${tabNum === 2 ? 'act' : ''}`}>
|
||||
{getMessage('modal.circuit.trestle.setting.circuit.allocation')}({getMessage('modal.circuit.trestle.setting.step.up.allocation')})
|
||||
</div>
|
||||
</div>
|
||||
{tabNum === 1 && allocationType === ALLOCATION_TYPE.AUTO && <PowerConditionalSelect {...powerConditionalSelectProps} />}
|
||||
{tabNum === 1 && allocationType === ALLOCATION_TYPE.PASSIVITY && (
|
||||
<PassivityCircuitAllocation {...passivityProps} ref={passivityCircuitAllocationRef} />
|
||||
)}
|
||||
{tabNum === 2 && <StepUp {...stepUpProps} onInitialize={handleStepUpInitialize} />}
|
||||
</div>
|
||||
{tabNum === 1 && allocationType === ALLOCATION_TYPE.AUTO && <PowerConditionalSelect {...powerConditionalSelectProps} />}
|
||||
{tabNum === 1 && allocationType === ALLOCATION_TYPE.PASSIVITY && (
|
||||
<PassivityCircuitAllocation {...passivityProps} ref={passivityCircuitAllocationRef} />
|
||||
)}
|
||||
{tabNum === 2 && <StepUp {...stepUpProps} onInitialize={handleStepUpInitialize} />}
|
||||
|
||||
{tabNum === 1 && allocationType === ALLOCATION_TYPE.AUTO && (
|
||||
<div className="grid-btn-wrap">
|
||||
<button className="btn-frame modal mr5 act" onClick={() => onAutoRecommend()}>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user