번역 수정
This commit is contained in:
parent
c8f70e0746
commit
11f69a01bb
@ -71,30 +71,19 @@ export function useRoofAllocationSetting(id) {
|
|||||||
roof.innerLines.forEach((line) => {
|
roof.innerLines.forEach((line) => {
|
||||||
/** 실측값이 없는 경우 라인 두께 4로 설정 */
|
/** 실측값이 없는 경우 라인 두께 4로 설정 */
|
||||||
if (!line.attributes.actualSize || line.attributes?.actualSize === 0) {
|
if (!line.attributes.actualSize || line.attributes?.actualSize === 0) {
|
||||||
line.set({
|
line.set({ strokeWidth: 4, stroke: 'black', selectable: true })
|
||||||
strokeWidth: 4,
|
|
||||||
stroke: 'black',
|
|
||||||
selectable: true,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 현재 선택된 라인인 경우 라인 두께 2로 설정 */
|
/** 현재 선택된 라인인 경우 라인 두께 2로 설정 */
|
||||||
if (editingLines.includes(line)) {
|
if (editingLines.includes(line)) {
|
||||||
line.set({
|
line.set({ strokeWidth: 2, stroke: 'black', selectable: true })
|
||||||
strokeWidth: 2,
|
|
||||||
stroke: 'black',
|
|
||||||
selectable: true,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
/** 현재 선택된 객체가 보조라인, 피라미드, 힙인 경우 두께 4로 설정 */
|
/** 현재 선택된 객체가 보조라인, 피라미드, 힙인 경우 두께 4로 설정 */
|
||||||
if (currentObject && currentObject.name && ['auxiliaryLine', 'ridge', 'hip'].includes(currentObject.name)) {
|
if (currentObject && currentObject.name && ['auxiliaryLine', 'ridge', 'hip'].includes(currentObject.name)) {
|
||||||
currentObject.set({
|
currentObject.set({ strokeWidth: 4, stroke: '#EA10AC' })
|
||||||
strokeWidth: 4,
|
|
||||||
stroke: '#EA10AC',
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}, [currentObject])
|
}, [currentObject])
|
||||||
|
|
||||||
@ -102,7 +91,7 @@ export function useRoofAllocationSetting(id) {
|
|||||||
/** 현재 선택된 객체가 보조라인, 피라미드, 힙인 경우 두께 4로 설정 */
|
/** 현재 선택된 객체가 보조라인, 피라미드, 힙인 경우 두께 4로 설정 */
|
||||||
const roofBases = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
const roofBases = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
||||||
if (roofBases.length === 0) {
|
if (roofBases.length === 0) {
|
||||||
swalFire({ text: '할당할 지붕이 없습니다.' })
|
swalFire({ text: getMessage('roofAllocation.not.found'), icon: 'warning' })
|
||||||
closePopup(id)
|
closePopup(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,9 +104,7 @@ export function useRoofAllocationSetting(id) {
|
|||||||
*/
|
*/
|
||||||
const fetchBasicSettings = async (planNo) => {
|
const fetchBasicSettings = async (planNo) => {
|
||||||
try {
|
try {
|
||||||
await get({
|
await get({ url: `/api/canvas-management/canvas-basic-settings/by-object/${correntObjectNo}/${planNo}` }).then((res) => {
|
||||||
url: `/api/canvas-management/canvas-basic-settings/by-object/${correntObjectNo}/${planNo}`,
|
|
||||||
}).then((res) => {
|
|
||||||
let roofsArray = {}
|
let roofsArray = {}
|
||||||
|
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
@ -187,11 +174,7 @@ export function useRoofAllocationSetting(id) {
|
|||||||
selectedRoofMaterial: selectRoofs.find((roof) => roof.selected),
|
selectedRoofMaterial: selectRoofs.find((roof) => roof.selected),
|
||||||
})
|
})
|
||||||
|
|
||||||
setBasicInfo({
|
setBasicInfo({ planNo: '' + res[0].planNo, roofSizeSet: '' + res[0].roofSizeSet, roofAngleSet: '' + res[0].roofAngleSet })
|
||||||
planNo: '' + res[0].planNo,
|
|
||||||
roofSizeSet: '' + res[0].roofSizeSet,
|
|
||||||
roofAngleSet: '' + res[0].roofAngleSet,
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Data fetching error:', error)
|
console.error('Data fetching error:', error)
|
||||||
@ -250,10 +233,7 @@ export function useRoofAllocationSetting(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const originCurrentRoofList = currentRoofList.map((roof) => {
|
const originCurrentRoofList = currentRoofList.map((roof) => {
|
||||||
return {
|
return { ...roof, selected: false }
|
||||||
...roof,
|
|
||||||
selected: false,
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
originCurrentRoofList.push({
|
originCurrentRoofList.push({
|
||||||
...currentRoofMaterial,
|
...currentRoofMaterial,
|
||||||
@ -320,10 +300,7 @@ export function useRoofAllocationSetting(id) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
setBasicSetting((prev) => {
|
setBasicSetting((prev) => {
|
||||||
return {
|
return { ...prev, selectedRoofMaterial: newRoofList.find((roof) => roof.selected) }
|
||||||
...prev,
|
|
||||||
selectedRoofMaterial: newRoofList.find((roof) => roof.selected),
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
setRoofList(newRoofList)
|
setRoofList(newRoofList)
|
||||||
@ -358,11 +335,7 @@ export function useRoofAllocationSetting(id) {
|
|||||||
if (!checkInnerLines()) {
|
if (!checkInnerLines()) {
|
||||||
apply()
|
apply()
|
||||||
} else {
|
} else {
|
||||||
swalFire({
|
swalFire({ type: 'alert', icon: 'error', text: getMessage('실제치수를 입력해 주세요.') })
|
||||||
type: 'alert',
|
|
||||||
icon: 'error',
|
|
||||||
text: getMessage('실제치수를 입력해 주세요.'),
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,11 +350,7 @@ export function useRoofAllocationSetting(id) {
|
|||||||
if (roof.separatePolygon.length === 0) {
|
if (roof.separatePolygon.length === 0) {
|
||||||
roof.innerLines.forEach((line) => {
|
roof.innerLines.forEach((line) => {
|
||||||
if (!line.attributes.actualSize || line.attributes?.actualSize === 0) {
|
if (!line.attributes.actualSize || line.attributes?.actualSize === 0) {
|
||||||
line.set({
|
line.set({ strokeWidth: 4, stroke: 'black', selectable: true })
|
||||||
strokeWidth: 4,
|
|
||||||
stroke: 'black',
|
|
||||||
selectable: true,
|
|
||||||
})
|
|
||||||
result = true
|
result = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -429,10 +398,7 @@ export function useRoofAllocationSetting(id) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
setBasicSetting((prev) => {
|
setBasicSetting((prev) => {
|
||||||
return {
|
return { ...prev, selectedRoofMaterial: newRoofList.find((roof) => roof.selected) }
|
||||||
...prev,
|
|
||||||
selectedRoofMaterial: newRoofList.find((roof) => roof.selected),
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
setRoofList(newRoofList)
|
setRoofList(newRoofList)
|
||||||
|
|
||||||
@ -440,9 +406,7 @@ export function useRoofAllocationSetting(id) {
|
|||||||
|
|
||||||
roofs.forEach((roof) => {
|
roofs.forEach((roof) => {
|
||||||
if (roof.isFixed) return
|
if (roof.isFixed) return
|
||||||
roof.set({
|
roof.set({ isFixed: true })
|
||||||
isFixed: true,
|
|
||||||
})
|
|
||||||
|
|
||||||
/** 모양 패턴 설정 */
|
/** 모양 패턴 설정 */
|
||||||
setSurfaceShapePattern(
|
setSurfaceShapePattern(
|
||||||
@ -479,10 +443,7 @@ export function useRoofAllocationSetting(id) {
|
|||||||
if (id === line.id) {
|
if (id === line.id) {
|
||||||
setEditingLines([...editingLines.filter((editLine) => editLine.id !== line.id), line])
|
setEditingLines([...editingLines.filter((editLine) => editLine.id !== line.id), line])
|
||||||
line.attributes.actualSize = size
|
line.attributes.actualSize = size
|
||||||
line.set({
|
line.set({ strokeWidth: 2, stroke: 'black' })
|
||||||
strokeWidth: 2,
|
|
||||||
stroke: 'black',
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user