!816 fix(#I2AYE6): set the default column name as property name when not set display name

* chore: 更新项目依赖版本
* refactor: 未找到列显示文本时使用属性名称
This commit is contained in:
Argo 2020-12-27 00:04:23 +08:00
parent 611f5c7e78
commit eedbc06ca0
2 changed files with 4 additions and 4 deletions

View File

@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk.Razor"> <Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<IsPackable>true</IsPackable> <IsPackable>true</IsPackable>
<PackageIcon>logo.png</PackageIcon> <PackageIcon>logo.png</PackageIcon>
<Version>5.0.1</Version> <Version>5.0.2</Version>
<PackageReleaseNotes>https://gitee.com/LongbowEnterprise/BootstrapBlazor/wikis</PackageReleaseNotes> <PackageReleaseNotes>https://gitee.com/LongbowEnterprise/BootstrapBlazor/wikis</PackageReleaseNotes>
</PropertyGroup> </PropertyGroup>
@ -13,7 +13,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="BootstrapBlazor" Version="5.0.7" /> <PackageReference Include="BootstrapBlazor" Version="5.0.8" />
<PackageReference Include="EPPlus" Version="4.5.3.3" /> <PackageReference Include="EPPlus" Version="4.5.3.3" />
</ItemGroup> </ItemGroup>

View File

@ -52,7 +52,7 @@ namespace BootstrapBlazor.Components
var th_value = cols.FirstOrDefault(x => x.GetFieldName() == pi.Name)?.Text var th_value = cols.FirstOrDefault(x => x.GetFieldName() == pi.Name)?.Text
?? items.FirstOrDefault()?.GetDisplayName(pi.Name) ?? items.FirstOrDefault()?.GetDisplayName(pi.Name)
?? "未设置"; ?? pi.Name;
worksheet.SetValue(1, x, th_value); worksheet.SetValue(1, x, th_value);
} }