fix(filter-form): avoid error
This commit is contained in:
		
							parent
							
								
									7b550ce5aa
								
							
						
					
					
						commit
						c8c081eba5
					
				@ -5,7 +5,7 @@ import { useCollection, useCollectionManager } from '../../../collection-manager
 | 
			
		||||
 * 获取当前字段所支持的操作符列表
 | 
			
		||||
 * @returns
 | 
			
		||||
 */
 | 
			
		||||
export const useOperatorList = () => {
 | 
			
		||||
export const useOperatorList = (): any[] => {
 | 
			
		||||
  const schema = useFieldSchema();
 | 
			
		||||
  const fieldInterface = schema['x-designer-props']?.interface;
 | 
			
		||||
  const { name } = useCollection();
 | 
			
		||||
 | 
			
		||||
@ -522,7 +522,7 @@ export const EditOperator = () => {
 | 
			
		||||
  const { t } = useTranslation();
 | 
			
		||||
  const { dn } = useDesignable();
 | 
			
		||||
  const operatorList = useOperatorList();
 | 
			
		||||
  const { operators: storedOperators, uid } = findFilterOperators(fieldSchema);
 | 
			
		||||
  const { operators: storedOperators = {}, uid } = findFilterOperators(fieldSchema);
 | 
			
		||||
 | 
			
		||||
  if (operatorList.length && !storedOperators[fieldSchema.name]) {
 | 
			
		||||
    storedOperators[fieldSchema.name] = operatorList[0].value;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user