Правка фронта
This commit is contained in:
@@ -1,21 +1,10 @@
|
||||
<template>
|
||||
<div
|
||||
class="archive-card"
|
||||
:class="{ 'has-label-color': cardLabelColor, 'dragging': isDragging }"
|
||||
:class="{ 'has-label-color': cardLabelColor }"
|
||||
:style="cardLabelColor ? { '--label-bg': cardLabelColor } : {}"
|
||||
:draggable="true"
|
||||
@dragstart="handleDragStart"
|
||||
@dragend="handleDragEnd"
|
||||
@click="$emit('click')"
|
||||
>
|
||||
<!-- Drag handle (6 точек) -->
|
||||
<div
|
||||
class="drag-handle"
|
||||
title="Перетащите для изменения порядка"
|
||||
>
|
||||
<i data-lucide="grip-vertical"></i>
|
||||
</div>
|
||||
|
||||
<!-- Аватарка -->
|
||||
<div class="card-assignee" v-if="card.assignee">
|
||||
<img
|
||||
@@ -79,12 +68,11 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, onUpdated } from 'vue'
|
||||
import { computed, onMounted, onUpdated } from 'vue'
|
||||
import { getFullUrl } from '../api'
|
||||
|
||||
const props = defineProps({
|
||||
card: Object,
|
||||
index: Number,
|
||||
departments: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
@@ -95,7 +83,7 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['click', 'restore', 'delete', 'dragstart', 'dragend'])
|
||||
const emit = defineEmits(['click', 'restore', 'delete'])
|
||||
|
||||
const refreshIcons = () => {
|
||||
if (window.lucide) {
|
||||
@@ -106,22 +94,6 @@ const refreshIcons = () => {
|
||||
onMounted(refreshIcons)
|
||||
onUpdated(refreshIcons)
|
||||
|
||||
// Drag state
|
||||
const isDragging = ref(false)
|
||||
|
||||
const handleDragStart = (e) => {
|
||||
isDragging.value = true
|
||||
e.dataTransfer.effectAllowed = 'move'
|
||||
e.dataTransfer.setData('cardId', props.card.id.toString())
|
||||
e.dataTransfer.setData('fromIndex', props.index.toString())
|
||||
emit('dragstart', props.card.id)
|
||||
}
|
||||
|
||||
const handleDragEnd = () => {
|
||||
isDragging.value = false
|
||||
emit('dragend')
|
||||
}
|
||||
|
||||
// Получаем отдел по id
|
||||
const cardDepartment = computed(() => {
|
||||
if (!props.card.departmentId) return null
|
||||
@@ -174,40 +146,6 @@ const formatDateFull = (dateStr) => {
|
||||
background: var(--bg-card-hover);
|
||||
}
|
||||
|
||||
.archive-card.dragging {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
/* Drag handle (6 точек) */
|
||||
.drag-handle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: grab;
|
||||
flex-shrink: 0;
|
||||
padding: 4px;
|
||||
margin: -4px;
|
||||
margin-right: 0;
|
||||
border-radius: 4px;
|
||||
color: var(--text-muted);
|
||||
opacity: 0.4;
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
.drag-handle:hover {
|
||||
opacity: 1;
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.drag-handle:active {
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
.drag-handle i {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.archive-card.has-label-color {
|
||||
border-left-color: var(--label-bg);
|
||||
background: color-mix(in srgb, var(--label-bg) 8%, var(--bg-card));
|
||||
|
||||
Reference in New Issue
Block a user