feat: gantt block suprt process update

This commit is contained in:
katherinehhh 2023-02-01 15:52:16 +08:00
parent a437cf2f5f
commit 01e93148b9
4 changed files with 6 additions and 6 deletions

View File

@ -95,7 +95,7 @@ const formatData = (data = [], fieldNames, tasks: any[] = [], projectId: any = u
name: item[fieldNames.title], name: item[fieldNames.title],
id: item.id + '', id: item.id + '',
type: fieldNames.end?'task':'milestone', type: fieldNames.end?'task':'milestone',
progress: item[fieldNames.progress], progress: item[fieldNames.progress]*100,
project: projectId, project: projectId,
}); });
} }

View File

@ -130,7 +130,7 @@ export const GanttDesigner = () => {
<SchemaSettings.SelectItem <SchemaSettings.SelectItem
title={t('Progress field')} title={t('Progress field')}
value={fieldNames.progress} value={fieldNames.progress}
options={useOptions('double')} options={useOptions('float')}
onChange={(progress) => { onChange={(progress) => {
const fieldNames = field.decoratorProps.fieldNames || {}; const fieldNames = field.decoratorProps.fieldNames || {};
fieldNames['progress'] = progress; fieldNames['progress'] = progress;

View File

@ -374,7 +374,7 @@ export const Gantt: any = (props:any) => {
filterByTk: task.id, filterByTk: task.id,
values: { values: {
...task, ...task,
[fieldNames.progress]: task.progress, [fieldNames.progress]: task.progress/100,
}, },
}); });
}; };

View File

@ -38,7 +38,7 @@ export const GanttBlockInitializer = (props) => {
}; };
}); });
const numberFields = collectionFields const numberFields = collectionFields
?.filter((field) => field.type === 'double') ?.filter((field) => field.type === 'float')
?.map((field) => { ?.map((field) => {
return { return {
label: field?.uiSchema?.title, label: field?.uiSchema?.title,
@ -83,8 +83,8 @@ export const GanttBlockInitializer = (props) => {
title: t('Time range'), title: t('Time range'),
enum: [ enum: [
{ label: '{{t("Hour")}}', value: 'hour', color: 'orange' }, { label: '{{t("Hour")}}', value: 'hour', color: 'orange' },
{ label: '{{t("Quarter of day")}}', value: 'quarterOfDay', color: 'default' }, { label: '{{t("Quarter of day")}}', value: 'quarterDay', color: 'default' },
{ label: '{{t("Half of day")}}', value: 'halOfDay', color: 'blue' }, { label: '{{t("Half of day")}}', value: 'halfDay', color: 'blue' },
{ label: '{{t("Day")}}', value: 'day', color: 'yellow' }, { label: '{{t("Day")}}', value: 'day', color: 'yellow' },
{ label: '{{t("Week")}}', value: 'week', color: 'pule' }, { label: '{{t("Week")}}', value: 'week', color: 'pule' },
{ label: '{{t("Month")}}', value: 'month', color: 'green' }, { label: '{{t("Month")}}', value: 'month', color: 'green' },