From e782b38bd2fbe97b140b6bdd450d2c3d299f4b0b Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期四, 04 九月 2025 13:55:42 +0800
Subject: [PATCH] 1、中空查询任务时增加耗时日志,排查查询慢的原因

---
 UI-Project/src/views/Identify/identifwutwo.vue |   40 +++++++++++++++++++++++++++-------------
 1 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/UI-Project/src/views/Identify/identifwutwo.vue b/UI-Project/src/views/Identify/identifwutwo.vue
index defc531..2ba788a 100644
--- a/UI-Project/src/views/Identify/identifwutwo.vue
+++ b/UI-Project/src/views/Identify/identifwutwo.vue
@@ -51,6 +51,8 @@
 const adjustedRects = ref([]);
 const ava = ref('');
 const avanum = ref('');
+const realwidth = ref('');
+const realheight = ref('');
 let socket = null;
 const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/currentCutDrawingTwo`;
 const handleMessage = (data: any) => {
@@ -64,18 +66,30 @@
   }else{
     avanum.value = ''
   }
-      const scaleFactor = 1621.78 / 6000;
-      const scaleFactory = 750 / 3300;
+      if (data.upPattenUsage && data.upPattenUsage.length > 0) {
+        realwidth.value = data.upPattenUsage[0].width;
+        realheight.value = data.upPattenUsage[0].height;
+        const realx = realwidth.value;
+        const realy = realheight.value;
+        const scaleFactora = 1621.78 / realx;
+        const scaleFactorya = 750 / realy;
+      window.localStorage.setItem('widthreturna', realy)
+      window.localStorage.setItem('scaleFactorb', scaleFactora)
+      window.localStorage.setItem('scaleFactoryb', scaleFactorya)
+      }
       if (data.currentCutTerritory && data.currentCutTerritory.length > 0) {
+        let scaleFactor = window.localStorage.getItem('scaleFactorb')
+        let scaleFactory = window.localStorage.getItem('scaleFactoryb')
+        let widthreturn = window.localStorage.getItem('widthreturna')
         const newRects = data.currentCutTerritory[0].map(rect => {
           const existingRect = adjustedRects.value.find(r => r.glassId === rect.glassId);
           if (existingRect) {
             return {
               ...existingRect,
-               xAxisa: rect.xAxis * scaleFactor * 1.1,
-               yAxisa: (3300 - (rect.yAxis + rect.edgHeight + 300)) * scaleFactory * 1.1,
-              width: rect.edgWidth * scaleFactor * 1.1,
-              height: rect.edgHeight * scaleFactory * 1.1,
+               xAxisa: rect.xAxis * scaleFactor,
+               yAxisa: (widthreturn - (rect.yAxis + rect.edgHeight )) * scaleFactory,
+              width: rect.edgWidth * scaleFactor,
+              height: rect.edgHeight * scaleFactory,
               widtha: rect.edgWidth,
               heighta: rect.edgHeight,
               state: rect.state,
@@ -84,10 +98,10 @@
             // 濡傛灉涓嶅瓨鍦紝鍒欐坊鍔犳柊鐭╁舰锛岄粯璁� isActive 涓� false
             return {
               ...rect,
-               xAxisa: rect.xAxis * scaleFactor * 1.1,
-               yAxisa: (3300 - (rect.yAxis + rect.edgHeight + 300)) * scaleFactory * 1.1,
-              width: rect.edgWidth * scaleFactor * 1.1,
-              height: rect.edgHeight * scaleFactory * 1.1,
+              xAxisa: rect.xAxis * scaleFactor,
+              yAxisa: (widthreturn - (rect.yAxis + rect.edgHeight)) * scaleFactory,
+              width: rect.edgWidth * scaleFactor,
+              height: rect.edgHeight * scaleFactory,
               widtha: rect.edgWidth,
               heighta: rect.edgHeight,
               state: rect.state,
@@ -162,7 +176,7 @@
 function getRectColor(state: number): string {
   switch (state) {
     case 0:  
-      return '#7AC5CD';
+      return '#7AC5CD';//鏈繘绗�
     case 1:
       return '#95d475';
     case -1:
@@ -174,9 +188,9 @@
     case 4:  
       return '#CD6090';
     case 8:
-      return '#911005';
+      return '#911005';//鐮存崯
     case 9:
-      return '#4682B4';
+      return '#4682B4';//鎷胯蛋
     default:
       return '#CDAF95'; 
   }

--
Gitblit v1.8.0