From 5985a3693d4d902455b9fd46b052362417b044d7 Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期五, 16 八月 2024 16:32:09 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes

---
 UI-Project/src/views/PurchaseReturn/purchaseReturn.vue |   84 +++++++++++++++---------------------------
 1 files changed, 30 insertions(+), 54 deletions(-)

diff --git a/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue b/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
index 36297d2..1b332f2 100644
--- a/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
+++ b/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,  

--
Gitblit v1.8.0