fix(client/form-fields): fix fields's x-read-pretty (#994)
This commit is contained in:
parent
9f5f2d6028
commit
b23d2bcae7
@ -120,14 +120,14 @@ export const useAssociatedTableColumnInitializerFields = () => {
|
|||||||
// type: 'string',
|
// type: 'string',
|
||||||
name: `${field.name}.${subField.name}`,
|
name: `${field.name}.${subField.name}`,
|
||||||
// title: subField?.uiSchema?.title || subField.name,
|
// title: subField?.uiSchema?.title || subField.name,
|
||||||
|
|
||||||
'x-component': 'CollectionField',
|
'x-component': 'CollectionField',
|
||||||
'x-read-pretty': true,
|
'x-read-pretty': true,
|
||||||
'x-collection-field': `${name}.${field.name}.${subField.name}`,
|
'x-collection-field': `${name}.${field.name}.${subField.name}`,
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type: 'item',
|
type: 'item',
|
||||||
title: subField?.uiSchema?.title || subField.name,
|
title: subField?.uiSchema?.title || subField.name,
|
||||||
@ -145,7 +145,7 @@ export const useAssociatedTableColumnInitializerFields = () => {
|
|||||||
return {
|
return {
|
||||||
type: 'subMenu',
|
type: 'subMenu',
|
||||||
title: field.uiSchema?.title,
|
title: field.uiSchema?.title,
|
||||||
children: items,
|
children: items,
|
||||||
} as SchemaInitializerItemOptions;
|
} as SchemaInitializerItemOptions;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -171,6 +171,7 @@ export const useFormItemInitializerFields = (options?: any) => {
|
|||||||
'x-component': field.interface === 'o2m' ? 'TableField' : 'CollectionField',
|
'x-component': field.interface === 'o2m' ? 'TableField' : 'CollectionField',
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-collection-field': `${name}.${field.name}`,
|
'x-collection-field': `${name}.${field.name}`,
|
||||||
|
'x-read-pretty': field?.uiSchema?.['x-read-pretty'],
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -234,7 +235,7 @@ export const useAssociatedFormItemInitializerFields = (options?: any) => {
|
|||||||
return {
|
return {
|
||||||
type: 'subMenu',
|
type: 'subMenu',
|
||||||
title: field.uiSchema?.title,
|
title: field.uiSchema?.title,
|
||||||
children: items,
|
children: items,
|
||||||
} as SchemaInitializerItemOptions;
|
} as SchemaInitializerItemOptions;
|
||||||
});
|
});
|
||||||
return groups;
|
return groups;
|
||||||
@ -294,9 +295,9 @@ const removeSchema = (schema, cb) => {
|
|||||||
|
|
||||||
const recursiveParent = (schema: Schema) => {
|
const recursiveParent = (schema: Schema) => {
|
||||||
if (!schema.parent) return null;
|
if (!schema.parent) return null;
|
||||||
|
|
||||||
if (schema.parent['x-initializer']) return schema.parent;
|
if (schema.parent['x-initializer']) return schema.parent;
|
||||||
|
|
||||||
return recursiveParent(schema.parent);
|
return recursiveParent(schema.parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user