fix language edit
This commit is contained in:
@@ -1,15 +1,10 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Atomx.Admin.Client.Models
|
||||
namespace Atomx.Admin.Client.Models
|
||||
{
|
||||
public class LanguageModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据ID
|
||||
/// </summary>
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -41,15 +36,5 @@ namespace Atomx.Admin.Client.Models
|
||||
/// 是否可用,系统面
|
||||
/// </summary>
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多语言资源的版本,可以是时间戳或哈希
|
||||
/// </summary>
|
||||
public string ResourceVersion { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 是否编辑
|
||||
/// </summary>
|
||||
public bool IsEdit { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace Atomx.Admin.Client.Models
|
||||
{
|
||||
public class LocaleResourceSearch
|
||||
{
|
||||
public int LanguageId { get; set; }
|
||||
|
||||
public string? ResourceName { get; set; }
|
||||
|
||||
public string? ResourceValue { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -33,10 +33,13 @@
|
||||
<Icon Type="close" Theme="IconThemeType.Outline" Width="1.3em" Height="1.3em" />
|
||||
}
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.ResourceVersion" Title="资源版本" Width="190px" />
|
||||
<PropertyColumn Property="c => c.UpdateTime" Title="最后更新" Width="190px" />
|
||||
<ActionColumn Title="操作" Align="ColumnAlign.Right" Width="160px">
|
||||
<PropertyColumn Property="c => c.ResourceVersion" Title="资源版本"/>
|
||||
<PropertyColumn Property="c => c.UpdateTime" Title="最后更新" />
|
||||
<ActionColumn Title="操作" Align="ColumnAlign.Right">
|
||||
<Space>
|
||||
<SpaceItem>
|
||||
<a href="@($"/system/locale/resource/list/{context.Id}")"> <Icon Type="@IconType.Outline.Edit" /> 语言资源</a>
|
||||
</SpaceItem>
|
||||
<SpaceItem>
|
||||
<Dropdown Trigger="@(new Trigger[] { Trigger.Click })">
|
||||
<Overlay>
|
||||
|
||||
@@ -2,10 +2,41 @@
|
||||
@inject ILogger<LocaleResourceList> Logger
|
||||
|
||||
<PageTitle>本地化语言资源</PageTitle>
|
||||
<Title Level="4">多语言本地资源管理</Title>
|
||||
<Spin Spinning="loading">
|
||||
|
||||
</Spin>
|
||||
@code {
|
||||
[Parameter]
|
||||
public long Id { get; set; }
|
||||
public int Id { get; set; }
|
||||
bool loading = false;
|
||||
|
||||
[SupplyParameterFromForm]
|
||||
LocaleResourceSearch search { get; set; } = default!;
|
||||
|
||||
[SupplyParameterFromForm]
|
||||
LocaleResourceModel model { get; set; } = default!;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
search ??= new LocaleResourceSearch();
|
||||
model ??= new LocaleResourceModel();
|
||||
base.OnInitialized();
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await LoadList();
|
||||
}
|
||||
|
||||
private async Task LoadList()
|
||||
{
|
||||
loading = true;
|
||||
|
||||
var url = $"/api/locale/resource/search/{Id}";
|
||||
|
||||
|
||||
loading = false;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user