Skip to content

Commit 243c2da

Browse files
committed
v1.4.0 - bugfix
1 parent 0c317b1 commit 243c2da

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

src/components/Timeline.vue

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ const optimizedTimelineData = computed(() => {
354354
const currentDay = new Date(day.year, day.month - 1, day.day)
355355
currentDay.setHours(0, 0, 0, 0)
356356
const daysDiff = Math.floor(
357-
(currentDay.getTime() - dayStart.getTime()) / (1000 * 60 * 60 * 24),
357+
(currentDay.getTime() - dayStart.getTime()) / (1000 * 60 * 60 * 24)
358358
)
359359
const totalHourOffset = daysDiff * 24
360360
@@ -455,7 +455,7 @@ const computeAllMilestonesPositions = () => {
455455
if (!isNaN(milestoneDate.getTime())) {
456456
const startDiff = Math.floor(
457457
(milestoneDate.getTime() - timelineConfig.value.startDate.getTime()) /
458-
(1000 * 60 * 60 * 24),
458+
(1000 * 60 * 60 * 24)
459459
)
460460
const left = startDiff * 30 + 30 / 2 - 12 // 30是dayWidth,12是图标半径
461461
@@ -489,7 +489,7 @@ const computeAllMilestonesPositions = () => {
489489
if (!isNaN(milestoneDate.getTime())) {
490490
const startDiff = Math.floor(
491491
(milestoneDate.getTime() - timelineConfig.value.startDate.getTime()) /
492-
(1000 * 60 * 60 * 24),
492+
(1000 * 60 * 60 * 24)
493493
)
494494
const left = startDiff * 30 + 30 / 2 - 12
495495
@@ -592,7 +592,7 @@ const handleTaskRowHover = (taskId: number | null) => {
592592
window.dispatchEvent(
593593
new CustomEvent('timeline-task-hover', {
594594
detail: taskId,
595-
}),
595+
})
596596
)
597597
}
598598
@@ -644,7 +644,7 @@ const handleMilestoneIconChange = (milestoneId: number, icon: string) => {
644644
window.dispatchEvent(
645645
new CustomEvent('milestone-icon-changed', {
646646
detail: { milestoneId, icon },
647-
}),
647+
})
648648
)
649649
}
650650
@@ -662,7 +662,7 @@ const handleMilestoneSave = (updatedMilestone: Milestone) => {
662662
window.dispatchEvent(
663663
new CustomEvent('milestone-data-updated', {
664664
detail: { milestone: updatedMilestone },
665-
}),
665+
})
666666
)
667667
}
668668
@@ -675,14 +675,14 @@ const handleMilestoneDelete = (milestoneId: number) => {
675675
window.dispatchEvent(
676676
new CustomEvent('milestone-deleted', {
677677
detail: { milestoneId },
678-
}),
678+
})
679679
)
680680
681681
// 广播里程碑数据变化事件,确保Timeline重新渲染
682682
window.dispatchEvent(
683683
new CustomEvent('milestone-data-changed', {
684684
detail: { milestoneId },
685-
}),
685+
})
686686
)
687687
}
688688
@@ -697,7 +697,7 @@ const handleMilestoneUpdate = (updatedMilestone: Milestone) => {
697697
window.dispatchEvent(
698698
new CustomEvent('milestone-data-updated', {
699699
detail: { milestone: updatedMilestone },
700-
}),
700+
})
701701
)
702702
}
703703
@@ -1017,7 +1017,7 @@ watch(
10171017
clearTimelineCache()
10181018
timelineData.value = generateTimelineData()
10191019
}
1020-
},
1020+
}
10211021
)
10221022
10231023
// 保证每次时间轴数据变化后都自动居中今日(仅初始化和外部props变更时触发,不因任务/里程碑变更触发)
@@ -1032,7 +1032,7 @@ watch(
10321032
})
10331033
}
10341034
},
1035-
{ deep: true },
1035+
{ deep: true }
10361036
)
10371037
10381038
// 将今日定位到时间线中间位置
@@ -1057,13 +1057,13 @@ const scrollToTodayCenter = (retry = 0) => {
10571057
startNormalized = new Date(
10581058
yearRange.startDate.getFullYear(),
10591059
yearRange.startDate.getMonth(),
1060-
yearRange.startDate.getDate(),
1060+
yearRange.startDate.getDate()
10611061
)
10621062
} else {
10631063
startNormalized = new Date(
10641064
timelineStart.getFullYear(),
10651065
timelineStart.getMonth(),
1066-
timelineStart.getDate(),
1066+
timelineStart.getDate()
10671067
)
10681068
}
10691069
@@ -1136,7 +1136,7 @@ const scrollToTodayCenter = (retry = 0) => {
11361136
}
11371137
11381138
const dayOffset = Math.floor(
1139-
(todayNormalized.getTime() - startOfQuarter.getTime()) / (1000 * 60 * 60 * 24),
1139+
(todayNormalized.getTime() - startOfQuarter.getTime()) / (1000 * 60 * 60 * 24)
11401140
)
11411141
const daysInQuarter =
11421142
Math.floor((endOfQuarter.getTime() - startOfQuarter.getTime()) / (1000 * 60 * 60 * 24)) + 1
@@ -1193,7 +1193,7 @@ const getTodayLinePositionInYearView = computed(() => {
11931193
const startNormalized = new Date(
11941194
yearRange.startDate.getFullYear(),
11951195
yearRange.startDate.getMonth(),
1196-
yearRange.startDate.getDate(),
1196+
yearRange.startDate.getDate()
11971197
)
11981198
11991199
const startYear = startNormalized.getFullYear()
@@ -1287,7 +1287,7 @@ const scrollToToday = () => {
12871287
const startNormalized = new Date(
12881288
timelineStart.getFullYear(),
12891289
timelineStart.getMonth(),
1290-
timelineStart.getDate(),
1290+
timelineStart.getDate()
12911291
)
12921292
12931293
// 计算今天距离时间线开始日期的天数
@@ -1338,7 +1338,7 @@ const updateTask = (updatedTask: Task) => {
13381338
window.dispatchEvent(
13391339
new CustomEvent('task-updated', {
13401340
detail: updatedTask,
1341-
}),
1341+
})
13421342
)
13431343
}
13441344
@@ -1398,7 +1398,7 @@ const handleTaskBarContextMenu = (event: { task: Task; position: { x: number; y:
13981398
window.dispatchEvent(
13991399
new CustomEvent('context-menu', {
14001400
detail: event,
1401-
}),
1401+
})
14021402
)
14031403
}
14041404
@@ -1481,7 +1481,7 @@ onMounted(() => {
14811481
// 监听TaskList的垂直滚动事件
14821482
window.addEventListener(
14831483
'task-list-vertical-scroll',
1484-
handleTaskListVerticalScroll as EventListener,
1484+
handleTaskListVerticalScroll as EventListener
14851485
)
14861486
// 监听语言变化
14871487
window.addEventListener('locale-changed', handleLocaleChange as EventListener)
@@ -1491,7 +1491,7 @@ onMounted(() => {
14911491
// 监听Timeline容器resize事件(TaskList切换等)
14921492
window.addEventListener(
14931493
'timeline-container-resized',
1494-
handleTimelineContainerResized as EventListener,
1494+
handleTimelineContainerResized as EventListener
14951495
)
14961496
14971497
// 监听里程碑点击定位事件
@@ -1581,7 +1581,7 @@ const handleTimelineBodyScroll = (event: Event) => {
15811581
window.dispatchEvent(
15821582
new CustomEvent('timeline-vertical-scroll', {
15831583
detail: { scrollTop },
1584-
}),
1584+
})
15851585
)
15861586
}
15871587
}
@@ -1594,7 +1594,7 @@ watch(
15941594
updateSvgSize()
15951595
})
15961596
},
1597-
{ immediate: true },
1597+
{ immediate: true }
15981598
)
15991599
16001600
// 拖拽滑动相关状态
@@ -1778,7 +1778,7 @@ const startAutoScroll = (direction: 'left' | 'right') => {
17781778
window.dispatchEvent(
17791779
new CustomEvent('timeline-auto-scroll', {
17801780
detail: { scrollDelta: newScrollLeft - currentScrollLeft },
1781-
}),
1781+
})
17821782
)
17831783
17841784
autoScrollTimer = window.setTimeout(scroll, 16) // 约60fps
@@ -1832,14 +1832,14 @@ onUnmounted(() => {
18321832
window.removeEventListener('task-list-hover', handleTaskListHover as EventListener)
18331833
window.removeEventListener(
18341834
'task-list-vertical-scroll',
1835-
handleTaskListVerticalScroll as EventListener,
1835+
handleTaskListVerticalScroll as EventListener
18361836
)
18371837
window.removeEventListener('locale-changed', handleLocaleChange as EventListener)
18381838
window.removeEventListener('splitter-drag-start', handleSplitterDragStart as EventListener)
18391839
window.removeEventListener('splitter-drag-end', handleSplitterDragEnd as EventListener)
18401840
window.removeEventListener(
18411841
'timeline-container-resized',
1842-
handleTimelineContainerResized as EventListener,
1842+
handleTimelineContainerResized as EventListener
18431843
)
18441844
window.removeEventListener('milestone-click-locate', handleMilestoneClickLocate as EventListener)
18451845
window.removeEventListener('drag-boundary-check', handleDragBoundaryCheck as EventListener)
@@ -1950,7 +1950,7 @@ watch(
19501950
}
19511951
})
19521952
},
1953-
{ deep: true },
1953+
{ deep: true }
19541954
)
19551955
19561956
// 处理里程碑点击定位事件
@@ -2936,7 +2936,7 @@ const handleAddSuccessor = (task: Task) => {
29362936
border-right: 1px solid var(--gantt-border-medium);
29372937
box-sizing: border-box;
29382938
height: 100%;
2939-
min-width: 120px;
2939+
min-width: 60px;
29402940
}
29412941
29422942
.timeline-month:last-child {

0 commit comments

Comments
 (0)