于杰
2025-08-01 ee2c98d774c546f4bccf1ff3b80ba5415f179e5b
解决前端调整玻璃调整方向错误的问题
2个文件已修改
12 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/OptimizationRect.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/RectRenderer.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/OptimizationRect.vue
@@ -563,7 +563,7 @@
  const newRect = { ...glassDetail };
  newRect.x += deltaX / scale;
  newRect.y -= deltaY / scale;
  newRect.y += deltaY / scale;
  const otherRects = layout.glassDetails.filter(r => !r.isRemain && r !== glassDetail);
  let isValidMove = true;
@@ -829,10 +829,10 @@
  switch (direction) {
    case 'up':
      glassDetail.y -= maxStep;
      glassDetail.y += maxStep;
      break;
    case 'down':
      glassDetail.y += maxStep;
      glassDetail.y -= maxStep;
      break;
    case 'left':
      glassDetail.x -= maxStep;
@@ -962,7 +962,7 @@
//向上移动计算坐标
const getAvailableSpaceUp = (glassDetail, layout, obstacles) => {
  let maxSpace = glassDetail.y;
  let maxSpace = layout.height - glassDetail.y - glassDetail.height;
  obstacles.forEach(obstacle => {
    if (obstacle.y > glassDetail.y + glassDetail.height &&
        obstacle.x <= glassDetail.x + glassDetail.width &&
@@ -975,7 +975,7 @@
//向下移动计算坐标
const getAvailableSpaceDown = (glassDetail, layout, obstacles) => {
  let maxSpace = layout.height - (glassDetail.y + glassDetail.height);;
  let maxSpace = glassDetail.y;
  obstacles.forEach(obstacle => {
    if (obstacle.y + obstacle.height < glassDetail.y &&
        obstacle.x <= glassDetail.x + glassDetail.width &&
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/RectRenderer.vue
@@ -197,7 +197,7 @@
  return {
    position: 'absolute',
    left: `${glassDetail.x * scale}px`,
    bottom: `${glassDetail.y * scale}px`,
    top: `${glassDetail.y * scale}px`,
    width: `${glassDetail.width * scale}px`,
    height: `${glassDetail.height * scale}px`,
    backgroundColor: glassDetail.isRemain ? '#f0f0f0' : '#a0d8ef',