+
@@ -23,6 +23,7 @@
{{ scaleValue }}%
+ 重置
@@ -93,6 +94,8 @@ const startX = ref(0)
const startY = ref(0)
const currentX = ref(0)
const currentY = ref(0)
+const initialX = ref(0)
+const initialY = ref(0)
const setGrabCursor = () => {
document.body.style.cursor = 'grab';
@@ -238,6 +241,18 @@ const zoomOut = () => {
const processReZoom = () => {
scaleValue.value = 100
}
+
+// 在组件初始化时记录初始位置
+onMounted(() => {
+ initialX.value = currentX.value
+ initialY.value = currentY.value
+})
+
+// 重置位置的函数
+const resetPosition = () => {
+ currentX.value = initialX.value
+ currentY.value = initialY.value
+}
--
Gitee
From 58825842abb4ee3afda11eeb80ba8d2828191567 Mon Sep 17 00:00:00 2001
From: Lemon <1599456917@qq.com>
Date: Tue, 18 Feb 2025 12:03:12 +0800
Subject: [PATCH 4/4] =?UTF-8?q?1.=20=E5=A2=9E=E5=8A=A0=E6=B5=81=E7=A8=8B?=
=?UTF-8?q?=E5=9B=BE=20=E5=B0=8F=E6=89=8B=E5=8A=9F=E8=83=BD=202.=20?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=87=8D=E7=BD=AE=E5=8A=9F=E8=83=BD=20?=
=?UTF-8?q?=E7=A7=BB=E5=8A=A8=E6=B5=81=E7=A8=8B=E4=BD=8D=E7=BD=AE=E5=90=8E?=
=?UTF-8?q?=E6=81=A2=E5=A4=8D=E5=8E=9F=E4=BD=8D=E7=BD=AE=203.=20=E6=B5=81?=
=?UTF-8?q?=E7=A8=8B=E6=8C=AA=E5=8A=A8=E7=9A=84=E6=97=B6=E5=80=99=E7=A6=81?=
=?UTF-8?q?=E7=94=A8=E6=96=87=E6=9C=AC=E9=80=89=E6=8B=A9,=E7=A1=AE?=
=?UTF-8?q?=E4=BF=9D=E6=8B=96=E5=8A=A8=E6=97=B6=E4=B8=8D=E4=BC=9A=E9=80=89?=
=?UTF-8?q?=E6=8B=A9=E6=96=87=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../SimpleProcessDesignerV2/src/SimpleProcessModel.vue | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/components/SimpleProcessDesignerV2/src/SimpleProcessModel.vue b/src/components/SimpleProcessDesignerV2/src/SimpleProcessModel.vue
index 5a472980c..daf74867d 100644
--- a/src/components/SimpleProcessDesignerV2/src/SimpleProcessModel.vue
+++ b/src/components/SimpleProcessDesignerV2/src/SimpleProcessModel.vue
@@ -114,7 +114,7 @@ const startDrag = (e: MouseEvent) => {
const onDrag = (e: MouseEvent) => {
if (!isDragging.value) return;
- e.preventDefault();
+ e.preventDefault(); // 禁用文本选择
// 使用 requestAnimationFrame 优化性能
requestAnimationFrame(() => {
@@ -261,6 +261,7 @@ const resetPosition = () => {
height: 100%;
position: relative;
overflow: hidden;
+ user-select: none; // 禁用文本选择
}
.simple-process-model {
--
Gitee