From aaf09d3f81556c5de7f9442254a0ec9056af7ab4 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Mon, 30 Jun 2025 20:14:55 +0800 Subject: [PATCH] fix: bug --- packages/core/client/src/flow/flowSetting/TitleField.tsx | 3 +-- .../core/client/src/flow/models/data-blocks/form/FormModel.tsx | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/client/src/flow/flowSetting/TitleField.tsx b/packages/core/client/src/flow/flowSetting/TitleField.tsx index 726e3050c1..ae62e84834 100644 --- a/packages/core/client/src/flow/flowSetting/TitleField.tsx +++ b/packages/core/client/src/flow/flowSetting/TitleField.tsx @@ -46,7 +46,7 @@ export const titleField = defineAction({ }, }, defaultParams: (ctx: any) => { - const targetCollection = ctx.model.targetCollection; + const targetCollection = ctx.model.collectionField.targetCollection; const filterKey = getUniqueKeyFromCollection(targetCollection.options as any); return { label: ctx.model.props.fieldNames?.label || targetCollection.options.titleField || filterKey, @@ -55,7 +55,6 @@ export const titleField = defineAction({ async handler(ctx: any, params) { const target = ctx.model.collectionField.target; const targetCollection = ctx.model.collectionField.targetCollection; - console.log(ctx.model.collectionField); const filterKey = getUniqueKeyFromCollection(targetCollection.options as any); const label = params.label || targetCollection.options.titleField || filterKey; const newFieldNames = { diff --git a/packages/core/client/src/flow/models/data-blocks/form/FormModel.tsx b/packages/core/client/src/flow/models/data-blocks/form/FormModel.tsx index 7654f82cc7..63d97e9a18 100644 --- a/packages/core/client/src/flow/models/data-blocks/form/FormModel.tsx +++ b/packages/core/client/src/flow/models/data-blocks/form/FormModel.tsx @@ -22,6 +22,7 @@ export class FormModel extends DataBlockModel { declare resource: SingleRecordResource; render() { + console.log(this); return ( @@ -53,7 +54,7 @@ export class FormModel extends DataBlockModel { subModelBaseClass="EditableFieldModel" onSubModelAdded={async (model: EditableFieldModel) => { const params = model.getStepParams('default', 'step1'); - this.addAppends(params?.fieldPath, true); + this.addAppends(params?.fieldPath, !!this.ctx.shared?.currentFlow?.extra?.filterByTk); }} />