fix: chinaRegions association fieldName (#3600)

* fix: chinaRegions association fieldName

* fix: useAssociatedFormItemInitializerFields fieldName
This commit is contained in:
katherinehhh 2024-03-04 19:00:29 +08:00 committed by GitHub
parent 56d4d240a1
commit f619c4e6c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -418,7 +418,6 @@ export const useAssociatedFormItemInitializerFields = (options?: any) => {
?.map((subField) => {
const interfaceConfig = getInterface(subField.interface);
const isFileCollection = field?.target && getCollection(field?.target)?.template === 'file';
const isAssociationField = ['hasOne', 'hasMany', 'belongsTo', 'belongsToMany'].includes(subField?.type);
const schema = {
type: 'string',
name: `${field.name}.${subField.name}`,
@ -429,9 +428,9 @@ export const useAssociatedFormItemInitializerFields = (options?: any) => {
'x-read-pretty': readPretty,
'x-component-props': {
'pattern-disable': block === 'Form' && readPretty,
fieldNames: isAssociationField
fieldNames: isFileCollection
? {
label: isFileCollection ? 'preview' : 'id',
label: 'preview',
value: 'id',
}
: undefined,