From e00c3b5bee887cd6fa1e5c475f5bf45f8b1d1f22 Mon Sep 17 00:00:00 2001 From: Zhenyu Zheng Date: Tue, 10 Feb 2026 14:52:04 +0800 Subject: [PATCH] feat: implement drag-and-drop scheduling for content calendar Use FullCalendar's official Draggable API to enable bidirectional drag-and-drop between the unscheduled content panel and the calendar: - Drag unscheduled items onto calendar dates to schedule them - Drag calendar events back to the unscheduled panel to unschedule - Visual feedback: panel highlights with dashed border on drag-over, items show reduced opacity while being dragged - Auto-reinitialize Draggable when content list or panel state changes - Proper lifecycle cleanup on component unmount Co-Authored-By: Claude Opus 4.6 --- frontend/src/views/ContentCalendar.vue | 141 +++++++++++++++++++------ 1 file changed, 106 insertions(+), 35 deletions(-) diff --git a/frontend/src/views/ContentCalendar.vue b/frontend/src/views/ContentCalendar.vue index 885e2d2..ec7f902 100644 --- a/frontend/src/views/ContentCalendar.vue +++ b/frontend/src/views/ContentCalendar.vue @@ -39,7 +39,14 @@
-
+
@@ -49,14 +56,13 @@
-
+
@@ -177,14 +183,14 @@ @@ -590,6 +653,12 @@ onMounted(() => { transition: all 0.3s ease; overflow: hidden; + &.drop-target-active { + background: #ecf5ff; + border: 2px dashed #409eff; + box-shadow: 0 0 12px rgba(64, 158, 255, 0.2); + } + &.collapsed { width: 40px; min-width: 40px; @@ -650,9 +719,11 @@ onMounted(() => { transform: translateY(-1px); } - &:active { + &:active, + &.fc-dragging { cursor: grabbing; - opacity: 0.7; + opacity: 0.4; + box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3); } &.status-draft { border-left-color: #909399; }