fix: 修复表头显示英文问题
This commit is contained in:
parent
32071fe0ad
commit
cc3af1218c
|
@ -1,5 +1,6 @@
|
|||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
@ -62,8 +63,17 @@ namespace Bootstrap.Admin.Pages.Components
|
|||
/// </summary>
|
||||
public string GetDisplayName()
|
||||
{
|
||||
var ret = "";
|
||||
if (_fieldIdentifier == null) _fieldIdentifier = FieldIdentifier.Create(ValueExpression);
|
||||
return _fieldIdentifier?.GetDisplayName() ?? "";
|
||||
if (DisplayNamesExtensions.TryGetValue((_fieldIdentifier.Value.Model.GetType(), _fieldIdentifier.Value.FieldName), out var s))
|
||||
{
|
||||
ret = s;
|
||||
}
|
||||
if (string.IsNullOrEmpty(ret))
|
||||
{
|
||||
ret = _fieldIdentifier?.GetDisplayName() ?? "";
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue