diff --git a/packages/core/client/src/collection-manager/interfaces/o2m.tsx b/packages/core/client/src/collection-manager/interfaces/o2m.tsx index d0cb6b559d..09bd6deff7 100644 --- a/packages/core/client/src/collection-manager/interfaces/o2m.tsx +++ b/packages/core/client/src/collection-manager/interfaces/o2m.tsx @@ -103,38 +103,55 @@ export const o2m: IField = { const association = `${field.collectionName}.${field.name}`; schema.type = 'void'; schema.properties = { - block: { - type: 'void', - 'x-decorator': 'SubFormProvider', - 'x-decorator-props': { - collection: field.target, - association: association, - resource: association, - action: action, - fieldName: field.name, - readPretty, - }, - 'x-component': 'CardItem', - 'x-component-props': { - bordered: true, - }, - properties: { - [field.name]: { - type: 'object', - 'x-component': 'FormV2', - 'x-component-props': { - useProps: '{{ useSubFormProps }}', - }, - properties: { - __form_grid: { - type: 'void', - 'x-component': 'Grid', - 'x-initializer': 'FormItemInitializers', - properties: {}, + array: { + type: 'array', + 'x-component': 'ArrayCards', + default:[{}], + items: { + type: 'object', + properties: { + block: { + type: 'void', + 'x-decorator': 'SubFormProvider', + 'x-decorator-props': { + collection: field.target, + association: association, + resource: association, + action: action, + fieldName: field.name, + readPretty, + }, + 'x-component': 'CardItem', + 'x-component-props': { + bordered: true, + }, + properties: { + [field.name]: { + type: 'object', + 'x-component': 'FormV2', + 'x-component-props': { + useProps: '{{ useSubFormProps }}', + }, + properties: { + __form_grid: { + type: 'void', + 'x-component': 'Grid', + 'x-initializer': 'FormItemInitializers', + properties: {}, + }, + }, + }, }, }, }, }, + properties: { + addition: { + type: 'void', + title: 'Add new', + 'x-component': 'ArrayCards.Addition', + }, + }, }, }; } else if (schema['x-component'] === 'AssociationSelect') { diff --git a/packages/core/client/src/schema-component/antd/index.ts b/packages/core/client/src/schema-component/antd/index.ts index e9ecf21978..9844d76c96 100644 --- a/packages/core/client/src/schema-component/antd/index.ts +++ b/packages/core/client/src/schema-component/antd/index.ts @@ -40,5 +40,6 @@ export * from './time-picker'; export * from './tree-select'; export * from './upload'; export * from './variable'; -export * from './gantt' +export * from './gantt'; +export { ArrayCards } from '@formily/antd'; import './index.less';