데이터 유지 초기화 작업
This commit is contained in:
parent
81fb5ffcc1
commit
dfc67cb7dd
@ -38,7 +38,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
const [isClosePopup, setIsClosePopup] = useState({ close: false, id: 0 })
|
||||
|
||||
// const { initEvent } = useContext(EventContext)
|
||||
const { manualModuleSetup, autoModuleSetup, manualFlatroofModuleSetup, autoFlatroofModuleSetup } = useModuleBasicSetting(1)
|
||||
const { manualModuleSetup, autoModuleSetup, manualFlatroofModuleSetup, autoFlatroofModuleSetup } = useModuleBasicSetting(tabNum)
|
||||
const { updateObjectDate } = useMasterController()
|
||||
const handleBtnNextStep = () => {
|
||||
if (tabNum === 1) {
|
||||
|
||||
@ -58,8 +58,8 @@ export default function Module({ setTabNum }) {
|
||||
useEffect(() => {
|
||||
if (tempModuleSelectionData.roofConstructions.length > 0) {
|
||||
if (tempModuleSelectionData.common.moduleItemId && isObjectNotEmpty(tempModuleSelectionData.module)) {
|
||||
setModuleSelectionData(tempModuleSelectionData)
|
||||
//저장된 temp데이터가 지붕재(addedRoofs) 개수와 같으면 모듈 선택 저장
|
||||
setModuleSelectionData(tempModuleSelectionData)
|
||||
if (tempModuleSelectionData.roofConstructions.length === addedRoofs.length) {
|
||||
moduleSelectedDataTrigger(tempModuleSelectionData)
|
||||
}
|
||||
@ -83,7 +83,7 @@ export default function Module({ setTabNum }) {
|
||||
header: [
|
||||
{ name: getMessage('module'), width: 150, prop: 'module', type: 'color-box' },
|
||||
{
|
||||
name: `${getMessage('높이')} (mm)`,
|
||||
name: `${getMessage('height')} (mm)`,
|
||||
prop: 'height',
|
||||
},
|
||||
{ name: `${getMessage('width')} (mm)`, prop: 'width' },
|
||||
|
||||
@ -64,6 +64,9 @@ export function useModuleBasicSetting(tabNum) {
|
||||
if (canvasSetting.roofSizeSet !== '3') {
|
||||
const common = moduleSelectionData.common
|
||||
const roofConstructions = moduleSelectionData.roofConstructions
|
||||
|
||||
console.log('moduleSelectionData', moduleSelectionData)
|
||||
|
||||
const listParams = roofConstructions.map((item) => {
|
||||
return {
|
||||
...common,
|
||||
@ -78,6 +81,7 @@ export function useModuleBasicSetting(tabNum) {
|
||||
inclCd: String(item.addRoof.pitch),
|
||||
roofIndex: item.addRoof.index,
|
||||
workingWidth: item.addRoof.lenBase,
|
||||
raftBaseCd: item.trestle.raftBaseCd,
|
||||
}
|
||||
})
|
||||
setTrestleDetailParams(listParams)
|
||||
@ -142,6 +146,7 @@ export function useModuleBasicSetting(tabNum) {
|
||||
const makeModuleInstArea = (roof, trestleDetail) => {
|
||||
//지붕 객체 반환
|
||||
|
||||
if (tabNum == 3) {
|
||||
if (!roof) {
|
||||
return
|
||||
}
|
||||
@ -311,6 +316,7 @@ export function useModuleBasicSetting(tabNum) {
|
||||
canvas?.renderAll()
|
||||
setModuleSetupSurface([...selectedModuleInstSurfaceArray])
|
||||
}
|
||||
}
|
||||
|
||||
//모듈,회로에서 다른메뉴 -> 배치면으로 갈 경수 초기화
|
||||
const restoreModuleInstArea = () => {
|
||||
|
||||
@ -114,7 +114,9 @@ export function useModuleSelection(props) {
|
||||
}
|
||||
|
||||
//데이터가 있으면 모듈 자동 선택
|
||||
//1번 모듈 리스트 조회
|
||||
useEffect(() => {
|
||||
//모듈리스트의 데이터가 변경 되면 모듈 선택으로 이벤트
|
||||
if (moduleList.length > 0 && isObjectNotEmpty(moduleSelectionData.module)) {
|
||||
handleChangeModule(moduleSelectionData.module)
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
||||
const [roofBaseParams, setRoofBaseParams] = useState({}) //지붕밑바탕 관련 api호출 파라메터
|
||||
|
||||
const moduleSelectionInitParams = useRecoilValue(moduleSelectionInitParamsState) //모듈 기본 데이터 ex) 면조도, 높이등등
|
||||
const moduleSelectionInitOriginData = useRef(moduleSelectionInitParams)
|
||||
const moduleSelectionInitOriginData = useRef({})
|
||||
|
||||
const { getTrestleList, getConstructionList } = useMasterController()
|
||||
|
||||
@ -95,8 +95,6 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
||||
})
|
||||
setRaftCodes(raftCodeList)
|
||||
|
||||
console.log('addRoof', addRoof)
|
||||
|
||||
if (addRoof.raft) {
|
||||
setSelectedRaftBase({
|
||||
...selectedRaftBase,
|
||||
@ -155,6 +153,7 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
||||
useEffect(() => {
|
||||
//lengbase는 무조건 있다고 가정 하고 최초에 실행 방지
|
||||
if (selectedModules) {
|
||||
//여기서부터 시작
|
||||
//가대메이커 파라메터 만들기
|
||||
setTrestleParams({
|
||||
moduleTpCd: selectedModules.itemTp,
|
||||
@ -174,6 +173,7 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
||||
|
||||
//가대메이커 변경 함수
|
||||
const handleChangeTrestle = (option) => {
|
||||
option.raftBaseCd = selectedRaftBase.raftBaseCd
|
||||
setSelectedTrestle(option) //선택값 저장
|
||||
setConstructionParams({ ...trestleParams, trestleMkrCd: option.trestleMkrCd, constMthdCd: '', roofBaseCd: '' })
|
||||
}
|
||||
@ -266,7 +266,6 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
||||
//공법 선택시 이후 프로세스
|
||||
useEffect(() => {
|
||||
if (isObjectNotEmpty(selectedRoofBase) && isObjectNotEmpty(selectedConstruction)) {
|
||||
if (tabIndex === roofTab) {
|
||||
const common = { ...moduleSelectionInitParams }
|
||||
const module = { ...selectedModules }
|
||||
const newRoofConstructions = {
|
||||
@ -293,14 +292,11 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [selectedConstruction])
|
||||
|
||||
//거대메이커, 공법, 지붕밑바탕 api 조회
|
||||
const getModuleOptionsListData = async (params, type) => {
|
||||
const optionsList = await getTrestleList(params)
|
||||
console.log('optionsList', optionsList)
|
||||
|
||||
if (optionsList.data.length > 0) {
|
||||
if (type === 'trestle') {
|
||||
//가대 메이커일때
|
||||
@ -340,6 +336,10 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
||||
resetSelected()
|
||||
}
|
||||
}
|
||||
|
||||
if (moduleSelectionInitParams.moduleItemId && moduleSelectionInitParams.moduleTpCd) {
|
||||
moduleSelectionInitOriginData.current = moduleSelectionInitParams
|
||||
}
|
||||
}, [moduleSelectionInitParams])
|
||||
|
||||
const handleHajebichiAndLength = (e, type) => {
|
||||
|
||||
@ -26,7 +26,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
||||
|
||||
useEffect(() => {
|
||||
if (canvas) {
|
||||
dbClickEvent()
|
||||
// dbClickEvent()
|
||||
}
|
||||
|
||||
return () => {
|
||||
|
||||
@ -85,6 +85,10 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
|
||||
canvas?.remove(...canvas?.getObjects().filter((obj) => obj.name === MENU.BATCH_CANVAS.SURFACE_SHAPE_BATCH_TEMP))
|
||||
points = getSurfaceShape(surfaceId, pointer, { length1, length2, length3, length4, length5 })
|
||||
|
||||
console.log('surfaceRefs.xInversion', surfaceRefs.xInversion)
|
||||
console.log('surfaceRefs.yInversion', surfaceRefs.yInversion)
|
||||
console.log('surfaceRefs.rotate', surfaceRefs.rotate)
|
||||
|
||||
const options = {
|
||||
fill: 'transparent',
|
||||
stroke: 'black',
|
||||
@ -100,7 +104,7 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
|
||||
name: MENU.BATCH_CANVAS.SURFACE_SHAPE_BATCH_TEMP,
|
||||
flipX: surfaceRefs.yInversion,
|
||||
flipY: surfaceRefs.xInversion,
|
||||
angle: surfaceRefs.rotate,
|
||||
angle: Math.abs(surfaceRefs.rotate),
|
||||
originX: 'center',
|
||||
originY: 'center',
|
||||
pitch: globalPitch,
|
||||
|
||||
@ -858,6 +858,7 @@
|
||||
"surface.shape.validate.size.1to2": "①길이는 ②보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.1to3": "①길이는 ③보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.1to23": "①길이는 ②+③보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.1to23low": "②+③길이는 ①보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.2to3": "②길이는 ③보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.3to2": "③길이는 ②보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.3to4": "③길이는 ④보다 큰 값을 넣어주세요.",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user