Merge branch 'dev' of ssh://git.jetbrains.space/nalpari/q-cast-iii/qcast-front into dev
This commit is contained in:
commit
236ad5c20e
@ -221,6 +221,7 @@ export default function CanvasMenu(props) {
|
|||||||
await reloadCanvasStatus(objectNo, pid)
|
await reloadCanvasStatus(objectNo, pid)
|
||||||
break
|
break
|
||||||
case 5:
|
case 5:
|
||||||
|
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) {
|
||||||
const estimateDetail = res.data
|
const estimateDetail = res.data
|
||||||
@ -230,6 +231,9 @@ export default function CanvasMenu(props) {
|
|||||||
setFloorPlanObjectNo({ floorPlanObjectNo: objectNo })
|
setFloorPlanObjectNo({ floorPlanObjectNo: objectNo })
|
||||||
setIsGlobalLoading(false)
|
setIsGlobalLoading(false)
|
||||||
router.push(`/floor-plan/estimate/${menu.index}?pid=${selectedPlan.planNo}&objectNo=${objectNo}`)
|
router.push(`/floor-plan/estimate/${menu.index}?pid=${selectedPlan.planNo}&objectNo=${objectNo}`)
|
||||||
|
if (pathname === '/floor-plan/estimate/5') {
|
||||||
|
setIsGlobalLoading(false)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setIsGlobalLoading(false)
|
setIsGlobalLoading(false)
|
||||||
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
||||||
|
|||||||
@ -710,7 +710,7 @@ export const useTrestle = () => {
|
|||||||
slope,
|
slope,
|
||||||
classType: currentAngleType === 'slope' ? '0' : '1',
|
classType: currentAngleType === 'slope' ? '0' : '1',
|
||||||
angle: getDegreeByChon(slope),
|
angle: getDegreeByChon(slope),
|
||||||
azimuth: surfaceCompass ?? moduleCompass ?? 0,
|
azimuth: getAzimuth(surface),
|
||||||
moduleList,
|
moduleList,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -726,6 +726,70 @@ export const useTrestle = () => {
|
|||||||
return { itemList, northArrangement, roofSurfaceList, circuitItemList }
|
return { itemList, northArrangement, roofSurfaceList, circuitItemList }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getAzimuth = (surface) => {
|
||||||
|
const { moduleCompass, surfaceCompass, direction } = surface
|
||||||
|
|
||||||
|
if (surfaceCompass) {
|
||||||
|
if (surfaceCompass > 180) {
|
||||||
|
return surfaceCompass - 360
|
||||||
|
}
|
||||||
|
return surfaceCompass
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (direction) {
|
||||||
|
case 'south': {
|
||||||
|
if (moduleCompass < 0) {
|
||||||
|
return -1 * moduleCompass
|
||||||
|
} else if (moduleCompass === 0) {
|
||||||
|
return 0
|
||||||
|
} else if (moduleCompass < 180) {
|
||||||
|
return -1 * moduleCompass
|
||||||
|
} else if (moduleCompass === 180) {
|
||||||
|
return 180
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 'north': {
|
||||||
|
if (moduleCompass < 0) {
|
||||||
|
return -1 * (180 + moduleCompass)
|
||||||
|
} else if (moduleCompass === 0) {
|
||||||
|
return 180
|
||||||
|
} else if (moduleCompass < 180) {
|
||||||
|
return 180 - moduleCompass
|
||||||
|
} else if (moduleCompass === 180) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 'west': {
|
||||||
|
if (moduleCompass > -180 && moduleCompass < -90) {
|
||||||
|
return -180 - (90 + moduleCompass)
|
||||||
|
} else if (moduleCompass < 0) {
|
||||||
|
return 180 - (90 + moduleCompass)
|
||||||
|
} else if (moduleCompass === 0) {
|
||||||
|
return 90
|
||||||
|
} else if (moduleCompass < 180) {
|
||||||
|
return 90 - moduleCompass
|
||||||
|
} else if (moduleCompass === 180) {
|
||||||
|
return -90
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 'east': {
|
||||||
|
if (moduleCompass < 0) {
|
||||||
|
return -(90 + moduleCompass)
|
||||||
|
} else if (moduleCompass === 0) {
|
||||||
|
return -90
|
||||||
|
} else if (moduleCompass < 90) {
|
||||||
|
return -180 + (90 - moduleCompass)
|
||||||
|
} else if (moduleCompass < 180) {
|
||||||
|
return 180 + (90 - moduleCompass)
|
||||||
|
} else if (moduleCompass === 180) {
|
||||||
|
return 90
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
const getNorthArrangement = () => {
|
const getNorthArrangement = () => {
|
||||||
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||||
let northArrangement = '0'
|
let northArrangement = '0'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user