😎fix: 치수 입력방법에 의해서 메뉴 validation check 추가
This commit is contained in:
parent
e14f1458d9
commit
2226cfd509
@ -41,7 +41,7 @@ import { isObjectNotEmpty } from '@/util/common-utils'
|
||||
import KO from '@/locales/ko.json'
|
||||
import JA from '@/locales/ja.json'
|
||||
|
||||
import { MENU } from '@/common/common'
|
||||
import { MENU, POLYGON_TYPE } from '@/common/common'
|
||||
|
||||
import { QcastContext } from '@/app/QcastProvider'
|
||||
|
||||
@ -167,7 +167,12 @@ export default function CanvasMenu(props) {
|
||||
setType('surface')
|
||||
break
|
||||
case 4:
|
||||
setType('module')
|
||||
if (!checkMenuAndCanvasState()) {
|
||||
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
||||
return
|
||||
} else {
|
||||
setType('module')
|
||||
}
|
||||
break
|
||||
case 5:
|
||||
// let pid = urlParams.get('pid')
|
||||
@ -328,6 +333,14 @@ export default function CanvasMenu(props) {
|
||||
return (['2', '3'].includes(canvasSetting?.roofSizeSet) && menu.index === 2) || (menuNumber === 4 && menu.index === 2)
|
||||
}
|
||||
|
||||
const checkMenuAndCanvasState = () => {
|
||||
const roofs = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
||||
// 지붕면 할당이 끝난 지붕이 하나라도 있는지 체크
|
||||
const isExist = roofs?.some((roof) => roof.roofMaterial)
|
||||
console.log('🚀 ~ checkMenuAndCanvasState ~ isExist:', isExist)
|
||||
return isExist
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (isObjectNotEmpty(estimateRecoilState)) {
|
||||
if (estimateRecoilState?.createUser === 'T01') {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user