This commit is contained in:
katherinehhh 2025-06-30 20:14:55 +08:00
parent 28baf20755
commit aaf09d3f81
2 changed files with 3 additions and 3 deletions

View File

@ -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 = {

View File

@ -22,6 +22,7 @@ export class FormModel extends DataBlockModel {
declare resource: SingleRecordResource;
render() {
console.log(this);
return (
<Card>
<FormProvider form={this.form}>
@ -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);
}}
/>
<FormButtonGroup style={{ marginTop: 16 }}>