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