From e315b06175eb6c8007f1ebdea3162fd8a4c1c468 Mon Sep 17 00:00:00 2001 From: jeremyjone Date: Mon, 17 Apr 2023 11:09:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8add=20reactive=20gantt=20heade?= =?UTF-8?q?r=20by=20unit=20and=20width?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/demo.vue | 2 +- src/components/common/GanttHeader.vue | 5 ++-- src/components/root/index.vue | 27 ++++++++++++++++-- src/components/root/rootProps.ts | 17 +++++++----- src/composables/useData.ts | 25 ++++++++++++----- src/composables/useGanttWidth.ts | 21 ++++++++++++-- src/composables/useStyle.ts | 3 ++ src/models/param/header.ts | 40 +++++++++++++++++++++------ src/models/param/styles.ts | 31 ++++++++++++++++----- src/typings/size.d.ts | 15 ++++++++++ 10 files changed, 148 insertions(+), 38 deletions(-) create mode 100644 src/typings/size.d.ts diff --git a/demo/demo.vue b/demo/demo.vue index fee1732..73a749d 100644 --- a/demo/demo.vue +++ b/demo/demo.vue @@ -48,7 +48,7 @@ ganttData[0].children = [ id: ++id, name: 'sub-t' + id, startDate: new Date(2020, 0, 1), - endDate: new Date(2020, 5, 5), + endDate: new Date(2020, 0, 5), children: [ { id: ++id, diff --git a/src/components/common/GanttHeader.vue b/src/components/common/GanttHeader.vue index df86b0d..5ecd278 100644 --- a/src/components/common/GanttHeader.vue +++ b/src/components/common/GanttHeader.vue @@ -28,9 +28,8 @@ import useStyle from '@/composables/useStyle'; const { $styleBox } = useStyle(); -const { getDateList } = useData(); -const dateList = getDateList(); -console.log('getDateList', dateList); +const { dateList } = useData(); +console.log('getDateList', dateList.value);