From 503c45f8fd117ca58d56dcaceb44d8f95b3e2527 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期五, 16 八月 2024 12:19:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 UI-Project/src/views/Identify/identify.vue |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/UI-Project/src/views/Identify/identify.vue b/UI-Project/src/views/Identify/identify.vue
index 83eae3b..d973668 100644
--- a/UI-Project/src/views/Identify/identify.vue
+++ b/UI-Project/src/views/Identify/identify.vue
@@ -142,11 +142,12 @@
       const rawRects = response.data[0];
       rawData.value = response.data;
       totalPages.value = rawData.value.length;
+      const scaleFactor =  1621.78/6000; 
       adjustedRects.value = rawRects.map(rect => ({  
         ...rect,
-        x_axis: (6000 -(rect.x_axis + rect.width)) * 0.2085,
+        x_axis: (6000 -(rect.x_axis + rect.width)) * scaleFactor,
         y_axis: rect.y_axis * 0.17,
-        width: rect.width * 0.2 ,
+        width: rect.width * scaleFactor ,
         widtha: rect.width ,
         heighta: rect.height ,
         height: rect.height * 0.165 ,
@@ -166,12 +167,13 @@
 const handleCurrentChange = (val: number) => {  
   currentPage.value = val;
   const page = currentPage.value - 1
+      const scaleFactor =  1621.78/6000; 
       adjustedRects.value = rawData.value[page]?.map(rect => ({  
       // adjustedRects.value = rawRects.map(rect => ({  
         ...rect,
-        x_axis: (6000 -(rect.x_axis + rect.width)) * 0.2085,
+        x_axis: (6000 -(rect.x_axis + rect.width)) * scaleFactor,
         y_axis: rect.y_axis * 0.17,
-        width: rect.width * 0.2 ,
+        width: rect.width * scaleFactor ,
         widtha: rect.width ,
         heighta: rect.height ,
         height: rect.height * 0.165 ,
@@ -210,11 +212,12 @@
     webSocket = new WebSocket(socketUrl);  
     webSocket.onmessage = (event) => {  
       const data = JSON.parse(event.data);   
+      const scaleFactor =  1621.78/6000; 
         adjustedRects.value = data.currentCutTerritory[0].map(rect => ({  
         ...rect,
-        x_axis: (6000 -(rect.x_axis + rect.width)) * 0.2085,
+        x_axis: (6000 -(rect.x_axis + rect.width)) * scaleFactor,
         y_axis: rect.y_axis * 0.17,
-        width: rect.width * 0.2 ,
+        width: rect.width * scaleFactor ,
         widtha: rect.width ,
         heighta: rect.height ,
         height: rect.height * 0.165 ,

--
Gitblit v1.8.0