Merge branch 'dev' into dev-yj
This commit is contained in:
commit
c6c8a2d5b8
@ -222,7 +222,7 @@ export default function CanvasMenu(props) {
|
||||
}
|
||||
await reloadCanvasStatus(objectNo, pid)
|
||||
break
|
||||
case 4:
|
||||
case 'module':
|
||||
if (selectedMenu < menu.index) {
|
||||
if (!checkMenuAndCanvasState()) {
|
||||
swalFire({ text: getMessage('menu.validation.canvas.roof') })
|
||||
@ -236,7 +236,7 @@ export default function CanvasMenu(props) {
|
||||
}
|
||||
await reloadCanvasStatus(objectNo, pid)
|
||||
break
|
||||
case 5:
|
||||
case 'estimate':
|
||||
setIsGlobalLoading(true)
|
||||
promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.planNo}/detail` }).then((res) => {
|
||||
if (res.status === 200) {
|
||||
@ -246,7 +246,7 @@ export default function CanvasMenu(props) {
|
||||
setCurrentMenu(menu.title)
|
||||
setFloorPlanObjectNo({ floorPlanObjectNo: objectNo })
|
||||
setIsGlobalLoading(false)
|
||||
router.push(`/floor-plan/estimate/${menu.type}?pid=${selectedPlan.planNo}&objectNo=${objectNo}`)
|
||||
router.push(`/floor-plan/estimate/5?pid=${selectedPlan.planNo}&objectNo=${objectNo}`)
|
||||
if (pathname === '/floor-plan/estimate/5') {
|
||||
setIsGlobalLoading(false)
|
||||
}
|
||||
@ -257,7 +257,7 @@ export default function CanvasMenu(props) {
|
||||
}
|
||||
})
|
||||
break
|
||||
case 6:
|
||||
case 'simulation':
|
||||
setIsGlobalLoading(true)
|
||||
promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.planNo}/detail` }).then((res) => {
|
||||
if (res.status === 200) {
|
||||
@ -265,7 +265,7 @@ export default function CanvasMenu(props) {
|
||||
if (estimateDetail.estimateDate !== null && estimateDetail.docNo) {
|
||||
setSelectedMenu(menu.type)
|
||||
setCurrentMenu(menu.title)
|
||||
router.push(`/floor-plan/simulator/${menu.index}?pid=${selectedPlan.planNo}&objectNo=${objectNo}`)
|
||||
router.push(`/floor-plan/simulator/6?pid=${selectedPlan.planNo}&objectNo=${objectNo}`)
|
||||
if (pathname === '/floor-plan/simulator/6') {
|
||||
setIsGlobalLoading(false)
|
||||
}
|
||||
@ -283,7 +283,6 @@ export default function CanvasMenu(props) {
|
||||
setCurrentMenu(menu.title)
|
||||
}
|
||||
if (pathname !== '/floor-plan') {
|
||||
// if (menu.index !== 0 ) {
|
||||
//견적서 or 발전시뮬레이션 탭에서 같은 탭 클릭시 화면 이동했다 돌아오지않도록..
|
||||
if (menu.type !== 'drawing' && menu.type !== 'estimate' && menu.type !== 'simulation') {
|
||||
router.push(`/floor-plan?pid=${pid}&objectNo=${objectNo}`)
|
||||
@ -308,6 +307,7 @@ export default function CanvasMenu(props) {
|
||||
const settingsModalOptions = useRecoilState(settingModalFirstOptionsState)
|
||||
|
||||
useEffect(() => {
|
||||
console.log(selectedMenu)
|
||||
if (selectedMenu === 'placement') {
|
||||
onClickPlacementInitialMenu()
|
||||
}
|
||||
@ -316,8 +316,9 @@ export default function CanvasMenu(props) {
|
||||
if (moduleSurfacesArray.length > 0) {
|
||||
initRoofs()
|
||||
moduleSurfacesArray.forEach((moduleSurface) => {
|
||||
moduleSurface.modules = []
|
||||
canvas.remove(...moduleSurface.modules)
|
||||
canvas.remove(moduleSurface)
|
||||
moduleSurface.modules = []
|
||||
})
|
||||
canvas.renderAll()
|
||||
}
|
||||
@ -423,7 +424,7 @@ export default function CanvasMenu(props) {
|
||||
|
||||
const checkMenuState = (menu) => {
|
||||
return (
|
||||
(['2', '3'].includes(canvasSetting?.roofSizeSet) && menu.type === 'surface') ||
|
||||
(['2', '3'].includes(canvasSetting?.roofSizeSet) && menu.type === 'outline') ||
|
||||
(selectedMenu === 'module' && ['drawing', 'placement'].includes(menu.type))
|
||||
)
|
||||
}
|
||||
@ -543,7 +544,7 @@ export default function CanvasMenu(props) {
|
||||
key={`canvas-menu-${menu.type}`}
|
||||
className={`canvas-menu-item ${selectedMenu === menu.type ? 'active' : ''}`}
|
||||
onClick={async () => {
|
||||
if (['2', '3'].includes(canvasSetting?.roofSizeSet) && menu.type === 'surface') return
|
||||
if (['2', '3'].includes(canvasSetting?.roofSizeSet) && menu.type === 'outline') return
|
||||
if (selectedMenu === 'module' && ['drawing', 'placement'].includes(menu.type)) return
|
||||
await onClickNav(menu)
|
||||
}}
|
||||
|
||||
@ -456,6 +456,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
|
||||
<button
|
||||
className={`${+currentRoof.roofSizeSet !== 3 && currentRoof?.layout === ROOF_MATERIAL_LAYOUT.PARALLEL && 'act'}`}
|
||||
value={ROOF_MATERIAL_LAYOUT.PARALLEL}
|
||||
disabled={currentRoof?.roofSizeSet === '3'}
|
||||
onClick={() => handleRoofLayoutChange(ROOF_MATERIAL_LAYOUT.PARALLEL)}
|
||||
>
|
||||
{getMessage('modal.roof.alloc.select.parallel')}
|
||||
@ -463,6 +464,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
|
||||
</button>
|
||||
<button
|
||||
className={`${+currentRoof.roofSizeSet !== 3 && currentRoof.layout === ROOF_MATERIAL_LAYOUT.STAIRS && 'act'}`}
|
||||
disabled={currentRoof?.roofSizeSet === '3'}
|
||||
value={ROOF_MATERIAL_LAYOUT.STAIRS}
|
||||
onClick={() => handleRoofLayoutChange(ROOF_MATERIAL_LAYOUT.STAIRS)}
|
||||
>
|
||||
|
||||
@ -52,7 +52,9 @@ const defaultDotLineGridSetting = {
|
||||
LINE: false,
|
||||
}
|
||||
|
||||
export function useCanvasSetting() {
|
||||
// hook 추가 시 executeEffect를 인자로 받고 false일 경우 useEffect를 실행하지 않는다. default true
|
||||
// 아래 hook에 추가 된 함수만 사용하고 싶을 경우 false로 인자 전달
|
||||
export function useCanvasSetting(executeEffect = true) {
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
/** canvas가 null이 아닐 때에만 getObjects 호출 */
|
||||
const canvasObjects = canvas ? canvas.getObjects() : []
|
||||
@ -138,6 +140,9 @@ export function useCanvasSetting() {
|
||||
const { closePopup, closeAll } = usePopup() // 팝업 닫기
|
||||
|
||||
useEffect(() => {
|
||||
if (!executeEffect) {
|
||||
return
|
||||
}
|
||||
const tempFetchRoofMaterials = !fetchRoofMaterials
|
||||
|
||||
/** 초 1회만 실행하도록 처리 */
|
||||
@ -175,6 +180,9 @@ export function useCanvasSetting() {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!executeEffect) {
|
||||
return
|
||||
}
|
||||
if (addedRoofs.length > 0 && addedRoofs[0].planNo === basicSetting.planNo) {
|
||||
const raftCodeList = findCommonCode('203800')
|
||||
setRaftCodes(raftCodeList)
|
||||
@ -188,6 +196,9 @@ export function useCanvasSetting() {
|
||||
}, [addedRoofs])
|
||||
|
||||
useEffect(() => {
|
||||
if (!executeEffect) {
|
||||
return
|
||||
}
|
||||
const selectedRoofMaterial = roofMaterials[0]
|
||||
|
||||
if (addedRoofs.length === 0) {
|
||||
@ -202,6 +213,9 @@ export function useCanvasSetting() {
|
||||
if (!canvas) {
|
||||
return
|
||||
}
|
||||
if (!executeEffect) {
|
||||
return
|
||||
}
|
||||
const { column } = corridorDimension
|
||||
const lengthTexts = canvas.getObjects().filter((obj) => obj.name === 'lengthText')
|
||||
|
||||
@ -230,6 +244,9 @@ export function useCanvasSetting() {
|
||||
}, [corridorDimension])
|
||||
|
||||
useEffect(() => {
|
||||
if (!executeEffect) {
|
||||
return
|
||||
}
|
||||
if (settingsDataSave !== undefined) onClickOption2()
|
||||
}, [settingsData])
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ import { placementShapeDrawingPointsState } from '@/store/placementShapeDrawingA
|
||||
import { getBackGroundImage } from '@/lib/imageActions'
|
||||
import PlacementSurfaceLineProperty from '@/components/floor-plan/modal/placementShape/PlacementSurfaceLineProperty'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { useCanvasSetting } from '@/hooks/option/useCanvasSetting'
|
||||
|
||||
export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
|
||||
const { getMessage } = useMessage()
|
||||
@ -40,6 +41,7 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
|
||||
const { addPopup, closePopup } = usePopup()
|
||||
const { setSurfaceShapePattern } = useRoofFn()
|
||||
const currentCanvasPlan = useRecoilValue(currentCanvasPlanState)
|
||||
const { fetchSettings } = useCanvasSetting(false)
|
||||
|
||||
const applySurfaceShape = (surfaceRefs, selectedType, id) => {
|
||||
let length1, length2, length3, length4, length5
|
||||
@ -762,6 +764,7 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
|
||||
|
||||
resetOuterLinePoints()
|
||||
resetPlacementShapeDrawingPoints()
|
||||
fetchSettings()
|
||||
swalFire({ text: getMessage('plan.message.delete') })
|
||||
},
|
||||
// denyFn: () => {
|
||||
|
||||
@ -14,7 +14,7 @@ export const selectedMenuState = atom({
|
||||
export const menusState = atom({
|
||||
key: 'menusState',
|
||||
default: [
|
||||
{ type: 'drawing', name: 'plan.menu.plan.drawing', icon: 'con00', title: MENU.PLAN_DRAWING }, //. 도면 작성
|
||||
{ type: 'drawing', name: 'plan.menu.plan.drawing', icon: 'con00', title: MENU.PLAN_DRAWING }, //. 물건정보
|
||||
{
|
||||
type: 'placement', // 배치면 초기설정
|
||||
name: 'plan.menu.placement.surface.initial.setting',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user