...
This commit is contained in:
@@ -21,8 +21,8 @@
|
||||
</form>
|
||||
</BodyTemplate>
|
||||
<FooterTemplate>
|
||||
<Button Color="ButtonColor.Secondary" @onclick="OnHideModalClick">Close</Button>
|
||||
<Button Color="ButtonColor.Primary" @onclick="OnClickNewTicket">ثبت</Button>
|
||||
<Button Disabled="SpinnerVisible" Color="ButtonColor.Secondary" @onclick="OnHideModalClick">Close</Button>
|
||||
<Button Disabled="SpinnerVisible" Color="ButtonColor.Primary" @onclick="OnClickNewTicket">ثبت</Button>
|
||||
</FooterTemplate>
|
||||
</Modal>
|
||||
|
||||
@@ -31,11 +31,15 @@
|
||||
<span class="text-muted fw-light">متفرقه /</span> پشتیبانی
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<Alert hidden="@Hidealert" Color="@alertColor" Dismissable="false">
|
||||
<Icon Name="@alertIconName" class="me-2"></Icon>
|
||||
@alertMessage
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<Spinner Visible="SpinnerVisible" Color="SpinnerColor.Primary" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
@@ -56,12 +60,12 @@
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
|
||||
<button type="submit" @onclick="Submit" class="btn btn-primary">جستجو</button>
|
||||
<Button Disabled="SpinnerVisible" Color="ButtonColor.Primary" @onclick="Submit">جستجو</Button>
|
||||
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
|
||||
<button type="submit" @onclick="OnShowModalClick" class="btn btn-primary">جدید</button>
|
||||
<Button Disabled="SpinnerVisible" Color="ButtonColor.Primary" @onclick="OnShowModalClick">جدید</Button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -112,7 +116,7 @@
|
||||
|
||||
@code {
|
||||
LTicket child;
|
||||
|
||||
public bool SpinnerVisible { get; set; } = false;
|
||||
private Modal modal = default!;
|
||||
// alert
|
||||
AlertColor alertColor = AlertColor.Primary;
|
||||
@@ -134,6 +138,7 @@
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
SpinnerVisible = false;
|
||||
if (PageIndex == null) PageIndex = 1;
|
||||
await Search(PageIndex.Value);
|
||||
await base.OnParametersSetAsync();
|
||||
@@ -161,7 +166,8 @@
|
||||
}
|
||||
public async Task Search(int pi)
|
||||
{
|
||||
|
||||
SpinnerVisible = true;
|
||||
|
||||
var rsp = await hc.Post<ItemSerchGetTicket>("Ticket/GetAll", new ItemSerchGetTicket
|
||||
{
|
||||
PageIndex = pi,
|
||||
@@ -178,6 +184,7 @@
|
||||
{
|
||||
ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
|
||||
}
|
||||
SpinnerVisible = false;
|
||||
}
|
||||
private async Task OnShowModalClick()
|
||||
{
|
||||
@@ -189,6 +196,7 @@
|
||||
}
|
||||
private async Task OnClickNewTicket()
|
||||
{
|
||||
SpinnerVisible = true;
|
||||
var rsp = await hc.Post<CTicketDto>("Ticket/NewTicket", new CTicketDto
|
||||
{
|
||||
CompanyID = userinfo.Company.ID.ToString(),
|
||||
@@ -206,6 +214,6 @@
|
||||
ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
|
||||
}
|
||||
await modal.HideAsync();
|
||||
|
||||
SpinnerVisible = false;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user