mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-09 23:49:27 +08:00
refactor: style improve
This commit is contained in:
parent
8d2a8b2f3a
commit
27db6a1a00
@ -1,8 +1,10 @@
|
|||||||
import React, { useState, SyntheticEvent, useRef, useEffect, useMemo, useCallback } from 'react';
|
import React, { useState, SyntheticEvent, useRef, useEffect, useMemo, useCallback } from 'react';
|
||||||
import { useFieldSchema, Schema, RecursionField } from '@formily/react';
|
import { useFieldSchema, Schema, RecursionField } from '@formily/react';
|
||||||
import { cx } from '@emotion/css';
|
import { cx } from '@emotion/css';
|
||||||
|
import { message } from 'antd';
|
||||||
import { createForm } from '@formily/core';
|
import { createForm } from '@formily/core';
|
||||||
import { css } from '@emotion/css';
|
import { css } from '@emotion/css';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Task } from '../../types/public-types';
|
import { Task } from '../../types/public-types';
|
||||||
import { GridProps } from '../grid/grid';
|
import { GridProps } from '../grid/grid';
|
||||||
import { ganttDateRange, seedDates } from '../../helpers/date-helper';
|
import { ganttDateRange, seedDates } from '../../helpers/date-helper';
|
||||||
@ -56,7 +58,7 @@ export const Gantt: any = (props: any) => {
|
|||||||
const { designable } = useDesignable();
|
const { designable } = useDesignable();
|
||||||
const currentTheme = localStorage.getItem('NOCOBASE_THEME');
|
const currentTheme = localStorage.getItem('NOCOBASE_THEME');
|
||||||
const {
|
const {
|
||||||
headerHeight = currentTheme === 'compact' ? (designable ? 52 : 45) : designable ? 64 : 55,
|
headerHeight = currentTheme === 'compact' ? (designable ? 53 : 45) : designable ? 65 : 55,
|
||||||
listCellWidth = '155px',
|
listCellWidth = '155px',
|
||||||
rowHeight = currentTheme === 'compact' ? 45 : 55.56,
|
rowHeight = currentTheme === 'compact' ? 45 : 55.56,
|
||||||
ganttHeight = 0,
|
ganttHeight = 0,
|
||||||
@ -92,6 +94,7 @@ export const Gantt: any = (props: any) => {
|
|||||||
const { onExpanderClick, tasks, expandAndCollapseAll } = useProps();
|
const { onExpanderClick, tasks, expandAndCollapseAll } = useProps();
|
||||||
const ctx = useGanttBlockContext();
|
const ctx = useGanttBlockContext();
|
||||||
const appInfo = useCurrentAppInfo();
|
const appInfo = useCurrentAppInfo();
|
||||||
|
const { t } = useTranslation();
|
||||||
const locale = appInfo.data?.lang;
|
const locale = appInfo.data?.lang;
|
||||||
const tableCtx = useTableBlockContext();
|
const tableCtx = useTableBlockContext();
|
||||||
const { resource, service } = useBlockRequestContext();
|
const { resource, service } = useBlockRequestContext();
|
||||||
@ -404,6 +407,7 @@ export const Gantt: any = (props: any) => {
|
|||||||
[fieldNames.progress]: task.progress / 100,
|
[fieldNames.progress]: task.progress / 100,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
message.success(t('Saved successfully'));
|
||||||
await service?.refresh();
|
await service?.refresh();
|
||||||
};
|
};
|
||||||
const handleTaskChange = async (task: Task) => {
|
const handleTaskChange = async (task: Task) => {
|
||||||
@ -415,6 +419,7 @@ export const Gantt: any = (props: any) => {
|
|||||||
[fieldNames.end]: task.end,
|
[fieldNames.end]: task.end,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
message.success(t('Saved successfully'));
|
||||||
await service?.refresh();
|
await service?.refresh();
|
||||||
};
|
};
|
||||||
const handleBarClick = (data) => {
|
const handleBarClick = (data) => {
|
||||||
|
@ -15,7 +15,7 @@ export const BarSmall: React.FC<TaskItemProps> = ({
|
|||||||
isSelected,
|
isSelected,
|
||||||
}) => {
|
}) => {
|
||||||
const progressPoint = getProgressPoint(
|
const progressPoint = getProgressPoint(
|
||||||
task.progressWidth + task.x1,
|
task.progressWidth + task.x1+10,
|
||||||
task.y,
|
task.y,
|
||||||
task.height
|
task.height
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user