- api 데이터 중 circuit 정보 없는 module 설정안하게 수정
This commit is contained in:
parent
6401195deb
commit
28640a7000
@ -119,7 +119,8 @@ export default function StepUp(props) {
|
|||||||
|
|
||||||
// 새로운 모듈 회로 정보 추가
|
// 새로운 모듈 회로 정보 추가
|
||||||
roofSurface.moduleList.forEach((module) => {
|
roofSurface.moduleList.forEach((module) => {
|
||||||
const targetModule = canvas.getObjects().filter((obj) => obj.id === module.uniqueId)[0]
|
const targetModule = canvas.getObjects().find((obj) => obj.id === module.uniqueId)
|
||||||
|
if (targetModule && module.circuit !== '' && module.circuit) {
|
||||||
const moduleCircuitText = new fabric.Text(module.circuit, {
|
const moduleCircuitText = new fabric.Text(module.circuit, {
|
||||||
left: targetModule.left + targetModule.width / 2,
|
left: targetModule.left + targetModule.width / 2,
|
||||||
top: targetModule.top + targetModule.height / 2,
|
top: targetModule.top + targetModule.height / 2,
|
||||||
@ -143,6 +144,7 @@ export default function StepUp(props) {
|
|||||||
targetModule.pcsItemId = module.pcsItemId
|
targetModule.pcsItemId = module.pcsItemId
|
||||||
targetModule.circuitNumber = module.circuit
|
targetModule.circuitNumber = module.circuit
|
||||||
canvas.add(moduleCircuitText)
|
canvas.add(moduleCircuitText)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -441,8 +443,8 @@ export default function StepUp(props) {
|
|||||||
canvas.renderAll()
|
canvas.renderAll()
|
||||||
|
|
||||||
roofSurface.moduleList.forEach((module) => {
|
roofSurface.moduleList.forEach((module) => {
|
||||||
const targetModule = canvas.getObjects().filter((obj) => obj.id === module.uniqueId)[0]
|
const targetModule = canvas.getObjects().find((obj) => obj.id === module.uniqueId)
|
||||||
if (module.circuit !== '' && module.circuit) {
|
if (targetModule && module.circuit !== '' && module.circuit !== null) {
|
||||||
const moduleCircuitText = new fabric.Text(module.circuit, {
|
const moduleCircuitText = new fabric.Text(module.circuit, {
|
||||||
left: targetModule.left + targetModule.width / 2,
|
left: targetModule.left + targetModule.width / 2,
|
||||||
top: targetModule.top + targetModule.height / 2,
|
top: targetModule.top + targetModule.height / 2,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user