From 1e1ec86bfa76fb8aade83d8e58c291cbe287f3dd Mon Sep 17 00:00:00 2001 From: yicone Date: Tue, 2 Feb 2021 11:54:10 +0800 Subject: [PATCH] feat: add timeaxis mode: [month_days, day_hours] --- src/GGanttChart.vue | 7 +- src/GGanttGrid.vue | 77 ++++---- src/GGanttRow.vue | 2 + src/GGanttTimeaxis.vue | 406 ++++++++++++++++++++++------------------- 4 files changed, 266 insertions(+), 226 deletions(-) diff --git a/src/GGanttChart.vue b/src/GGanttChart.vue index c0c6ed1..bb6cc27 100644 --- a/src/GGanttChart.vue +++ b/src/GGanttChart.vue @@ -62,7 +62,9 @@ export default { type: Number, default: 0 }, - defaultBarLength: { type: Number, default: 1 } + defaultBarLength: { type: Number, default: 1 }, + // ["month_days", "day_hours"] + timeaxisMode: {type: String, default: "month_days"} }, data(){ @@ -297,7 +299,8 @@ export default { shouldSnapBackOnOverlap: () => this.snapBackOnOverlap, snapBackBundle: (ganttBar) => this.snapBackBundle(ganttBar), getMinGapBetweenBars: () => this.minGapBetweenBars, - getDefaultBarLength: () => this.defaultBarLength + getDefaultBarLength: () => this.defaultBarLength, + getTimeaxisMode:() => this.timeaxisMode } } } diff --git a/src/GGanttGrid.vue b/src/GGanttGrid.vue index a536956..aa21c32 100644 --- a/src/GGanttGrid.vue +++ b/src/GGanttGrid.vue @@ -1,17 +1,17 @@