From 253ed21fd25c42ab983116904769ed90adce6927 Mon Sep 17 00:00:00 2001 From: qiuchengw Date: Wed, 24 Sep 2025 19:55:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=AE=BE=E7=BD=AE=E9=BB=98?= =?UTF-8?q?=E8=AE=A4timeline=20scale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/GanttChart.vue | 9 ++++ src/components/GanttToolbar.vue | 76 +++++++++++++++++++++-------- src/components/TaskRow.vue | 2 +- src/models/configs/ToolbarConfig.ts | 5 +- 4 files changed, 70 insertions(+), 22 deletions(-) diff --git a/src/components/GanttChart.vue b/src/components/GanttChart.vue index f774baf..55c477a 100644 --- a/src/components/GanttChart.vue +++ b/src/components/GanttChart.vue @@ -117,6 +117,15 @@ const timelineRef = ref | null>(null) // 时间刻度状态 const currentTimeScale = ref(TimelineScale.DAY) +watch( + () => timelineRef.value, + newTimeline => { + if (newTimeline) { + newTimeline.updateTimeScale(currentTimeScale.value) + } + }, +) + // TaskList的固定总长度(所有列的最小宽度之和 + 边框等额外空间) // 列宽: 300+120+120+140+140+100+100+100 = 1120px // 边框: 7个列间边框 * 1px = 7px diff --git a/src/components/GanttToolbar.vue b/src/components/GanttToolbar.vue index e2805d9..ada324a 100644 --- a/src/components/GanttToolbar.vue +++ b/src/components/GanttToolbar.vue @@ -1,5 +1,5 @@