!2629 fix(#I51TKP): lookup not work on EditorItem component

* fix: 修复 EditorItem Lookup 不生效问题
This commit is contained in:
Argo 2022-04-08 15:03:16 +00:00
parent f8ec74dda1
commit 9a43efc7be

View File

@ -293,7 +293,7 @@ public static class Utility
var fieldValue = GenerateValue(model, fieldName); var fieldValue = GenerateValue(model, fieldName);
var fieldValueChanged = GenerateValueChanged(component, model, fieldName, fieldType); var fieldValueChanged = GenerateValueChanged(component, model, fieldName, fieldType);
var valueExpression = GenerateValueExpression(model, fieldName, fieldType); var valueExpression = GenerateValueExpression(model, fieldName, fieldType);
var lookup = item is ITableColumn col ? col.Lookup : lookUpService?.GetItemsByKey(item.LookUpServiceKey); var lookup = item.Lookup ?? lookUpService?.GetItemsByKey(item.LookUpServiceKey);
var componentType = item.ComponentType ?? GenerateComponentType(fieldType, item.Rows != 0, lookup); var componentType = item.ComponentType ?? GenerateComponentType(fieldType, item.Rows != 0, lookup);
builder.OpenComponent(0, componentType); builder.OpenComponent(0, componentType);
if (componentType.IsSubclassOf(typeof(ValidateBase<>).MakeGenericType(fieldType))) if (componentType.IsSubclassOf(typeof(ValidateBase<>).MakeGenericType(fieldType)))