解决前端调整与数控图像显示不一致的问题,解决方向按键移动相反的问题
1个文件已修改
18 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/OptimizationRect.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/OptimizationRect.vue
@@ -266,7 +266,7 @@
  return {
    position: 'absolute',
    left: `${layout.leftTrim * scale}px`,
    top: `${layout.upTrim * scale}px`,
    bottom: `${layout.upTrim * scale}px`,
    width: `${layout.width * scale}px`,
    height: `${layout.height * scale}px`,
    overflow: 'visible',
@@ -314,7 +314,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' : themeColor.value,
@@ -332,7 +332,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' : themeColor.value,
@@ -620,19 +620,19 @@
  const threshold = Math.max(glassDetail.width, glassDetail.height) * 0.1;
  otherRects.forEach(otherRect => {
    // 水平对齐保持不变
    // 水平对齐
    if (Math.abs(glassDetail.x - otherRect.x) < threshold) {
      glassDetail.x = Math.round((glassDetail.x + otherRect.x) / 2);
    }
    // 水平对齐右侧边缘保持不变
    // 水平对齐右侧边缘
    if (Math.abs((glassDetail.x + glassDetail.width) - (otherRect.x + otherRect.width)) < threshold) {
      glassDetail.x = Math.round((otherRect.x + otherRect.width - glassDetail.width));
    }
    // 垂直对齐需要调整(基于左下角坐标系)
    // 垂直对齐
    if (Math.abs(glassDetail.y - otherRect.y) < threshold) {
      glassDetail.y = Math.round((glassDetail.y + otherRect.y) / 2);
    }
    // 垂直对齐上边缘(基于左下角坐标系)
    // 垂直对齐上边缘
    if (Math.abs((glassDetail.y + glassDetail.height) - (otherRect.y + otherRect.height)) < threshold) {
      glassDetail.y = Math.round((otherRect.y + otherRect.height - glassDetail.height));
    }
@@ -1028,7 +1028,7 @@
      event.preventDefault();
      if (!moveInterval) {
        moveInterval = setInterval(() => {
          moveRect(layoutIndex, rectIndex, 'up');
          moveRect(layoutIndex, rectIndex, 'down');
        }, 50);
      }
      break;
@@ -1036,7 +1036,7 @@
      event.preventDefault();
      if (!moveInterval) {
        moveInterval = setInterval(() => {
          moveRect(layoutIndex, rectIndex, 'down');
          moveRect(layoutIndex, rectIndex, 'up');
        }, 50);
      }
      break;