From 564e0a08c9e9979f5e20cad075b82a57797e505a Mon Sep 17 00:00:00 2001 From: Dunqing Date: Thu, 26 Oct 2023 07:34:22 -0500 Subject: [PATCH] fix(core): print not work when has sub-form or sub-details (#2852) --- .../client/src/block-provider/hooks/index.ts | 44 +------------------ 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/packages/core/client/src/block-provider/hooks/index.ts b/packages/core/client/src/block-provider/hooks/index.ts index d4b680d06..ce246fe35 100644 --- a/packages/core/client/src/block-provider/hooks/index.ts +++ b/packages/core/client/src/block-provider/hooks/index.ts @@ -95,47 +95,6 @@ export function getFormValues({ } return form.values; - const values = {}; - for (const key in form.values) { - if (fieldNames.includes(key)) { - const collectionField = getField(key); - if (filterByTk) { - if (field.added && !field.added.has(key)) { - continue; - } - if (['subTable', 'o2m', 'o2o', 'oho', 'obo', 'm2o'].includes(collectionField.interface)) { - values[key] = form.values[key]; - continue; - } - } - const items = form.values[key]; - if (['linkTo', 'm2o', 'm2m'].includes(collectionField.interface)) { - const targetKey = collectionField.targetKey || 'id'; - if (resource instanceof TableFieldResource) { - if (Array.isArray(items)) { - values[key] = filterValue(items); - } else if (items && typeof items === 'object') { - values[key] = filterValue(items); - } else { - values[key] = items; - } - } else { - if (Array.isArray(items)) { - values[key] = items.map((item) => item[targetKey]); - } else if (items && typeof items === 'object') { - values[key] = items[targetKey]; - } else { - values[key] = items; - } - } - } else { - values[key] = form.values[key]; - } - } else { - values[key] = form.values[key]; - } - } - return values; } export const useCreateActionProps = () => { @@ -1040,10 +999,9 @@ export const useDetailPrintActionProps = () => { * { margin: 0; } - div.ant-formily-layout>div:first-child { + :not(.ant-formily-item-control-content-component) > div.ant-formily-layout>div:first-child { overflow: hidden; height: 0; } - }`, }); return {