mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 18:52:20 +08:00
fix: bug
This commit is contained in:
parent
28baf20755
commit
aaf09d3f81
@ -46,7 +46,7 @@ export const titleField = defineAction({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
defaultParams: (ctx: any) => {
|
defaultParams: (ctx: any) => {
|
||||||
const targetCollection = ctx.model.targetCollection;
|
const targetCollection = ctx.model.collectionField.targetCollection;
|
||||||
const filterKey = getUniqueKeyFromCollection(targetCollection.options as any);
|
const filterKey = getUniqueKeyFromCollection(targetCollection.options as any);
|
||||||
return {
|
return {
|
||||||
label: ctx.model.props.fieldNames?.label || targetCollection.options.titleField || filterKey,
|
label: ctx.model.props.fieldNames?.label || targetCollection.options.titleField || filterKey,
|
||||||
@ -55,7 +55,6 @@ export const titleField = defineAction({
|
|||||||
async handler(ctx: any, params) {
|
async handler(ctx: any, params) {
|
||||||
const target = ctx.model.collectionField.target;
|
const target = ctx.model.collectionField.target;
|
||||||
const targetCollection = ctx.model.collectionField.targetCollection;
|
const targetCollection = ctx.model.collectionField.targetCollection;
|
||||||
console.log(ctx.model.collectionField);
|
|
||||||
const filterKey = getUniqueKeyFromCollection(targetCollection.options as any);
|
const filterKey = getUniqueKeyFromCollection(targetCollection.options as any);
|
||||||
const label = params.label || targetCollection.options.titleField || filterKey;
|
const label = params.label || targetCollection.options.titleField || filterKey;
|
||||||
const newFieldNames = {
|
const newFieldNames = {
|
||||||
|
@ -22,6 +22,7 @@ export class FormModel extends DataBlockModel {
|
|||||||
declare resource: SingleRecordResource;
|
declare resource: SingleRecordResource;
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
console.log(this);
|
||||||
return (
|
return (
|
||||||
<Card>
|
<Card>
|
||||||
<FormProvider form={this.form}>
|
<FormProvider form={this.form}>
|
||||||
@ -53,7 +54,7 @@ export class FormModel extends DataBlockModel {
|
|||||||
subModelBaseClass="EditableFieldModel"
|
subModelBaseClass="EditableFieldModel"
|
||||||
onSubModelAdded={async (model: EditableFieldModel) => {
|
onSubModelAdded={async (model: EditableFieldModel) => {
|
||||||
const params = model.getStepParams('default', 'step1');
|
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 }}>
|
<FormButtonGroup style={{ marginTop: 16 }}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user