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