diff --git a/packages/core/client/src/schema-component/antd/form-item/FormItem.tsx b/packages/core/client/src/schema-component/antd/form-item/FormItem.tsx index 6d9233158..ecbdb786e 100644 --- a/packages/core/client/src/schema-component/antd/form-item/FormItem.tsx +++ b/packages/core/client/src/schema-component/antd/form-item/FormItem.tsx @@ -223,6 +223,8 @@ FormItem.Designer = function Designer() { const showFieldMode = isAssociationField && fieldModeOptions && !isTableField; const showModeSelect = showFieldMode && isPickerMode; const isDateField = ['datetime', 'createdAt', 'updatedAt'].includes(collectionField?.interface); + const isAttachmentField = + ['attachment'].includes(collectionField?.interface) || targetCollection?.template === 'file'; return ( @@ -727,6 +729,33 @@ FormItem.Designer = function Designer() { )} {isDateField && } + {isAttachmentField && field.readPretty && ( + { + const schema = { + ['x-uid']: fieldSchema['x-uid'], + }; + fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {}; + fieldSchema['x-component-props']['size'] = size; + schema['x-component-props'] = fieldSchema['x-component-props']; + field.componentProps = field.componentProps || {}; + field.componentProps.size = size; + dn.emit('patch', { + schema, + }); + dn.refresh(); + }} + /> + )} + {isAssociationField && ['Tag'].includes(fieldMode) && ( { padding: '1px !important', }, }, - + '&.nb-upload-large': { + [`${componentCls}-list-picture-card-container${componentCls}-list-picture-card-container`]: { + margin: '0 3px 3px 0 !important', + height: '160px !important', + width: '160px !important', + marginBlock: '0 28px !important', + }, + }, '&.nb-upload': { [`${componentCls}-list-item${componentCls}-list-item-list-type-picture-card`]: { padding: '3px !important',