From f4d9c0d0b790c8836cdc05c0826dba3c304d42f6 Mon Sep 17 00:00:00 2001
From: 于杰 <1210123631@qq.com>
Date: 星期三, 03 十二月 2025 14:28:57 +0800
Subject: [PATCH] 增加 点击需要移动的小片,显示红框提醒
---
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/OptimizationRect.vue | 34 ++++++++++++++++++++++++++++------
1 files changed, 28 insertions(+), 6 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 29fe2c2..f43bcde 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
@@ -253,6 +253,12 @@
return bestFit;
};
+const isSelected = (layoutIndex, rectIndex) => {
+ return focusIndex.value &&
+ focusIndex.value.layoutIndex === layoutIndex &&
+ focusIndex.value.rectIndex === rectIndex;
+};
+
//鐗堝浘鍐呭鏍峰紡鍔犺浇
const layoutContainerStyle = (layoutIndex) => {
const layout = layouts.value[layoutIndex];
@@ -304,9 +310,10 @@
//鐗堝浘鍐呭灏忕墖鏍峰紡鍔犺浇
const rectStyle = (glassDetail, layoutIndex) => {
const layout = layouts.value[layoutIndex];
- const scale = Math.min(0.25
- );
- return {
+ const scale = Math.min(0.25);
+ const isSelectedRect = isSelected(layoutIndex, layout.glassDetails.indexOf(glassDetail));
+
+ let style = {
position: 'absolute',
left: `${glassDetail.x * scale}px`,
top: `${glassDetail.y * scale}px`,
@@ -318,13 +325,21 @@
draggable: !glassDetail.isRemain,
zIndex: glassDetail.isRemain ? 1 : 2
};
+
+ // 濡傛灉琚�変腑锛屽垯娣诲姞鍐呬晶绾㈡
+ if (isSelectedRect) {
+ style.boxShadow = 'inset 0 0 0 2px red';
+ }
+
+ return style;
};
const rectStyle1 = (glassDetail, layoutIndex) => {
const layout = layouts.value[layoutIndex];
- const scale = Math.min(0.25
- );
- return {
+ const scale = Math.min(0.25);
+ const isSelectedRect = isSelected(layoutIndex, layout.glassDetails.indexOf(glassDetail));
+
+ let style = {
position: 'absolute',
left: `${glassDetail.x * scale}px`,
top: `${glassDetail.y * scale}px`,
@@ -336,6 +351,13 @@
draggable: !glassDetail.isRemain,
zIndex: glassDetail.isRemain ? 1 : 2
};
+
+ // 濡傛灉琚�変腑锛屽垯娣诲姞鍐呬晶绾㈡
+ if (isSelectedRect) {
+ style.boxShadow = 'inset 0 0 0 2px red';
+ }
+
+ return style;
};
//鐐瑰嚮灏忕墖
--
Gitblit v1.8.0