mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 06:06:25 +00:00
feat: sub-form suport nest
This commit is contained in:
parent
49c3dab9a8
commit
2d64123b2a
@ -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') {
|
||||
|
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user