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