mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 10:42:19 +08:00
feat: getFirstSubclassNameOf
This commit is contained in:
parent
75dc5f26ad
commit
5785b83e6e
@ -162,8 +162,7 @@ QuickEditForm.registerFlow({
|
|||||||
}
|
}
|
||||||
const collectionField = ctx.model.collection.getField(fieldPath) as CollectionField;
|
const collectionField = ctx.model.collection.getField(fieldPath) as CollectionField;
|
||||||
if (collectionField) {
|
if (collectionField) {
|
||||||
const FieldModels = collectionField.getSubclassesOf('EditableFieldModel');
|
const use = collectionField.getFirstSubclassNameOf('EditableFieldModel') || 'EditableFieldModel';
|
||||||
const use = FieldModels.keys().next().value || 'EditableFieldModel';
|
|
||||||
ctx.model.addSubModel('fields', {
|
ctx.model.addSubModel('fields', {
|
||||||
use,
|
use,
|
||||||
stepParams: {
|
stepParams: {
|
||||||
|
@ -461,6 +461,11 @@ export class CollectionField {
|
|||||||
return isFieldInterfaceMatch(M['supportedFieldInterfaces'], this.interface);
|
return isFieldInterfaceMatch(M['supportedFieldInterfaces'], this.interface);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getFirstSubclassNameOf(baseClass: string) {
|
||||||
|
const subclasses = this.getSubclassesOf(baseClass);
|
||||||
|
return subclasses.keys().next().value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user