fix: chinaRegions association fieldName (#3600)
* fix: chinaRegions association fieldName * fix: useAssociatedFormItemInitializerFields fieldName
This commit is contained in:
		
							parent
							
								
									56d4d240a1
								
							
						
					
					
						commit
						f619c4e6c0
					
				@ -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,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user