From 43a6eccb37602e27c56bf7c40a74c8350ecfd82e Mon Sep 17 00:00:00 2001
From: wang <3597712270@qq.com>
Date: 星期三, 15 五月 2024 11:51:46 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes

---
 UI-Project/src/views/UnLoadGlass/Landingindication.vue |   52 +++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 45 insertions(+), 7 deletions(-)

diff --git a/UI-Project/src/views/UnLoadGlass/Landingindication.vue b/UI-Project/src/views/UnLoadGlass/Landingindication.vue
index 72b46a9..ca6a564 100644
--- a/UI-Project/src/views/UnLoadGlass/Landingindication.vue
+++ b/UI-Project/src/views/UnLoadGlass/Landingindication.vue
@@ -33,19 +33,21 @@
 
 <script setup>
 import Swal from 'sweetalert2'
-
+import request from "@/utils/request";
 const racks = [
   { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } },
-  { x: 50, y: 270, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 20, width: 10, fillColor: 'yellow', content: 'NG1234567' } },
+ 
   { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 30, width: 20, fillColor: 'yellow', content: 'NG12345678' } },
-  { x: 280, y: 270, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 35, width: 23, fillColor: 'yellow', content: 'NG123456910' } },
+ 
   { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 30, width: 100, fillColor: 'yellow', content: 'NG1234561454' } }
+  
 ];
 
+
 const calculateItemXPosition = (rack, item, index) => {
-  if (index === 0 || index === 1) {
+  if (index === 0 ) {
     return rack.x;
-  } else if (index === 2 || index === 3) {
+  } else if (index === 1 ) {
     return rack.x + rack.width - item.width;
   } else {
     return rack.x + (rack.width - item.width) / 2;
@@ -53,15 +55,51 @@
 };
 
 const calculateItemYPosition = (rack, item, index) => {
-  if (index === 0 || index === 1) {
+  if (index === 0 ) {
     return rack.y + (rack.height - item.height) / 2;
-  } else if (index === 2 || index === 3) {
+  } else if (index === 1) {
     return rack.y + (rack.height - item.height) / 2;
   } else {
     return rack.y + rack.height - item.height;
   }
 };
 
+
+const fetchFlowCardId = async () => {
+  try {
+    const response = await request.get('unLoadGlass/downWorkStation/getwo');
+    console.log(response)
+    if (response.code === 200) {
+      console.log(response.data);
+      // 閬嶅巻鍝嶅簲鏁版嵁骞舵浛鎹acks鏁扮粍涓殑item灞炴��
+      response.data.forEach((itemData, index) => {
+        if (index < racks.length) {
+          const rack = racks[index];
+          const newItem = {
+            content: itemData.item.content,
+            fillColor: itemData.item.fillColor,
+            width: itemData.item.width/10000,
+            height: itemData.item.height/10000
+          };
+          rack.item == newItem;
+         
+        }
+      });
+      
+      console.log(racks); // 鏌ョ湅鏇存柊鍚庣殑racks鏁扮粍
+    } else {
+      ElMessage.error(response.msg);
+    }
+  } catch (error) {
+    console.error(error);
+  }
+};
+
+fetchFlowCardId()
+// setTimeout(fetchFlowCardId(),1000);
+  
+
+
 const showCustomAlert = (content) => {
   var str="鏋跺彿   :      111\n" +
     "闀�     :      111\n" +

--
Gitblit v1.8.0