Merge branch 'dev' into dev-yj
This commit is contained in:
commit
01d3b1b037
@ -116,6 +116,15 @@ export const POLYGON_TYPE = {
|
||||
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 = [
|
||||
'selectable',
|
||||
'name',
|
||||
|
||||
@ -67,7 +67,7 @@ export default function CanvasFrame() {
|
||||
useEffect(() => {
|
||||
loadCanvas()
|
||||
resetRecoilData()
|
||||
Object.keys(currentCanvasPlan).length > 0 && handleModuleSelectionTotal()
|
||||
Object.keys(currentCanvasPlan).length > 0 && canvas && handleModuleSelectionTotal()
|
||||
|
||||
/* 플랜번호가 있으면 베이직세팅 팝업 데이터 로드 */
|
||||
if (currentCanvasPlan.planNo) {
|
||||
|
||||
@ -410,7 +410,7 @@ export default function CanvasMenu(props) {
|
||||
(['2', '3'].includes(canvasSetting?.roofSizeSet) && menu.type === 'outline') ||
|
||||
(selectedMenu === 'module' && ['drawing', 'placement'].includes(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))
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -1625,17 +1625,6 @@ export default function StuffDetail() {
|
||||
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) => {
|
||||
if (managementState?.createSaleStoreId === 'T01') {
|
||||
@ -1653,7 +1642,13 @@ export default function StuffDetail() {
|
||||
pid: planNo,
|
||||
objectNo: objectNo,
|
||||
}
|
||||
setSelectedMenu(null)
|
||||
// 견적서 생성 여부에 따라 selectedMenu 셋팅
|
||||
if (params?.data?.estimateDate) {
|
||||
setSelectedMenu('module')
|
||||
} else {
|
||||
setSelectedMenu('surface')
|
||||
}
|
||||
|
||||
const url = `/floor-plan?${queryStringFormatter(param)}`
|
||||
router.push(url)
|
||||
}
|
||||
@ -1946,7 +1941,6 @@ export default function StuffDetail() {
|
||||
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
||||
<Select
|
||||
id="long-value-select2"
|
||||
// components={{ NoOptionsMessage }}
|
||||
instanceId="long-value-select2"
|
||||
className="react-select-custom"
|
||||
classNamePrefix="custom"
|
||||
|
||||
@ -55,7 +55,20 @@ export default function StuffSubHeader({ type }) {
|
||||
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)}`
|
||||
|
||||
router.push(url)
|
||||
|
||||
@ -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>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRecoilValue } from 'recoil'
|
||||
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 { getDegreeByChon } from '@/util/canvas-util'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
@ -147,7 +147,7 @@ export const useTrestle = () => {
|
||||
if (!bottomPoints) return
|
||||
const eaveBar = new fabric.Line([bottomPoints[0].x, bottomPoints[0].y, bottomPoints[1].x, bottomPoints[1].y], {
|
||||
parent: surface,
|
||||
name: 'eaveBar',
|
||||
name: TRESTLE_MATERIAL.EAVE_BAR,
|
||||
stroke: 'blue',
|
||||
strokeWidth: 4,
|
||||
selectable: false,
|
||||
@ -178,7 +178,7 @@ export const useTrestle = () => {
|
||||
if (!bottomPoints) return
|
||||
const halfEaveBar = new fabric.Line(barPoints, {
|
||||
parent: surface,
|
||||
name: 'halfEaveBar',
|
||||
name: TRESTLE_MATERIAL.HALF_EAVE_BAR,
|
||||
stroke: 'blue',
|
||||
strokeWidth: 4,
|
||||
selectable: false,
|
||||
@ -208,7 +208,7 @@ export const useTrestle = () => {
|
||||
if (!bottomPoints) return
|
||||
const halfEaveBar = new fabric.Line(barPoints, {
|
||||
parent: surface,
|
||||
name: 'halfEaveBar',
|
||||
name: TRESTLE_MATERIAL.HALF_EAVE_BAR,
|
||||
stroke: 'blue',
|
||||
strokeWidth: 4,
|
||||
selectable: false,
|
||||
@ -1086,7 +1086,7 @@ export const useTrestle = () => {
|
||||
rackLength = getTrestleLength(setRackTpLen, degree) / 10
|
||||
if (setRackTpCd === 'RACK') {
|
||||
const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY - rackLength], {
|
||||
name: 'smartRack',
|
||||
name: TRESTLE_MATERIAL.SMART_RACK,
|
||||
stroke: 'red',
|
||||
strokeWidth: 4,
|
||||
selectable: true,
|
||||
@ -1117,7 +1117,7 @@ export const useTrestle = () => {
|
||||
})
|
||||
} else {
|
||||
const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY - rackLength], {
|
||||
name: 'rack',
|
||||
name: TRESTLE_MATERIAL.RACK,
|
||||
stroke: 'red',
|
||||
strokeWidth: 4,
|
||||
selectable: false,
|
||||
@ -1159,7 +1159,7 @@ export const useTrestle = () => {
|
||||
rackLength = getTrestleLength(setRackTpLen, degree) / 10
|
||||
if (setRackTpCd === 'RACK') {
|
||||
const rack = new fabric.Line([startPointX, startPointY, startPointX - rackLength, startPointY], {
|
||||
name: 'smartRack',
|
||||
name: TRESTLE_MATERIAL.SMART_RACK,
|
||||
stroke: 'red',
|
||||
strokeWidth: 4,
|
||||
selectable: false,
|
||||
@ -1190,7 +1190,7 @@ export const useTrestle = () => {
|
||||
})
|
||||
} else {
|
||||
const rack = new fabric.Line([startPointX, startPointY, startPointX - rackLength, startPointY], {
|
||||
name: 'rack',
|
||||
name: TRESTLE_MATERIAL.RACK,
|
||||
stroke: 'red',
|
||||
shadow: {
|
||||
color: 'black', // Outline color
|
||||
@ -1231,7 +1231,7 @@ export const useTrestle = () => {
|
||||
rackLength = getTrestleLength(setRackTpLen, degree) / 10
|
||||
if (setRackTpCd === 'RACK') {
|
||||
const rack = new fabric.Line([startPointX, startPointY, startPointX + rackLength, startPointY], {
|
||||
name: 'smartRack',
|
||||
name: TRESTLE_MATERIAL.SMART_RACK,
|
||||
stroke: 'red',
|
||||
strokeWidth: 4,
|
||||
selectable: false,
|
||||
@ -1262,7 +1262,7 @@ export const useTrestle = () => {
|
||||
})
|
||||
} else {
|
||||
const rack = new fabric.Line([startPointX, startPointY, startPointX + rackLength, startPointY], {
|
||||
name: 'rack',
|
||||
name: TRESTLE_MATERIAL.RACK,
|
||||
stroke: 'red',
|
||||
shadow: {
|
||||
color: 'black', // Outline color
|
||||
@ -1301,7 +1301,7 @@ export const useTrestle = () => {
|
||||
rackLength = getTrestleLength(setRackTpLen, degree) / 10
|
||||
if (setRackTpCd === 'RACK') {
|
||||
const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY + rackLength], {
|
||||
name: 'smartRack',
|
||||
name: TRESTLE_MATERIAL.SMART_RACK,
|
||||
stroke: 'red',
|
||||
strokeWidth: 4,
|
||||
selectable: false,
|
||||
@ -1332,7 +1332,7 @@ export const useTrestle = () => {
|
||||
})
|
||||
} else {
|
||||
const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY + rackLength], {
|
||||
name: 'rack',
|
||||
name: TRESTLE_MATERIAL.RACK,
|
||||
stroke: 'red',
|
||||
shadow: {
|
||||
color: 'black', // Outline color
|
||||
@ -1394,7 +1394,7 @@ export const useTrestle = () => {
|
||||
left: x2 - bracketLength / 3,
|
||||
top: len,
|
||||
fill: 'green',
|
||||
name: 'bracket',
|
||||
name: TRESTLE_MATERIAL.BRACKET,
|
||||
parentId: rack.parentId,
|
||||
visible: isTrestleDisplay,
|
||||
surfaceId: surface.id,
|
||||
@ -1416,7 +1416,7 @@ export const useTrestle = () => {
|
||||
left: len,
|
||||
top: y2 - bracketLength / 3,
|
||||
fill: 'green',
|
||||
name: 'bracket',
|
||||
name: TRESTLE_MATERIAL.BRACKET,
|
||||
parentId: rack.parentId,
|
||||
visible: isTrestleDisplay,
|
||||
surfaceId: surface.id,
|
||||
@ -1441,7 +1441,7 @@ export const useTrestle = () => {
|
||||
parentId: rack.parentId,
|
||||
visible: isTrestleDisplay,
|
||||
surfaceId: surface.id,
|
||||
name: 'bracket',
|
||||
name: TRESTLE_MATERIAL.BRACKET,
|
||||
width: bracketLength,
|
||||
height: bracketLength,
|
||||
selectable: false,
|
||||
@ -1459,7 +1459,7 @@ export const useTrestle = () => {
|
||||
left: x2 - bracketLength / 3,
|
||||
top: len,
|
||||
fill: 'green',
|
||||
name: 'bracket',
|
||||
name: TRESTLE_MATERIAL.BRACKET,
|
||||
parentId: rack.parentId,
|
||||
visible: isTrestleDisplay,
|
||||
surfaceId: surface.id,
|
||||
@ -1645,7 +1645,7 @@ export const useTrestle = () => {
|
||||
left: startPointX - 5,
|
||||
top: startPointY - 5,
|
||||
fill: 'green',
|
||||
name: 'bracket',
|
||||
name: TRESTLE_MATERIAL.BRACKET,
|
||||
parentId: module.id,
|
||||
surfaceId: module.surfaceId,
|
||||
width: 10,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user