Skip to content

Commit be0e2b3

Browse files
committed
v1.3.0 - lint format
1 parent 992cbcf commit be0e2b3

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

src/components/GanttChart.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ const tasksForTimeline = computed(() => {
608608
// 将Task[]转换为Milestone[]的计算属性,确保类型兼容
609609
const milestonesForTimeline = computed((): Milestone[] => {
610610
if (!props.milestones) return []
611-
611+
612612
// 过滤出有startDate的里程碑,并转换为Milestone类型
613613
return props.milestones
614614
.filter((task): task is Task & { startDate: string } => !!task.startDate)

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
@@ -997,7 +997,7 @@ watch(
997997
clearTimelineCache()
998998
timelineData.value = generateTimelineData()
999999
}
1000-
}
1000+
},
10011001
)
10021002
10031003
// 保证每次时间轴数据变化后都自动居中今日(仅初始化和外部props变更时触发,不因任务/里程碑变更触发)
@@ -1012,7 +1012,7 @@ watch(
10121012
})
10131013
}
10141014
},
1015-
{ deep: true }
1015+
{ deep: true },
10161016
)
10171017
10181018
// 将今日定位到时间线中间位置
@@ -1034,21 +1034,21 @@ const scrollToTodayCenter = (retry = 0) => {
10341034
startNormalized = new Date(
10351035
yearRange.startDate.getFullYear(),
10361036
yearRange.startDate.getMonth(),
1037-
yearRange.startDate.getDate()
1037+
yearRange.startDate.getDate(),
10381038
)
10391039
} else if (currentTimeScale.value === TimelineScale.QUARTER) {
10401040
// 季度视图使用与年度视图相同的基准日期,确保坐标系统一致
10411041
const yearRange = getYearTimelineRange()
10421042
startNormalized = new Date(
10431043
yearRange.startDate.getFullYear(),
10441044
yearRange.startDate.getMonth(),
1045-
yearRange.startDate.getDate()
1045+
yearRange.startDate.getDate(),
10461046
)
10471047
} else {
10481048
startNormalized = new Date(
10491049
timelineStart.getFullYear(),
10501050
timelineStart.getMonth(),
1051-
timelineStart.getDate()
1051+
timelineStart.getDate(),
10521052
)
10531053
}
10541054
@@ -1121,7 +1121,7 @@ const scrollToTodayCenter = (retry = 0) => {
11211121
}
11221122
11231123
const dayOffset = Math.floor(
1124-
(todayNormalized.getTime() - startOfQuarter.getTime()) / (1000 * 60 * 60 * 24)
1124+
(todayNormalized.getTime() - startOfQuarter.getTime()) / (1000 * 60 * 60 * 24),
11251125
)
11261126
const daysInQuarter =
11271127
Math.floor((endOfQuarter.getTime() - startOfQuarter.getTime()) / (1000 * 60 * 60 * 24)) + 1
@@ -1178,7 +1178,7 @@ const getTodayLinePositionInYearView = computed(() => {
11781178
const startNormalized = new Date(
11791179
yearRange.startDate.getFullYear(),
11801180
yearRange.startDate.getMonth(),
1181-
yearRange.startDate.getDate()
1181+
yearRange.startDate.getDate(),
11821182
)
11831183
11841184
const startYear = startNormalized.getFullYear()
@@ -1272,7 +1272,7 @@ const scrollToToday = () => {
12721272
const startNormalized = new Date(
12731273
timelineStart.getFullYear(),
12741274
timelineStart.getMonth(),
1275-
timelineStart.getDate()
1275+
timelineStart.getDate(),
12761276
)
12771277
12781278
// 计算今天距离时间线开始日期的天数
@@ -1323,7 +1323,7 @@ const updateTask = (updatedTask: Task) => {
13231323
window.dispatchEvent(
13241324
new CustomEvent('task-updated', {
13251325
detail: updatedTask,
1326-
})
1326+
}),
13271327
)
13281328
}
13291329
@@ -1383,7 +1383,7 @@ const handleTaskBarContextMenu = (event: { task: Task; position: { x: number; y:
13831383
window.dispatchEvent(
13841384
new CustomEvent('context-menu', {
13851385
detail: event,
1386-
})
1386+
}),
13871387
)
13881388
}
13891389
@@ -1466,7 +1466,7 @@ onMounted(() => {
14661466
// 监听TaskList的垂直滚动事件
14671467
window.addEventListener(
14681468
'task-list-vertical-scroll',
1469-
handleTaskListVerticalScroll as EventListener
1469+
handleTaskListVerticalScroll as EventListener,
14701470
)
14711471
// 监听语言变化
14721472
window.addEventListener('locale-changed', handleLocaleChange as EventListener)
@@ -1476,7 +1476,7 @@ onMounted(() => {
14761476
// 监听Timeline容器resize事件(TaskList切换等)
14771477
window.addEventListener(
14781478
'timeline-container-resized',
1479-
handleTimelineContainerResized as EventListener
1479+
handleTimelineContainerResized as EventListener,
14801480
)
14811481
14821482
// 监听里程碑点击定位事件
@@ -1566,7 +1566,7 @@ const handleTimelineBodyScroll = (event: Event) => {
15661566
window.dispatchEvent(
15671567
new CustomEvent('timeline-vertical-scroll', {
15681568
detail: { scrollTop },
1569-
})
1569+
}),
15701570
)
15711571
}
15721572
}
@@ -1579,7 +1579,7 @@ watch(
15791579
updateSvgSize()
15801580
})
15811581
},
1582-
{ immediate: true }
1582+
{ immediate: true },
15831583
)
15841584
15851585
// 拖拽滑动相关状态
@@ -1763,7 +1763,7 @@ const startAutoScroll = (direction: 'left' | 'right') => {
17631763
window.dispatchEvent(
17641764
new CustomEvent('timeline-auto-scroll', {
17651765
detail: { scrollDelta: newScrollLeft - currentScrollLeft },
1766-
})
1766+
}),
17671767
)
17681768
17691769
autoScrollTimer = window.setTimeout(scroll, 16) // 约60fps
@@ -1817,14 +1817,14 @@ onUnmounted(() => {
18171817
window.removeEventListener('task-list-hover', handleTaskListHover as EventListener)
18181818
window.removeEventListener(
18191819
'task-list-vertical-scroll',
1820-
handleTaskListVerticalScroll as EventListener
1820+
handleTaskListVerticalScroll as EventListener,
18211821
)
18221822
window.removeEventListener('locale-changed', handleLocaleChange as EventListener)
18231823
window.removeEventListener('splitter-drag-start', handleSplitterDragStart as EventListener)
18241824
window.removeEventListener('splitter-drag-end', handleSplitterDragEnd as EventListener)
18251825
window.removeEventListener(
18261826
'timeline-container-resized',
1827-
handleTimelineContainerResized as EventListener
1827+
handleTimelineContainerResized as EventListener,
18281828
)
18291829
window.removeEventListener('milestone-click-locate', handleMilestoneClickLocate as EventListener)
18301830
window.removeEventListener('drag-boundary-check', handleDragBoundaryCheck as EventListener)
@@ -1935,7 +1935,7 @@ watch(
19351935
}
19361936
})
19371937
},
1938-
{ deep: true }
1938+
{ deep: true },
19391939
)
19401940
19411941
// 处理里程碑点击定位事件

0 commit comments

Comments
 (0)