示例:
Question问题弹出框:
CalculateExpense.razor
@namespace 命名空间
@inherits 域名
@if (Initialized)
{
<SweetAlertBody Category="SwalCategory.Question" ShowConfirm="false" ShowClose="false" ShowFooter="true">
<BodyTemplate>
<div class="d-flex flex-column w-100">
<div class="d-flex flex-column align-self-center">
<span>@IFCALCULATE</span>
</div>
<div>
</BodyTemplate>
<FooterTemplate>
<div class="mx-3 mb-2 d-flex w-100">
<div class="flex-fill"></div>
<Button class="me-2" style="width:95px;"
Size="BlzComponentSize.Medium"
Color="BlzComponentColor.Primary"
Icon="bi bi-check2-square m-1"
Text="@ButtonSaveText"
OnClick="btnSave_Click" />
<Button class="me-2" style="width:95px;"
Size="BlzComponentSize.Medium"
Color="BlzComponentColor.Danger"
Icon="bi bi-x-octagon m-1"
Text="@ButtonCancelText"
OnClick="() => Close(DialogResult.No)" />
</div>
</FooterTemplate>
}
CalculateExpense.razor.cs
namespace Explm.MainWeb.PartialViews
{
[PopupCode("CalculateExpense")]
partial class CalculateExpense
{
protected override void InternalInitialize()
{
base.InternalInitialize();
IFCALCULATE="是否要执行费用计算?"
ButtonSaveText="确定";
ButtonCancelText="取消";
}
private async System.Threading.Tasks.Task btnSave_Click()
{
using (Transaction t = StatementBroker.GetTransaction())
{
//省略计算过程
t.Commit();
}
//返回并关闭窗口
await Close(DialogResult.Yes);
}
}
}
效果图: