fix: file collection field should default to preview as the title field (#2059)

* fix: after selecting files for multiple association fields, the selected files should not be removed

* fix:  file collection field should default to preview as the title field

---------

Co-authored-by: chenos <chenlinxh@gmail.com>
This commit is contained in:
katherinehhh 2023-06-19 20:48:20 +08:00 committed by GitHub
parent 331d6d57b2
commit bcad6c89dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,8 +102,15 @@ export const useTableColumnInitializerFields = () => {
name: field.name, name: field.name,
'x-collection-field': `${name}.${field.name}`, 'x-collection-field': `${name}.${field.name}`,
'x-component': 'CollectionField', 'x-component': 'CollectionField',
'x-component-props': isFileCollection
? {
fieldNames: {
label: 'preview',
value: 'id',
},
}
: {},
'x-read-pretty': isReadPretty || field.uiSchema?.['x-read-pretty'], 'x-read-pretty': isReadPretty || field.uiSchema?.['x-read-pretty'],
'x-component-props': {},
'x-decorator': isSubTable 'x-decorator': isSubTable
? quickEditField.includes(field.interface) || isFileCollection ? quickEditField.includes(field.interface) || isFileCollection
? 'QuickEdit' ? 'QuickEdit'