diff --git a/front_vue/src/components/Card.vue b/front_vue/src/components/Card.vue index b39a02d..3c94dea 100644 --- a/front_vue/src/components/Card.vue +++ b/front_vue/src/components/Card.vue @@ -7,6 +7,9 @@ @touchstart="handleTouchStart" @touchend="handleTouchEnd" @touchmove="handleTouchMove" + @mousedown="handleMouseDown" + @mouseup="handleMouseUp" + @mouseleave="handleMouseLeave" @contextmenu="handleContextMenu" :class="{ dragging: isDragging, 'has-label-color': cardLabelColor, 'long-pressing': isLongPressing }" :style="cardLabelColor ? { '--label-bg': cardLabelColor } : {}" @@ -149,6 +152,40 @@ const handleContextMenu = (e) => { } } +// Mouse long-press для ПК в мобильном режиме (когда touch события недоступны) +const handleMouseDown = (e) => { + if (!isMobile.value) return + // Только левая кнопка мыши + if (e.button !== 0) return + + longPressTimer = setTimeout(() => { + isLongPressing.value = true + // Эмитим запрос на перемещение + emit('move-request', { + cardId: props.card.id, + cardTitle: props.card.title, + columnId: props.columnId + }) + isLongPressing.value = false + }, 500) +} + +const handleMouseUp = () => { + if (longPressTimer) { + clearTimeout(longPressTimer) + longPressTimer = null + } + isLongPressing.value = false +} + +const handleMouseLeave = () => { + if (longPressTimer) { + clearTimeout(longPressTimer) + longPressTimer = null + } + isLongPressing.value = false +} + const refreshIcons = () => { if (window.lucide) { window.lucide.createIcons()