Merge branch 'feature/yj-layoutSetup' of https://git.hanasys.jp/qcast3/qcast-front into feature/module-grouping
# Conflicts: # src/locales/ja.json
This commit is contained in:
commit
e7b50ca642
@ -39,7 +39,7 @@ export default function QSelectBox({
|
||||
if (showKey !== '' && !value) {
|
||||
//value가 없으면 showKey가 있으면 우선 보여준다
|
||||
// return options[0][showKey]
|
||||
return title
|
||||
return title !== '' ? title : getMessage('selectbox.title')
|
||||
} else if (showKey !== '' && value) {
|
||||
//value가 있으면 sourceKey와 targetKey를 비교하여 보여준다
|
||||
|
||||
|
||||
@ -1,12 +1,17 @@
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import WithDraggable from '@/components/common/draggable/WithDraggable'
|
||||
import { useContext, useEffect, useRef, useState } from 'react'
|
||||
import Module from '@/components/floor-plan/modal/basic/step/Module'
|
||||
import PitchModule from '@/components/floor-plan/modal/basic/step/pitch/PitchModule'
|
||||
import PitchPlacement from '@/components/floor-plan/modal/basic/step/pitch/PitchPlacement'
|
||||
import Placement from '@/components/floor-plan/modal/basic/step/Placement'
|
||||
import { useRecoilValue, useRecoilState } from 'recoil'
|
||||
import { canvasSettingState, canvasState, checkedModuleState, isManualModuleSetupState } from '@/store/canvasAtom'
|
||||
import {
|
||||
canvasSettingState,
|
||||
canvasState,
|
||||
checkedModuleState,
|
||||
isManualModuleLayoutSetupState,
|
||||
isManualModuleSetupState,
|
||||
toggleManualSetupModeState,
|
||||
} from '@/store/canvasAtom'
|
||||
import { usePopup } from '@/hooks/usePopup'
|
||||
import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientation'
|
||||
import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting'
|
||||
@ -20,31 +25,133 @@ import { useMasterController } from '@/hooks/common/useMasterController'
|
||||
import { loginUserStore } from '@/store/commonAtom'
|
||||
import { currentCanvasPlanState } from '@/store/canvasAtom'
|
||||
import { POLYGON_TYPE } from '@/common/common'
|
||||
import { useModuleSelection } from '@/hooks/module/useModuleSelection'
|
||||
import { useOrientation } from '@/hooks/module/useOrientation'
|
||||
import Trestle from './step/Trestle'
|
||||
import { roofsState } from '@/store/roofAtom'
|
||||
|
||||
export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
const { getMessage } = useMessage()
|
||||
const { closePopup } = usePopup()
|
||||
const [tabNum, setTabNum] = useState(1)
|
||||
const canvasSetting = useRecoilValue(canvasSettingState)
|
||||
const orientationRef = useRef(null)
|
||||
const { initEvent } = useEvent()
|
||||
const [isManualModuleSetup, setIsManualModuleSetup] = useRecoilState(isManualModuleSetupState)
|
||||
const moduleSelectionData = useRecoilValue(moduleSelectionDataState)
|
||||
const addedRoofs = useRecoilValue(addedRoofsState)
|
||||
const [isManualModuleLayoutSetup, setIsManualModuleLayoutSetup] = useRecoilState(isManualModuleLayoutSetupState)
|
||||
const trestleRef = useRef(null)
|
||||
const [moduleSelectionData, setModuleSelectionData] = useRecoilState(moduleSelectionDataState)
|
||||
const [addedRoofs, setAddedRoofs] = useRecoilState(addedRoofsState)
|
||||
const loginUserState = useRecoilValue(loginUserStore)
|
||||
const currentCanvasPlan = useRecoilValue(currentCanvasPlanState)
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const [basicSetting, setBasicSettings] = useRecoilState(basicSettingState)
|
||||
const [isClosePopup, setIsClosePopup] = useState({ close: false, id: 0 })
|
||||
const [checkedModules, setCheckedModules] = useRecoilState(checkedModuleState)
|
||||
const [roofs, setRoofs] = useState(addedRoofs)
|
||||
const [manualSetupMode, setManualSetupMode] = useRecoilState(toggleManualSetupModeState)
|
||||
const [layoutSetup, setLayoutSetup] = useState([{}])
|
||||
|
||||
const {
|
||||
moduleSelectionInitParams,
|
||||
selectedModules,
|
||||
roughnessCodes,
|
||||
windSpeedCodes,
|
||||
managementState,
|
||||
setManagementState,
|
||||
moduleList,
|
||||
setSelectedModules,
|
||||
selectedSurfaceType,
|
||||
setSelectedSurfaceType,
|
||||
installHeight,
|
||||
setInstallHeight,
|
||||
standardWindSpeed,
|
||||
setStandardWindSpeed,
|
||||
verticalSnowCover,
|
||||
setVerticalSnowCover,
|
||||
handleChangeModule,
|
||||
handleChangeSurfaceType,
|
||||
handleChangeWindSpeed,
|
||||
handleChangeInstallHeight,
|
||||
handleChangeVerticalSnowCover,
|
||||
} = useModuleSelection({ addedRoofs })
|
||||
const { nextStep, compasDeg, setCompasDeg } = useOrientation()
|
||||
const { trigger: orientationTrigger } = useCanvasPopupStatusController(1)
|
||||
const { trigger: trestleTrigger } = useCanvasPopupStatusController(2)
|
||||
const { trigger: placementTrigger } = useCanvasPopupStatusController(3)
|
||||
const roofsStore = useRecoilValue(roofsState)
|
||||
|
||||
// const { initEvent } = useContext(EventContext)
|
||||
const { manualModuleSetup, autoModuleSetup, manualFlatroofModuleSetup, autoFlatroofModuleSetup } = useModuleBasicSetting(tabNum)
|
||||
const { manualModuleSetup, autoModuleSetup, manualFlatroofModuleSetup, autoFlatroofModuleSetup, manualModuleLayoutSetup } =
|
||||
useModuleBasicSetting(tabNum)
|
||||
const { updateObjectDate } = useMasterController()
|
||||
|
||||
useEffect(() => {
|
||||
if (managementState) console.log('managementState', managementState)
|
||||
}, [managementState])
|
||||
|
||||
useEffect(() => {
|
||||
if (roofsStore && addedRoofs) {
|
||||
console.log('🚀 ~ useEffect ~ roofsStore, addedRoofs:', roofsStore, addedRoofs)
|
||||
setRoofs(
|
||||
addedRoofs.map((roof, index) => {
|
||||
return {
|
||||
...roof,
|
||||
...roofsStore[index]?.addRoof,
|
||||
}
|
||||
}),
|
||||
)
|
||||
|
||||
setModuleSelectionData({
|
||||
...moduleSelectionData,
|
||||
roofConstructions: roofsStore.map((roof) => {
|
||||
return {
|
||||
addRoof: {
|
||||
...roof.addRoof,
|
||||
},
|
||||
construction: {
|
||||
...roof.construction,
|
||||
},
|
||||
trestle: {
|
||||
...roof.trestle,
|
||||
},
|
||||
}
|
||||
}),
|
||||
})
|
||||
}
|
||||
}, [roofsStore, addedRoofs])
|
||||
|
||||
useEffect(() => {
|
||||
let hasModules = canvas
|
||||
.getObjects()
|
||||
.filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||
.some((obj) => obj.modules?.length > 0)
|
||||
|
||||
if (hasModules) {
|
||||
orientationRef.current.handleNextStep()
|
||||
setTabNum(3)
|
||||
}
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
if (basicSetting.roofSizeSet !== '3') {
|
||||
manualModuleSetup()
|
||||
} else {
|
||||
manualFlatroofModuleSetup(placementFlatRef)
|
||||
}
|
||||
if (isClosePopup.close) {
|
||||
closePopup(isClosePopup.id)
|
||||
}
|
||||
}, [isManualModuleSetup, isClosePopup])
|
||||
|
||||
useEffect(() => {
|
||||
setIsManualModuleSetup(false)
|
||||
}, [checkedModules])
|
||||
|
||||
const handleBtnNextStep = () => {
|
||||
if (tabNum === 1) {
|
||||
console.log('moduleSelectionData', moduleSelectionData)
|
||||
orientationRef.current.handleNextStep()
|
||||
setAddedRoofs(roofs)
|
||||
return
|
||||
} else if (tabNum === 2) {
|
||||
if (basicSetting.roofSizeSet !== '3') {
|
||||
if (!isObjectNotEmpty(moduleSelectionData.module)) {
|
||||
@ -55,7 +162,15 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
return
|
||||
}
|
||||
|
||||
if (addedRoofs.length !== moduleSelectionData.roofConstructions.length) {
|
||||
// if (addedRoofs.length !== moduleSelectionData.roofConstructions.length) {
|
||||
// Swal.fire({
|
||||
// title: getMessage('construction.length.difference'),
|
||||
// icon: 'warning',
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
if (!trestleRef.current.isComplete()) {
|
||||
Swal.fire({
|
||||
title: getMessage('construction.length.difference'),
|
||||
icon: 'warning',
|
||||
@ -63,14 +178,6 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
return
|
||||
}
|
||||
//물건정보 갱신일 수정
|
||||
updateObjectDataApi({
|
||||
objectNo: currentCanvasPlan.objectNo, //오브젝트_no
|
||||
standardWindSpeedId: moduleSelectionData.common.stdWindSpeed, //기준풍속코드
|
||||
verticalSnowCover: moduleSelectionData.common.stdSnowLd, //적설량
|
||||
surfaceType: moduleSelectionData.common.illuminationTpNm, //면조도구분
|
||||
installHeight: moduleSelectionData.common.instHt, //설치높이
|
||||
userId: loginUserState.userId, //작성자아아디
|
||||
})
|
||||
} else {
|
||||
if (!isObjectNotEmpty(moduleSelectionData.module)) {
|
||||
Swal.fire({
|
||||
@ -85,84 +192,149 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
setTabNum(tabNum + 1)
|
||||
}
|
||||
|
||||
const placementRef = {
|
||||
isChidori: useRef('false'),
|
||||
setupLocation: useRef('eaves'),
|
||||
isMaxSetup: useRef('false'),
|
||||
}
|
||||
|
||||
const placementFlatRef = {
|
||||
setupLocation: useRef('south'),
|
||||
}
|
||||
|
||||
const handleManualModuleSetup = () => {
|
||||
setManualSetupMode(`manualSetup_${!isManualModuleSetup}`)
|
||||
setIsManualModuleSetup(!isManualModuleSetup)
|
||||
}
|
||||
|
||||
const handleManualModuleLayoutSetup = () => {
|
||||
setManualSetupMode(`manualLayoutSetup_${!isManualModuleLayoutSetup}`)
|
||||
setIsManualModuleLayoutSetup(!isManualModuleLayoutSetup)
|
||||
}
|
||||
|
||||
const updateObjectDataApi = async (params) => {
|
||||
const res = await updateObjectDate(params)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
let hasModules = canvas
|
||||
.getObjects()
|
||||
.filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||
.some((obj) => obj.modules?.length > 0)
|
||||
|
||||
if (hasModules) {
|
||||
orientationRef.current.handleNextStep()
|
||||
setTabNum(3)
|
||||
}
|
||||
}, [])
|
||||
|
||||
//팝업 닫기 버튼 이벤트
|
||||
const handleClosePopup = (id) => {
|
||||
if (tabNum == 3) {
|
||||
if (isManualModuleSetup) {
|
||||
setIsManualModuleSetup(false)
|
||||
}
|
||||
if (isManualModuleLayoutSetup) {
|
||||
setIsManualModuleLayoutSetup(false)
|
||||
}
|
||||
}
|
||||
setIsClosePopup({ close: true, id: id })
|
||||
}
|
||||
|
||||
const orientationProps = {
|
||||
roofs,
|
||||
setRoofs,
|
||||
tabNum,
|
||||
setTabNum,
|
||||
compasDeg, // 방위각
|
||||
setCompasDeg,
|
||||
moduleSelectionInitParams,
|
||||
selectedModules,
|
||||
moduleSelectionData,
|
||||
setModuleSelectionData,
|
||||
roughnessCodes, // 면조도 목록
|
||||
windSpeedCodes, // 기준풍속 목록
|
||||
managementState,
|
||||
setManagementState,
|
||||
moduleList, // 모듈 리스트
|
||||
setSelectedModules,
|
||||
selectedSurfaceType,
|
||||
setSelectedSurfaceType,
|
||||
installHeight, // 설치높이
|
||||
setInstallHeight,
|
||||
standardWindSpeed, // 기준풍속
|
||||
setStandardWindSpeed,
|
||||
verticalSnowCover, // 적설량
|
||||
setVerticalSnowCover,
|
||||
currentCanvasPlan,
|
||||
loginUserState,
|
||||
handleChangeModule,
|
||||
handleChangeSurfaceType,
|
||||
handleChangeWindSpeed,
|
||||
handleChangeInstallHeight,
|
||||
handleChangeVerticalSnowCover,
|
||||
orientationTrigger,
|
||||
nextStep,
|
||||
updateObjectDataApi,
|
||||
}
|
||||
const trestleProps = {
|
||||
roofs,
|
||||
setRoofs,
|
||||
setTabNum,
|
||||
moduleSelectionData,
|
||||
setModuleSelectionData,
|
||||
trestleTrigger,
|
||||
}
|
||||
const placementProps = {}
|
||||
|
||||
useEffect(() => {
|
||||
if (basicSetting.roofSizeSet !== '3') {
|
||||
manualModuleSetup(placementRef)
|
||||
if (manualSetupMode.indexOf('manualSetup') > -1) {
|
||||
manualModuleSetup()
|
||||
} else if (manualSetupMode.indexOf('manualLayoutSetup') > -1) {
|
||||
manualModuleLayoutSetup(layoutSetup)
|
||||
} else if (manualSetupMode.indexOf('off') > -1) {
|
||||
manualModuleSetup()
|
||||
manualModuleLayoutSetup(layoutSetup)
|
||||
}
|
||||
} else {
|
||||
manualFlatroofModuleSetup(placementFlatRef)
|
||||
}
|
||||
|
||||
if (isClosePopup.close) {
|
||||
closePopup(isClosePopup.id)
|
||||
}
|
||||
}, [isManualModuleSetup, isClosePopup])
|
||||
}, [manualSetupMode, isClosePopup])
|
||||
|
||||
useEffect(() => {
|
||||
if (isManualModuleLayoutSetup) {
|
||||
manualModuleLayoutSetup(layoutSetup)
|
||||
}
|
||||
}, [layoutSetup])
|
||||
|
||||
useEffect(() => {
|
||||
setIsManualModuleSetup(false)
|
||||
setIsManualModuleLayoutSetup(false)
|
||||
setManualSetupMode(`off`)
|
||||
}, [checkedModules])
|
||||
|
||||
return (
|
||||
<WithDraggable isShow={true} pos={pos} className="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.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>
|
||||
<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 !== 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} tabNum={tabNum} setTabNum={setTabNum} />}
|
||||
{tabNum === 1 && <Orientation ref={orientationRef} {...orientationProps} />}
|
||||
{/*배치면 초기설정 - 입력방법: 복시도 입력 || 실측값 입력*/}
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && tabNum === 2 && <Module setTabNum={setTabNum} />}
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && tabNum === 3 && <Placement setTabNum={setTabNum} ref={placementRef} />}
|
||||
|
||||
{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 === 2 && <PitchModule setTabNum={setTabNum} />}
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet == '3' && tabNum === 3 && (
|
||||
{/* {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>} */}
|
||||
|
||||
{tabNum !== 1 && (
|
||||
<button className="btn-frame modal mr5" onClick={() => setTabNum(tabNum - 1)}>
|
||||
{getMessage('modal.module.basic.setting.prev')}
|
||||
@ -179,16 +351,20 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
<>
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && (
|
||||
<>
|
||||
<button className={`btn-frame modal mr5 ${isManualModuleLayoutSetup ? 'act' : ''}`} onClick={handleManualModuleLayoutSetup}>
|
||||
{getMessage('modal.module.basic.setting.row.batch')}
|
||||
</button>
|
||||
<button className={`btn-frame modal mr5 ${isManualModuleSetup ? 'act' : ''}`} onClick={handleManualModuleSetup}>
|
||||
{getMessage('modal.module.basic.setting.passivity.placement')}
|
||||
</button>
|
||||
<button className="btn-frame modal act" onClick={() => autoModuleSetup(placementRef)}>
|
||||
<button className="btn-frame modal act" onClick={() => autoModuleSetup()}>
|
||||
{getMessage('modal.module.basic.setting.auto.placement')}
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet == '3' && (
|
||||
<>
|
||||
<button className="btn-frame modal mr5">{getMessage('modal.module.basic.setting.row.batch')}</button>
|
||||
<button className={`btn-frame modal mr5 ${isManualModuleSetup ? 'act' : ''}`} onClick={handleManualModuleSetup}>
|
||||
{getMessage('modal.module.basic.setting.passivity.placement')}
|
||||
</button>
|
||||
|
||||
@ -1,35 +1,153 @@
|
||||
import { forwardRef, useContext, useEffect, useImperativeHandle, useState } from 'react'
|
||||
import { forwardRef, use, useContext, useEffect, useImperativeHandle, useState } from 'react'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import { useOrientation } from '@/hooks/module/useOrientation'
|
||||
import { getDegreeInOrientation } from '@/util/canvas-util'
|
||||
import { numberCheck } from '@/util/common-utils'
|
||||
import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController'
|
||||
import { addedRoofsState, basicSettingState } from '@/store/settingAtom'
|
||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||
import QSelectBox from '@/components/common/select/QSelectBox'
|
||||
import { moduleSelectionDataState } from '@/store/selectedModuleOptions'
|
||||
|
||||
export const Orientation = forwardRef(({ tabNum }, ref) => {
|
||||
export const Orientation = forwardRef((props, ref) => {
|
||||
const { getMessage } = useMessage()
|
||||
|
||||
const { trigger: canvasPopupStatusTrigger } = useCanvasPopupStatusController(1)
|
||||
|
||||
const { nextStep, compasDeg, setCompasDeg } = useOrientation()
|
||||
|
||||
const [hasAnglePassivity, setHasAnglePassivity] = useState(false)
|
||||
const basicSetting = useRecoilValue(basicSettingState)
|
||||
const [addedRoofs, setAddedRoofs] = useRecoilState(addedRoofsState) //지붕재 선택
|
||||
const [roofTab, setRoofTab] = useState(0) //지붕재 탭
|
||||
const {
|
||||
roofs,
|
||||
setRoofs,
|
||||
tabNum,
|
||||
setTabNum,
|
||||
compasDeg,
|
||||
setCompasDeg,
|
||||
moduleSelectionInitParams,
|
||||
selectedModules,
|
||||
roughnessCodes,
|
||||
windSpeedCodes,
|
||||
managementState,
|
||||
setManagementState,
|
||||
moduleList,
|
||||
moduleSelectionData,
|
||||
setModuleSelectionData,
|
||||
setSelectedModules,
|
||||
selectedSurfaceType,
|
||||
setSelectedSurfaceType,
|
||||
installHeight,
|
||||
setInstallHeight,
|
||||
standardWindSpeed,
|
||||
setStandardWindSpeed,
|
||||
verticalSnowCover,
|
||||
setVerticalSnowCover,
|
||||
orientationTrigger,
|
||||
nextStep,
|
||||
currentCanvasPlan,
|
||||
loginUserState,
|
||||
updateObjectDataApi,
|
||||
} = props
|
||||
const [inputCompasDeg, setInputCompasDeg] = useState(compasDeg ?? 0)
|
||||
const [inputInstallHeight, setInputInstallHeight] = useState('0')
|
||||
const [inputVerticalSnowCover, setInputVerticalSnowCover] = useState('0')
|
||||
const [inputRoughness, setInputRoughness] = useState(selectedSurfaceType)
|
||||
const [inputStandardWindSpeed, setInputStandardWindSpeed] = useState(standardWindSpeed)
|
||||
const moduleData = {
|
||||
header: [
|
||||
{ name: getMessage('module'), width: 150, prop: 'module', type: 'color-box' },
|
||||
{
|
||||
name: `${getMessage('height')} (mm)`,
|
||||
prop: 'height',
|
||||
},
|
||||
{ name: `${getMessage('width')} (mm)`, prop: 'width' },
|
||||
{ name: `${getMessage('output')} (W)`, prop: 'output' },
|
||||
],
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (selectedSurfaceType) {
|
||||
console.log(roughnessCodes, selectedSurfaceType)
|
||||
setInputRoughness(roughnessCodes.find((code) => code.clCode === managementState?.surfaceTypeValue))
|
||||
}
|
||||
}, [selectedSurfaceType])
|
||||
|
||||
useEffect(() => {
|
||||
if (standardWindSpeed) setInputStandardWindSpeed(windSpeedCodes.find((code) => code.clCode === managementState?.standardWindSpeedId))
|
||||
}, [standardWindSpeed])
|
||||
|
||||
useEffect(() => {
|
||||
if (managementState?.installHeight && managementState?.installHeight) {
|
||||
console.log('🚀 ~ useEffect ~ managementState:', managementState)
|
||||
setSelectedSurfaceType(roughnessCodes.find((code) => code.clCode === managementState?.surfaceTypeValue))
|
||||
setInputInstallHeight(managementState?.installHeight)
|
||||
setStandardWindSpeed(windSpeedCodes.find((code) => code.clCode === managementState?.standardWindSpeedId))
|
||||
setInputVerticalSnowCover(managementState?.verticalSnowCover)
|
||||
}
|
||||
}, [managementState])
|
||||
|
||||
useEffect(() => {
|
||||
if (moduleSelectionData) {
|
||||
console.log('moduleSelectionData', moduleSelectionData)
|
||||
}
|
||||
}, [moduleSelectionData])
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
handleNextStep,
|
||||
}))
|
||||
|
||||
const handleNextStep = () => {
|
||||
nextStep()
|
||||
canvasPopupStatusTrigger(compasDeg)
|
||||
if (isComplete()) {
|
||||
const common = {
|
||||
illuminationTp: inputRoughness.clCode,
|
||||
illuminationTpNm: inputRoughness.clCodeNm,
|
||||
instHt: inputInstallHeight,
|
||||
stdWindSpeed: inputStandardWindSpeed.clCode,
|
||||
stdSnowLd: inputVerticalSnowCover,
|
||||
saleStoreNorthFlg: managementState?.saleStoreNorthFlg,
|
||||
moduleTpCd: selectedModules.itemTp,
|
||||
moduleItemId: selectedModules.itemId,
|
||||
}
|
||||
setCompasDeg(inputCompasDeg)
|
||||
setInstallHeight(inputInstallHeight)
|
||||
setVerticalSnowCover(inputVerticalSnowCover)
|
||||
setSelectedSurfaceType(inputRoughness)
|
||||
setStandardWindSpeed(inputStandardWindSpeed)
|
||||
nextStep()
|
||||
setManagementState({
|
||||
...managementState,
|
||||
installHeight: inputInstallHeight,
|
||||
verticalSnowCover: inputVerticalSnowCover,
|
||||
standardWindSpeedId: inputStandardWindSpeed.clCode,
|
||||
surfaceType: inputRoughness.clCodeNm,
|
||||
surfaceTypeValue: inputRoughness.clCode,
|
||||
})
|
||||
setModuleSelectionData({
|
||||
...moduleSelectionData,
|
||||
module: {
|
||||
...selectedModules,
|
||||
},
|
||||
})
|
||||
orientationTrigger({
|
||||
compasDeg: inputCompasDeg,
|
||||
common: common,
|
||||
module: {
|
||||
...selectedModules,
|
||||
},
|
||||
})
|
||||
updateObjectDataApi({
|
||||
objectNo: currentCanvasPlan.objectNo, //오브젝트_no
|
||||
standardWindSpeedId: inputStandardWindSpeed.clCode, //기준풍속코드
|
||||
verticalSnowCover: inputVerticalSnowCover, //적설량
|
||||
surfaceType: inputRoughness.clCodeNm, //면조도구분
|
||||
installHeight: inputInstallHeight, //설치높이
|
||||
userId: loginUserState.userId, //작성자아아디
|
||||
})
|
||||
setTabNum(2)
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
checkDegree(compasDeg)
|
||||
}, [compasDeg])
|
||||
|
||||
const checkDegree = (e) => {
|
||||
if (e === '-0' || e === '-') {
|
||||
setCompasDeg('-')
|
||||
setInputCompasDeg('-')
|
||||
return
|
||||
}
|
||||
if (e === '0-') {
|
||||
@ -45,71 +163,273 @@ export const Orientation = forwardRef(({ tabNum }, ref) => {
|
||||
}
|
||||
}
|
||||
|
||||
const isComplete = () => {
|
||||
if (basicSetting && basicSetting.roofSizeSet !== '3') {
|
||||
if (inputInstallHeight <= 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (+inputVerticalSnowCover <= 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (!inputStandardWindSpeed) return false
|
||||
if (!inputRoughness) return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
const handleChangeModule = (e) => {
|
||||
resetRoofs()
|
||||
setSelectedModules(e)
|
||||
}
|
||||
|
||||
const handleChangeRoughness = (e) => {
|
||||
resetRoofs()
|
||||
setInputRoughness(e)
|
||||
}
|
||||
|
||||
const handleChangeInstallHeight = (e) => {
|
||||
resetRoofs()
|
||||
setInputInstallHeight(e)
|
||||
}
|
||||
|
||||
const handleChangeStandardWindSpeed = (e) => {
|
||||
resetRoofs()
|
||||
setInputStandardWindSpeed(e)
|
||||
}
|
||||
|
||||
const handleChangeVerticalSnowCover = (e) => {
|
||||
resetRoofs()
|
||||
setInputVerticalSnowCover(e)
|
||||
}
|
||||
|
||||
const resetRoofs = () => {
|
||||
const newRoofs = addedRoofs.map((roof) => {
|
||||
return {
|
||||
...roof,
|
||||
lengthBase: null,
|
||||
trestleMkrCd: null,
|
||||
constMthdCd: null,
|
||||
constTp: null,
|
||||
roofBaseCd: null,
|
||||
ridgeMargin: null,
|
||||
kerabaMargin: null,
|
||||
eavesMargin: null,
|
||||
roofPchBase: null,
|
||||
cvrYn: 'N',
|
||||
snowGdPossYn: 'N',
|
||||
cvrChecked: false,
|
||||
snowGdChecked: false,
|
||||
}
|
||||
})
|
||||
setRoofs(newRoofs)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="properties-setting-wrap">
|
||||
<div className="outline-wrap">
|
||||
<div className="guide">{getMessage('modal.module.basic.setting.orientation.setting.info')}</div>
|
||||
<div className="roof-module-compas">
|
||||
<div className="compas-box">
|
||||
<div className="compas-box-inner">
|
||||
{Array.from({ length: 180 / 15 }).map((dot, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className={`circle ${getDegreeInOrientation(compasDeg) === -1 * (-15 * index + 180) || (index === 0 && compasDeg >= 172 && index === 0 && compasDeg <= 180) || (compasDeg === -180 && index === 0) ? 'act' : ''}`}
|
||||
onClick={() => {
|
||||
if (index === 0) {
|
||||
setCompasDeg(180)
|
||||
return
|
||||
}
|
||||
setCompasDeg(-1 * (-15 * index + 180))
|
||||
}}
|
||||
>
|
||||
{index === 0 && <i>180°</i>}
|
||||
{index === 6 && <i>-90°</i>}
|
||||
<div className="roof-module-inner">
|
||||
<div className="compas-wrapper">
|
||||
<div className="guide">{getMessage('modal.module.basic.setting.orientation.setting.info')}</div>
|
||||
<div className="roof-module-compas">
|
||||
<div className="compas-box">
|
||||
<div className="compas-box-inner">
|
||||
{Array.from({ length: 180 / 15 }).map((dot, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className={`circle ${getDegreeInOrientation(inputCompasDeg) === -1 * (-15 * index + 180) || (index === 0 && inputCompasDeg >= 172 && index === 0 && inputCompasDeg <= 180) || (inputCompasDeg === -180 && index === 0) ? 'act' : ''}`}
|
||||
onClick={() => {
|
||||
if (index === 0) {
|
||||
setInputCompasDeg(180)
|
||||
return
|
||||
}
|
||||
setInputCompasDeg(-1 * (-15 * index + 180))
|
||||
}}
|
||||
>
|
||||
{index === 0 && <i>180°</i>}
|
||||
{index === 6 && <i>-90°</i>}
|
||||
</div>
|
||||
))}
|
||||
{Array.from({ length: 180 / 15 }).map((dot, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className={`circle ${inputCompasDeg !== 180 && getDegreeInOrientation(inputCompasDeg) === 15 * index ? 'act' : ''}`}
|
||||
onClick={() => setInputCompasDeg(15 * index)}
|
||||
>
|
||||
{index === 0 && <i>0°</i>}
|
||||
{index === 6 && <i>90°</i>}
|
||||
</div>
|
||||
))}
|
||||
<div className="compas">
|
||||
<div className="compas-arr" style={{ transform: `rotate(${getDegreeInOrientation(inputCompasDeg)}deg)` }}></div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
{Array.from({ length: 180 / 15 }).map((dot, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className={`circle ${compasDeg !== 180 && getDegreeInOrientation(compasDeg) === 15 * index ? 'act' : ''}`}
|
||||
onClick={() => setCompasDeg(15 * index)}
|
||||
>
|
||||
{index === 0 && <i>0°</i>}
|
||||
{index === 6 && <i>90°</i>}
|
||||
</div>
|
||||
</div>
|
||||
<div className="center-wrap">
|
||||
<div className="outline-form">
|
||||
<div className="d-check-box pop mr10">
|
||||
<input type="checkbox" id="ch99" checked={hasAnglePassivity} onChange={() => setHasAnglePassivity(!hasAnglePassivity)} />
|
||||
<label htmlFor="ch99">{getMessage('modal.module.basic.setting.orientation.setting.angle.passivity')}</label>
|
||||
</div>
|
||||
))}
|
||||
<div className="compas">
|
||||
<div className="compas-arr" style={{ transform: `rotate(${getDegreeInOrientation(compasDeg)}deg)` }}></div>
|
||||
<div className="input-grid mr10" style={{ width: '60px' }}>
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
value={inputCompasDeg}
|
||||
readOnly={!hasAnglePassivity}
|
||||
placeholder={0}
|
||||
onChange={(e) => checkDegree(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<span className="thin">°</span>
|
||||
<span className="thin">( -180 〜 180 )</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="center-wrap">
|
||||
<div className="d-check-box pop">
|
||||
<input type="checkbox" id="ch99" checked={hasAnglePassivity} onChange={() => setHasAnglePassivity(!hasAnglePassivity)} />
|
||||
<label htmlFor="ch99">{getMessage('modal.module.basic.setting.orientation.setting.angle.passivity')}(-180 〜 180)</label>
|
||||
</div>
|
||||
<div className="outline-form">
|
||||
<div className="input-grid mr10" style={{ width: '160px' }}>
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
value={compasDeg}
|
||||
readOnly={!hasAnglePassivity}
|
||||
placeholder={0}
|
||||
onChange={
|
||||
(e) => checkDegree(e.target.value)
|
||||
// setCompasDeg(
|
||||
|
||||
// e.target.value === '-' || (e.target.value !== '' && parseInt(e.target.value) <= 180 && parseInt(e.target.value) >= -180)
|
||||
// ? e.target.value
|
||||
// : 0,
|
||||
// )
|
||||
}
|
||||
/>
|
||||
<div className="compas-table-wrap">
|
||||
<div className="compas-table-box mb10">
|
||||
<div className="outline-form mb10">
|
||||
<span>{getMessage('modal.module.basic.setting.module.setting')}</span>
|
||||
<div className="grid-select">
|
||||
{moduleList && (
|
||||
<QSelectBox
|
||||
options={moduleList}
|
||||
value={moduleSelectionInitParams}
|
||||
targetKey={'moduleItemId'}
|
||||
sourceKey={'itemId'}
|
||||
showKey={'itemNm'}
|
||||
onChange={(e) => handleChangeModule(e)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="roof-module-table">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
{moduleData.header.map((header) => {
|
||||
return (
|
||||
<th key={header.prop} style={{ width: header.width ? header.width + 'px' : '' }}>
|
||||
{header.name}
|
||||
</th>
|
||||
)
|
||||
})}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Array.from({ length: 3 }).map((_, index) => {
|
||||
return selectedModules && selectedModules?.itemList && selectedModules?.itemList?.length >= index + 1 ? (
|
||||
<tr key={index}>
|
||||
<td>
|
||||
<div className="color-wrap">
|
||||
<span
|
||||
className="color-box"
|
||||
style={{
|
||||
backgroundColor: selectedModules.itemList[index].color,
|
||||
}}
|
||||
></span>
|
||||
<span className="name">{selectedModules.itemList[index].itemNm}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td className="al-r">{Number(selectedModules.itemList[index].shortAxis).toFixed(0)}</td>
|
||||
<td className="al-r">{Number(selectedModules.itemList[index].longAxis).toFixed(0)}</td>
|
||||
<td className="al-r">{Number(selectedModules.itemList[index].wpOut).toFixed(0)}</td>
|
||||
</tr>
|
||||
) : (
|
||||
<tr key={index}>
|
||||
<td>
|
||||
<div className="color-wrap"></div>
|
||||
</td>
|
||||
<td className="al-r"></td>
|
||||
<td className="al-r"></td>
|
||||
<td className="al-r"></td>
|
||||
</tr>
|
||||
)
|
||||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{basicSetting && basicSetting.roofSizeSet === '3' && (
|
||||
<div className="outline-form mt15">
|
||||
<span>{getMessage('modal.module.basic.setting.module.placement.area')}</span>
|
||||
<div className="input-grid mr10" style={{ width: '60px' }}>
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
value={inputInstallHeight}
|
||||
onChange={(e) => setInputInstallHeight(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<span className="thin">m</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<span className="thin">°</span>
|
||||
|
||||
{basicSetting && basicSetting.roofSizeSet !== '3' && (
|
||||
<div className="compas-table-box">
|
||||
<div className="compas-grid-table">
|
||||
<div className="outline-form">
|
||||
<span>{getMessage('modal.module.basic.setting.module.surface.type')}</span>
|
||||
<div className="grid-select">
|
||||
{roughnessCodes.length > 0 && managementState && (
|
||||
<QSelectBox
|
||||
options={roughnessCodes}
|
||||
value={inputRoughness}
|
||||
targetKey={'clCode'}
|
||||
sourceKey={'clCode'}
|
||||
showKey={'clCodeNm'}
|
||||
onChange={(e) => handleChangeRoughness(e)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="outline-form">
|
||||
<span>{getMessage('modal.module.basic.setting.module.fitting.height')}</span>
|
||||
<div className="input-grid mr10">
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
value={inputInstallHeight}
|
||||
onChange={(e) => handleChangeInstallHeight(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<span className="thin">m</span>
|
||||
</div>
|
||||
<div className="outline-form">
|
||||
<span>{getMessage('modal.module.basic.setting.module.standard.wind.speed')}</span>
|
||||
<div className="grid-select">
|
||||
{windSpeedCodes.length > 0 && managementState && (
|
||||
<QSelectBox
|
||||
title={''}
|
||||
options={windSpeedCodes}
|
||||
value={inputStandardWindSpeed}
|
||||
targetKey={'clCode'}
|
||||
sourceKey={'clCode'}
|
||||
showKey={'clCodeNm'}
|
||||
onChange={(e) => handleChangeStandardWindSpeed(e)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="outline-form">
|
||||
<span>{getMessage('modal.module.basic.setting.module.standard.snowfall.amount')}</span>
|
||||
<div className="input-grid mr10">
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
value={inputVerticalSnowCover}
|
||||
onChange={(e) => handleChangeVerticalSnowCover(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<span className="thin">cm</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,29 +1,43 @@
|
||||
import { forwardRef, useEffect, useState } from 'react'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting'
|
||||
import { checkedModuleState, currentCanvasPlanState, isManualModuleSetupState } from '@/store/canvasAtom'
|
||||
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'
|
||||
import {
|
||||
checkedModuleState,
|
||||
isManualModuleLayoutSetupState,
|
||||
isManualModuleSetupState,
|
||||
moduleRowColArrayState,
|
||||
moduleSetupOptionState,
|
||||
toggleManualSetupModeState,
|
||||
} from '@/store/canvasAtom'
|
||||
import { useRecoilState, useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil'
|
||||
import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
|
||||
import { isObjectNotEmpty } from '@/util/common-utils'
|
||||
|
||||
const Placement = forwardRef((props, refs) => {
|
||||
const { getMessage } = useMessage()
|
||||
const [isChidori, setIsChidori] = useState(false)
|
||||
const [useTab, setUseTab] = useState(true)
|
||||
|
||||
const [isChidoriNotAble, setIsChidoriNotAble] = useState(false)
|
||||
|
||||
const [setupLocation, setSetupLocation] = useState('eaves')
|
||||
const [isMaxSetup, setIsMaxSetup] = useState('false')
|
||||
const [selectedItems, setSelectedItems] = useState({})
|
||||
|
||||
const [selectedModules, setSelectedModules] = useRecoilState(selectedModuleState)
|
||||
|
||||
const setCheckedModules = useSetRecoilState(checkedModuleState)
|
||||
const moduleSelectionData = useRecoilValue(moduleSelectionDataState)
|
||||
const { makeModuleInitArea } = useModuleBasicSetting(3)
|
||||
const { makeModuleInitArea, roofOutlineColor } = useModuleBasicSetting(3)
|
||||
|
||||
const [isMultiModule, setIsMultiModule] = useState(false)
|
||||
|
||||
const [isManualModuleSetup, setIsManualModuleSetup] = useRecoilState(isManualModuleSetupState)
|
||||
//언마운트시 버튼 초기화
|
||||
const setIsManualModuleSetup = useSetRecoilState(isManualModuleSetupState)
|
||||
const setIsManualModuleLayoutSetup = useSetRecoilState(isManualModuleLayoutSetupState)
|
||||
const setManualSetupMode = useSetRecoilState(toggleManualSetupModeState)
|
||||
|
||||
const [moduleSetupOption, setModuleSetupOption] = useRecoilState(moduleSetupOptionState) //모듈 설치 옵션
|
||||
const resetModuleSetupOption = useResetRecoilState(moduleSetupOptionState)
|
||||
|
||||
const [colspan, setColspan] = useState(1)
|
||||
const [moduleRowColArray, setModuleRowColArray] = useRecoilState(moduleRowColArrayState)
|
||||
|
||||
//모듈 배치면 생성
|
||||
useEffect(() => {
|
||||
@ -36,13 +50,24 @@ const Placement = forwardRef((props, refs) => {
|
||||
makeModuleInitArea(moduleSelectionData)
|
||||
}
|
||||
|
||||
if (moduleSelectionData.module.itemList.length > 1) {
|
||||
setColspan(2)
|
||||
}
|
||||
|
||||
return () => {
|
||||
refs.isChidori.current = 'false'
|
||||
refs.setupLocation.current = 'eaves'
|
||||
// refs.isChidori.current = 'false'
|
||||
// refs.setupLocation.current = 'eaves'
|
||||
setIsManualModuleSetup(false)
|
||||
setIsManualModuleLayoutSetup(false)
|
||||
setManualSetupMode('off')
|
||||
resetModuleSetupOption()
|
||||
}
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
console.log('moduleRowColArray', moduleRowColArray)
|
||||
}, [moduleRowColArray])
|
||||
|
||||
//최초 지입시 체크
|
||||
useEffect(() => {
|
||||
if (isObjectNotEmpty(moduleSelectionData)) {
|
||||
@ -56,8 +81,10 @@ const Placement = forwardRef((props, refs) => {
|
||||
initCheckedModule = { ...initCheckedModule, [obj.itemId]: true }
|
||||
}
|
||||
})
|
||||
|
||||
setSelectedItems(initCheckedModule)
|
||||
setSelectedModules(moduleSelectionData.module)
|
||||
props.setLayoutSetup(moduleSelectionData.module.itemList.map((item) => ({ moduleId: item.itemId, col: 0, row: 0, checked: true })))
|
||||
}
|
||||
|
||||
//모듈 배치면 생성
|
||||
@ -82,59 +109,75 @@ const Placement = forwardRef((props, refs) => {
|
||||
header: [
|
||||
{ type: 'check', name: '', prop: 'check', width: 70 },
|
||||
{ type: 'color-box', name: getMessage('module'), prop: 'module' },
|
||||
{ type: 'text', name: `${getMessage('output')} (W)`, prop: 'output', width: 70 },
|
||||
{ type: 'text', name: getMessage('modal.module.basic.setting.module.placement.mix.asg.yn'), prop: 'mixAsgYn', width: 50 },
|
||||
{ type: 'text', name: `単数`, prop: 'rows', width: 60 },
|
||||
{ type: 'text', name: `熱水`, prop: 'cols', width: 60 },
|
||||
],
|
||||
rows: [],
|
||||
}
|
||||
|
||||
const handleChangeChidori = (e) => {
|
||||
const bool = e.target.value === 'true' ? true : false
|
||||
setIsChidori(bool)
|
||||
refs.isChidori.current = e.target.value
|
||||
setModuleSetupOption({ ...moduleSetupOption, isChidori: bool })
|
||||
|
||||
//변경하면 수동 다 꺼짐
|
||||
setIsManualModuleSetup(false)
|
||||
setIsManualModuleLayoutSetup(false)
|
||||
setManualSetupMode('off')
|
||||
}
|
||||
|
||||
const handleSetupLocation = (e) => {
|
||||
setSetupLocation(e.target.value)
|
||||
refs.setupLocation.current = e.target.value
|
||||
}
|
||||
setModuleSetupOption({ ...moduleSetupOption, setupLocation: e.target.value })
|
||||
|
||||
const handleMaxSetup = (e) => {
|
||||
if (e.target.checked) {
|
||||
setIsMaxSetup('true')
|
||||
refs.isMaxSetup.current = 'true'
|
||||
} else {
|
||||
setIsMaxSetup('false')
|
||||
refs.isMaxSetup.current = 'false'
|
||||
}
|
||||
//변경하면 수동 다 꺼짐
|
||||
setIsManualModuleSetup(false)
|
||||
setIsManualModuleLayoutSetup(false)
|
||||
setManualSetupMode('off')
|
||||
}
|
||||
|
||||
//체크된 모듈 아이디 추출
|
||||
const handleSelectedItem = (e) => {
|
||||
const handleSelectedItem = (e, itemId) => {
|
||||
setSelectedItems({ ...selectedItems, [e.target.name]: e.target.checked })
|
||||
|
||||
const newLayoutSetup = [...props.layoutSetup]
|
||||
props.layoutSetup.forEach((item, index) => {
|
||||
if (item.moduleId === itemId) {
|
||||
newLayoutSetup[index] = { ...props.layoutSetup[index], checked: e.target.checked }
|
||||
}
|
||||
})
|
||||
props.setLayoutSetup(newLayoutSetup)
|
||||
}
|
||||
|
||||
const handleLayoutSetup = (e, itemId, index) => {
|
||||
const newLayoutSetup = [...props.layoutSetup]
|
||||
newLayoutSetup[index] = {
|
||||
...newLayoutSetup[index],
|
||||
moduleId: itemId,
|
||||
[e.target.name]: Number(e.target.value),
|
||||
}
|
||||
props.setLayoutSetup(newLayoutSetup)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="module-table-flex-wrap mb10">
|
||||
<div className="module-table-flex-wrap">
|
||||
<div className="module-table-box">
|
||||
<div className="module-table-inner">
|
||||
<div className="roof-module-table">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
{moduleData.header.map((data) => (
|
||||
<th key={data.prop} style={{ width: data.width ? data.width : '' }}>
|
||||
{data.type === 'check' ? (
|
||||
<div className="d-check-box no-text pop">
|
||||
<input type="checkbox" id="ch01" disabled />
|
||||
<label htmlFor="ch01"></label>
|
||||
</div>
|
||||
) : (
|
||||
data.name
|
||||
)}
|
||||
</th>
|
||||
))}
|
||||
</tr>
|
||||
{moduleData.header.map((data) => (
|
||||
<th key={data.prop} style={{ width: data.width ? data.width : '' }}>
|
||||
{data.type === 'check' ? (
|
||||
<div className="d-check-box no-text pop">
|
||||
<input type="checkbox" id="ch01" disabled />
|
||||
<label htmlFor="ch01"></label>
|
||||
</div>
|
||||
) : (
|
||||
data.name
|
||||
)}
|
||||
</th>
|
||||
))}
|
||||
</thead>
|
||||
<tbody>
|
||||
{selectedModules.itemList &&
|
||||
@ -147,7 +190,7 @@ const Placement = forwardRef((props, refs) => {
|
||||
id={item.itemId}
|
||||
name={item.itemId}
|
||||
checked={selectedItems[item.itemId]}
|
||||
onChange={handleSelectedItem}
|
||||
onChange={(e) => handleSelectedItem(e, item.itemId)}
|
||||
/>
|
||||
<label htmlFor={item.itemId}></label>
|
||||
</div>
|
||||
@ -158,93 +201,174 @@ const Placement = forwardRef((props, refs) => {
|
||||
<span className="name">{item.itemNm}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td className="al-r">{item.wpOut}</td>
|
||||
<td className="al-c">
|
||||
<div className="color-wrap">
|
||||
<span className="name">{item.mixAsgYn}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td className="al-r">
|
||||
<div className="input-grid">
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
name="row"
|
||||
value={props.layoutSetup[index]?.row ?? 1}
|
||||
defaultValue={0}
|
||||
onChange={(e) => handleLayoutSetup(e, item.itemId, index)}
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
<td className="al-r">
|
||||
<div className="input-grid">
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
name="col"
|
||||
value={props.layoutSetup[index]?.col ?? 1}
|
||||
defaultValue={0}
|
||||
onChange={(e) => handleLayoutSetup(e, item.itemId, index)}
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="module-table-box">
|
||||
<div className="module-table-box non-flex">
|
||||
<div className="module-table-inner">
|
||||
<div className="self-table-tit">{getMessage('modal.module.basic.setting.module.placement.select.fitting.type')}</div>
|
||||
<div className="module-self-table">
|
||||
<div className="self-table-item">
|
||||
<div className="self-item-th">{getMessage('modal.module.basic.setting.module.placement.waterfowl.arrangement')}</div>
|
||||
<div className="self-item-td">
|
||||
<div className="pop-form-radio">
|
||||
<div className="d-check-radio pop">
|
||||
<input
|
||||
type="radio"
|
||||
name="radio01"
|
||||
id="ra01"
|
||||
checked={isChidori}
|
||||
disabled={isChidoriNotAble}
|
||||
value={'true'}
|
||||
onChange={(e) => handleChangeChidori(e)}
|
||||
/>
|
||||
<label htmlFor="ra01">{getMessage('modal.module.basic.setting.module.placement.do')}</label>
|
||||
</div>
|
||||
<div className="d-check-radio pop">
|
||||
<input type="radio" name="radio02" id="ra02" checked={!isChidori} value={'false'} onChange={(e) => handleChangeChidori(e)} />
|
||||
<label htmlFor="ra02">{getMessage('modal.module.basic.setting.module.placement.do.not')}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="self-table-item">
|
||||
<div className="self-item-th">{getMessage('modal.module.basic.setting.module.placement.arrangement.standard')}</div>
|
||||
<div className="self-item-td">
|
||||
<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">
|
||||
<input
|
||||
type="radio"
|
||||
name="radio04"
|
||||
id="ra04"
|
||||
checked={setupLocation === 'eaves'}
|
||||
value={'eaves'}
|
||||
onChange={handleSetupLocation}
|
||||
/>
|
||||
<label htmlFor="ra04">{getMessage('modal.module.basic.setting.module.placement.arrangement.standard.eaves')}</label>
|
||||
</div>
|
||||
<div className="d-check-radio pop">
|
||||
<input
|
||||
type="radio"
|
||||
name="radio05"
|
||||
id="ra05"
|
||||
checked={setupLocation === 'ridge'}
|
||||
value={'ridge'}
|
||||
onChange={handleSetupLocation}
|
||||
disabled={isMultiModule}
|
||||
/>
|
||||
<label htmlFor="ra05">{getMessage('modal.module.basic.setting.module.placement.arrangement.standard.ridge')}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="self-table-flx">
|
||||
{/* <div className="d-check-box pop">
|
||||
<input type="checkbox" id="ch04" checked={isMaxSetup === 'true'} value={'true'} onChange={handleMaxSetup} />
|
||||
<label htmlFor="ch04">{getMessage('modal.module.basic.setting.module.placement.maximum')}</label>
|
||||
</div> */}
|
||||
<div className="roof-module-table">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{getMessage('modal.module.basic.setting.module.placement.waterfowl.arrangement')}</th>
|
||||
<th>{getMessage('modal.module.basic.setting.module.placement.arrangement.standard')}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<div className="hexagonal-radio-wrap">
|
||||
<div className="d-check-radio pop mb10">
|
||||
<input
|
||||
type="radio"
|
||||
name="radio02"
|
||||
id="ra03"
|
||||
checked={moduleSetupOption.isChidori}
|
||||
disabled={isChidoriNotAble}
|
||||
value={'true'}
|
||||
onChange={(e) => handleChangeChidori(e)}
|
||||
/>
|
||||
<label htmlFor="ra03">{getMessage('modal.module.basic.setting.module.placement.do')}</label>
|
||||
</div>
|
||||
<div className="d-check-radio pop">
|
||||
<input
|
||||
type="radio"
|
||||
name="radio02"
|
||||
id="ra04"
|
||||
checked={!moduleSetupOption.isChidori}
|
||||
value={'false'}
|
||||
onChange={(e) => handleChangeChidori(e)}
|
||||
/>
|
||||
<label htmlFor="ra04">{getMessage('modal.module.basic.setting.module.placement.do.not')}</label>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div className="hexagonal-radio-wrap">
|
||||
<div className="d-check-radio pop mb10">
|
||||
<input
|
||||
type="radio"
|
||||
name="radio03"
|
||||
id="ra05"
|
||||
checked={moduleSetupOption.setupLocation === 'eaves'}
|
||||
value={'eaves'}
|
||||
onChange={handleSetupLocation}
|
||||
/>
|
||||
<label htmlFor="ra05">{getMessage('modal.module.basic.setting.module.placement.arrangement.standard.eaves')}</label>
|
||||
</div>
|
||||
<div className="d-check-radio pop">
|
||||
<input
|
||||
type="radio"
|
||||
name="radio03"
|
||||
id="ra06"
|
||||
checked={moduleSetupOption.setupLocation === 'ridge'}
|
||||
value={'ridge'}
|
||||
onChange={handleSetupLocation}
|
||||
disabled={isMultiModule}
|
||||
/>
|
||||
<label htmlFor="ra06">{getMessage('modal.module.basic.setting.module.placement.arrangement.standard.ridge')}</label>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="hide-check-guide">
|
||||
{getMessage('modal.module.basic.setting.module.placement.max.size.check')}
|
||||
<button className={`arr ${!useTab ? 'act' : ''}`} onClick={() => setUseTab(!useTab)}></button>
|
||||
</div>
|
||||
<div className={`module-table-box mt10 ${useTab ? 'hide' : ''}`}>
|
||||
<div className="module-table-inner">
|
||||
<div className="roof-module-table">
|
||||
<table className="">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowSpan={2} style={{ width: '22%' }}></th>
|
||||
{selectedModules &&
|
||||
selectedModules.itemList.map((item) => (
|
||||
<th colSpan={colspan}>
|
||||
<div className="color-wrap">
|
||||
<span className="color-box" style={{ backgroundColor: item.color }}></span>
|
||||
<span className="name">{item.itemNm}</span>
|
||||
</div>
|
||||
</th>
|
||||
))}
|
||||
</tr>
|
||||
<tr>
|
||||
{selectedModules.itemList.map((item) => (
|
||||
<>
|
||||
<th>{getMessage('modal.module.basic.setting.module.placement.max.row')}</th>
|
||||
{colspan > 1 && <th>{getMessage('modal.module.basic.setting.module.placement.max.rows.multiple')}</th>}
|
||||
</>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{moduleSelectionData.roofConstructions.map((item, index) => (
|
||||
<tr>
|
||||
<td>
|
||||
<div className="color-wrap">
|
||||
<span className="color-box" style={{ backgroundColor: roofOutlineColor(item.addRoof.index) }}></span>
|
||||
<span className="name">{item.addRoof.roofMatlNmJp}</span>
|
||||
</div>
|
||||
</td>
|
||||
{moduleRowColArray[index]?.map((item) => (
|
||||
<>
|
||||
<td className="al-c">{item.moduleMaxRows}</td>
|
||||
{colspan > 1 && <td className="al-c">{item.mixModuleMaxRows}</td>}
|
||||
</>
|
||||
))}
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
})
|
||||
|
||||
555
src/components/floor-plan/modal/basic/step/Trestle.jsx
Normal file
555
src/components/floor-plan/modal/basic/step/Trestle.jsx
Normal file
@ -0,0 +1,555 @@
|
||||
import { GlobalDataContext } from '@/app/GlobalDataProvider'
|
||||
import QSelectBox from '@/components/common/select/QSelectBox'
|
||||
import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting'
|
||||
import { useModuleTrestle } from '@/hooks/module/useModuleTrestle'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import { currentAngleTypeSelector, pitchTextSelector } from '@/store/canvasAtom'
|
||||
import { roofsState } from '@/store/roofAtom'
|
||||
import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
|
||||
import { isObjectNotEmpty } from '@/util/common-utils'
|
||||
import { forwardRef, useContext, useEffect, useImperativeHandle, useState } from 'react'
|
||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||
|
||||
const Trestle = forwardRef((props, ref) => {
|
||||
const { setTabNum, trestleTrigger, roofs, setRoofs, moduleSelectionData, setModuleSelectionData } = props
|
||||
const { getMessage } = useMessage()
|
||||
// const [selectedTrestle, setSelectedTrestle] = useState()
|
||||
const currentAngleType = useRecoilValue(currentAngleTypeSelector)
|
||||
const pitchText = useRecoilValue(pitchTextSelector)
|
||||
const [selectedRoof, setSelectedRoof] = useState()
|
||||
const {
|
||||
trestleState,
|
||||
trestleDetail,
|
||||
dispatch,
|
||||
raftBaseList,
|
||||
trestleList,
|
||||
constMthdList,
|
||||
roofBaseList,
|
||||
constructionList,
|
||||
eavesMargin,
|
||||
ridgeMargin,
|
||||
kerabaMargin,
|
||||
setEavesMargin,
|
||||
setRidgeMargin,
|
||||
setKerabaMargin,
|
||||
cvrYn,
|
||||
cvrChecked,
|
||||
snowGdPossYn,
|
||||
snowGdChecked,
|
||||
setCvrYn,
|
||||
setCvrChecked,
|
||||
setSnowGdPossYn,
|
||||
setSnowGdChecked,
|
||||
} = useModuleTrestle({
|
||||
selectedRoof,
|
||||
})
|
||||
const selectedModules = useRecoilValue(selectedModuleState) //선택된 모듈
|
||||
// const [moduleSelectionData, setModuleSelectionData] = useRecoilState(moduleSelectionDataState)
|
||||
const [lengthBase, setLengthBase] = useState(0)
|
||||
const [hajebichi, setHajebichi] = useState(0)
|
||||
const [selectedRaftBase, setSelectedRaftBase] = useState(null)
|
||||
const [selectedTrestle, setSelectedTrestle] = useState(null)
|
||||
const [selectedConstMthd, setSelectedConstMthd] = useState(null)
|
||||
const [selectedConstruction, setSelectedConstruction] = useState(null)
|
||||
const [selectedRoofBase, setSelectedRoofBase] = useState(null)
|
||||
const { managementState } = useContext(GlobalDataContext)
|
||||
const { restoreModuleInstArea } = useModuleBasicSetting()
|
||||
|
||||
useEffect(() => {
|
||||
if (roofs && !selectedRoof) {
|
||||
setSelectedRoof(roofs[0])
|
||||
}
|
||||
|
||||
//모듈 설치 영역 복구
|
||||
restoreModuleInstArea()
|
||||
}, [roofs])
|
||||
|
||||
useEffect(() => {
|
||||
if (selectedRoof) {
|
||||
dispatch({ type: 'SET_INITIALIZE', roof: { ...selectedRoof, moduleTpCd: selectedModules.itemTp } })
|
||||
}
|
||||
}, [selectedRoof])
|
||||
|
||||
useEffect(() => {
|
||||
if (raftBaseList.length > 0) setSelectedRaftBase(raftBaseList.find((raft) => raft.clCode === trestleState?.raftBaseCd) ?? null)
|
||||
}, [raftBaseList])
|
||||
|
||||
useEffect(() => {
|
||||
if (trestleList.length > 0) setSelectedTrestle(trestleList.find((trestle) => trestle.trestleMkrCd === trestleState?.trestleMkrCd) ?? null)
|
||||
}, [trestleList])
|
||||
|
||||
useEffect(() => {
|
||||
if (roofBaseList.length > 0) setSelectedRoofBase(roofBaseList.find((roofBase) => roofBase.roofBaseCd === trestleState?.roofBaseCd) ?? null)
|
||||
}, [roofBaseList])
|
||||
|
||||
useEffect(() => {
|
||||
if (constMthdList.length > 0) setSelectedConstMthd(constMthdList.find((constMthd) => constMthd.constMthdCd === trestleState?.constMthdCd) ?? null)
|
||||
}, [constMthdList])
|
||||
|
||||
useEffect(() => {
|
||||
if (constructionList.length > 0) {
|
||||
setSelectedConstruction(constructionList.find((construction) => construction.constTp === trestleState?.constTp) ?? null)
|
||||
}
|
||||
}, [constructionList])
|
||||
|
||||
const getConstructionState = (index) => {
|
||||
if (constructionList && constructionList.length > 0) {
|
||||
if (constructionList[index].constPossYn === 'Y') {
|
||||
if (trestleState && trestleState.constTp === constructionList[index].constTp) {
|
||||
return 'blue'
|
||||
}
|
||||
return 'white'
|
||||
}
|
||||
return 'no-click'
|
||||
}
|
||||
return 'no-click'
|
||||
}
|
||||
|
||||
const onChangeRaftBase = (e) => {
|
||||
setSelectedRaftBase(e)
|
||||
dispatch({
|
||||
type: 'SET_RAFT_BASE',
|
||||
roof: {
|
||||
moduleTpCd: selectedModules.itemTp ?? '',
|
||||
roofMatlCd: selectedRoof?.roofMatlCd ?? '',
|
||||
raftBaseCd: e.clCode,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
const onChangeTrestleMaker = (e) => {
|
||||
setSelectedTrestle(e)
|
||||
dispatch({
|
||||
type: 'SET_TRESTLE_MAKER',
|
||||
roof: {
|
||||
moduleTpCd: selectedModules.itemTp ?? '',
|
||||
roofMatlCd: selectedRoof?.roofMatlCd ?? '',
|
||||
raftBaseCd: trestleState.raftBaseCd ?? '',
|
||||
trestleMkrCd: e.trestleMkrCd,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
const onChangeConstMthd = (e) => {
|
||||
setSelectedConstMthd(e)
|
||||
dispatch({
|
||||
type: 'SET_CONST_MTHD',
|
||||
roof: {
|
||||
moduleTpCd: selectedModules.itemTp ?? '',
|
||||
roofMatlCd: selectedRoof?.roofMatlCd ?? '',
|
||||
raftBaseCd: trestleState.raftBaseCd ?? '',
|
||||
trestleMkrCd: trestleState.trestleMkrCd,
|
||||
constMthdCd: e.constMthdCd,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
const onChangeRoofBase = (e) => {
|
||||
setSelectedRoofBase(e)
|
||||
dispatch({
|
||||
type: 'SET_ROOF_BASE',
|
||||
roof: {
|
||||
moduleTpCd: selectedModules.itemTp ?? '',
|
||||
roofMatlCd: selectedRoof?.roofMatlCd ?? '',
|
||||
raftBaseCd: trestleState.raftBaseCd ?? '',
|
||||
trestleMkrCd: trestleState.trestleMkrCd,
|
||||
constMthdCd: trestleState.constMthdCd,
|
||||
roofBaseCd: e.roofBaseCd,
|
||||
illuminationTp: managementState?.surfaceTypeValue ?? '',
|
||||
instHt: managementState?.installHeight ?? '',
|
||||
stdWindSpeed: managementState?.standardWindSpeedId ?? '',
|
||||
stdSnowLd: managementState?.verticalSnowCover ?? '',
|
||||
inclCd: selectedRoof?.pitch ?? 0,
|
||||
roofPitch: Math.round(selectedRoof?.roofPchBase ?? 0),
|
||||
},
|
||||
})
|
||||
}
|
||||
const handleChangeRoofMaterial = (index) => {
|
||||
const newAddedRoofs = roofs.map((roof, i) => {
|
||||
if (i === selectedRoof.index) {
|
||||
return {
|
||||
...selectedRoof,
|
||||
...trestleState,
|
||||
eavesMargin,
|
||||
ridgeMargin,
|
||||
kerabaMargin,
|
||||
cvrYn,
|
||||
snowGdPossYn,
|
||||
cvrChecked,
|
||||
snowGdChecked,
|
||||
}
|
||||
}
|
||||
return { ...roof }
|
||||
})
|
||||
setRoofs(newAddedRoofs)
|
||||
setSelectedRoof(newAddedRoofs[index])
|
||||
}
|
||||
|
||||
const handleConstruction = (index) => {
|
||||
if (constructionList[index]?.constPossYn === 'Y') {
|
||||
dispatch({
|
||||
type: 'SET_CONSTRUCTION',
|
||||
roof: {
|
||||
moduleTpCd: selectedModules.itemTp ?? '',
|
||||
roofMatlCd: selectedRoof?.roofMatlCd ?? '',
|
||||
raftBaseCd: trestleState.raftBaseCd ?? '',
|
||||
trestleMkrCd: trestleState.trestleMkrCd,
|
||||
constMthdCd: trestleState.constMthdCd,
|
||||
roofBaseCd: trestleState.roofBaseCd,
|
||||
illuminationTp: managementState?.surfaceTypeValue ?? '',
|
||||
instHt: managementState?.installHeight ?? '',
|
||||
stdWindSpeed: managementState?.standardWindSpeedId ?? '',
|
||||
stdSnowLd: +managementState?.verticalSnowCover ?? '',
|
||||
inclCd: selectedRoof?.pitch.toString() ?? 0,
|
||||
roofPitch: Math.round(selectedRoof?.roofPchBase ?? 0),
|
||||
constTp: constructionList[index].constTp,
|
||||
mixMatlNo: selectedModules.mixMatlNo,
|
||||
workingWidth: selectedRoof?.length.toString() ?? '',
|
||||
// snowGdPossYn: constructionList[index].snowGdPossYn,
|
||||
// cvrYn: constructionList[index].cvrYn,
|
||||
},
|
||||
})
|
||||
|
||||
setCvrYn(constructionList[index].cvrYn)
|
||||
setSnowGdPossYn(constructionList[index].snowGdPossYn)
|
||||
setCvrChecked(false)
|
||||
setSnowGdChecked(false)
|
||||
}
|
||||
}
|
||||
|
||||
const isComplete = () => {
|
||||
const newAddedRoofs = roofs.map((roof, i) => {
|
||||
if (i === selectedRoof?.index) {
|
||||
return {
|
||||
...selectedRoof,
|
||||
...trestleState,
|
||||
eavesMargin,
|
||||
ridgeMargin,
|
||||
kerabaMargin,
|
||||
cvrYn,
|
||||
snowGdPossYn,
|
||||
cvrChecked,
|
||||
snowGdChecked,
|
||||
trestleDetail,
|
||||
}
|
||||
}
|
||||
return { ...roof }
|
||||
})
|
||||
|
||||
let result = true
|
||||
newAddedRoofs.forEach((roof) => {
|
||||
if (roof.eavesMargin && roof.ridgeMargin && roof.kerabaMargin) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (!roof.trestleMkrCd) result = false
|
||||
if (!roof.constMthdCd) result = false
|
||||
if (!roof.roofBaseCd) result = false
|
||||
if (!roof.constTp) result = false
|
||||
|
||||
if (selectedRoof.lenAuth === 'C') {
|
||||
if (!trestleState?.lengthBase) result = false
|
||||
}
|
||||
if (['C', 'R'].includes(selectedRoof.raftAuth)) {
|
||||
if (!roof.raftBaseCd) result = false
|
||||
}
|
||||
|
||||
if (['C', 'R'].includes(selectedRoof.roofPchAuth)) {
|
||||
if (!roof.roofPchBase) result = false
|
||||
}
|
||||
})
|
||||
|
||||
console.log('newAddedRoofs', newAddedRoofs)
|
||||
|
||||
if (result) {
|
||||
setRoofs(newAddedRoofs)
|
||||
setModuleSelectionData({
|
||||
...moduleSelectionData,
|
||||
roofConstructions: newAddedRoofs.map((roof, index) => {
|
||||
return {
|
||||
addRoof: {
|
||||
...moduleSelectionData.roofConstructions[index]?.addRoof,
|
||||
...roof.addRoof,
|
||||
},
|
||||
trestle: {
|
||||
...roof.trestle,
|
||||
...moduleSelectionData.roofConstructions[index]?.trestle,
|
||||
},
|
||||
construction: {
|
||||
...roof.construction,
|
||||
...moduleSelectionData.roofConstructions[index]?.construction,
|
||||
},
|
||||
trestleDetail: {
|
||||
...roof.trestleDetail,
|
||||
},
|
||||
}
|
||||
}),
|
||||
})
|
||||
trestleTrigger({
|
||||
roofConstruction: newAddedRoofs.map((roof) => {
|
||||
return {
|
||||
roofIndex: roof.index,
|
||||
addRoof: {
|
||||
...roof,
|
||||
},
|
||||
trestle: {
|
||||
...selectedTrestle,
|
||||
raftBaseCd: roof.raftBaseCd,
|
||||
},
|
||||
construction: {
|
||||
...constructionList.find((construction) => trestleState.constTp === construction.constTp),
|
||||
roofIndex: roof.index,
|
||||
setupCover: roof.cvrYn === 'Y',
|
||||
setupSnowCover: roof.snowGdYn === 'Y',
|
||||
selectedIndex: roof.index,
|
||||
},
|
||||
}
|
||||
}),
|
||||
})
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
isComplete,
|
||||
}))
|
||||
|
||||
return (
|
||||
<div className="roof-module-tab2-overflow">
|
||||
<div className="module-table-box mb10">
|
||||
<div className="module-box-tab">
|
||||
{roofs &&
|
||||
roofs.map((roof, index) => (
|
||||
<button
|
||||
key={index}
|
||||
className={`module-btn ${selectedRoof?.index === index ? 'act' : ''}`}
|
||||
onClick={() => (roof ? handleChangeRoofMaterial(index) : null)}
|
||||
>
|
||||
{roof !== undefined ? `${roof.nameJp} (${currentAngleType === 'slope' ? roof.pitch : roof.angle}${pitchText})` : '-'}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<div className="module-table-inner">
|
||||
<div className="module-table-flex-wrap tab2">
|
||||
<div className="module-flex-item">
|
||||
<div className="eaves-keraba-table">
|
||||
{selectedRoof && selectedRoof.lenAuth === 'C' && (
|
||||
<>
|
||||
<div className="eaves-keraba-item">
|
||||
<div className="eaves-keraba-th">L</div>
|
||||
<div className="eaves-keraba-td">
|
||||
<div className="grid-select">
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
value={trestleState?.lengthBase}
|
||||
onChange={(e) => setLengthBase(e.target.value)}
|
||||
disabled={selectedRoof.lenAuth === 'R'}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
{selectedRoof && ['C', 'R'].includes(selectedRoof.raftAuth) && (
|
||||
<>
|
||||
<div className="eaves-keraba-item">
|
||||
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.rafter.margin')}</div>
|
||||
<div className="eaves-keraba-td">
|
||||
<div className="grid-select">
|
||||
{raftBaseList.length > 0 && (
|
||||
<QSelectBox
|
||||
options={raftBaseList}
|
||||
value={selectedRaftBase}
|
||||
sourceKey={'clCode'}
|
||||
targetKey={'clCode'}
|
||||
showKey={'clCodeNm'}
|
||||
disabled={selectedRoof.raftAuth === 'R'}
|
||||
onChange={(e) => onChangeRaftBase(e)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
{selectedRoof && ['C', 'R'].includes(selectedRoof.roofPchAuth) && (
|
||||
<>
|
||||
<div className="eaves-keraba-item">
|
||||
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.hajebichi')}</div>
|
||||
<div className="eaves-keraba-td">
|
||||
<div className="grid-select">
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
disabled={selectedRoof.roofPchAuth === 'R'}
|
||||
onChange={(e) => handleHajebichiAndLength(e, 'hajebichi')}
|
||||
value={hajebichi}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
<div className="eaves-keraba-item">
|
||||
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.trestle.maker')}</div>
|
||||
<div className="eaves-keraba-td">
|
||||
<div className="grid-select">
|
||||
{trestleList && (
|
||||
<QSelectBox
|
||||
title={getMessage('selectbox.title')}
|
||||
options={trestleList}
|
||||
value={selectedTrestle}
|
||||
sourceKey={'trestleMkrCd'}
|
||||
targetKey={'trestleMkrCd'}
|
||||
showKey={'trestleMkrCdJp'}
|
||||
onChange={(e) => onChangeTrestleMaker(e)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="eaves-keraba-item">
|
||||
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.construction.method')}</div>
|
||||
<div className="eaves-keraba-td">
|
||||
<div className="grid-select">
|
||||
{constMthdList && (
|
||||
<QSelectBox
|
||||
title={getMessage('selectbox.title')}
|
||||
options={constMthdList}
|
||||
value={selectedConstMthd}
|
||||
sourceKey={'constMthdCd'}
|
||||
targetKey={'constMthdCd'}
|
||||
showKey={'constMthdCdJp'}
|
||||
onChange={(e) => onChangeConstMthd(e)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="eaves-keraba-item">
|
||||
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.under.roof')}</div>
|
||||
<div className="eaves-keraba-td">
|
||||
<div className="grid-select">
|
||||
{roofBaseList && (
|
||||
<QSelectBox
|
||||
title={getMessage('selectbox.title')}
|
||||
options={roofBaseList}
|
||||
sourceKey={'roofBaseCd'}
|
||||
targetKey={'roofBaseCd'}
|
||||
showKey={'roofBaseCdJp'}
|
||||
value={selectedRoofBase}
|
||||
onChange={(e) => onChangeRoofBase(e)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="module-flex-item non-flex">
|
||||
<div className="flex-item-btn-wrap">
|
||||
<button className={`btn-frame roof ${getConstructionState(0)}`} onClick={() => handleConstruction(0)}>
|
||||
{getMessage('modal.module.basic.setting.module.standard.construction')}(I)
|
||||
</button>
|
||||
<button className={`btn-frame roof ${getConstructionState(3)}`} onClick={() => handleConstruction(3)}>
|
||||
{getMessage('modal.module.basic.setting.module.multiple.construction')}
|
||||
</button>
|
||||
<button className={`btn-frame roof ${getConstructionState(1)}`} onClick={() => handleConstruction(1)}>
|
||||
{getMessage('modal.module.basic.setting.module.standard.construction')}
|
||||
</button>
|
||||
<button className={`btn-frame roof ${getConstructionState(4)}`} onClick={() => handleConstruction(4)}>
|
||||
{getMessage('modal.module.basic.setting.module.multiple.construction')}(II)
|
||||
</button>
|
||||
<button className={`btn-frame roof ${getConstructionState(2)}`} onClick={() => handleConstruction(2)}>
|
||||
{getMessage('modal.module.basic.setting.module.enforce.construction')}
|
||||
</button>
|
||||
</div>
|
||||
<div className="grid-check-form-flex">
|
||||
<div className="d-check-box pop">
|
||||
<input
|
||||
type="checkbox"
|
||||
id={`ch01`}
|
||||
disabled={!cvrYn || cvrYn === 'N'}
|
||||
checked={cvrChecked || false}
|
||||
// onChange={() => dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, cvrChecked: !trestleState.cvrChecked } })}
|
||||
onChange={() => setCvrChecked(!cvrChecked)}
|
||||
/>
|
||||
<label htmlFor={`ch01`}>{getMessage('modal.module.basic.setting.module.eaves.bar.fitting')}</label>
|
||||
</div>
|
||||
<div className="d-check-box pop">
|
||||
<input
|
||||
type="checkbox"
|
||||
id={`ch02`}
|
||||
disabled={!trestleState?.snowGdPossYn || trestleState?.snowGdPossYn === 'N'}
|
||||
checked={snowGdChecked || false}
|
||||
// onChange={() => dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, snowGdChecked: !trestleState.snowGdChecked } })}
|
||||
onChange={() => setSnowGdChecked(!snowGdChecked)}
|
||||
/>
|
||||
<label htmlFor={`ch02`}>{getMessage('modal.module.basic.setting.module.blind.metal.fitting')}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="module-area mt10">
|
||||
<div className="module-area-title">{getMessage('modal.module.basic.setting.module.placement.area')}</div>
|
||||
<div className="outline-form mr15">
|
||||
<span>{getMessage('modal.module.basic.setting.module.placement.area.eaves')}</span>
|
||||
<div className="input-grid mr10">
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
value={eavesMargin ?? 0}
|
||||
// onChange={(e) => dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, eavesMargin: e.target.value } })}
|
||||
onChange={(e) => setEavesMargin(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<span className="thin">mm</span>
|
||||
</div>
|
||||
<div className="outline-form mr15">
|
||||
<span>{getMessage('modal.module.basic.setting.module.placement.area.ridge')}</span>
|
||||
<div className="input-grid mr10">
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
value={ridgeMargin ?? 0}
|
||||
// onChange={(e) => dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, ridgeMargin: e.target.value } })}
|
||||
onChange={(e) => setRidgeMargin(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<span className="thin">mm</span>
|
||||
</div>
|
||||
<div className="outline-form ">
|
||||
<span>{getMessage('modal.module.basic.setting.module.placement.area.keraba')}</span>
|
||||
<div className="input-grid mr10">
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
value={kerabaMargin ?? 0}
|
||||
// onChange={(e) => dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, kerabaMargin: e.target.value } })}
|
||||
onChange={(e) => setKerabaMargin(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<span className="thin">mm</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="module-bottom">
|
||||
<div className="module-table-box ">
|
||||
<div className="warning-guide">
|
||||
<div className="warning">
|
||||
{getMessage('modal.module.basic.setting.module.setting.info1')}
|
||||
<br />
|
||||
{getMessage('modal.module.basic.setting.module.setting.info2')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
|
||||
export default Trestle
|
||||
@ -100,7 +100,7 @@ export default function ObjectSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
]
|
||||
|
||||
return (
|
||||
<WithDraggable isShow={true} pos={pos} className="lrr" style={{ visibility: isHidden ? 'hidden' : 'visible' }}>
|
||||
<WithDraggable isShow={true} pos={pos} className="lrr" isHidden={isHidden}>
|
||||
<WithDraggable.Header title={getMessage('plan.menu.placement.surface.object')} onClose={() => closePopup(id)} />
|
||||
<WithDraggable.Body>
|
||||
<div className="modal-btn-wrap">
|
||||
|
||||
@ -46,7 +46,6 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
|
||||
const { setSurfaceShapePattern } = useRoofFn()
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const roofDisplay = useRecoilValue(roofDisplaySelector)
|
||||
const { saveCanvas } = usePlan()
|
||||
|
||||
const roofRef = {
|
||||
roofCd: useRef(null),
|
||||
@ -55,7 +54,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
|
||||
rafter: useRef(null),
|
||||
hajebichi: useRef(null),
|
||||
}
|
||||
|
||||
const { saveCanvas } = usePlan()
|
||||
/**
|
||||
* 치수 입력방법(복시도입력/실측값입력/육지붕)
|
||||
*/
|
||||
@ -263,8 +262,6 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
|
||||
<WithDraggable isShow={true} pos={pos} className="ll">
|
||||
<WithDraggable.Header title={getMessage('plan.menu.placement.surface.initial.setting')} />
|
||||
<WithDraggable.Body>
|
||||
<div className="left-bar modal-handle"></div>
|
||||
<div className="right-bar modal-handle"></div>
|
||||
<div className="placement-table">
|
||||
<table>
|
||||
<colgroup>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
'use client'
|
||||
|
||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'
|
||||
import useSWRMutation from 'swr/mutation'
|
||||
import { useAxios } from '../useAxios'
|
||||
import { unescapeString } from '@/util/common-utils'
|
||||
@ -10,6 +10,8 @@ import { canvasState, currentCanvasPlanState } from '@/store/canvasAtom'
|
||||
import { POLYGON_TYPE } from '@/common/common'
|
||||
import { useCircuitTrestle } from '../useCirCuitTrestle'
|
||||
import { useEffect } from 'react'
|
||||
import { addedRoofsState } from '@/store/settingAtom'
|
||||
import { roofsState } from '@/store/roofAtom'
|
||||
|
||||
/**
|
||||
* 캔버스 팝업 상태 관리
|
||||
@ -19,13 +21,14 @@ import { useEffect } from 'react'
|
||||
export function useCanvasPopupStatusController(param = 1) {
|
||||
const popupType = parseInt(param)
|
||||
|
||||
const [compasDeg, setCompasDeg] = useRecoilState(compasDegAtom)
|
||||
const [moduleSelectionDataStore, setModuleSelectionDataStore] = useRecoilState(moduleSelectionDataState)
|
||||
const [selectedModules, setSelectedModules] = useRecoilState(selectedModuleState)
|
||||
const setCompasDeg = useSetRecoilState(compasDegAtom)
|
||||
const setModuleSelectionDataStore = useSetRecoilState(moduleSelectionDataState)
|
||||
const setSelectedModules = useSetRecoilState(selectedModuleState)
|
||||
const { get, promiseGet, getFetcher, postFetcher } = useAxios()
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const currentCanvasPlan = useRecoilValue(currentCanvasPlanState)
|
||||
|
||||
const [addedRoofs, setAddedRoofs] = useRecoilState(addedRoofsState)
|
||||
const [roofs, setRoofs] = useRecoilState(roofsState)
|
||||
/**
|
||||
* 팝업 상태 조회
|
||||
* @param {number} popupTypeParam
|
||||
@ -53,19 +56,27 @@ export function useCanvasPopupStatusController(param = 1) {
|
||||
const handleModuleSelectionTotal = async () => {
|
||||
for (let i = 1; i < 3; i++) {
|
||||
const result = await getModuleSelection(i)
|
||||
console.log('🚀 ~ handleModuleSelectionTotal ~ result:', result)
|
||||
if (!result.objectNo) return
|
||||
if (i === 1) {
|
||||
setCompasDeg(result.popupStatus)
|
||||
if (result.popupStatus && unescapeString(result.popupStatus)) {
|
||||
const data = JSON.parse(unescapeString(result.popupStatus))
|
||||
|
||||
if (data?.compasDeg) setCompasDeg(data.compasDeg)
|
||||
if (data?.module) setSelectedModules(data.module)
|
||||
setModuleSelectionDataStore(data)
|
||||
}
|
||||
} else if (i === 2) {
|
||||
const data = JSON.parse(unescapeString(result.popupStatus))
|
||||
setModuleSelectionDataStore(data)
|
||||
const roofSurfaceList = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||
const modules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE)
|
||||
roofSurfaceList.forEach((surface) => {
|
||||
surface.modules = modules.filter((module) => module.surfaceId === surface.id)
|
||||
})
|
||||
if (data.module) setSelectedModules(data.module)
|
||||
if (data.roofConstruction) {
|
||||
setRoofs(data.roofConstruction)
|
||||
// setManagementState({ ...managementState, roofs: data.roofConstruction.map((roof) => roof.construction.managementState) })
|
||||
}
|
||||
// if (data?.module) setManagementState(data.common.managementState)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -80,7 +91,8 @@ export function useCanvasPopupStatusController(param = 1) {
|
||||
objectNo: currentCanvasPlan.objectNo,
|
||||
planNo: parseInt(currentCanvasPlan.planNo),
|
||||
popupType: popupType.toString(),
|
||||
popupStatus: popupType === 1 ? arg : JSON.stringify(arg).replace(/"/g, '\"'),
|
||||
// popupStatus: popupType === 1 ? arg : JSON.stringify(arg).replace(/"/g, '\"'),
|
||||
popupStatus: JSON.stringify(arg).replace(/"/g, '\"'),
|
||||
}
|
||||
postFetcher(`/api/v1/canvas-popup-status`, params)
|
||||
},
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -19,9 +19,9 @@ export function useModuleSelection(props) {
|
||||
const [moduleList, setModuleList] = useState([{}]) //모듈 목록
|
||||
|
||||
const [selectedSurfaceType, setSelectedSurfaceType] = useState({}) //선택된 면조도
|
||||
const [installHeight, setInstallHeight] = useState() //설치 높이
|
||||
const [standardWindSpeed, setStandardWindSpeed] = useState({}) //기준풍속
|
||||
const [verticalSnowCover, setVerticalSnowCover] = useState() //수직적설량
|
||||
const [installHeight, setInstallHeight] = useState(managementState?.installHeight) //설치 높이
|
||||
const [standardWindSpeed, setStandardWindSpeed] = useState() //기준풍속
|
||||
const [verticalSnowCover, setVerticalSnowCover] = useState(managementState?.verticalSnowCover) //수직적설량
|
||||
|
||||
const [selectedModules, setSelectedModules] = useRecoilState(selectedModuleState) //선택된 모듈
|
||||
const [moduleSelectionInitParams, setModuleSelectionInitParams] = useRecoilState(moduleSelectionInitParamsState) //모듈 기본 데이터 ex) 면조도, 높이등등
|
||||
@ -32,6 +32,7 @@ export function useModuleSelection(props) {
|
||||
const { restoreModuleInstArea } = useModuleBasicSetting()
|
||||
|
||||
const bindInitData = () => {
|
||||
console.log('bindInitData', managementState)
|
||||
setInstallHeight(managementState?.installHeight)
|
||||
setStandardWindSpeed(managementState?.standardWindSpeedId)
|
||||
setVerticalSnowCover(managementState?.verticalSnowCover)
|
||||
@ -184,14 +185,6 @@ export function useModuleSelection(props) {
|
||||
})
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
// console.log('installHeight', installHeight)
|
||||
}, [installHeight])
|
||||
|
||||
useEffect(() => {
|
||||
// console.log('verticalSnowCover', verticalSnowCover)
|
||||
}, [verticalSnowCover])
|
||||
|
||||
//TODO: 설치높이, 기준적설량 debounce 적용해서 추가해야됨
|
||||
|
||||
// useEffect(() => {
|
||||
@ -226,11 +219,17 @@ export function useModuleSelection(props) {
|
||||
roughnessCodes,
|
||||
windSpeedCodes,
|
||||
managementState,
|
||||
setManagementState,
|
||||
moduleList,
|
||||
setSelectedModules,
|
||||
selectedSurfaceType,
|
||||
setSelectedSurfaceType,
|
||||
installHeight,
|
||||
setInstallHeight,
|
||||
standardWindSpeed,
|
||||
setStandardWindSpeed,
|
||||
verticalSnowCover,
|
||||
setVerticalSnowCover,
|
||||
handleChangeModule,
|
||||
handleChangeSurfaceType,
|
||||
handleChangeWindSpeed,
|
||||
|
||||
244
src/hooks/module/useModuleTrestle.js
Normal file
244
src/hooks/module/useModuleTrestle.js
Normal file
@ -0,0 +1,244 @@
|
||||
import { use, useContext, useEffect, useReducer, useState } from 'react'
|
||||
import { useCommonCode } from '../common/useCommonCode'
|
||||
import { useMasterController } from '../common/useMasterController'
|
||||
import { selectedModuleState } from '@/store/selectedModuleOptions'
|
||||
import { useRecoilValue } from 'recoil'
|
||||
import { GlobalDataContext } from '@/app/GlobalDataProvider'
|
||||
|
||||
const RAFT_BASE_CODE = '203800'
|
||||
|
||||
const trestleReducer = (state, action) => {
|
||||
console.log('🚀 ~ trestleReducer ~ state:', state)
|
||||
console.log('🚀 ~ trestleReducer ~ action:', action)
|
||||
switch (action.type) {
|
||||
case 'SET_RAFT_BASE':
|
||||
case 'SET_TRESTLE_MAKER':
|
||||
case 'SET_CONST_MTHD':
|
||||
case 'SET_ROOF_BASE':
|
||||
case 'SET_CONSTRUCTION':
|
||||
case 'SET_TRESTLE_DETAIL':
|
||||
return {
|
||||
...action.roof,
|
||||
}
|
||||
case 'SET_INITIALIZE':
|
||||
console.log('SET_INITIALIZE')
|
||||
return {
|
||||
moduleTpCd: action.roof.moduleTpCd ?? '',
|
||||
roofMatlCd: action.roof.roofMatlCd ?? '',
|
||||
raftBaseCd: action.roof.raftBaseCd ?? null,
|
||||
trestleMkrCd: action.roof.trestleMkrCd ?? null,
|
||||
constMthdCd: action.roof.constMthdCd ?? null,
|
||||
constTp: action.roof.constTp ?? null,
|
||||
roofBaseCd: action.roof.roofBaseCd ?? null,
|
||||
workingWidth: action.roof.workingWidth ?? 0,
|
||||
lengthBase: action.roof.length ?? 0,
|
||||
illuminationTp: action.roof.illuminationTp ?? null,
|
||||
instHt: action.roof.instHt ?? null,
|
||||
stdWindSpeed: action.roof.stdWindSpeed ?? null,
|
||||
stdSnowLd: action.roof.stdSnowLd ?? null,
|
||||
inclCd: action.roof.inclCd ?? null,
|
||||
roofPitch: action.roof.roofPchBase ?? 0,
|
||||
eavesMargin: action.roof.eavesMargin ?? null,
|
||||
ridgeMargin: action.roof.ridgeMargin ?? null,
|
||||
kerabaMargin: action.roof.kerabaMargin ?? null,
|
||||
}
|
||||
default:
|
||||
return state
|
||||
}
|
||||
}
|
||||
|
||||
export function useModuleTrestle(props) {
|
||||
const { selectedRoof } = props
|
||||
const { findCommonCode } = useCommonCode()
|
||||
const [raftBaseList, setRaftBaseList] = useState([])
|
||||
const [trestleList, setTrestleList] = useState([])
|
||||
const [constMthdList, setConstMthdList] = useState([])
|
||||
const [roofBaseList, setRoofBaseList] = useState([])
|
||||
const [constructionList, setConstructionList] = useState([])
|
||||
const { getTrestleList, getConstructionList, getTrestleDetailList } = useMasterController()
|
||||
const [cvrYn, setCvrYn] = useState('N')
|
||||
const [cvrChecked, setCvrChecked] = useState(false)
|
||||
const [snowGdPossYn, setSnowGdPossYn] = useState('N')
|
||||
const [snowGdChecked, setSnowGdChecked] = useState(false)
|
||||
const [eavesMargin, setEavesMargin] = useState(0)
|
||||
const [ridgeMargin, setRidgeMargin] = useState(0)
|
||||
const [kerabaMargin, setKerabaMargin] = useState(0)
|
||||
const [trestleState, dispatch] = useReducer(trestleReducer, null)
|
||||
const [trestleDetail, setTrestleDetail] = useState(null)
|
||||
|
||||
useEffect(() => {
|
||||
const raftCodeList = findCommonCode(RAFT_BASE_CODE)
|
||||
|
||||
setRaftBaseList(raftCodeList)
|
||||
setTrestleList([])
|
||||
setConstMthdList([])
|
||||
setRoofBaseList([])
|
||||
setConstructionList([])
|
||||
setEavesMargin(selectedRoof?.eavesMargin ?? 0)
|
||||
setRidgeMargin(selectedRoof?.ridgeMargin ?? 0)
|
||||
setKerabaMargin(selectedRoof?.kerabaMargin ?? 0)
|
||||
setCvrYn(selectedRoof?.cvrYn ?? 'N')
|
||||
setCvrChecked(selectedRoof?.cvrChecked ?? false)
|
||||
setSnowGdPossYn(selectedRoof?.snowGdPossYn ?? 'N')
|
||||
setSnowGdChecked(selectedRoof?.snowGdChecked ?? false)
|
||||
}, [selectedRoof])
|
||||
|
||||
useEffect(() => {
|
||||
if (trestleState) {
|
||||
console.log('🚀 ~ useEffect ~ trestleState:', trestleState)
|
||||
handleSetTrestleList()
|
||||
if (!trestleState.trestleMkrCd) {
|
||||
setConstMthdList([])
|
||||
setRoofBaseList([])
|
||||
setConstructionList([])
|
||||
setTrestleDetail(null)
|
||||
return
|
||||
}
|
||||
|
||||
handleSetConstMthdList()
|
||||
if (!trestleState.constMthdCd) {
|
||||
setRoofBaseList([])
|
||||
setConstructionList([])
|
||||
setTrestleDetail(null)
|
||||
return
|
||||
}
|
||||
|
||||
handleSetRoofBaseList()
|
||||
if (!trestleState.roofBaseCd) {
|
||||
setConstructionList([])
|
||||
setTrestleDetail(null)
|
||||
return
|
||||
}
|
||||
|
||||
handleSetConstructionList()
|
||||
if (!trestleState.constTp) {
|
||||
setTrestleDetail(null)
|
||||
return
|
||||
}
|
||||
|
||||
if (!trestleState.eavesMargin) {
|
||||
handleSetTrestleDetailData()
|
||||
}
|
||||
}
|
||||
}, [trestleState])
|
||||
|
||||
const handleSetTrestleList = () => {
|
||||
getTrestleList({
|
||||
moduleTpCd: trestleState.moduleTpCd ?? '',
|
||||
roofMatlCd: trestleState.roofMatlCd ?? '',
|
||||
raftBaseCd: trestleState.raftBaseCd ?? '',
|
||||
}).then((res) => {
|
||||
if (res?.data) setTrestleList(res.data)
|
||||
})
|
||||
}
|
||||
|
||||
const handleSetConstMthdList = () => {
|
||||
getTrestleList({
|
||||
moduleTpCd: trestleState.moduleTpCd ?? '',
|
||||
roofMatlCd: trestleState.roofMatlCd ?? '',
|
||||
raftBaseCd: trestleState.raftBaseCd ?? '',
|
||||
trestleMkrCd: trestleState.trestleMkrCd ?? '',
|
||||
}).then((res) => {
|
||||
if (res?.data) setConstMthdList(res.data)
|
||||
})
|
||||
}
|
||||
|
||||
const handleSetRoofBaseList = () => {
|
||||
getTrestleList({
|
||||
moduleTpCd: trestleState.moduleTpCd ?? '',
|
||||
roofMatlCd: trestleState.roofMatlCd ?? '',
|
||||
raftBaseCd: trestleState.raftBaseCd ?? '',
|
||||
trestleMkrCd: trestleState.trestleMkrCd ?? '',
|
||||
constMthdCd: trestleState.constMthdCd ?? '',
|
||||
}).then((res) => {
|
||||
if (res?.data) setRoofBaseList(res.data)
|
||||
})
|
||||
}
|
||||
|
||||
const handleSetConstructionList = () => {
|
||||
getConstructionList({
|
||||
moduleTpCd: trestleState.moduleTpCd ?? '',
|
||||
roofMatlCd: trestleState.roofMatlCd ?? '',
|
||||
trestleMkrCd: trestleState.trestleMkrCd ?? '',
|
||||
constMthdCd: trestleState.constMthdCd ?? '',
|
||||
roofBaseCd: trestleState.roofBaseCd ?? '',
|
||||
illuminationTp: trestleState.illuminationTp ?? '',
|
||||
instHt: trestleState.instHt ?? '',
|
||||
stdWindSpeed: trestleState.stdWindSpeed ?? '',
|
||||
stdSnowLd: trestleState.stdSnowLd ?? '',
|
||||
inclCd: trestleState.inclCd ?? '',
|
||||
raftBaseCd: trestleState.raftBaseCd ?? '',
|
||||
roofPitch: trestleState.roofPitch ?? '',
|
||||
}).then((res) => {
|
||||
if (res?.data) setConstructionList(res.data)
|
||||
})
|
||||
}
|
||||
|
||||
const handleSetTrestleDetailData = () => {
|
||||
getTrestleDetailList([
|
||||
{
|
||||
moduleTpCd: trestleState.moduleTpCd ?? '',
|
||||
roofMatlCd: trestleState.roofMatlCd ?? '',
|
||||
trestleMkrCd: trestleState.trestleMkrCd ?? '',
|
||||
constMthdCd: trestleState.constMthdCd ?? '',
|
||||
roofBaseCd: trestleState.roofBaseCd ?? '',
|
||||
illuminationTp: trestleState.illuminationTp ?? '',
|
||||
instHt: trestleState.instHt ?? '',
|
||||
stdWindSpeed: trestleState.stdWindSpeed ?? '',
|
||||
stdSnowLd: trestleState.stdSnowLd ?? '',
|
||||
inclCd: trestleState.inclCd ?? '',
|
||||
constTp: trestleState.constTp ?? '',
|
||||
mixMatlNo: trestleState.mixMatlNo ?? '',
|
||||
roofPitch: trestleState.roofPitch ?? '',
|
||||
workingWidth: trestleState.workingWidth ?? '',
|
||||
},
|
||||
]).then((res) => {
|
||||
if (res.length > 0) {
|
||||
if (!res[0].data) return
|
||||
setEavesMargin(res[0].data.eaveIntvl)
|
||||
setRidgeMargin(res[0].data.ridgeIntvl)
|
||||
setKerabaMargin(res[0].data.kerabaIntvl)
|
||||
setTrestleDetail(res[0].data)
|
||||
// dispatch({
|
||||
// type: 'SET_TRESTLE_DETAIL',
|
||||
// roof: {
|
||||
// ...trestleState,
|
||||
// eavesMargin: res[0].data.eaveIntvl,
|
||||
// ridgeMargin: res[0].data.ridgeIntvl,
|
||||
// kerabaMargin: res[0].data.kerabaIntvl,
|
||||
// },
|
||||
// })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
trestleState,
|
||||
trestleDetail,
|
||||
dispatch,
|
||||
raftBaseList,
|
||||
trestleList,
|
||||
constMthdList,
|
||||
roofBaseList,
|
||||
constructionList,
|
||||
handleSetTrestleList,
|
||||
handleSetConstMthdList,
|
||||
handleSetRoofBaseList,
|
||||
handleSetConstructionList,
|
||||
handleSetTrestleDetailData,
|
||||
eavesMargin,
|
||||
ridgeMargin,
|
||||
kerabaMargin,
|
||||
setEavesMargin,
|
||||
setRidgeMargin,
|
||||
setKerabaMargin,
|
||||
cvrYn,
|
||||
cvrChecked,
|
||||
snowGdPossYn,
|
||||
snowGdChecked,
|
||||
setCvrYn,
|
||||
setCvrChecked,
|
||||
setSnowGdPossYn,
|
||||
setSnowGdChecked,
|
||||
}
|
||||
}
|
||||
@ -370,7 +370,20 @@ export const useTrestle = () => {
|
||||
rack.value.moduleTpCd === leftRowsInfo.moduleTotalTp &&
|
||||
rack.value.moduleRows === leftRowsInfo.rowsInfo.reduce((acc, row) => acc + row.count, 0)
|
||||
)
|
||||
} else {
|
||||
} else if (leftRowsInfo.rowsInfo.length >= 2) {
|
||||
//C1C2C3인 경우
|
||||
if (rack.value.moduleTpCd.length === 6) {
|
||||
// 변환 C1C2만 있는경우 C3 0개로 추가해준다.
|
||||
let newLeftRowsInfo = normalizeModules(rack.value.moduleTpCd, leftRowsInfo)
|
||||
|
||||
return (
|
||||
rack.value.moduleTpCd === newLeftRowsInfo.moduleTotalTp &&
|
||||
rack.value.moduleRows === newLeftRowsInfo.rowsInfo.reduce((acc, row) => acc + row.count, 0) &&
|
||||
Number(rack.value.moduleTpRows1) === newLeftRowsInfo.rowsInfo[0].count &&
|
||||
Number(rack.value.moduleTpRows2) === newLeftRowsInfo.rowsInfo[1].count &&
|
||||
Number(rack.value.moduleTpRows3) === newLeftRowsInfo.rowsInfo[2].count
|
||||
)
|
||||
}
|
||||
return (
|
||||
rack.value.moduleTpCd === leftRowsInfo.moduleTotalTp &&
|
||||
rack.value.moduleRows === leftRowsInfo.rowsInfo.reduce((acc, row) => acc + row.count, 0) &&
|
||||
@ -387,7 +400,19 @@ export const useTrestle = () => {
|
||||
rack.value.moduleTpCd === rightRowsInfo.moduleTotalTp &&
|
||||
rack.value.moduleRows === rightRowsInfo.rowsInfo.reduce((acc, row) => acc + row.count, 0)
|
||||
)
|
||||
} else {
|
||||
} else if (rightRowsInfo.rowsInfo.length === 2) {
|
||||
if (rack.value.moduleTpCd.length === 6) {
|
||||
// 변환 C1C2만 있는경우 C3 0개로 추가해준다.
|
||||
let newRightRowsInfo = normalizeModules(rack.value.moduleTpCd, rightRowsInfo)
|
||||
|
||||
return (
|
||||
rack.value.moduleTpCd === newRightRowsInfo.moduleTotalTp &&
|
||||
rack.value.moduleRows === newRightRowsInfo.rowsInfo.reduce((acc, row) => acc + row.count, 0) &&
|
||||
Number(rack.value.moduleTpRows1) === newRightRowsInfo.rowsInfo[0].count &&
|
||||
Number(rack.value.moduleTpRows2) === newRightRowsInfo.rowsInfo[1].count &&
|
||||
Number(rack.value.moduleTpRows3) === newRightRowsInfo.rowsInfo[2].count
|
||||
)
|
||||
}
|
||||
return (
|
||||
rack.value.moduleTpCd === rightRowsInfo.moduleTotalTp &&
|
||||
rack.value.moduleRows === rightRowsInfo.rowsInfo.reduce((acc, row) => acc + row.count, 0) &&
|
||||
@ -404,7 +429,19 @@ export const useTrestle = () => {
|
||||
rack.value.moduleTpCd === centerRowsInfo.moduleTotalTp &&
|
||||
rack.value.moduleRows === centerRowsInfo.rowsInfo.reduce((acc, row) => acc + row.count, 0)
|
||||
)
|
||||
} else {
|
||||
} else if (centerRowsInfo.rowsInfo.length === 2) {
|
||||
if (rack.value.moduleTpCd.length === 6) {
|
||||
// 변환 C1C2만 있는경우 C3 0개로 추가해준다.
|
||||
let newCenterRowsInfo = normalizeModules(rack.value.moduleTpCd, centerRowsInfo)
|
||||
|
||||
return (
|
||||
rack.value.moduleTpCd === newCenterRowsInfo.moduleTotalTp &&
|
||||
rack.value.moduleRows === newCenterRowsInfo.rowsInfo.reduce((acc, row) => acc + row.count, 0) &&
|
||||
Number(rack.value.moduleTpRows1) === newCenterRowsInfo.rowsInfo[0].count &&
|
||||
Number(rack.value.moduleTpRows2) === newCenterRowsInfo.rowsInfo[1].count &&
|
||||
Number(rack.value.moduleTpRows3) === newCenterRowsInfo.rowsInfo[2].count
|
||||
)
|
||||
}
|
||||
return (
|
||||
rack.value.moduleTpCd === centerRowsInfo.moduleTotalTp &&
|
||||
rack.value.moduleRows === centerRowsInfo.rowsInfo.reduce((acc, row) => acc + row.count, 0) &&
|
||||
@ -499,7 +536,19 @@ export const useTrestle = () => {
|
||||
rack.value.moduleTpCd === leftRowsInfo.moduleTotalTp &&
|
||||
rack.value.moduleRows === leftRowsInfo.rowsInfo.reduce((acc, row) => acc + row.count, 0)
|
||||
)
|
||||
} else {
|
||||
} else if (leftRowsInfo.rowsInfo.length === 2) {
|
||||
if (rack.value.moduleTpCd.length === 6) {
|
||||
// 변환 C1C2만 있는경우 C3 0개로 추가해준다.
|
||||
let newLeftRowsInfo = normalizeModules(rack.value.moduleTpCd, leftRowsInfo)
|
||||
|
||||
return (
|
||||
rack.value.moduleTpCd === newLeftRowsInfo.moduleTotalTp &&
|
||||
rack.value.moduleRows === newLeftRowsInfo.rowsInfo.reduce((acc, row) => acc + row.count, 0) &&
|
||||
Number(rack.value.moduleTpRows1) === newLeftRowsInfo.rowsInfo[0].count &&
|
||||
Number(rack.value.moduleTpRows2) === newLeftRowsInfo.rowsInfo[1].count &&
|
||||
Number(rack.value.moduleTpRows3) === newLeftRowsInfo.rowsInfo[2].count
|
||||
)
|
||||
}
|
||||
return (
|
||||
rack.value.moduleTpCd === leftRowsInfo.moduleTotalTp &&
|
||||
rack.value.moduleRows === leftRowsInfo.rowsInfo.reduce((acc, row) => acc + row.count, 0) &&
|
||||
@ -575,7 +624,19 @@ export const useTrestle = () => {
|
||||
rack.value.moduleTpCd === rightRowsInfo.moduleTotalTp &&
|
||||
rack.value.moduleRows === rightRowsInfo.rowsInfo.reduce((acc, row) => acc + row.count, 0)
|
||||
)
|
||||
} else {
|
||||
} else if (rightRowsInfo.rowsInfo.length === 2) {
|
||||
if (rack.value.moduleTpCd.length === 6) {
|
||||
// 변환 C1C2만 있는경우 C3 0개로 추가해준다.
|
||||
let newRightRowsInfo = normalizeModules(rack.value.moduleTpCd, rightRowsInfo)
|
||||
|
||||
return (
|
||||
rack.value.moduleTpCd === newRightRowsInfo.moduleTotalTp &&
|
||||
rack.value.moduleRows === newRightRowsInfo.rowsInfo.reduce((acc, row) => acc + row.count, 0) &&
|
||||
Number(rack.value.moduleTpRows1) === newRightRowsInfo.rowsInfo[0].count &&
|
||||
Number(rack.value.moduleTpRows2) === newRightRowsInfo.rowsInfo[1].count &&
|
||||
Number(rack.value.moduleTpRows3) === newRightRowsInfo.rowsInfo[2].count
|
||||
)
|
||||
}
|
||||
return (
|
||||
rack.value.moduleTpCd === rightRowsInfo.moduleTotalTp &&
|
||||
rack.value.moduleRows === rightRowsInfo.rowsInfo.reduce((acc, row) => acc + row.count, 0) &&
|
||||
@ -635,6 +696,31 @@ export const useTrestle = () => {
|
||||
return { moduleTotalTp, rowsInfo }
|
||||
}
|
||||
|
||||
function normalizeModules(rackTpCd, data) {
|
||||
// rackTpCd를 숫자를 기준으로 자른다.
|
||||
const allModules = rackTpCd.match(/[A-Za-z]+\d+/g) || [] // 모든 모듈 유형
|
||||
|
||||
// 현재 존재하는 모듈 유형을 추출
|
||||
const existingModules = data.rowsInfo.map((row) => row.moduleTpCd)
|
||||
|
||||
const result = { ...data, rowsInfo: [...data.rowsInfo] }
|
||||
|
||||
// 없는 모듈을 추가 (count: 0)
|
||||
allModules.forEach((module) => {
|
||||
if (!existingModules.includes(module)) {
|
||||
result.rowsInfo.push({ moduleTpCd: module, count: 0 })
|
||||
}
|
||||
})
|
||||
|
||||
// rowsInfo를 C1, C2, C3 순서로 정렬
|
||||
result.rowsInfo.sort((a, b) => allModules.indexOf(a.moduleTpCd) - allModules.indexOf(b.moduleTpCd))
|
||||
|
||||
// moduleTotalTp를 C1C2C3로 설정
|
||||
result.moduleTotalTp = allModules.join('')
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// itemList 조회 후 estimateParam에 저장
|
||||
const getEstimateData = async () => {
|
||||
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||
|
||||
@ -138,6 +138,7 @@
|
||||
"modal.module.basic.setting.pitch.module.column.amount": "列数",
|
||||
"modal.module.basic.setting.pitch.module.column.margin": "左右間隔",
|
||||
"modal.module.basic.setting.prev": "前に戻る",
|
||||
"modal.module.basic.setting.row.batch": "単数指定配置",
|
||||
"modal.module.basic.setting.passivity.placement": "手動配置",
|
||||
"modal.module.basic.setting.auto.placement": "自動配置",
|
||||
"plan.menu.module.circuit.setting.circuit.trestle.setting": "回路設定",
|
||||
@ -603,7 +604,6 @@
|
||||
"myinfo.message.password.error": "パスワードが間違っています。",
|
||||
"login": "ログイン",
|
||||
"login.auto.page.text": "自動ログイン中です。",
|
||||
"login.fail": "アカウントが存在しないか、パスワードが間違っています。",
|
||||
"login.id.save": "ID保存",
|
||||
"login.id.placeholder": "IDを入力してください。",
|
||||
"login.password.placeholder": "パスワードを入力してください。",
|
||||
@ -1046,6 +1046,7 @@
|
||||
"outerLine.property.fix": "外壁線の属性設定 を完了しますか?",
|
||||
"outerLine.property.close": "外壁線の属性設定 を終了しますか?",
|
||||
"want.to.complete.auxiliary.creation": "補助線の作成を完了しますか?",
|
||||
"module.layout.setup.has.zero.value": "モジュールの列、行を入力してください.",
|
||||
"modal.placement.initial.setting.plan.drawing.only.number": "(※数字は[半角]入力のみ可能です。)",
|
||||
"wall.line.not.found": "外壁がありません",
|
||||
"roof.line.not.found": "屋根形状がありません",
|
||||
@ -1053,5 +1054,11 @@
|
||||
"chidory.can.not.install": "千鳥配置できない工法です。",
|
||||
"module.layout.setup.max.count": "모듈의 최대 단수는 {0}, 최대 열수는 {1} 입니다. (JA)",
|
||||
"module.layout.setup.max.count.multiple": "모듈 {0}번의 최대 단수는 {1}, 최대 열수는 {2} 입니다. (JA)",
|
||||
"roofAllocation.not.found": "할당할 지붕이 없습니다. (JA)"
|
||||
"roofAllocation.not.found": "할당할 지붕이 없습니다. (JA)",
|
||||
"modal.module.basic.setting.module.placement.max.size.check": "지붕재별 모듈의 최대 단수. 혼합 최대 단수를 확인하십시오. (JA)",
|
||||
"modal.module.basic.setting.module.placement.max.row": "최대 단수 (JA)",
|
||||
"modal.module.basic.setting.module.placement.max.rows.multiple": "혼합 단수 (JA)",
|
||||
"modal.module.basic.setting.module.placement.mix.asg.yn.error": "혼합 설치 불가능한 모듈입니다. (JA)",
|
||||
"modal.module.basic.setting.module.placement.mix.asg.yn": "ミックス. (JA)",
|
||||
"modal.module.basic.setting.layoutpassivity.placement": "layout配置 (JA)"
|
||||
}
|
||||
|
||||
@ -1047,6 +1047,7 @@
|
||||
"outerLine.property.fix": "외벽선 속성 설정을 완료하시겠습니까?",
|
||||
"outerLine.property.close": "외벽선 속성 설정을 종료하시겠습니까?",
|
||||
"want.to.complete.auxiliary.creation": "보조선 작성을 완료하시겠습니까?",
|
||||
"module.layout.setup.has.zero.value": "모듈의 열, 행을 입력해 주세요.",
|
||||
"modal.placement.initial.setting.plan.drawing.only.number": "(※ 숫자는 [반각]입력만 가능합니다.)",
|
||||
"wall.line.not.found": "외벽선이 없습니다.",
|
||||
"roof.line.not.found": "지붕형상이 없습니다.",
|
||||
@ -1054,5 +1055,11 @@
|
||||
"chidory.can.not.install": "치조 불가 공법입니다.",
|
||||
"module.layout.setup.max.count": "모듈의 최대 단수는 {0}, 최대 열수는 {1} 입니다.",
|
||||
"module.layout.setup.max.count.multiple": "모듈 {0}번의 최대 단수는 {1}, 최대 열수는 {2} 입니다.",
|
||||
"roofAllocation.not.found": "할당할 지붕이 없습니다."
|
||||
"roofAllocation.not.found": "할당할 지붕이 없습니다.",
|
||||
"modal.module.basic.setting.module.placement.max.size.check": "지붕재별 모듈의 최대 단수. 혼합 최대 단수를 확인하십시오.",
|
||||
"modal.module.basic.setting.module.placement.max.row": "최대 단수",
|
||||
"modal.module.basic.setting.module.placement.max.rows.multiple": "혼합 단수",
|
||||
"modal.module.basic.setting.module.placement.mix.asg.yn.error": "혼합 설치 불가능한 모듈입니다.",
|
||||
"modal.module.basic.setting.module.placement.mix.asg.yn": "혼합",
|
||||
"modal.module.basic.setting.layoutpassivity.placement": "레이아웃 배치"
|
||||
}
|
||||
|
||||
@ -384,3 +384,27 @@ export const isManualModuleSetupState = atom({
|
||||
key: 'isManualModuleSetupState',
|
||||
default: false,
|
||||
})
|
||||
|
||||
export const isManualModuleLayoutSetupState = atom({
|
||||
key: 'isManualModuleLayoutSetupState',
|
||||
default: false,
|
||||
})
|
||||
|
||||
export const moduleSetupOptionState = atom({
|
||||
key: 'moduleSetupOptionState',
|
||||
default: {
|
||||
isChidori: false, //치조 안함
|
||||
setupLocation: 'eaves', //처마
|
||||
},
|
||||
})
|
||||
|
||||
export const toggleManualSetupModeState = atom({
|
||||
key: 'toggleManualSetupModeState',
|
||||
default: '',
|
||||
})
|
||||
|
||||
export const moduleRowColArrayState = atom({
|
||||
key: 'moduleRowColArrayState',
|
||||
default: [],
|
||||
dangerouslyAllowMutability: true,
|
||||
})
|
||||
|
||||
7
src/store/roofAtom.js
Normal file
7
src/store/roofAtom.js
Normal file
@ -0,0 +1,7 @@
|
||||
import { atom } from 'recoil'
|
||||
|
||||
export const roofsState = atom({
|
||||
key: 'roofs',
|
||||
default: null,
|
||||
dangerouslyAllowMutability: true,
|
||||
})
|
||||
@ -383,7 +383,7 @@ button{
|
||||
}
|
||||
}
|
||||
&::-webkit-scrollbar {
|
||||
width: 2px;
|
||||
width: 5px;
|
||||
background-color: transparent;
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user