From f619c4e6c0f3275fdeea1f3660e3afcf0e1d35b4 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Mon, 4 Mar 2024 19:00:29 +0800 Subject: [PATCH] fix: chinaRegions association fieldName (#3600) * fix: chinaRegions association fieldName * fix: useAssociatedFormItemInitializerFields fieldName --- packages/core/client/src/schema-initializer/utils.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/core/client/src/schema-initializer/utils.ts b/packages/core/client/src/schema-initializer/utils.ts index 19bee2e57..f2c7e78b7 100644 --- a/packages/core/client/src/schema-initializer/utils.ts +++ b/packages/core/client/src/schema-initializer/utils.ts @@ -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,