wu
2024-08-16 5985a3693d4d902455b9fd46b052362417b044d7
UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
@@ -27,7 +27,7 @@
// 进炉中
  if(data.intoGlass!=null){
    adjustedRects1.value =  data.intoGlass[0].map(rect => {  
      console.log( adjustedRects1.value);
      const scaleFactor =  794.67/5087;
        let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;;
        let newX = rect.yCoordinate; 
      if (rect.width < rect.height) {
@@ -38,34 +38,21 @@
        heighta = rect.height;
      }
      if (rect.angle === 0) {  
    adjustedWidth = heighta * 0.12;
    adjustedWidth = widtha * scaleFactor;
    adjustedHeight = heighta * 0.1;
    // adjustedWidtha = widtha;
    // adjustedHeighta = heighta;
    newX = 5087 - (rect.yCoordinate + widtha);
    } else {
    adjustedWidth = heighta * scaleFactor;
    adjustedHeight = widtha * 0.1;  
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;  
    newX = 5087 - (rect.yCoordinate + heighta);
    } else {
    adjustedWidth = widtha * 0.12;
    adjustedHeight = heighta * 0.1;
    // adjustedWidtha = widtha;
    // adjustedHeighta = heighta;
    newX = 5087 - (rect.yCoordinate + widtha);
  }
  // if (rect.angle === 0) {
  //         adjustedWidth = heighta * 0.12;
  //         adjustedHeight = widtha * 0.1;
  //         adjustedWidtha = heighta;
  //         adjustedHeighta = widtha;
  //         newX = 5087 - (rect.xCoordinate + heighta);
  //       } else {
  //         adjustedWidth = widtha * 0.12;
  //         adjustedHeight = heighta * 0.1;
  //         adjustedWidtha = widtha;
  //         adjustedHeighta = heighta;
  //         newX = 5087 - (rect.xCoordinate + widtha);
  //       }
    newX = 5087 - (rect.yCoordinate + heighta);
  }
        return {  
        ...rect, 
        xcoordinate: newX * 0.12,
        xcoordinate: newX * scaleFactor,
        ycoordinate: rect.xCoordinate * 0.1,
        width: adjustedWidth,  
        height: adjustedHeight,  
@@ -78,7 +65,7 @@
      }
  if(data.intoGlass2!=null){
    adjustedRects2.value =  data.intoGlass2[0].map(rect => {  
      console.log( adjustedRects2.value);
      const scaleFactor =  794.67/5087;
      let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;;
      let newX = rect.yCoordinate; 
      if (rect.width < rect.height) {
@@ -89,34 +76,21 @@
        heighta = rect.height;
      }
      if (rect.angle === 0) {  
    adjustedWidth = heighta * 0.12;
    adjustedHeight = widtha * 0.1;
    // adjustedWidtha = widtha;
    // adjustedHeighta = heighta;
    newX = 5087 - (rect.yCoordinate + heighta);
    } else {
    adjustedWidth = widtha * 0.12;
    adjustedWidth = widtha * scaleFactor;
    adjustedHeight = heighta * 0.1;
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;  
    newX = 5087 - (rect.yCoordinate + widtha); 
  }
  //     if (rect.angle === 0) {
  //         adjustedWidth = heighta * 0.12;
  //         adjustedHeight = widtha * 0.1;
  //         adjustedWidtha = heighta;
  //         adjustedHeighta = widtha;
  //         newX = 5087 - (rect.xCoordinate + heighta);
  // } else {
  //         adjustedWidth = widtha * 0.12;
  //         adjustedHeight = heighta * 0.1;
  //         adjustedWidtha = widtha;
  //         adjustedHeighta = heighta;
  //         newX = 5087 - (rect.xCoordinate + widtha);
  // }
    } else {
    adjustedWidth = heighta * scaleFactor;
    adjustedHeight = widtha * 0.1;
    // adjustedWidtha = widtha;
    // adjustedHeighta = heighta;
    newX = 5087 - (rect.yCoordinate + heighta);
  }
        return {  
        ...rect, 
        xcoordinate: newX * 0.12,
        xcoordinate: newX * scaleFactor,
        ycoordinate: rect.xCoordinate * 0.1,
        width: adjustedWidth,  
        height: adjustedHeight,  
@@ -130,6 +104,7 @@
  // 进炉前
  if(data.waitingGlass!=null){
    adjustedRectsa.value = data.waitingGlass[0].map(rect => {  
      const scaleFactor =  1621.78/5190;
  let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; 
  let newX = rect.yCoordinate; 
      if (rect.width < rect.height) {
@@ -140,13 +115,13 @@
        heighta = rect.height;
      }
  if (rect.angle === 0) {  
    adjustedWidth = widtha * 0.24;
    adjustedWidth = widtha * scaleFactor;
    adjustedHeight = heighta * 0.16;
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;  
    newX = 5190 - (rect.yCoordinate + widtha); 
    } else {  
    adjustedWidth = heighta * 0.24;
    adjustedWidth = heighta * scaleFactor;
    adjustedHeight = widtha * 0.16;  
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;  
@@ -154,7 +129,7 @@
  }  
  return {  
    ...rect, 
    x: newX * 0.24,
    x: newX * scaleFactor,
    y: rect.xCoordinate * 0.16,  
    width: adjustedWidth,  
    height: adjustedHeight,  
@@ -168,7 +143,8 @@
    // 已出炉
  if(data.outGlass!=null){
    adjustedRectsb.value = data.outGlass[0].map(rect => {  
  let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;;
      const scaleFactor =  1621.78/5190;
      let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;;
  let newX = rect.yCoordinate; 
      if (rect.width < rect.height) {
        widtha = rect.height;
@@ -178,13 +154,13 @@
        heighta = rect.height;
      }
  if (rect.angle === 0) {  
    adjustedWidth = widtha * 0.24;
    adjustedWidth = widtha * scaleFactor;
    adjustedHeight = heighta * 0.16;  
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;  
    // newX = 5190 - (rect.yCoordinate + widtha); 
  } else {  
    adjustedWidth = heighta * 0.24;
    adjustedWidth = heighta * scaleFactor;
    adjustedHeight = widtha * 0.16;  
    // adjustedWidtha = heighta;  
    // adjustedHeighta = widtha;  
@@ -192,7 +168,7 @@
  }  
  return {  
        ...rect, // 复制原始对象的其他属性  
        x: newX * 0.24,
        x: newX * scaleFactor,
        y: rect.xCoordinate * 0.16,
        width: adjustedWidth,  
        height: adjustedHeight,