From bd5e141e592cca806fad15adfc0c540db075b7e6 Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期三, 18 十二月 2024 09:54:33 +0800
Subject: [PATCH] 已出炉更改显示逻辑
---
UI-Project/src/views/PurchaseReturn/purchaseReturn.vue | 75 ++++++++++++++++++++++++++++---------
1 files changed, 56 insertions(+), 19 deletions(-)
diff --git a/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue b/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
index 51909ab..c70f264 100644
--- a/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
+++ b/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
@@ -203,6 +203,7 @@
else {
adjustedRects1.value = []
}
+// 杩涚倝鍓�
if (data.waitingGlass && data.waitingGlass.length > 0) {
const newGlassIds = new Set(data.waitingGlass[0].map(rect => rect.glassId));
const existingRects = adjustedRectsa.value.filter(rect => newGlassIds.has(rect.glassId));
@@ -253,6 +254,7 @@
else if (data.waitingGlass == null) {
adjustedRectsa.value = []
}
+ // 宸插嚭鐐�
if (data.outGlass && data.outGlass.length > 0) {
// 鎻愬彇鏂扮殑鐭╁舰ID
const newGlassIds = new Set(data.outGlass[0].map(rect => rect.glassId));
@@ -261,8 +263,8 @@
// 璁$畻鏂扮殑鐭╁舰
const newRects = data.outGlass[0].map(rect => {
const scaleFactor = 1390/5190;
- const scaleFactory = 750/2800;
- let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta,newY;
+ const scaleFactorY = 750/2800;
+ let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;;
let newX = rect.yCoordinate;
if (rect.width < rect.height) {
widtha = rect.height;
@@ -273,29 +275,64 @@
}
if (rect.angle === 0) {
adjustedWidth = widtha * scaleFactor;
- adjustedHeight = heighta * scaleFactory;
+ adjustedHeight = heighta * scaleFactorY;
// adjustedWidtha = widtha;
// adjustedHeighta = heighta;
- // newX = 5190 - (rect.yCoordinate + widtha);
- newY = 2800 - (rect.xCoordinate + heighta);
- } else {
+ newX = 5190 - (rect.yCoordinate + widtha);
+ } else {
adjustedWidth = heighta * scaleFactor;
- adjustedHeight = widtha * scaleFactory;
- // adjustedWidtha = heighta;
- // adjustedHeighta = widtha;
- // newX = 5190 - (rect.yCoordinate + heighta);
- newY = 2800 - (rect.xCoordinate + widtha);
+ adjustedHeight = widtha * scaleFactorY;
+ // adjustedWidtha = widtha;
+ // adjustedHeighta = heighta;
+ newX = 5190 - (rect.yCoordinate + heighta);
}
return {
- ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�
- x: newX * scaleFactor,
- y: newY * scaleFactory,
- width: adjustedWidth,
- height: adjustedHeight,
- widtha: rect.width,
- heighta: rect.height,
+ ...rect,
+ x: newX * scaleFactor,
+ y: rect.xCoordinate * scaleFactorY,
+ width: adjustedWidth,
+ height: adjustedHeight,
+ widtha: rect.width,
+ heighta: rect.height,
}
- });
+ });
+ // const newRects = data.outGlass[0].map(rect => {
+ // const scaleFactor = 1390/5190;
+ // const scaleFactory = 750/2800;
+ // let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta,newY;
+ // let newX = rect.yCoordinate;
+ // if (rect.width < rect.height) {
+ // widtha = rect.height;
+ // heighta = rect.width;
+ // }else {
+ // widtha = rect.width;
+ // heighta = rect.height;
+ // }
+ // if (rect.angle === 0) {
+ // adjustedWidth = widtha * scaleFactor;
+ // adjustedHeight = heighta * scaleFactory;
+ // // adjustedWidtha = widtha;
+ // // adjustedHeighta = heighta;
+ // // newX = 5190 - (rect.yCoordinate + widtha);
+ // newY = 2800 - (rect.xCoordinate + heighta);
+ // } else {
+ // adjustedWidth = heighta * scaleFactor;
+ // adjustedHeight = widtha * scaleFactory;
+ // // adjustedWidtha = heighta;
+ // // adjustedHeighta = widtha;
+ // // newX = 5190 - (rect.yCoordinate + heighta);
+ // newY = 2800 - (rect.xCoordinate + widtha);
+ // }
+ // return {
+ // ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�
+ // x: newX * scaleFactor,
+ // y: newY * scaleFactory,
+ // width: adjustedWidth,
+ // height: adjustedHeight,
+ // widtha: rect.width,
+ // heighta: rect.height,
+ // }
+ // });
// 鍚堝苟鏂版棫鐭╁舰锛屽苟淇濈暀 isActive 鐘舵��
adjustedRectsb.value = existingRects.map(oldRect => {
--
Gitblit v1.8.0