feat: gantt adapt to compact themes

This commit is contained in:
katherinehhh 2023-04-11 17:24:32 +08:00
parent 64b3618d05
commit adb4a9c7bd
2 changed files with 5 additions and 4 deletions

View File

@ -54,10 +54,11 @@ const GanttRecordViewer = (props) => {
}; };
export const Gantt: any = (props: any) => { export const Gantt: any = (props: any) => {
const { designable } = useDesignable(); const { designable } = useDesignable();
const currentTheme = localStorage.getItem('NOCOBASE_THEME');
const { const {
headerHeight = designable ? 64 : 55, headerHeight = currentTheme === 'compact' ? (designable ? 52 : 45) : designable ? 64 : 55,
listCellWidth = '155px', listCellWidth = '155px',
rowHeight = 55.56, rowHeight = currentTheme === 'compact' ? 45 : 55.56,
ganttHeight = 0, ganttHeight = 0,
preStepsCount = 1, preStepsCount = 1,
barFill = 60, barFill = 60,
@ -129,7 +130,7 @@ export const Gantt: any = (props: any) => {
useEffect(() => { useEffect(() => {
tableCtx.field.onExpandClick = handleTableExpanderClick; tableCtx.field.onExpandClick = handleTableExpanderClick;
tableCtx.field.onRowSelect = handleRowSelect; tableCtx.field.onRowSelect = handleRowSelect;
tableCtx.setExpandFlag(true) tableCtx.setExpandFlag(true);
}, []); }, []);
useEffect(() => { useEffect(() => {
expandAndCollapseAll?.(!expandFlag); expandAndCollapseAll?.(!expandFlag);

View File

@ -10,7 +10,7 @@ export const gridHeightRow = css`
export const gridRowLine = css` export const gridRowLine = css`
stroke: #f0f0f0; stroke: #f0f0f0;
stroke-width:1; stroke-width:1.5;
border-bottom: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0;
`; `;