fix: 修复表头显示英文问题

This commit is contained in:
Argo-Cloud 2021-01-22 22:26:24 +08:00
parent 32071fe0ad
commit cc3af1218c
1 changed files with 11 additions and 1 deletions

View File

@ -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>