Merge branch 'dev' into dev-yj
This commit is contained in:
commit
62fdd091c6
16
src/app/GlobalDataProvider.js
Normal file
16
src/app/GlobalDataProvider.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import { createContext, useState } from 'react'
|
||||||
|
|
||||||
|
export const GlobalDataContext = createContext({
|
||||||
|
managementState: {},
|
||||||
|
setManagementState: () => {},
|
||||||
|
})
|
||||||
|
|
||||||
|
const GlobalDataProvider = ({ children }) => {
|
||||||
|
const [managementState, setManagementState] = useState({})
|
||||||
|
|
||||||
|
return <GlobalDataContext.Provider value={{ managementState, setManagementState }}>{children}</GlobalDataContext.Provider>
|
||||||
|
}
|
||||||
|
|
||||||
|
export default GlobalDataProvider
|
||||||
@ -4,10 +4,11 @@ import { getSession } from '@/lib/authActions'
|
|||||||
import RecoilRootWrapper from './RecoilWrapper'
|
import RecoilRootWrapper from './RecoilWrapper'
|
||||||
|
|
||||||
import { QcastProvider } from './QcastProvider'
|
import { QcastProvider } from './QcastProvider'
|
||||||
|
import SessionProvider from './SessionProvider'
|
||||||
|
import GlobalDataProvider from './GlobalDataProvider'
|
||||||
import Header from '@/components/header/Header'
|
import Header from '@/components/header/Header'
|
||||||
import QModal from '@/components/common/modal/QModal'
|
import QModal from '@/components/common/modal/QModal'
|
||||||
import Dimmed from '@/components/ui/Dimmed'
|
import Dimmed from '@/components/ui/Dimmed'
|
||||||
import SessionProvider from './SessionProvider'
|
|
||||||
import PopupManager from '@/components/common/popupManager/PopupManager'
|
import PopupManager from '@/components/common/popupManager/PopupManager'
|
||||||
|
|
||||||
import './globals.css'
|
import './globals.css'
|
||||||
@ -60,26 +61,28 @@ export default async function RootLayout({ children }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<RecoilRootWrapper>
|
<RecoilRootWrapper>
|
||||||
<html lang="en">
|
<GlobalDataProvider>
|
||||||
<body>
|
<html lang="en">
|
||||||
{headerPathname === '/login' || headerPathname === '/join' ? (
|
<body>
|
||||||
<QcastProvider>{children}</QcastProvider>
|
{headerPathname === '/login' || headerPathname === '/join' ? (
|
||||||
) : (
|
<QcastProvider>{children}</QcastProvider>
|
||||||
<QcastProvider>
|
) : (
|
||||||
<div className="wrap">
|
<QcastProvider>
|
||||||
<Header userSession={sessionProps} />
|
<div className="wrap">
|
||||||
<div className="content">
|
<Header userSession={sessionProps} />
|
||||||
<Dimmed />
|
<div className="content">
|
||||||
<SessionProvider useSession={sessionProps}>{children}</SessionProvider>
|
<Dimmed />
|
||||||
|
<SessionProvider useSession={sessionProps}>{children}</SessionProvider>
|
||||||
|
</div>
|
||||||
|
<Footer />
|
||||||
</div>
|
</div>
|
||||||
<Footer />
|
</QcastProvider>
|
||||||
</div>
|
)}
|
||||||
</QcastProvider>
|
<QModal />
|
||||||
)}
|
<PopupManager />
|
||||||
<QModal />
|
</body>
|
||||||
<PopupManager />
|
</html>
|
||||||
</body>
|
</GlobalDataProvider>
|
||||||
</html>
|
|
||||||
</RecoilRootWrapper>
|
</RecoilRootWrapper>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,20 +1,18 @@
|
|||||||
'ues client'
|
'ues client'
|
||||||
|
|
||||||
import { createContext, useEffect, useState } from 'react'
|
import { createContext } from 'react'
|
||||||
|
|
||||||
export const ManagementContext = createContext({
|
export const ManagementContext = createContext({})
|
||||||
managementState: {},
|
|
||||||
setManagementState: () => {},
|
|
||||||
})
|
|
||||||
|
|
||||||
const ManagementProvider = ({ children }) => {
|
const ManagementProvider = ({ children }) => {
|
||||||
const [managementState, setManagementState] = useState({})
|
// const [managementState, setManagementState] = useState({})
|
||||||
|
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
console.log('🚀 ~ managementState:', managementState)
|
// console.log('🚀 ~ managementState:', managementState)
|
||||||
}, [managementState])
|
// }, [managementState])
|
||||||
|
|
||||||
return <ManagementContext.Provider value={{ managementState, setManagementState }}>{children}</ManagementContext.Provider>
|
// return <ManagementContext.Provider value={{ managementState, setManagementState }}>{children}</ManagementContext.Provider>
|
||||||
|
return <ManagementContext.Provider>{children}</ManagementContext.Provider>
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ManagementProvider
|
export default ManagementProvider
|
||||||
|
|||||||
@ -35,10 +35,6 @@ export const QLine = fabric.util.createClass(fabric.Line, {
|
|||||||
|
|
||||||
this.startPoint = { x: this.x1, y: this.y1 }
|
this.startPoint = { x: this.x1, y: this.y1 }
|
||||||
this.endPoint = { x: this.x2, y: this.y2 }
|
this.endPoint = { x: this.x2, y: this.y2 }
|
||||||
|
|
||||||
if (canvas) {
|
|
||||||
this.canvas = canvas
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
init: function () {
|
init: function () {
|
||||||
|
|||||||
@ -238,11 +238,12 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
<div className="placement-option">
|
<div className="placement-option">
|
||||||
<div className="grid-select no-flx" style={{ width: '171px' }}>
|
<div className="grid-select no-flx" style={{ width: '171px' }}>
|
||||||
<QSelectBox
|
<QSelectBox
|
||||||
|
title={basicSetting.roofSizeSet === '3' ? getMessage('modal.placement.initial.setting.size.none.pitch') : ''}
|
||||||
ref={roofRef.roofCd}
|
ref={roofRef.roofCd}
|
||||||
options={roofMaterials.map((roof, index) => {
|
options={roofMaterials.map((roof, index) => {
|
||||||
return { ...roof, name: globalLocale === 'ko' ? roof.roofMatlNm : roof.roofMatlNmJp }
|
return { ...roof, name: globalLocale === 'ko' ? roof.roofMatlNm : roof.roofMatlNmJp }
|
||||||
})}
|
})}
|
||||||
value={currentRoofMaterial}
|
value={basicSetting.roofSizeSet === '3' ? null : currentRoofMaterial}
|
||||||
onChange={(e) => handleRoofTypeChange(e.roofMatlCd)}
|
onChange={(e) => handleRoofTypeChange(e.roofMatlCd)}
|
||||||
sourceKey="id"
|
sourceKey="id"
|
||||||
targetKey="id"
|
targetKey="id"
|
||||||
|
|||||||
@ -18,7 +18,8 @@ import WindSelectPop from './popup/WindSelectPop'
|
|||||||
import { useCommonCode } from '@/hooks/common/useCommonCode'
|
import { useCommonCode } from '@/hooks/common/useCommonCode'
|
||||||
import StuffPlanQGrid from './StuffPlanQGrid'
|
import StuffPlanQGrid from './StuffPlanQGrid'
|
||||||
import { floorPlanObjectState } from '@/store/floorPlanObjectAtom'
|
import { floorPlanObjectState } from '@/store/floorPlanObjectAtom'
|
||||||
import { ManagementContext } from '@/app/management/ManagementProvider'
|
import { GlobalDataContext } from '@/app/GlobalDataProvider'
|
||||||
|
// import { ManagementContext } from '@/app/management/ManagementProvider'
|
||||||
import DocDownOptionPop from '../estimate/popup/DocDownOptionPop'
|
import DocDownOptionPop from '../estimate/popup/DocDownOptionPop'
|
||||||
import { stuffSearchState } from '@/store/stuffAtom'
|
import { stuffSearchState } from '@/store/stuffAtom'
|
||||||
import { QcastContext } from '@/app/QcastProvider'
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
@ -106,7 +107,7 @@ export default function StuffDetail() {
|
|||||||
const objectNo = searchParams.get('objectNo') //url에서 물건번호 꺼내서 바로 set
|
const objectNo = searchParams.get('objectNo') //url에서 물건번호 꺼내서 바로 set
|
||||||
|
|
||||||
const [editMode, setEditMode] = useState('NEW')
|
const [editMode, setEditMode] = useState('NEW')
|
||||||
const { managementState, setManagementState } = useContext(ManagementContext)
|
const { managementState, setManagementState } = useContext(GlobalDataContext)
|
||||||
const [planGridProps, setPlanGridProps] = useState({
|
const [planGridProps, setPlanGridProps] = useState({
|
||||||
planGridData: [],
|
planGridData: [],
|
||||||
isPageable: false,
|
isPageable: false,
|
||||||
|
|||||||
@ -3,11 +3,12 @@
|
|||||||
import { useContext } from 'react'
|
import { useContext } from 'react'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { ManagementContext } from '@/app/management/ManagementProvider'
|
import { GlobalDataContext } from '@/app/GlobalDataProvider'
|
||||||
|
// import { ManagementContext } from '@/app/management/ManagementProvider'
|
||||||
export default function StuffHeader() {
|
export default function StuffHeader() {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
|
|
||||||
const { managementState } = useContext(ManagementContext)
|
const { managementState } = useContext(GlobalDataContext)
|
||||||
|
|
||||||
//물건번호 복사
|
//물건번호 복사
|
||||||
const copyObjectNo = async (objectNo) => {
|
const copyObjectNo = async (objectNo) => {
|
||||||
|
|||||||
@ -13,7 +13,8 @@ import { useMessage } from '@/hooks/useMessage'
|
|||||||
import { floorPlanObjectState } from '@/store/floorPlanObjectAtom'
|
import { floorPlanObjectState } from '@/store/floorPlanObjectAtom'
|
||||||
import { isObjectNotEmpty, queryStringFormatter } from '@/util/common-utils'
|
import { isObjectNotEmpty, queryStringFormatter } from '@/util/common-utils'
|
||||||
|
|
||||||
import { ManagementContext } from '@/app/management/ManagementProvider'
|
import { GlobalDataContext } from '@/app/GlobalDataProvider'
|
||||||
|
// import { ManagementContext } from '@/app/management/ManagementProvider'
|
||||||
import { SessionContext } from '@/app/SessionProvider'
|
import { SessionContext } from '@/app/SessionProvider'
|
||||||
|
|
||||||
export default function StuffSubHeader({ type }) {
|
export default function StuffSubHeader({ type }) {
|
||||||
@ -25,7 +26,7 @@ export default function StuffSubHeader({ type }) {
|
|||||||
|
|
||||||
const { isGlobalLoading } = useContext(QcastContext)
|
const { isGlobalLoading } = useContext(QcastContext)
|
||||||
|
|
||||||
const { managementState } = useContext(ManagementContext)
|
const { managementState } = useContext(GlobalDataContext)
|
||||||
|
|
||||||
const [buttonStyle, setButtonStyle] = useState('')
|
const [buttonStyle, setButtonStyle] = useState('')
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@ -54,7 +54,7 @@ export default function SampleReducer() {
|
|||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
setSampleState({ ...sampleState, tabs: newTabs })
|
setSampleState({ tabs: newTabs })
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@ -3,7 +3,12 @@ import { canvasState, currentObjectState } from '@/store/canvasAtom'
|
|||||||
import { selectedRoofMaterialSelector } from '@/store/settingAtom'
|
import { selectedRoofMaterialSelector } from '@/store/settingAtom'
|
||||||
import { ROOF_MATERIAL_LAYOUT } from '@/components/floor-plan/modal/placementShape/PlacementShapeSetting'
|
import { ROOF_MATERIAL_LAYOUT } from '@/components/floor-plan/modal/placementShape/PlacementShapeSetting'
|
||||||
import { POLYGON_TYPE } from '@/common/common'
|
import { POLYGON_TYPE } from '@/common/common'
|
||||||
|
const ROOF_COLOR = {
|
||||||
|
0: 'rgb(199,240,213)',
|
||||||
|
1: 'rgb(178,238,255)',
|
||||||
|
2: 'rgb(187,204,255)',
|
||||||
|
3: 'rgb(228,202,255)',
|
||||||
|
}
|
||||||
export function useRoofFn() {
|
export function useRoofFn() {
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
const selectedRoofMaterial = useRecoilValue(selectedRoofMaterialSelector)
|
const selectedRoofMaterial = useRecoilValue(selectedRoofMaterialSelector)
|
||||||
@ -16,6 +21,7 @@ export function useRoofFn() {
|
|||||||
|
|
||||||
let width = (roofMaterial.width ?? 226) / 10
|
let width = (roofMaterial.width ?? 226) / 10
|
||||||
let height = (roofMaterial.length ?? 158) / 10
|
let height = (roofMaterial.length ?? 158) / 10
|
||||||
|
const index = roofMaterial.index ?? 0
|
||||||
let roofStyle = 2
|
let roofStyle = 2
|
||||||
const inputPatternSize = { width: width, height: height } //임시 사이즈
|
const inputPatternSize = { width: width, height: height } //임시 사이즈
|
||||||
const patternSize = { ...inputPatternSize } // 입력된 값을 뒤집기 위해
|
const patternSize = { ...inputPatternSize } // 입력된 값을 뒤집기 위해
|
||||||
@ -35,7 +41,7 @@ export function useRoofFn() {
|
|||||||
const rows = Math.floor(patternSourceCanvas.height / patternSize.height)
|
const rows = Math.floor(patternSourceCanvas.height / patternSize.height)
|
||||||
const cols = Math.floor(patternSourceCanvas.width / patternSize.width)
|
const cols = Math.floor(patternSourceCanvas.width / patternSize.width)
|
||||||
|
|
||||||
ctx.strokeStyle = mode === 'allPainted' ? 'black' : 'blue'
|
ctx.strokeStyle = mode === 'allPainted' ? 'black' : ROOF_COLOR[index]
|
||||||
ctx.lineWidth = mode === 'allPainted' ? 1 : 0.4
|
ctx.lineWidth = mode === 'allPainted' ? 1 : 0.4
|
||||||
ctx.fillStyle = mode === 'allPainted' ? 'rgba(0, 159, 64, 0.7)' : 'white'
|
ctx.fillStyle = mode === 'allPainted' ? 'rgba(0, 159, 64, 0.7)' : 'white'
|
||||||
|
|
||||||
|
|||||||
@ -88,10 +88,10 @@ export function useRoofShapePassivitySetting(id) {
|
|||||||
const lines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
|
const lines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
|
||||||
let stroke, strokeWidth
|
let stroke, strokeWidth
|
||||||
lines.forEach((line) => {
|
lines.forEach((line) => {
|
||||||
if (line.attributes.type === LINE_TYPE.WALLLINE.EAVES || line.attributes.type === LINE_TYPE.WALLLINE.HIPANDGABLE) {
|
if (line.attributes?.type === LINE_TYPE.WALLLINE.EAVES || line.attributes?.type === LINE_TYPE.WALLLINE.HIPANDGABLE) {
|
||||||
stroke = '#45CD7D'
|
stroke = '#45CD7D'
|
||||||
strokeWidth = 4
|
strokeWidth = 4
|
||||||
} else if (line.attributes.type === LINE_TYPE.WALLLINE.GABLE || line.attributes.type === LINE_TYPE.WALLLINE.JERKINHEAD) {
|
} else if (line.attributes?.type === LINE_TYPE.WALLLINE.GABLE || line.attributes?.type === LINE_TYPE.WALLLINE.JERKINHEAD) {
|
||||||
stroke = '#3FBAE6'
|
stroke = '#3FBAE6'
|
||||||
strokeWidth = 4
|
strokeWidth = 4
|
||||||
} else {
|
} else {
|
||||||
@ -136,7 +136,7 @@ export function useRoofShapePassivitySetting(id) {
|
|||||||
const index = lines.findIndex((line) => line === selectedLine)
|
const index = lines.findIndex((line) => line === selectedLine)
|
||||||
|
|
||||||
const nextLine = lines[index + 1] || lines[0]
|
const nextLine = lines[index + 1] || lines[0]
|
||||||
if (nextLine.attributes.isFixed) {
|
if (nextLine.attributes?.isFixed) {
|
||||||
canvas.discardActiveObject()
|
canvas.discardActiveObject()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -108,6 +108,7 @@ export function useContextMenu() {
|
|||||||
{
|
{
|
||||||
id: 'roofMaterialPlacement',
|
id: 'roofMaterialPlacement',
|
||||||
name: getMessage('contextmenu.roof.material.placement'),
|
name: getMessage('contextmenu.roof.material.placement'),
|
||||||
|
component: <RoofAllocationSetting id={popupId} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'roofMaterialRemove',
|
id: 'roofMaterialRemove',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user