mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 21:49:25 +08:00
fix: file collection field should default to preview as the title field
This commit is contained in:
parent
6a8f998665
commit
7cce10c310
@ -82,12 +82,20 @@ export const useTableColumnInitializerFields = () => {
|
|||||||
)
|
)
|
||||||
.map((field) => {
|
.map((field) => {
|
||||||
const interfaceConfig = getInterface(field.interface);
|
const interfaceConfig = getInterface(field.interface);
|
||||||
|
const isFileCollection = field?.target && getCollection(field?.target)?.template === 'file';
|
||||||
const schema = {
|
const schema = {
|
||||||
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-read-pretty': true,
|
'x-read-pretty': true,
|
||||||
'x-component-props': {},
|
'x-component-props': isFileCollection
|
||||||
|
? {
|
||||||
|
fieldNames: {
|
||||||
|
label: 'preview',
|
||||||
|
value: 'id',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
: {},
|
||||||
};
|
};
|
||||||
// interfaceConfig?.schemaInitialize?.(schema, { field, readPretty: true, block: 'Table' });
|
// interfaceConfig?.schemaInitialize?.(schema, { field, readPretty: true, block: 'Table' });
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user