diff --git a/packages/core/client/src/collection-manager/interfaces/attachment.ts b/packages/core/client/src/collection-manager/interfaces/attachment.ts index b36db1494..f8445e010 100644 --- a/packages/core/client/src/collection-manager/interfaces/attachment.ts +++ b/packages/core/client/src/collection-manager/interfaces/attachment.ts @@ -23,7 +23,7 @@ export const attachment: IField = { }, }, schemaInitialize(schema: ISchema, { block }) { - if (['Table', 'Kanban'].includes(block)) { + if (['Table', 'KanbanV2'].includes(block)) { schema['x-component-props'] = schema['x-component-props'] || {}; schema['x-component-props']['size'] = 'small'; } diff --git a/packages/core/client/src/schema-component/antd/kanban-v2/Kanban.Card.Designer.tsx b/packages/core/client/src/schema-component/antd/kanban-v2/Kanban.Card.Designer.tsx index a6a3fe693..ad6cc883e 100644 --- a/packages/core/client/src/schema-component/antd/kanban-v2/Kanban.Card.Designer.tsx +++ b/packages/core/client/src/schema-component/antd/kanban-v2/Kanban.Card.Designer.tsx @@ -58,7 +58,7 @@ export const KanbanCardDesigner = (props: any) => { const { refresh } = useDesignable(); const field = useField(); const fieldSchema = useFieldSchema(); - const fields = useFormItemInitializerFields({ readPretty: true }); + const fields = useFormItemInitializerFields({ readPretty: true, block: 'KanbanV2' }); if (!designable) { return null; } @@ -75,7 +75,6 @@ export const KanbanCardDesigner = (props: any) => { } return buf; }, null); - console.log('schema', gridSchema) if (!gridSchema) { return; } diff --git a/packages/core/client/src/schema-initializer/utils.ts b/packages/core/client/src/schema-initializer/utils.ts index a15e360b7..65760838b 100644 --- a/packages/core/client/src/schema-initializer/utils.ts +++ b/packages/core/client/src/schema-initializer/utils.ts @@ -91,7 +91,7 @@ export const useFormItemInitializerFields = (options?: any) => { const { name, fields } = useCollection(); const { getInterface } = useCollectionManager(); const form = useForm(); - const { readPretty = form.readPretty } = options || {}; + const { readPretty = form.readPretty, block = 'Form' } = options || {}; return fields ?.filter((field) => field?.interface) ?.map((field) => { @@ -112,7 +112,7 @@ export const useFormItemInitializerFields = (options?: any) => { component: 'CollectionFieldInitializer', remove: removeGridFormItem, schemaInitialize: (s) => { - interfaceConfig?.schemaInitialize?.(s, { field, block: 'Form', readPretty }); + interfaceConfig?.schemaInitialize?.(s, { field, block, readPretty }); }, schema, } as SchemaInitializerItemOptions;