|
7 | 7 | using Microsoft.Extensions.Localization; |
8 | 8 | using System.ComponentModel; |
9 | 9 | using System.Data; |
| 10 | +using System.Globalization; |
10 | 11 | using System.Linq.Expressions; |
11 | 12 | using System.Reflection; |
12 | 13 |
|
@@ -101,6 +102,11 @@ public static class Utility |
101 | 102 | /// <returns></returns> |
102 | 103 | public static TResult GetPropertyValue<TModel, TResult>(TModel model, string fieldName) => CacheManager.GetPropertyValue<TModel, TResult>(model, fieldName); |
103 | 104 |
|
| 105 | + /// <summary> |
| 106 | + /// 获得 当前输入语言小数点分隔符 |
| 107 | + /// </summary> |
| 108 | + private static string NumberDecimalSeparator => CultureInfo.CurrentCulture?.NumberFormat?.NumberDecimalSeparator ?? "."; |
| 109 | + |
104 | 110 | /// <summary> |
105 | 111 | /// 获取 指定对象的属性值 |
106 | 112 | /// </summary> |
@@ -429,12 +435,10 @@ public static void CreateDisplayByFieldType(this RenderTreeBuilder builder, IEdi |
429 | 435 | builder.OpenComponent(0, typeof(Display<>).MakeGenericType(fieldType)); |
430 | 436 | builder.AddAttribute(10, nameof(Display<string>.DisplayText), displayName); |
431 | 437 | builder.AddAttribute(20, nameof(Display<string>.Value), fieldValue); |
432 | | - builder.AddAttribute(30, nameof(Display<string>.Lookup), item.Lookup); |
433 | | - builder.AddAttribute(30, nameof(Display<string>.LookupService), item.LookupService); |
434 | | - builder.AddAttribute(40, nameof(Display<string>.LookupServiceKey), item.LookupServiceKey); |
435 | | - builder.AddAttribute(50, nameof(Display<string>.LookupServiceData), item.LookupServiceData); |
436 | | - builder.AddAttribute(60, nameof(Display<string>.LookupStringComparison), item.LookupStringComparison); |
437 | | - builder.AddAttribute(65, nameof(Display<string>.ShowLabelTooltip), item.ShowLabelTooltip); |
| 438 | + builder.AddAttribute(30, nameof(Display<string>.LookupServiceKey), item.LookupServiceKey); |
| 439 | + builder.AddAttribute(40, nameof(Display<string>.LookupServiceData), item.LookupServiceData); |
| 440 | + builder.AddAttribute(50, nameof(Display<string>.Lookup), item.Lookup); |
| 441 | + builder.AddAttribute(60, nameof(Display<string>.ShowLabelTooltip), item.ShowLabelTooltip); |
438 | 442 | if (item is ITableColumn col) |
439 | 443 | { |
440 | 444 | if (col.Formatter != null) |
@@ -524,7 +528,6 @@ public static void CreateComponentByFieldType(this RenderTreeBuilder builder, Co |
524 | 528 | if (item.IsLookup() && item.Items == null) |
525 | 529 | { |
526 | 530 | builder.AddAttribute(110, nameof(Select<SelectedItem>.ShowSearch), item.ShowSearchWhenSelect); |
527 | | - builder.AddAttribute(115, nameof(Select<SelectedItem>.Items), item.Lookup); |
528 | 531 | builder.AddAttribute(120, nameof(Select<SelectedItem>.LookupService), lookupService); |
529 | 532 | builder.AddAttribute(121, nameof(Select<SelectedItem>.LookupServiceKey), item.LookupServiceKey); |
530 | 533 | builder.AddAttribute(122, nameof(Select<SelectedItem>.LookupServiceData), item.LookupServiceData); |
@@ -638,7 +641,7 @@ private static Type GenerateComponentType(IEditorItem item) |
638 | 641 | { |
639 | 642 | ret = typeof(NullSwitch); |
640 | 643 | } |
641 | | - else if (fieldType.IsNumber()) |
| 644 | + else if (fieldType.IsNumber() && NumberDecimalSeparator == ".") |
642 | 645 | { |
643 | 646 | ret = typeof(BootstrapInputNumber<>).MakeGenericType(fieldType); |
644 | 647 | } |
|
0 commit comments