Merge branch 'dev' into dev-yj

This commit is contained in:
yjnoh 2025-02-27 13:46:45 +09:00
commit 01d3b1b037
7 changed files with 49 additions and 148 deletions

View File

@ -116,6 +116,15 @@ export const POLYGON_TYPE = {
OBJECT_SURFACE: 'objectOffset', OBJECT_SURFACE: 'objectOffset',
} }
// 가대 관련 상수
export const TRESTLE_MATERIAL = {
EAVE_BAR: 'eaveBar',
HALF_EAVE_BAR: 'halfEaveBar',
RACK: 'rack',
SMART_RACK: 'smartRack',
BRACKET: 'bracket',
}
export const SAVE_KEY = [ export const SAVE_KEY = [
'selectable', 'selectable',
'name', 'name',

View File

@ -67,7 +67,7 @@ export default function CanvasFrame() {
useEffect(() => { useEffect(() => {
loadCanvas() loadCanvas()
resetRecoilData() resetRecoilData()
Object.keys(currentCanvasPlan).length > 0 && handleModuleSelectionTotal() Object.keys(currentCanvasPlan).length > 0 && canvas && handleModuleSelectionTotal()
/* 플랜번호가 있으면 베이직세팅 팝업 데이터 로드 */ /* 플랜번호가 있으면 베이직세팅 팝업 데이터 로드 */
if (currentCanvasPlan.planNo) { if (currentCanvasPlan.planNo) {

View File

@ -410,7 +410,7 @@ export default function CanvasMenu(props) {
(['2', '3'].includes(canvasSetting?.roofSizeSet) && menu.type === 'outline') || (['2', '3'].includes(canvasSetting?.roofSizeSet) && menu.type === 'outline') ||
(selectedMenu === 'module' && ['drawing', 'placement'].includes(menu.type)) || (selectedMenu === 'module' && ['drawing', 'placement'].includes(menu.type)) ||
(isExistModule() && ['placement', 'outline'].some((num) => num === menu.type)) || (isExistModule() && ['placement', 'outline'].some((num) => num === menu.type)) ||
(['estimate', 'simulation'].includes(selectedMenu) && ['drawing', 'placement', 'outline', 'surface'].includes(menu.type)) (['estimate', 'simulation'].includes(selectedMenu) && ['placement', 'outline', 'surface'].includes(menu.type))
) )
} }

View File

@ -1625,17 +1625,6 @@ export default function StuffDetail() {
input.value = input.value.replace(/[^0-9]/g, '') input.value = input.value.replace(/[^0-9]/g, '')
} }
// ..
const NoOptionsMessage = (props) => {
return (
<components.NoOptionsMessage {...props}>
<span style={{ background: 'red' }} className="custom-css-class">
TEXTTTTTTT
</span>
</components.NoOptionsMessage>
)
}
// //
const getCellDoubleClicked = (params) => { const getCellDoubleClicked = (params) => {
if (managementState?.createSaleStoreId === 'T01') { if (managementState?.createSaleStoreId === 'T01') {
@ -1653,7 +1642,13 @@ export default function StuffDetail() {
pid: planNo, pid: planNo,
objectNo: objectNo, objectNo: objectNo,
} }
setSelectedMenu(null) // selectedMenu
if (params?.data?.estimateDate) {
setSelectedMenu('module')
} else {
setSelectedMenu('surface')
}
const url = `/floor-plan?${queryStringFormatter(param)}` const url = `/floor-plan?${queryStringFormatter(param)}`
router.push(url) router.push(url)
} }
@ -1946,7 +1941,6 @@ export default function StuffDetail() {
<div className="select-wrap mr5" style={{ width: '567px' }}> <div className="select-wrap mr5" style={{ width: '567px' }}>
<Select <Select
id="long-value-select2" id="long-value-select2"
// components={{ NoOptionsMessage }}
instanceId="long-value-select2" instanceId="long-value-select2"
className="react-select-custom" className="react-select-custom"
classNamePrefix="custom" classNamePrefix="custom"

View File

@ -55,7 +55,20 @@ export default function StuffSubHeader({ type }) {
objectNo: objectNo, objectNo: objectNo,
} }
setSelectedMenu(null) /**
* 도면작성은 플랜1번의 도면작성화면으로 이동하기 때문에
* 1.물건작성하고 바로 -> planList 생성전. surface
* 2.물건이 여러건있을때 1 플랜의 estimateDate 여부로 selectedMenu 셋팅
*/
if (managementState?.planList.length === 0) {
setSelectedMenu('surface')
} else {
if (managementState?.planList[0].estimateDate) {
setSelectedMenu('module')
} else {
setSelectedMenu('surface')
}
}
const url = `/floor-plan?${queryStringFormatter(param)}` const url = `/floor-plan?${queryStringFormatter(param)}`
router.push(url) router.push(url)

View File

@ -1,115 +0,0 @@
import { Card, CardBody, Input, Tab, Tabs } from '@nextui-org/react'
import { useEffect, useReducer } from 'react'
const reducer = (prevState, nextState) => {
return { ...prevState, ...nextState }
}
const defaultData = {
commonData: 'common',
tabs: [
{
id: 1,
name: 'tab1',
range: 10,
maker: 'maker1',
law: 'law1',
basis: 'basis1',
},
{
id: 2,
name: 'tab2',
range: 20,
maker: 'maker2',
law: 'law2',
basis: 'basis2',
},
{
id: 3,
name: 'tab3',
range: 30,
maker: 'maker3',
law: 'law3',
basis: 'basis3',
},
{
id: 4,
name: 'tab4',
range: 40,
maker: 'maker4',
law: 'law4',
basis: 'basis4',
},
],
}
export default function SampleReducer() {
const [sampleState, setSampleState] = useReducer(reducer, defaultData)
const handleChangeTabsData = (newTab) => {
const newTabs = sampleState.tabs.map((t) => {
if (t.id === newTab.id) {
return newTab
} else {
return t
}
})
setSampleState({ tabs: newTabs })
}
useEffect(() => {
console.log('🚀 ~ SampleReducer ~ sampleState:', sampleState)
}, [sampleState])
return (
<>
<div>공통: {sampleState.commonData}</div>
<div className="flex w-full flex-col">
<Tabs aria-label="Options">
{sampleState.tabs.map((s) => (
<Tab key={s.id} title={s.name}>
<Card>
<CardBody>
<div className="flex w-full flex-wrap md:flex-nowrap gap-4">
<Input
label="range"
type="text"
value={s.range}
onChange={(e) => {
handleChangeTabsData({ ...s, range: e.target.value })
}}
/>
<Input
label="maker"
type="text"
value={s.maker}
onChange={(e) => {
handleChangeTabsData({ ...s, maker: e.target.value })
}}
/>
<Input
label="law"
type="text"
value={s.law}
onChange={(e) => {
handleChangeTabsData({ ...s, law: e.target.value })
}}
/>
<Input
label="basis"
type="text"
value={s.basis}
onChange={(e) => {
handleChangeTabsData({ ...s, basis: e.target.value })
}}
/>
</div>
</CardBody>
</Card>
</Tab>
))}
</Tabs>
</div>
</>
)
}

View File

@ -1,6 +1,6 @@
import { useRecoilValue } from 'recoil' import { useRecoilValue } from 'recoil'
import { canvasState, currentAngleTypeSelector } from '@/store/canvasAtom' import { canvasState, currentAngleTypeSelector } from '@/store/canvasAtom'
import { POLYGON_TYPE } from '@/common/common' import { POLYGON_TYPE, TRESTLE_MATERIAL } from '@/common/common'
import { moduleSelectionDataState } from '@/store/selectedModuleOptions' import { moduleSelectionDataState } from '@/store/selectedModuleOptions'
import { getDegreeByChon } from '@/util/canvas-util' import { getDegreeByChon } from '@/util/canvas-util'
import { v4 as uuidv4 } from 'uuid' import { v4 as uuidv4 } from 'uuid'
@ -147,7 +147,7 @@ export const useTrestle = () => {
if (!bottomPoints) return if (!bottomPoints) return
const eaveBar = new fabric.Line([bottomPoints[0].x, bottomPoints[0].y, bottomPoints[1].x, bottomPoints[1].y], { const eaveBar = new fabric.Line([bottomPoints[0].x, bottomPoints[0].y, bottomPoints[1].x, bottomPoints[1].y], {
parent: surface, parent: surface,
name: 'eaveBar', name: TRESTLE_MATERIAL.EAVE_BAR,
stroke: 'blue', stroke: 'blue',
strokeWidth: 4, strokeWidth: 4,
selectable: false, selectable: false,
@ -178,7 +178,7 @@ export const useTrestle = () => {
if (!bottomPoints) return if (!bottomPoints) return
const halfEaveBar = new fabric.Line(barPoints, { const halfEaveBar = new fabric.Line(barPoints, {
parent: surface, parent: surface,
name: 'halfEaveBar', name: TRESTLE_MATERIAL.HALF_EAVE_BAR,
stroke: 'blue', stroke: 'blue',
strokeWidth: 4, strokeWidth: 4,
selectable: false, selectable: false,
@ -208,7 +208,7 @@ export const useTrestle = () => {
if (!bottomPoints) return if (!bottomPoints) return
const halfEaveBar = new fabric.Line(barPoints, { const halfEaveBar = new fabric.Line(barPoints, {
parent: surface, parent: surface,
name: 'halfEaveBar', name: TRESTLE_MATERIAL.HALF_EAVE_BAR,
stroke: 'blue', stroke: 'blue',
strokeWidth: 4, strokeWidth: 4,
selectable: false, selectable: false,
@ -1086,7 +1086,7 @@ export const useTrestle = () => {
rackLength = getTrestleLength(setRackTpLen, degree) / 10 rackLength = getTrestleLength(setRackTpLen, degree) / 10
if (setRackTpCd === 'RACK') { if (setRackTpCd === 'RACK') {
const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY - rackLength], { const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY - rackLength], {
name: 'smartRack', name: TRESTLE_MATERIAL.SMART_RACK,
stroke: 'red', stroke: 'red',
strokeWidth: 4, strokeWidth: 4,
selectable: true, selectable: true,
@ -1117,7 +1117,7 @@ export const useTrestle = () => {
}) })
} else { } else {
const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY - rackLength], { const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY - rackLength], {
name: 'rack', name: TRESTLE_MATERIAL.RACK,
stroke: 'red', stroke: 'red',
strokeWidth: 4, strokeWidth: 4,
selectable: false, selectable: false,
@ -1159,7 +1159,7 @@ export const useTrestle = () => {
rackLength = getTrestleLength(setRackTpLen, degree) / 10 rackLength = getTrestleLength(setRackTpLen, degree) / 10
if (setRackTpCd === 'RACK') { if (setRackTpCd === 'RACK') {
const rack = new fabric.Line([startPointX, startPointY, startPointX - rackLength, startPointY], { const rack = new fabric.Line([startPointX, startPointY, startPointX - rackLength, startPointY], {
name: 'smartRack', name: TRESTLE_MATERIAL.SMART_RACK,
stroke: 'red', stroke: 'red',
strokeWidth: 4, strokeWidth: 4,
selectable: false, selectable: false,
@ -1190,7 +1190,7 @@ export const useTrestle = () => {
}) })
} else { } else {
const rack = new fabric.Line([startPointX, startPointY, startPointX - rackLength, startPointY], { const rack = new fabric.Line([startPointX, startPointY, startPointX - rackLength, startPointY], {
name: 'rack', name: TRESTLE_MATERIAL.RACK,
stroke: 'red', stroke: 'red',
shadow: { shadow: {
color: 'black', // Outline color color: 'black', // Outline color
@ -1231,7 +1231,7 @@ export const useTrestle = () => {
rackLength = getTrestleLength(setRackTpLen, degree) / 10 rackLength = getTrestleLength(setRackTpLen, degree) / 10
if (setRackTpCd === 'RACK') { if (setRackTpCd === 'RACK') {
const rack = new fabric.Line([startPointX, startPointY, startPointX + rackLength, startPointY], { const rack = new fabric.Line([startPointX, startPointY, startPointX + rackLength, startPointY], {
name: 'smartRack', name: TRESTLE_MATERIAL.SMART_RACK,
stroke: 'red', stroke: 'red',
strokeWidth: 4, strokeWidth: 4,
selectable: false, selectable: false,
@ -1262,7 +1262,7 @@ export const useTrestle = () => {
}) })
} else { } else {
const rack = new fabric.Line([startPointX, startPointY, startPointX + rackLength, startPointY], { const rack = new fabric.Line([startPointX, startPointY, startPointX + rackLength, startPointY], {
name: 'rack', name: TRESTLE_MATERIAL.RACK,
stroke: 'red', stroke: 'red',
shadow: { shadow: {
color: 'black', // Outline color color: 'black', // Outline color
@ -1301,7 +1301,7 @@ export const useTrestle = () => {
rackLength = getTrestleLength(setRackTpLen, degree) / 10 rackLength = getTrestleLength(setRackTpLen, degree) / 10
if (setRackTpCd === 'RACK') { if (setRackTpCd === 'RACK') {
const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY + rackLength], { const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY + rackLength], {
name: 'smartRack', name: TRESTLE_MATERIAL.SMART_RACK,
stroke: 'red', stroke: 'red',
strokeWidth: 4, strokeWidth: 4,
selectable: false, selectable: false,
@ -1332,7 +1332,7 @@ export const useTrestle = () => {
}) })
} else { } else {
const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY + rackLength], { const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY + rackLength], {
name: 'rack', name: TRESTLE_MATERIAL.RACK,
stroke: 'red', stroke: 'red',
shadow: { shadow: {
color: 'black', // Outline color color: 'black', // Outline color
@ -1394,7 +1394,7 @@ export const useTrestle = () => {
left: x2 - bracketLength / 3, left: x2 - bracketLength / 3,
top: len, top: len,
fill: 'green', fill: 'green',
name: 'bracket', name: TRESTLE_MATERIAL.BRACKET,
parentId: rack.parentId, parentId: rack.parentId,
visible: isTrestleDisplay, visible: isTrestleDisplay,
surfaceId: surface.id, surfaceId: surface.id,
@ -1416,7 +1416,7 @@ export const useTrestle = () => {
left: len, left: len,
top: y2 - bracketLength / 3, top: y2 - bracketLength / 3,
fill: 'green', fill: 'green',
name: 'bracket', name: TRESTLE_MATERIAL.BRACKET,
parentId: rack.parentId, parentId: rack.parentId,
visible: isTrestleDisplay, visible: isTrestleDisplay,
surfaceId: surface.id, surfaceId: surface.id,
@ -1441,7 +1441,7 @@ export const useTrestle = () => {
parentId: rack.parentId, parentId: rack.parentId,
visible: isTrestleDisplay, visible: isTrestleDisplay,
surfaceId: surface.id, surfaceId: surface.id,
name: 'bracket', name: TRESTLE_MATERIAL.BRACKET,
width: bracketLength, width: bracketLength,
height: bracketLength, height: bracketLength,
selectable: false, selectable: false,
@ -1459,7 +1459,7 @@ export const useTrestle = () => {
left: x2 - bracketLength / 3, left: x2 - bracketLength / 3,
top: len, top: len,
fill: 'green', fill: 'green',
name: 'bracket', name: TRESTLE_MATERIAL.BRACKET,
parentId: rack.parentId, parentId: rack.parentId,
visible: isTrestleDisplay, visible: isTrestleDisplay,
surfaceId: surface.id, surfaceId: surface.id,
@ -1645,7 +1645,7 @@ export const useTrestle = () => {
left: startPointX - 5, left: startPointX - 5,
top: startPointY - 5, top: startPointY - 5,
fill: 'green', fill: 'green',
name: 'bracket', name: TRESTLE_MATERIAL.BRACKET,
parentId: module.id, parentId: module.id,
surfaceId: module.surfaceId, surfaceId: module.surfaceId,
width: 10, width: 10,