From 2953ea46c6ea5256dfc66561bba1244e6e43505d Mon Sep 17 00:00:00 2001
From: Kirigaya <1193466151@qq.com>
Date: Sat, 31 Aug 2024 18:44:50 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D=20bug?=
=?UTF-8?q?=EF=BC=8C=20=E6=89=BE=E5=88=B0=E5=8E=9F=E5=9B=A0=EF=BC=9A=20use?=
=?UTF-8?q?r-pivot.vue=20=E7=9A=84=E9=97=AD=E5=8C=85=E4=BC=BC=E4=B9=8E?=
=?UTF-8?q?=E5=85=B1=E7=94=A8=E4=BA=86=E5=8F=98=E9=87=8F=EF=BC=8C=E5=B0=9D?=
=?UTF-8?q?=E8=AF=95=E5=B0=86=E9=97=AD=E5=8C=85=E5=87=BD=E6=95=B0=E7=9A=84?=
=?UTF-8?q?=E5=8F=98=E9=87=8F=E5=85=A8=E9=83=A8=E6=94=BE=E5=85=A5js?=
=?UTF-8?q?=E4=B8=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/pivot/index.vue | 16 ++++++++++++++--
src/components/pivot/moving-pivot.vue | 2 --
src/components/pivot/user-pivot.vue | 20 +++++++++++++++++---
src/components/toolbar/index.vue | 22 ++++++++++++++++++++--
4 files changed, 51 insertions(+), 9 deletions(-)
diff --git a/src/components/pivot/index.vue b/src/components/pivot/index.vue
index 4a390d9..4ee08b6 100644
--- a/src/components/pivot/index.vue
+++ b/src/components/pivot/index.vue
@@ -3,8 +3,10 @@
{
diff --git a/src/components/pivot/moving-pivot.vue b/src/components/pivot/moving-pivot.vue
index eae3e78..ab87bfd 100644
--- a/src/components/pivot/moving-pivot.vue
+++ b/src/components/pivot/moving-pivot.vue
@@ -73,8 +73,6 @@ function onMousemove(event) {
// 此时距离用户信标比较近,隐藏主信标
MovingPivot.show = false;
MovingPivot.currentTakenPivot = userPivot;
- } else {
- MovingPivot.show = true;
}
}
}
diff --git a/src/components/pivot/user-pivot.vue b/src/components/pivot/user-pivot.vue
index b3b69a8..ac0f9b0 100644
--- a/src/components/pivot/user-pivot.vue
+++ b/src/components/pivot/user-pivot.vue
@@ -3,7 +3,6 @@
v-if="renderPivot"
@mouseenter="onEnter()"
@mouseleave="onLeave()"
- @mouseup="onVLineMouseup()"
@contextmenu.prevent="handleUserContextMenu($event)"
class="user-pivot"
>
@@ -20,7 +19,6 @@
:style="colorStyle"
:ref="el => vline.element = el"
@mousedown.stop="onVLineMousedown()"
- @mouseup.stop="onVLineMouseup()"
>
{{ props.label }}
@@ -127,7 +125,8 @@ function onLeave() {
const vline = reactive({
dragEnable: false,
element: undefined,
- originTime: 0
+ originTime: 0,
+ delayTag: false,
});
@@ -156,6 +155,11 @@ function onVLineMousedown() {
// console.log('begin to drag');
mousemoveEventPipes.set(pivot.id, event => {
+ if (vline.dragEnable === false || vline.delayTag === true) {
+ return;
+ }
+ console.log('move pivot', vline);
+
const x = event.clientX || event.x;
pivot.x = x;
const pstate = globalLookup.pstate;
@@ -168,6 +172,16 @@ function onVLineMousedown() {
});
}
+document.onmouseup = () => {
+ vline.delayTag = true;
+ console.log('mouse up');
+ console.log(vline);
+ setTimeout(() => {
+ vline.delayTag = false;
+ }, 300);
+ onVLineMouseup();
+}
+
function onVLineMouseup() {
MovingPivot.dragEnable = false;
mousemoveEventPipes.delete(props.id);
diff --git a/src/components/toolbar/index.vue b/src/components/toolbar/index.vue
index 847fa5e..0146340 100644
--- a/src/components/toolbar/index.vue
+++ b/src/components/toolbar/index.vue
@@ -1,5 +1,8 @@
-