| | |
| | | adjustedRects2.value = [] |
| | | } |
| | | // 进炉中左 |
| | | if (data.intoGlass && data.intoGlass.length > 0) { |
| | | const newGlassIds = new Set(data.intoGlass[0].map(rect => rect.glassId)); |
| | | const existingRects = adjustedRects1.value.filter(rect => newGlassIds.has(rect.glassId)); |
| | | const newRects = data.intoGlass[0].map(rect => { |
| | | const scaleFactor = 810.89/5087; |
| | | const scaleFactorY = 430/2800; |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; |
| | | if (data.intoGlass && data.intoGlass.length > 0) { |
| | | console.log(data.intoGlass); |
| | | |
| | | const newGlassIds = new Set(data.intoGlass[0].map(rect => rect.glassId)); |
| | | const existingRects = adjustedRects1.value.filter(rect => newGlassIds.has(rect.glassId)); |
| | | const newRects = data.intoGlass[0].map(rect => { |
| | | const scaleFactor = 810.89/5087; |
| | | const scaleFactorY = 430/2800; |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta; |
| | | let newX = rect.yCoordinate; |
| | | if (rect.width < rect.height) { |
| | | widtha = rect.height; |
| | |
| | | return oldRect; // 如果旧矩形在新数据中不存在,但保留在newGlassIds中,则保留原样 |
| | | }).concat(newRects.filter(r => !existingRects.some(o => o.glassId === r.glassId))); |
| | | } |
| | | else if (data.overGlass == null) { |
| | | else { |
| | | adjustedRects1.value = [] |
| | | } |
| | | if (data.waitingGlass && data.waitingGlass.length > 0) { |