@@ -244,13 +244,13 @@ const taskBarStyle = computed(() => {
244244 const startDateOnly = new Date (
245245 startDate .getFullYear (),
246246 startDate .getMonth (),
247- startDate .getDate ()
247+ startDate .getDate (),
248248 )
249249 const endDateOnly = new Date (endDate .getFullYear (), endDate .getMonth (), endDate .getDate ())
250250 const baseStartOnly = new Date (
251251 baseStart .getFullYear (),
252252 baseStart .getMonth (),
253- baseStart .getDate ()
253+ baseStart .getDate (),
254254 )
255255
256256 if (props .currentTimeScale === TimelineScale .YEAR ) {
@@ -272,15 +272,15 @@ const taskBarStyle = computed(() => {
272272 const startPosition = calculatePositionFromTimelineData (
273273 startDateOnly ,
274274 props .timelineData ,
275- props .currentTimeScale
275+ props .currentTimeScale ,
276276 )
277277 // 计算结束位置:为结束日期添加一天来获取正确的结束位置
278278 const nextDay = new Date (endDateOnly )
279279 nextDay .setDate (nextDay .getDate () + 1 )
280280 let endPosition = calculatePositionFromTimelineData (
281281 nextDay ,
282282 props .timelineData ,
283- props .currentTimeScale
283+ props .currentTimeScale ,
284284 )
285285
286286 // 如果结束日期+1天超出范围,使用结束日期的位置+一天的宽度
@@ -295,7 +295,7 @@ const taskBarStyle = computed(() => {
295295 calculatePositionFromTimelineData (
296296 endDateOnly ,
297297 props .timelineData ,
298- props .currentTimeScale
298+ props .currentTimeScale ,
299299 ) + dayWidth
300300 }
301301
@@ -304,7 +304,7 @@ const taskBarStyle = computed(() => {
304304 } else {
305305 // 日视图:基于日期的简单计算
306306 const startDiff = Math .floor (
307- (startDateOnly .getTime () - baseStartOnly .getTime ()) / (1000 * 60 * 60 * 24 )
307+ (startDateOnly .getTime () - baseStartOnly .getTime ()) / (1000 * 60 * 60 * 24 ),
308308 )
309309
310310 // 计算持续天数(基于日期,忽略时间)
@@ -501,7 +501,7 @@ const handleMouseMove = (e: MouseEvent) => {
501501 mouseX: e .clientX ,
502502 isDragging: isDragging .value || isResizingLeft .value || isResizingRight .value ,
503503 },
504- })
504+ }),
505505 )
506506
507507 // 更新拖拽提示框位置
@@ -766,7 +766,7 @@ const handleMouseMove = (e: MouseEvent) => {
766766 const newDurationDays = newWidth / props .dayWidth
767767 const newEndDate = addDaysToLocalDate (
768768 props .startDate ,
769- resizeStartLeft .value / props .dayWidth + newDurationDays - 1
769+ resizeStartLeft .value / props .dayWidth + newDurationDays - 1 ,
770770 )
771771
772772 // 只更新临时数据,不触发事件
@@ -798,7 +798,7 @@ const handleMouseUp = () => {
798798 mouseX: 0 ,
799799 isDragging: false ,
800800 },
801- })
801+ }),
802802 )
803803
804804 // 如果有临时数据,说明发生了拖拽或拉伸,提交数据更新
@@ -882,7 +882,7 @@ watch(
882882 reportBarPosition ()
883883 })
884884 },
885- { deep: true }
885+ { deep: true },
886886)
887887
888888// 处理TaskBar双击事件
@@ -1171,7 +1171,7 @@ watch(
11711171 }
11721172 }, 200 )
11731173 }
1174- }
1174+ },
11751175)
11761176
11771177// 监听外部hideBubbles属性变化,确保Timeline的容器变化能及时反应
@@ -1184,7 +1184,7 @@ watch(
11841184 // 强制重新计算bubbleIndicator,确保容器宽度变化后正确显示半圆
11851185 })
11861186 }
1187- }
1187+ },
11881188)
11891189
11901190// 监听TaskBar可见性变化,只在滚动时实现重新出现动画
@@ -1193,7 +1193,7 @@ watch(
11931193 () => {
11941194 // TaskBar重新出现时,不需要动画效果
11951195 // 半圆会自然消失,TaskBar会立即显示
1196- }
1196+ },
11971197)
11981198
11991199// 监听页面缩放和大小变化,重新计算气泡位置
@@ -1353,13 +1353,13 @@ const calculateYearViewPosition = (targetDate: Date, baseStartDate: Date): numbe
13531353 const daysInHalfYear =
13541354 month <= 6
13551355 ? Math .floor (
1356- (new Date (targetYear , 6 , 1 ).getTime () - new Date (targetYear , 0 , 1 ).getTime ()) /
1357- (1000 * 60 * 60 * 24 )
1358- )
1356+ (new Date (targetYear , 6 , 1 ).getTime () - new Date (targetYear , 0 , 1 ).getTime ()) /
1357+ (1000 * 60 * 60 * 24 ),
1358+ )
13591359 : Math .floor (
1360- (new Date (targetYear + 1 , 0 , 1 ).getTime () - new Date (targetYear , 6 , 1 ).getTime ()) /
1361- (1000 * 60 * 60 * 24 )
1362- )
1360+ (new Date (targetYear + 1 , 0 , 1 ).getTime () - new Date (targetYear , 6 , 1 ).getTime ()) /
1361+ (1000 * 60 * 60 * 24 ),
1362+ )
13631363
13641364 const dayPositionInHalfYear = (dayOffset / daysInHalfYear ) * halfYearWidth
13651365 position += dayPositionInHalfYear
@@ -1383,7 +1383,7 @@ const calculatePositionFromTimelineData = (
13831383 subDays: Array <{ date: Date ; dayOfWeek? : number }>
13841384 }>
13851385 }>,
1386- timeScale : TimelineScale
1386+ timeScale : TimelineScale ,
13871387) => {
13881388 let cumulativePosition = 0
13891389
@@ -1401,11 +1401,11 @@ const calculatePositionFromTimelineData = (
14011401 // 找到目标日期所在的季度
14021402 const quarterWidth = 60
14031403 const daysInQuarter = Math .ceil (
1404- (quarterEnd .getTime () - quarterStart .getTime ()) / (1000 * 60 * 60 * 24 )
1404+ (quarterEnd .getTime () - quarterStart .getTime ()) / (1000 * 60 * 60 * 24 ),
14051405 )
14061406 const dayWidth = quarterWidth / daysInQuarter
14071407 const dayInQuarter = Math .ceil (
1408- (targetDate .getTime () - quarterStart .getTime ()) / (1000 * 60 * 60 * 24 )
1408+ (targetDate .getTime () - quarterStart .getTime ()) / (1000 * 60 * 60 * 24 ),
14091409 )
14101410 return cumulativePosition + dayInQuarter * dayWidth
14111411 }
0 commit comments