From cb94e393ea3cd9c1d8bbf1240e44baf084d87bbc Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期五, 16 八月 2024 08:49:24 +0800
Subject: [PATCH] 下片台模块更改图片顺序

---
 UI-Project/src/views/Identify/identify.vue |   41 ++++++++++++++++++++++-------------------
 1 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/UI-Project/src/views/Identify/identify.vue b/UI-Project/src/views/Identify/identify.vue
index bcb4693..d973668 100644
--- a/UI-Project/src/views/Identify/identify.vue
+++ b/UI-Project/src/views/Identify/identify.vue
@@ -84,16 +84,16 @@
     //   console.log(url);
     //   const response = await request.post(url)
   const response = await request.post('/cacheGlass/taskCache/identControls', {
-    identId: currentGlassId.value,
-    controlsId: 201,
+    glassId: currentGlassId.value,
+    state: 8,
     line: 1001,
-    machine: '璇嗗埆',
+    workingProcedure: '璇嗗埆',
     })
     if (response.code == 200) {
       ElMessage.success(response.message);
       // window.location.reload() 
       blind.value = false;
-      updateRectStatus(currentGlassId.value, 201); 
+      updateRectStatus(currentGlassId.value, 8); 
     } else {
       // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
       ElMessage.error(response.msg);
@@ -111,17 +111,17 @@
     //   console.log(url);
     //   const response = await request.post(url)
   const response = await request.post('/cacheGlass/taskCache/identControls', {
-    identId: currentGlassId.value,
-    controlsId: 200,
+    glassId: currentGlassId.value,
+    state: 9,
     line: 1001,
-    machine: '璇嗗埆',
+    workingProcedure: '璇嗗埆',
     })
     if (response.code == 200) {
       // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫
       ElMessage.success(response.message);
       // window.location.reload() 
       blind.value = false;
-      updateRectStatus(currentGlassId.value, 200); 
+      updateRectStatus(currentGlassId.value, 9); 
     } else {
       // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
       ElMessage.error(response.msg);
@@ -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 ,
@@ -188,12 +190,12 @@
       return '#b3e19d';  
     case 120:  
       return '#f89898';  
-    case 200: 
-      return 'lightblue';  
-    case 201:  
+    case 8: 
+      return '#911005';  
+    case 9:  
       return '#f3d19e';  
-    default:  
-      return '#911005'; // 榛樿棰滆壊  
+    // default:  
+    //   return '#911005'; // 榛樿棰滆壊  
   }  
 } 
 // 鏇存柊鐭╁舰鐘舵��  
@@ -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