mh_custom/wtmProject.Shared/Pages/_Admin/FrameworkCustom/Create.razor

41 lines
1.2 KiB
Plaintext
Raw Normal View History

2024-05-16 17:30:33 +08:00
@page "/_Admin/FrameworkCustom/Create"
@using wtmProject.ViewModel._Admin.FrameworkCustomVMs;
@inherits BasePage
<ValidateForm @ref="vform" Model="@Model" OnValidSubmit="@Submit">
<Row ItemsPerRow="ItemsPerRow.Two" RowType="RowType.Normal">
<BootstrapInput @bind-Value="@Model.Entity.CustomCode" />
<BootstrapInput @bind-Value="@Model.Entity.CustomName" />
</Row>
<div class="modal-footer table-modal-footer">
@* <Button Color="Color.Secondary" Icon="fa fa-close" Text="@WtmBlazor.Localizer["Sys.Close"]" OnClick="OnClose" />*@
<Button Color="Color.Primary" ButtonType="ButtonType.Submit" Icon="fa fa-save" Text="@WtmBlazor.Localizer["Sys.Save"]" IsAsync="true" />
</div>
</ValidateForm>
@code {
private FrameworkCustomVM Model = new FrameworkCustomVM();
private ValidateForm vform { get; set; }
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
}
private async Task Submit(EditContext context)
{
await PostsForm(vform, "/api/FrameworkCustom/add", (s) => "Sys.OprationSuccess");
}
public void OnClose()
{
CloseDialog();
}
}