Merge pull request 'dev' (#435) from dev into prd-deploy
Reviewed-on: #435
This commit is contained in:
commit
dcb9e06a09
@ -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 WithDraggable from '@/components/common/draggable/WithDraggable'
|
||||||
import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientation'
|
import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientation'
|
||||||
import PitchPlacement from '@/components/floor-plan/modal/basic/step/pitch/PitchPlacement'
|
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: trestleTrigger } = useCanvasPopupStatusController(2)
|
||||||
const { trigger: placementTrigger } = useCanvasPopupStatusController(3)
|
const { trigger: placementTrigger } = useCanvasPopupStatusController(3)
|
||||||
const [roofsStore, setRoofsStore] = useRecoilState(roofsState)
|
const [roofsStore, setRoofsStore] = useRecoilState(roofsState)
|
||||||
|
const [isFold, setIsFold] = useState(false)
|
||||||
|
|
||||||
// const { initEvent } = useContext(EventContext)
|
// const { initEvent } = useContext(EventContext)
|
||||||
const { manualModuleSetup, autoModuleSetup, manualFlatroofModuleSetup, autoFlatroofModuleSetup, manualModuleLayoutSetup, restoreModuleInstArea } =
|
const { manualModuleSetup, autoModuleSetup, manualFlatroofModuleSetup, autoFlatroofModuleSetup, manualModuleLayoutSetup, restoreModuleInstArea } =
|
||||||
@ -282,35 +283,42 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={pos} className={basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' ? 'll' : 'lx-2'}>
|
<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>
|
<WithDraggable.Body>
|
||||||
<div className="roof-module-tab">
|
<div style={{ display: isFold ? 'none' : 'block' }}>
|
||||||
<div className={`module-tab-bx act`}>{getMessage('modal.module.basic.setting.orientation.setting')}</div>
|
<div className="roof-module-tab">
|
||||||
<span className={`tab-arr ${tabNum !== 1 ? 'act' : ''}`}></span>
|
<div className={`module-tab-bx act`}>{getMessage('modal.module.basic.setting.orientation.setting')}</div>
|
||||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && (
|
<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 !== 1 ? 'act' : ''}`}>{getMessage('modal.module.basic.setting.module.setting')}</div>
|
||||||
<div className={`module-tab-bx ${tabNum === 3 ? 'act' : ''}`}>{getMessage('modal.module.basic.setting.module.placement')}</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' && (
|
{/*배치면 초기설정 - 입력방법: 육지붕*/}
|
||||||
<>
|
{/* {basicSetting.roofSizeSet && basicSetting.roofSizeSet == '3' && tabNum === 3 && <PitchModule setTabNum={setTabNum} />} */}
|
||||||
<div className={`module-tab-bx ${tabNum === 2 ? 'act' : ''}`}>{getMessage('modal.module.basic.setting.module.placement')}</div>
|
{basicSetting.roofSizeSet && basicSetting.roofSizeSet == '3' && tabNum === 2 && (
|
||||||
</>
|
<PitchPlacement setTabNum={setTabNum} ref={placementFlatRef} />
|
||||||
)}
|
)}
|
||||||
</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' && tabNum === 3 && <PitchModule setTabNum={setTabNum} />} */}
|
|
||||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet == '3' && tabNum === 2 && (
|
|
||||||
<PitchPlacement setTabNum={setTabNum} ref={placementFlatRef} />
|
|
||||||
)}
|
|
||||||
|
|
||||||
<div className="grid-btn-wrap">
|
<div className="grid-btn-wrap">
|
||||||
{/* {tabNum === 1 && <button className="btn-frame modal mr5">{getMessage('modal.common.save')}</button>} */}
|
{/* {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 { useCircuitTrestle } from '@/hooks/useCirCuitTrestle'
|
||||||
import { useImgLoader } from '@/hooks/floorPlan/useImgLoader'
|
import { useImgLoader } from '@/hooks/floorPlan/useImgLoader'
|
||||||
import { QcastContext } from '@/app/QcastProvider'
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
import { fabric } from 'fabric'
|
|
||||||
import { fontSelector } from '@/store/fontAtom'
|
import { fontSelector } from '@/store/fontAtom'
|
||||||
|
import { fabric } from 'fabric'
|
||||||
|
|
||||||
const ALLOCATION_TYPE = {
|
const ALLOCATION_TYPE = {
|
||||||
AUTO: 'auto',
|
AUTO: 'auto',
|
||||||
@ -59,6 +59,9 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
const passivityCircuitAllocationRef = useRef()
|
const passivityCircuitAllocationRef = useRef()
|
||||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||||
|
|
||||||
|
const originCanvasViewPortTransform = useRef([])
|
||||||
|
const [isFold, setIsFold] = useState(false)
|
||||||
|
|
||||||
const {
|
const {
|
||||||
makers,
|
makers,
|
||||||
setMakers,
|
setMakers,
|
||||||
@ -83,6 +86,7 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
} = useCircuitTrestle()
|
} = useCircuitTrestle()
|
||||||
// const { trigger: moduleSelectedDataTrigger } = useCanvasPopupStatusController(2)
|
// const { trigger: moduleSelectedDataTrigger } = useCanvasPopupStatusController(2)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
originCanvasViewPortTransform.current = [...canvas.viewportTransform]
|
||||||
if (!managementState) {
|
if (!managementState) {
|
||||||
}
|
}
|
||||||
// setCircuitData({
|
// 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
|
let x, y
|
||||||
x = canvas.width / 2
|
x = canvas.width / 2
|
||||||
y = canvas.height / 2
|
y = canvas.height / 2
|
||||||
|
|
||||||
canvas.zoomToPoint(new fabric.Point(x, y), 0.4)
|
canvas.zoomToPoint(new fabric.Point(x, y), 0.4)
|
||||||
|
|
||||||
changeFontSize('lengthText', '28')
|
changeFontSize('lengthText', '28')
|
||||||
changeFontSize('circuitNumber', '28')
|
changeFontSize('circuitNumber', '28')
|
||||||
changeFontSize('flowText', '28')
|
changeFontSize('flowText', '28')
|
||||||
@ -188,9 +189,12 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
|
|
||||||
// 캡쳐 후 처리
|
// 캡쳐 후 처리
|
||||||
const afterCapture = (type) => {
|
const afterCapture = (type) => {
|
||||||
setCanvasZoom(100)
|
if (originCanvasViewPortTransform.current[0] !== 1) {
|
||||||
canvas.set({ zoom: 1 })
|
setCanvasZoom(Number((originCanvasViewPortTransform.current[0] * 100).toFixed(0)))
|
||||||
canvas.viewportTransform = [1, 0, 0, 1, 0, 0]
|
}
|
||||||
|
canvas.viewportTransform = [...originCanvasViewPortTransform.current]
|
||||||
|
canvas.renderAll()
|
||||||
|
|
||||||
changeFontSize('lengthText', lengthText.fontSize.value)
|
changeFontSize('lengthText', lengthText.fontSize.value)
|
||||||
changeFontSize('circuitNumber', circuitNumberText.fontSize.value)
|
changeFontSize('circuitNumber', circuitNumberText.fontSize.value)
|
||||||
changeFontSize('flowText', flowText.fontSize.value)
|
changeFontSize('flowText', flowText.fontSize.value)
|
||||||
@ -788,20 +792,28 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={{ x: 50, y: 230 }} className="l-2">
|
<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>
|
<WithDraggable.Body>
|
||||||
<div className="roof-module-tab">
|
<div style={{ display: isFold ? 'none' : 'block' }}>
|
||||||
<div className={`module-tab-bx act`}>{getMessage('modal.circuit.trestle.setting.power.conditional.select')}</div>
|
<div className="roof-module-tab">
|
||||||
<span className={`tab-arr ${tabNum === 2 ? 'act' : ''}`}></span>
|
<div className={`module-tab-bx act`}>{getMessage('modal.circuit.trestle.setting.power.conditional.select')}</div>
|
||||||
<div className={`module-tab-bx ${tabNum === 2 ? 'act' : ''}`}>
|
<span className={`tab-arr ${tabNum === 2 ? 'act' : ''}`}></span>
|
||||||
{getMessage('modal.circuit.trestle.setting.circuit.allocation')}({getMessage('modal.circuit.trestle.setting.step.up.allocation')})
|
<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>
|
</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>
|
</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 && (
|
{tabNum === 1 && allocationType === ALLOCATION_TYPE.AUTO && (
|
||||||
<div className="grid-btn-wrap">
|
<div className="grid-btn-wrap">
|
||||||
<button className="btn-frame modal mr5 act" onClick={() => onAutoRecommend()}>
|
<button className="btn-frame modal mr5 act" onClick={() => onAutoRecommend()}>
|
||||||
|
|||||||
@ -219,7 +219,6 @@ export default function ContextRoofAllocationSetting(props) {
|
|||||||
name=""
|
name=""
|
||||||
label=""
|
label=""
|
||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
ref={pitchRef}
|
|
||||||
value={currentAngleType === 'slope' ? (roof.pitch ?? '') : (roof.angle ?? '')}
|
value={currentAngleType === 'slope' ? (roof.pitch ?? '') : (roof.angle ?? '')}
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
handleChangePitch(value, index)
|
handleChangePitch(value, index)
|
||||||
|
|||||||
@ -220,7 +220,6 @@ export default function RoofAllocationSetting(props) {
|
|||||||
name=""
|
name=""
|
||||||
label=""
|
label=""
|
||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
ref={pitchRef}
|
|
||||||
value={currentAngleType === 'slope' ? (roof.pitch ?? '') : (roof.angle ?? '')}
|
value={currentAngleType === 'slope' ? (roof.pitch ?? '') : (roof.angle ?? '')}
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
handleChangePitch(value, index)
|
handleChangePitch(value, index)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user