From d473c7b2b07cfeee3740f40dfdc95d722d8da3c2 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期五, 21 十一月 2025 14:04:13 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override
---
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/OptimizationRect.vue | 56 +++++++++++++++++++++++++++++++++++---------------------
1 files changed, 35 insertions(+), 21 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/OptimizationRect.vue b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/OptimizationRect.vue
index e33a740..8369231 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/OptimizationRect.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/OptimizationRect.vue
@@ -71,9 +71,9 @@
</div>
</div>
-<!-- <button @click="submitLayouts" style="position: fixed; top: 90px; right: 20px; padding: 10px; background: #409eff; color: white; border: none; border-radius: 5px; cursor: pointer;">-->
-<!-- 淇濆瓨璋冩暣-->
-<!-- </button>-->
+ <button @click="submitLayouts" style="position: fixed; top: 90px; right: 20px; padding: 10px; background: #409eff; color: white; border: none; border-radius: 5px; cursor: pointer;">
+ 淇濆瓨璋冩暣
+ </button>
</div>
</template>
@@ -119,10 +119,10 @@
const submitLayouts = async () => {
layouts.value.forEach(layout => {
layout.glassDetails.forEach(glassDetail => {
- glassDetail.x = Math.round(glassDetail.x);
- glassDetail.y = Math.round(glassDetail.y);
- glassDetail.width = Math.round(glassDetail.width);
- glassDetail.height = Math.round(glassDetail.height);
+ glassDetail.x = parseFloat(glassDetail.x.toFixed(2));
+ glassDetail.y = parseFloat(glassDetail.y.toFixed(2));
+ glassDetail.width = parseFloat(glassDetail.width.toFixed(2));
+ glassDetail.height = parseFloat(glassDetail.height.toFixed(2));
});
});
const savedProjectNo = localStorage.getItem('projectNo');
@@ -596,6 +596,9 @@
glassDetail.glassPoint.forEach(point => {
point.X += offsetX;
point.Y += offsetY;
+ // 娣诲姞绮惧害鎺у埗
+ point.X = parseFloat(point.X.toFixed(2));
+ point.Y = parseFloat(point.Y.toFixed(2));
});
}
@@ -619,8 +622,8 @@
(props.gh - 100) / layout.height
);
- glassDetail.x = Math.round(glassDetail.x);
- glassDetail.y = Math.round(glassDetail.y);
+ glassDetail.x = parseFloat(glassDetail.x.toFixed(2));
+ glassDetail.y = parseFloat(glassDetail.y.toFixed(2));
adjustAlignmentPosition(layoutIndex, rectIndex);
}
@@ -700,10 +703,10 @@
else {
// 鏃犳硶鍚堝苟锛屼繚瀛樺綋鍓嶇煩褰紝寮�濮嬫柊鐨勫悎骞�
merged.push({
- x: Math.round(current.x),
- y: Math.round(current.y),
- width: Math.round(current.width),
- height: Math.round(current.height),
+ x: current.x,
+ y: current.y,
+ width: current.width,
+ height: current.height,
isRemain: true
});
current = { ...next };
@@ -712,10 +715,10 @@
// 娣诲姞鏈�鍚庝竴涓煩褰�
merged.push({
- x: Math.round(current.x),
- y: Math.round(current.y),
- width: Math.round(current.width),
- height: Math.round(current.height),
+ x: current.x,
+ y: current.y,
+ width: current.width,
+ height: current.height,
isRemain: true
});
@@ -771,10 +774,10 @@
// 娣诲姞鏂扮殑浣欐枡鐭╁舰
uniqueArr.forEach((area) => {
newGlassDetails.push({
- x: Math.round(area.x),
- y: Math.round(area.y),
- width: Math.round(area.width),
- height: Math.round(area.height),
+ x: area.x,
+ y: area.y,
+ width: area.width,
+ height: area.height,
isRemain: true
});
});
@@ -849,6 +852,9 @@
// 鏃嬭浆90搴﹀悗鐨勫潗鏍囷紙椤烘椂閽堬級
point.X = originalState.x + relY;
point.Y = originalState.y + (originalState.width - relX);
+ // 娣诲姞绮惧害鎺у埗
+ point.X = parseFloat(point.X.toFixed(2));
+ point.Y = parseFloat(point.Y.toFixed(2));
});
}
adjustGrayRectangles(layoutIndex);
@@ -958,6 +964,9 @@
glassDetail.glassPoint.forEach(point => {
point.X += offsetX;
point.Y += offsetY;
+ // 娣诲姞绮惧害鎺у埗
+ point.X = parseFloat(point.X.toFixed(2));
+ point.Y = parseFloat(point.Y.toFixed(2));
});
}
adjustGrayRectangles(layoutIndex);
@@ -1213,6 +1222,8 @@
if (glassDetail.glassPoint && Array.isArray(glassDetail.glassPoint)) {
glassDetail.glassPoint.forEach(point => {
point.X = width - point.X;
+ point.X = parseFloat(point.X.toFixed(2));
+ point.Y = parseFloat(point.Y.toFixed(2));
});
}
});
@@ -1240,6 +1251,9 @@
if (glassDetail.glassPoint && Array.isArray(glassDetail.glassPoint)) {
glassDetail.glassPoint.forEach(point => {
point.Y = height - point.Y;
+ // 娣诲姞绮惧害鎺у埗
+ point.X = parseFloat(point.X.toFixed(2));
+ point.Y = parseFloat(point.Y.toFixed(2));
});
}
});
--
Gitblit v1.8.0