외벽선 속성 설정 완료 문구 추가
This commit is contained in:
parent
57b3a9e38b
commit
bc0655c8e2
@ -18,7 +18,7 @@ export default function FloorPlan({ children }) {
|
|||||||
|
|
||||||
const { closeAll } = usePopup()
|
const { closeAll } = usePopup()
|
||||||
const { selectedMenu, setSelectedMenu } = useCanvasMenu()
|
const { selectedMenu, setSelectedMenu } = useCanvasMenu()
|
||||||
const { fetchSettings } = useCanvasSetting(false)
|
const { fetchSettings } = useCanvasSetting()
|
||||||
const resetCurrentMenu = useResetRecoilState(currentMenuState)
|
const resetCurrentMenu = useResetRecoilState(currentMenuState)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
return () => {
|
return () => {
|
||||||
|
|||||||
@ -11,6 +11,8 @@ import PropertiesSetting from '@/components/floor-plan/modal/outerlinesetting/Pr
|
|||||||
import RoofShapeSetting from '@/components/floor-plan/modal/roofShape/RoofShapeSetting'
|
import RoofShapeSetting from '@/components/floor-plan/modal/roofShape/RoofShapeSetting'
|
||||||
import RoofAllocationSetting from '@/components/floor-plan/modal/roofAllocation/RoofAllocationSetting'
|
import RoofAllocationSetting from '@/components/floor-plan/modal/roofAllocation/RoofAllocationSetting'
|
||||||
import { settingModalFirstOptionsState } from '@/store/settingAtom'
|
import { settingModalFirstOptionsState } from '@/store/settingAtom'
|
||||||
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
|
|
||||||
// 외벽선 속성 설정
|
// 외벽선 속성 설정
|
||||||
export function usePropertiesSetting(id) {
|
export function usePropertiesSetting(id) {
|
||||||
@ -25,6 +27,8 @@ export function usePropertiesSetting(id) {
|
|||||||
const { addPolygonByLines } = usePolygon()
|
const { addPolygonByLines } = usePolygon()
|
||||||
const { removeLine, hideLine } = useLine()
|
const { removeLine, hideLine } = useLine()
|
||||||
const { addPopup, closePopup } = usePopup()
|
const { addPopup, closePopup } = usePopup()
|
||||||
|
const { swalFire } = useSwal()
|
||||||
|
const { getMessage } = useMessage()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const lines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
|
const lines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
|
||||||
@ -125,47 +129,52 @@ export function usePropertiesSetting(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleFix = () => {
|
const handleFix = () => {
|
||||||
const isClose = confirm('외벽선 속성 설정을 완료하시겠습니까?')
|
swalFire({
|
||||||
if (isClose) {
|
text: getMessage('outerLine.property.fix'),
|
||||||
const lines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
|
type: 'confirm',
|
||||||
|
confirmFn: async () => {
|
||||||
|
const lines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
|
||||||
|
|
||||||
|
const notSetAttributes = lines.filter((line) => !line.attributes?.type)
|
||||||
|
if (notSetAttributes.length > 0) {
|
||||||
|
// 세팅이 하나라도 안되어있으면 초기화
|
||||||
|
lines.forEach((line) => {
|
||||||
|
line.set({
|
||||||
|
stroke: '#000000',
|
||||||
|
strokeWidth: 4,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
canvas.discardActiveObject()
|
||||||
|
// closePopup(id)
|
||||||
|
addPopup(id, 1, <RoofShapeSetting id={id} pos={{ x: 50, y: 230 }} />)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const notSetAttributes = lines.filter((line) => !line.attributes?.type)
|
|
||||||
if (notSetAttributes.length > 0) {
|
|
||||||
// 세팅이 하나라도 안되어있으면 초기화
|
|
||||||
lines.forEach((line) => {
|
lines.forEach((line) => {
|
||||||
line.set({
|
line.set({
|
||||||
|
attributes: line.attributes ? line.attributes : { offset: 0, type: LINE_TYPE.WALLLINE.WALL },
|
||||||
stroke: '#000000',
|
stroke: '#000000',
|
||||||
strokeWidth: 4,
|
strokeWidth: 4,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
hideLine(line)
|
||||||
})
|
})
|
||||||
canvas.discardActiveObject()
|
|
||||||
// closePopup(id)
|
const wall = addPolygonByLines(lines, { name: POLYGON_TYPE.WALL, fill: 'transparent', stroke: 'black' })
|
||||||
addPopup(id, 1, <RoofShapeSetting id={id} pos={{ x: 50, y: 230 }} />)
|
|
||||||
|
wall.lines = [...lines]
|
||||||
|
|
||||||
|
const roof = drawRoofPolygon(wall)
|
||||||
|
|
||||||
|
setPoints([])
|
||||||
|
canvas.renderAll()
|
||||||
|
roof.drawHelpLine(settingModalFirstOptions)
|
||||||
|
addPopup(id, 1, <RoofAllocationSetting id={id} pos={{ x: 50, y: 230 }} />)
|
||||||
|
},
|
||||||
|
denyFn: async () => {
|
||||||
return
|
return
|
||||||
}
|
},
|
||||||
|
})
|
||||||
lines.forEach((line) => {
|
|
||||||
line.set({
|
|
||||||
attributes: line.attributes ? line.attributes : { offset: 0, type: LINE_TYPE.WALLLINE.WALL },
|
|
||||||
stroke: '#000000',
|
|
||||||
strokeWidth: 4,
|
|
||||||
})
|
|
||||||
|
|
||||||
hideLine(line)
|
|
||||||
})
|
|
||||||
|
|
||||||
const wall = addPolygonByLines(lines, { name: POLYGON_TYPE.WALL, fill: 'transparent', stroke: 'black' })
|
|
||||||
|
|
||||||
wall.lines = [...lines]
|
|
||||||
|
|
||||||
const roof = drawRoofPolygon(wall)
|
|
||||||
|
|
||||||
setPoints([])
|
|
||||||
canvas.renderAll()
|
|
||||||
roof.drawHelpLine(settingModalFirstOptions)
|
|
||||||
addPopup(id, 1, <RoofAllocationSetting id={id} pos={{ x: 50, y: 230 }} />)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const closeModal = (fn) => {
|
const closeModal = (fn) => {
|
||||||
|
|||||||
@ -1030,5 +1030,6 @@
|
|||||||
"roof.is.not.selected": "屋根の選択をお願いします。",
|
"roof.is.not.selected": "屋根の選択をお願いします。",
|
||||||
"length.direction.is.required": "長さと方向を入力します。",
|
"length.direction.is.required": "長さと方向を入力します。",
|
||||||
"canvas.infomation.text": "数字は [半角] 入力のみ可能です。",
|
"canvas.infomation.text": "数字は [半角] 入力のみ可能です。",
|
||||||
"roof.exceed.count": "屋根材は4つまで選択可能です。"
|
"roof.exceed.count": "屋根材は4つまで選択可能です。",
|
||||||
|
"outerLine.property.fix": "外壁線の属性設定 を完了しますか?"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1030,5 +1030,6 @@
|
|||||||
"roof.is.not.selected": "지붕을 선택해주세요.",
|
"roof.is.not.selected": "지붕을 선택해주세요.",
|
||||||
"length.direction.is.required": "길이와 방향을 입력하세요.",
|
"length.direction.is.required": "길이와 방향을 입력하세요.",
|
||||||
"canvas.infomation.text": "숫자는 [반각] 입력만 가능합니다.",
|
"canvas.infomation.text": "숫자는 [반각] 입력만 가능합니다.",
|
||||||
"roof.exceed.count": "지붕재는 4개까지 선택 가능합니다."
|
"roof.exceed.count": "지붕재는 4개까지 선택 가능합니다.",
|
||||||
|
"outerLine.property.fix": "외벽선 속성 설정을 완료하시겠습니까?"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user