mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 03:02:19 +08:00
feat: gantt block suprt time range change
This commit is contained in:
parent
71aeeee6b4
commit
a437cf2f5f
@ -91,10 +91,10 @@ const formatData = (data = [], fieldNames, tasks: any[] = [], projectId: any = u
|
|||||||
} else {
|
} else {
|
||||||
tasks.push({
|
tasks.push({
|
||||||
start: new Date(item[fieldNames.start]),
|
start: new Date(item[fieldNames.start]),
|
||||||
end: new Date(item[fieldNames.end]),
|
end: new Date(item[fieldNames.end]||item[fieldNames.start]+1),
|
||||||
name: item[fieldNames.title],
|
name: item[fieldNames.title],
|
||||||
id: item.id + '',
|
id: item.id + '',
|
||||||
type: 'task',
|
type: fieldNames.end?'task':'milestone',
|
||||||
progress: item[fieldNames.progress],
|
progress: item[fieldNames.progress],
|
||||||
project: projectId,
|
project: projectId,
|
||||||
});
|
});
|
||||||
@ -125,7 +125,6 @@ const InternalGanttBlockProvider = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const GanttBlockProvider = (props) => {
|
export const GanttBlockProvider = (props) => {
|
||||||
console.log(props);
|
|
||||||
return (
|
return (
|
||||||
<BlockProvider {...props} params={{ ...props.params, paginate: false }}>
|
<BlockProvider {...props} params={{ ...props.params, paginate: false }}>
|
||||||
<InternalGanttBlockProvider {...props} />
|
<InternalGanttBlockProvider {...props} />
|
||||||
|
@ -64,8 +64,8 @@ export const GanttDesigner = () => {
|
|||||||
value={fieldNames.range||'day'}
|
value={fieldNames.range||'day'}
|
||||||
options={[
|
options={[
|
||||||
{ label: compile('{{t("Hour")}}'), value: 'hour', color: 'orange' },
|
{ label: compile('{{t("Hour")}}'), value: 'hour', color: 'orange' },
|
||||||
{ label: compile('{{t("Quarter of day")}}'), value: 'quarterOfDay', color: 'default' },
|
{ label: compile('{{t("Quarter of day")}}'), value: 'quarterDay', color: 'default' },
|
||||||
{ label: compile('{{t("Half of day")}}'), value: 'halOfDay', color: 'blue' },
|
{ label: compile('{{t("Half of day")}}'), value: 'halfDay', color: 'blue' },
|
||||||
{ label: compile('{{t("Day")}}'), value: 'day', color: 'yellow' },
|
{ label: compile('{{t("Day")}}'), value: 'day', color: 'yellow' },
|
||||||
{ label: compile('{{t("Week")}}'), value: 'week', color: 'pule' },
|
{ label: compile('{{t("Week")}}'), value: 'week', color: 'pule' },
|
||||||
{ label: compile('{{t("Month")}}'), value: 'month', color: 'green' },
|
{ label: compile('{{t("Month")}}'), value: 'month', color: 'green' },
|
||||||
@ -126,6 +126,25 @@ export const GanttDesigner = () => {
|
|||||||
});
|
});
|
||||||
dn.refresh();
|
dn.refresh();
|
||||||
}}
|
}}
|
||||||
|
/>
|
||||||
|
<SchemaSettings.SelectItem
|
||||||
|
title={t('Progress field')}
|
||||||
|
value={fieldNames.progress}
|
||||||
|
options={useOptions('double')}
|
||||||
|
onChange={(progress) => {
|
||||||
|
const fieldNames = field.decoratorProps.fieldNames || {};
|
||||||
|
fieldNames['progress'] = progress;
|
||||||
|
field.decoratorProps.fieldNames = fieldNames;
|
||||||
|
fieldSchema['x-decorator-props']['fieldNames'] = fieldNames;
|
||||||
|
service.refresh();
|
||||||
|
dn.emit('patch', {
|
||||||
|
schema: {
|
||||||
|
['x-uid']: fieldSchema['x-uid'],
|
||||||
|
'x-decorator-props': field.decoratorProps,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
dn.refresh();
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<SchemaSettings.ModalItem
|
<SchemaSettings.ModalItem
|
||||||
title={t('Set the data scope')}
|
title={t('Set the data scope')}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user