From adb4a9c7bda1329016f529524e8c48ab839ae54d Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Tue, 11 Apr 2023 17:24:32 +0800 Subject: [PATCH] feat: gantt adapt to compact themes --- .../schema-component/antd/gantt/components/gantt/gantt.tsx | 7 ++++--- .../schema-component/antd/gantt/components/grid/style.tsx | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/gantt/components/gantt/gantt.tsx b/packages/core/client/src/schema-component/antd/gantt/components/gantt/gantt.tsx index f70cfa41b0..f94166bed5 100644 --- a/packages/core/client/src/schema-component/antd/gantt/components/gantt/gantt.tsx +++ b/packages/core/client/src/schema-component/antd/gantt/components/gantt/gantt.tsx @@ -54,10 +54,11 @@ const GanttRecordViewer = (props) => { }; export const Gantt: any = (props: any) => { const { designable } = useDesignable(); + const currentTheme = localStorage.getItem('NOCOBASE_THEME'); const { - headerHeight = designable ? 64 : 55, + headerHeight = currentTheme === 'compact' ? (designable ? 52 : 45) : designable ? 64 : 55, listCellWidth = '155px', - rowHeight = 55.56, + rowHeight = currentTheme === 'compact' ? 45 : 55.56, ganttHeight = 0, preStepsCount = 1, barFill = 60, @@ -129,7 +130,7 @@ export const Gantt: any = (props: any) => { useEffect(() => { tableCtx.field.onExpandClick = handleTableExpanderClick; tableCtx.field.onRowSelect = handleRowSelect; - tableCtx.setExpandFlag(true) + tableCtx.setExpandFlag(true); }, []); useEffect(() => { expandAndCollapseAll?.(!expandFlag); diff --git a/packages/core/client/src/schema-component/antd/gantt/components/grid/style.tsx b/packages/core/client/src/schema-component/antd/gantt/components/grid/style.tsx index e375488e41..a0e15a7479 100644 --- a/packages/core/client/src/schema-component/antd/gantt/components/grid/style.tsx +++ b/packages/core/client/src/schema-component/antd/gantt/components/grid/style.tsx @@ -10,7 +10,7 @@ export const gridHeightRow = css` export const gridRowLine = css` stroke: #f0f0f0; - stroke-width:1; + stroke-width:1.5; border-bottom: 1px solid #f0f0f0; `;