Merge branch 'dev' into feature/yj-layoutSetup
This commit is contained in:
commit
b88299b78d
@ -24,7 +24,7 @@
|
|||||||
"js-cookie": "^3.0.5",
|
"js-cookie": "^3.0.5",
|
||||||
"mathjs": "^13.0.2",
|
"mathjs": "^13.0.2",
|
||||||
"mssql": "^11.0.1",
|
"mssql": "^11.0.1",
|
||||||
"next": "14.2.21",
|
"next": "14.2.25",
|
||||||
"next-international": "^1.2.4",
|
"next-international": "^1.2.4",
|
||||||
"react": "^18",
|
"react": "^18",
|
||||||
"react-chartjs-2": "^5.2.0",
|
"react-chartjs-2": "^5.2.0",
|
||||||
|
|||||||
@ -1361,7 +1361,12 @@ export default function Estimate({}) {
|
|||||||
</th>
|
</th>
|
||||||
<td colSpan={3}>
|
<td colSpan={3}>
|
||||||
<div className="radio-wrap">
|
<div className="radio-wrap">
|
||||||
<div className="d-check-radio light mr10">
|
{/*pkgRank is null, empty 인 경우 : 사용불가, 이전에 등록된 경우 사용가능, style로 제어*/}
|
||||||
|
<div className="d-check-radio light mr10" style={{display:
|
||||||
|
(isNotEmptyArray(storePriceList) > 0
|
||||||
|
&& storePriceList[0].pkgRank !== null
|
||||||
|
&& storePriceList[0].pkgRank !== ''
|
||||||
|
|| estimateContextState?.estimateType === 'YJSS') ? "" : "none"}}>
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
name="estimateType"
|
name="estimateType"
|
||||||
|
|||||||
@ -31,11 +31,13 @@ import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
|
|||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
import { compasDegAtom } from '@/store/orientationAtom'
|
import { compasDegAtom } from '@/store/orientationAtom'
|
||||||
import { hotkeyStore } from '@/store/hotkeyAtom'
|
import { hotkeyStore } from '@/store/hotkeyAtom'
|
||||||
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
|
|
||||||
export default function CanvasFrame() {
|
export default function CanvasFrame() {
|
||||||
const canvasRef = useRef(null)
|
const canvasRef = useRef(null)
|
||||||
const { canvas } = useCanvas('canvas')
|
const { canvas } = useCanvas('canvas')
|
||||||
const { canvasLoadInit, gridInit } = useCanvasConfigInitialize()
|
const { canvasLoadInit, gridInit } = useCanvasConfigInitialize()
|
||||||
|
const { closeAll } = usePopup()
|
||||||
const currentMenu = useRecoilValue(currentMenuState)
|
const currentMenu = useRecoilValue(currentMenuState)
|
||||||
const { floorPlanState } = useContext(FloorPlanContext)
|
const { floorPlanState } = useContext(FloorPlanContext)
|
||||||
const { contextMenu, handleClick } = useContextMenu()
|
const { contextMenu, handleClick } = useContextMenu()
|
||||||
@ -93,6 +95,8 @@ export default function CanvasFrame() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsGlobalLoading(false)
|
setIsGlobalLoading(false)
|
||||||
|
// 혹시 모를 팝업이 떠있는 경우 닫고 시작한다.
|
||||||
|
closeAll()
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
canvas?.clear()
|
canvas?.clear()
|
||||||
|
|||||||
@ -248,16 +248,22 @@ export function useRoofAllocationSetting(id) {
|
|||||||
swalFire({ type: 'alert', icon: 'error', text: getMessage('roof.exceed.count') })
|
swalFire({ type: 'alert', icon: 'error', text: getMessage('roof.exceed.count') })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
setCurrentRoofList([
|
|
||||||
...currentRoofList,
|
const originCurrentRoofList = currentRoofList.map((roof) => {
|
||||||
{
|
return {
|
||||||
...currentRoofMaterial,
|
...roof,
|
||||||
selected: false,
|
selected: false,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
originCurrentRoofList.push({
|
||||||
|
...currentRoofMaterial,
|
||||||
|
selected: true,
|
||||||
id: currentRoofMaterial.roofMatlCd,
|
id: currentRoofMaterial.roofMatlCd,
|
||||||
name: currentRoofMaterial.roofMatlNm,
|
name: currentRoofMaterial.roofMatlNm,
|
||||||
index: currentRoofList.length,
|
index: currentRoofList.length,
|
||||||
},
|
})
|
||||||
])
|
|
||||||
|
setCurrentRoofList(originCurrentRoofList)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -267,7 +273,7 @@ export function useRoofAllocationSetting(id) {
|
|||||||
const roofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
const roofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
||||||
|
|
||||||
for (let i = 0; i < roofs.length; i++) {
|
for (let i = 0; i < roofs.length; i++) {
|
||||||
if (roofs[i].roofMaterial.index === idx) {
|
if (roofs[i].roofMaterial?.index === idx) {
|
||||||
swalFire({ type: 'alert', icon: 'error', text: getMessage('roof.material.can.not.delete') })
|
swalFire({ type: 'alert', icon: 'error', text: getMessage('roof.material.can.not.delete') })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,7 @@ export function useRoofShapePassivitySetting(id) {
|
|||||||
const { addCanvasMouseEventListener, initEvent } = useEvent()
|
const { addCanvasMouseEventListener, initEvent } = useEvent()
|
||||||
// const { addCanvasMouseEventListener, initEvent } = useContext(EventContext)
|
// const { addCanvasMouseEventListener, initEvent } = useContext(EventContext)
|
||||||
const { drawRoofPolygon } = useMode()
|
const { drawRoofPolygon } = useMode()
|
||||||
const { addPolygonByLines } = usePolygon()
|
const { addPolygonByLines, addLengthText } = usePolygon()
|
||||||
const currentObject = useRecoilValue(currentObjectState)
|
const currentObject = useRecoilValue(currentObjectState)
|
||||||
const offsetRef = useRef(null)
|
const offsetRef = useRef(null)
|
||||||
const pitchRef = useRef(null)
|
const pitchRef = useRef(null)
|
||||||
@ -248,6 +248,7 @@ export function useRoofShapePassivitySetting(id) {
|
|||||||
// 완료 한 경우에는 지붕까지 그려줌
|
// 완료 한 경우에는 지붕까지 그려줌
|
||||||
addPitchTextsByOuterLines()
|
addPitchTextsByOuterLines()
|
||||||
const roof = drawRoofPolygon(wall)
|
const roof = drawRoofPolygon(wall)
|
||||||
|
addLengthText(roof)
|
||||||
}
|
}
|
||||||
|
|
||||||
canvas.renderAll()
|
canvas.renderAll()
|
||||||
|
|||||||
@ -107,6 +107,10 @@ export function useEvent() {
|
|||||||
const horizonLines = canvas.getObjects().filter((obj) => obj.name === 'lineGrid' && obj.direction === 'horizontal')
|
const horizonLines = canvas.getObjects().filter((obj) => obj.name === 'lineGrid' && obj.direction === 'horizontal')
|
||||||
const verticalLines = canvas.getObjects().filter((obj) => obj.name === 'lineGrid' && obj.direction === 'vertical')
|
const verticalLines = canvas.getObjects().filter((obj) => obj.name === 'lineGrid' && obj.direction === 'vertical')
|
||||||
|
|
||||||
|
if (!horizonLines || !verticalLines) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const closestHorizontalLine = horizonLines.reduce((prev, curr) => {
|
const closestHorizontalLine = horizonLines.reduce((prev, curr) => {
|
||||||
const prevDistance = calculateDistance(pointer, prev)
|
const prevDistance = calculateDistance(pointer, prev)
|
||||||
const currDistance = calculateDistance(pointer, curr)
|
const currDistance = calculateDistance(pointer, curr)
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import { compasDegAtom } from '@/store/orientationAtom'
|
|||||||
import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
|
import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
|
||||||
import { useCanvasPopupStatusController } from './common/useCanvasPopupStatusController'
|
import { useCanvasPopupStatusController } from './common/useCanvasPopupStatusController'
|
||||||
import { useCanvasMenu } from './common/useCanvasMenu'
|
import { useCanvasMenu } from './common/useCanvasMenu'
|
||||||
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 플랜 처리 훅
|
* 플랜 처리 훅
|
||||||
@ -52,6 +53,9 @@ export function usePlan(params = {}) {
|
|||||||
const { fetchBasicSettings, basicSettingCopySave } = useCanvasSetting()
|
const { fetchBasicSettings, basicSettingCopySave } = useCanvasSetting()
|
||||||
const [canvasSetting, setCanvasSetting] = useRecoilState(canvasSettingState)
|
const [canvasSetting, setCanvasSetting] = useRecoilState(canvasSettingState)
|
||||||
|
|
||||||
|
/** 전역 로딩바 컨텍스트 */
|
||||||
|
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 플랜 복사 시 모듈이 있을경우 모듈 데이터 복사하기 위한 처리
|
* 플랜 복사 시 모듈이 있을경우 모듈 데이터 복사하기 위한 처리
|
||||||
*/
|
*/
|
||||||
@ -414,7 +418,7 @@ export function usePlan(params = {}) {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setSelectedPlan(currentCanvasPlan)
|
setSelectedPlan(currentCanvasPlan)
|
||||||
handleCurrentPlanUrl()
|
handleCurrentPlanUrl()
|
||||||
resetCurrentObject()
|
// resetCurrentObject()
|
||||||
resetModuleSetupSurface()
|
resetModuleSetupSurface()
|
||||||
}, [currentCanvasPlan])
|
}, [currentCanvasPlan])
|
||||||
|
|
||||||
@ -450,13 +454,21 @@ export function usePlan(params = {}) {
|
|||||||
text: `Plan ${currentCanvasPlan.planNo} ` + getMessage('plan.message.confirm.copy'),
|
text: `Plan ${currentCanvasPlan.planNo} ` + getMessage('plan.message.confirm.copy'),
|
||||||
type: 'confirm',
|
type: 'confirm',
|
||||||
confirmFn: async () => {
|
confirmFn: async () => {
|
||||||
|
setIsGlobalLoading(true)
|
||||||
await postObjectPlan(userId, objectNo, true, false)
|
await postObjectPlan(userId, objectNo, true, false)
|
||||||
|
setIsGlobalLoading(false)
|
||||||
},
|
},
|
||||||
denyFn: async () => {
|
denyFn: async () => {
|
||||||
|
setIsGlobalLoading(true)
|
||||||
await postObjectPlan(userId, objectNo, false, false)
|
await postObjectPlan(userId, objectNo, false, false)
|
||||||
|
setIsGlobalLoading(false)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
: await postObjectPlan(userId, objectNo, false, false)
|
: async () => {
|
||||||
|
setIsGlobalLoading(true)
|
||||||
|
await postObjectPlan(userId, objectNo, false, false)
|
||||||
|
setIsGlobalLoading(false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
var exec = require('child_process').exec
|
var exec = require('child_process').exec
|
||||||
exec('yarn start', { windowsHide: true })
|
exec('yarn dev', { windowsHide: true })
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user