feat : add ver 0.4.3.12 , improve ui

release
Amir Hossein Khademi 2024-02-09 22:40:13 +03:30
parent ed513f93bc
commit f883451697
8 changed files with 89 additions and 29 deletions

View File

@ -31,7 +31,7 @@
</MudItem> </MudItem>
<MudItem sm="8"> <MudItem sm="8">
<MudTextField Disabled="@ViewModel.PageDto.IsInfinity" @bind-Value="@ViewModel.PageDto.Count" T="int" Label="تعداد قابل استفاده" Variant="Variant.Outlined" /> <MudTextField Disabled="@ViewModel.PageDto.IsInfinity" Format="N0" @bind-Value="@ViewModel.PageDto.Count" T="int" Label="تعداد قابل استفاده" Variant="Variant.Outlined" />
</MudItem> </MudItem>
<MudItem sm="4"> <MudItem sm="4">
@ -47,21 +47,21 @@
</MudItem> </MudItem>
<MudItem md="4"> <MudItem md="4">
<MudTextField Disabled="@ViewModel.IsPercentType.Not()" @bind-Value="@ViewModel.PageDto.DiscountPercent" T="int" Label="درصد تخفیف" Variant="Variant.Outlined" /> <MudTextField Disabled="@ViewModel.IsPercentType.Not()" Format="N0" @bind-Value="@ViewModel.PageDto.DiscountPercent" T="int" Label="درصد تخفیف" Variant="Variant.Outlined" />
</MudItem> </MudItem>
<MudItem md="4"> <MudItem md="4">
<MudTextField Disabled="@ViewModel.IsAmountType.Not()" @bind-Value="@ViewModel.PageDto.DiscountAmount" T="long" Label="مبلغ تخفیفــ" Adornment="Adornment.End" AdornmentText="ریالــ" Variant="Variant.Outlined" /> <MudTextField Disabled="@ViewModel.IsAmountType.Not()" Format="N0" @bind-Value="@ViewModel.PageDto.DiscountAmount" T="long" Label="مبلغ تخفیفــ" Adornment="Adornment.End" AdornmentText="ریالــ" Variant="Variant.Outlined" />
</MudItem> </MudItem>
<MudItem md="6"> <MudItem md="6">
<MudTextField @bind-Value="@ViewModel.PageDto.PriceFloor" T="long" Label="کف قیمت برای تخفیف" Adornment="Adornment.End" AdornmentText="ریالــ" Variant="Variant.Outlined" /> <MudTextField @bind-Value="@ViewModel.PageDto.PriceFloor" Format="N0" T="long" Label="کف قیمت برای تخفیف" Adornment="Adornment.End" AdornmentText="ریالــ" Variant="Variant.Outlined" />
</MudItem> </MudItem>
<MudItem md="6"> <MudItem md="6">
<MudTextField @bind-Value="@ViewModel.PageDto.PriceCeiling" T="long" Label="سقف قیمت برای تخفیف" Adornment="Adornment.End" AdornmentText="ریالــ" Variant="Variant.Outlined" /> <MudTextField @bind-Value="@ViewModel.PageDto.PriceCeiling" Format="N0" T="long" Label="سقف قیمت برای تخفیف" Adornment="Adornment.End" AdornmentText="ریالــ" Variant="Variant.Outlined" />
</MudItem> </MudItem>
<MudItem sm="6"> <MudItem sm="6">

View File

@ -74,16 +74,16 @@
</MudAutocomplete> </MudAutocomplete>
</MudItem> </MudItem>
<MudItem lg="4" md="6"> <MudItem lg="4" md="6">
<MudTextField @bind-Value="@ViewModel.PageDto.Cost" T="double" Label="قیمت محصول" Adornment="Adornment.End" AdornmentText="ریالــ" Variant="Variant.Outlined" /> <MudTextField @bind-Value="@ViewModel.PageDto.Cost" T="double" Label="قیمت محصول" Adornment="Adornment.End" Format="N0" AdornmentText="ریالــ" Variant="Variant.Outlined" />
</MudItem> </MudItem>
<MudItem lg="4" md="6"> <MudItem lg="4" md="6">
<MudTextField @bind-Value="@ViewModel.PageDto.PackingCost" T="double" Label="مبلغ بسته بندی" Adornment="Adornment.End" AdornmentText="ریالــ" Variant="Variant.Outlined" /> <MudTextField @bind-Value="@ViewModel.PageDto.PackingCost" T="double" Label="مبلغ بسته بندی" Format="N0" Adornment="Adornment.End" AdornmentText="ریالــ" Variant="Variant.Outlined" />
</MudItem> </MudItem>
<MudItem lg="4" md="6"> <MudItem lg="4" md="6">
<MudTextField @bind-Value="@ViewModel.PageDto.Stock" T="int" Label="موجودی انبار" Variant="Variant.Outlined" /> <MudTextField @bind-Value="@ViewModel.PageDto.Stock" T="int" Format="N0" Label="موجودی انبار" Variant="Variant.Outlined" />
</MudItem> </MudItem>
<MudItem lg="4" md="6"> <MudItem lg="4" md="6">
<MudTextField @bind-Value="@ViewModel.PageDto.MaxOrderCount" T="int" Label="بیشترین خرید" Variant="Variant.Outlined" /> <MudTextField @bind-Value="@ViewModel.PageDto.MaxOrderCount" T="int" Format="N0" Label="بیشترین خرید" Variant="Variant.Outlined" />
</MudItem> </MudItem>
<MudItem lg="4" md="6"> <MudItem lg="4" md="6">
<MudTextField @bind-Value="@ViewModel.PageDto.Warranty" T="string" Label="گارانتی" Variant="Variant.Outlined" /> <MudTextField @bind-Value="@ViewModel.PageDto.Warranty" T="string" Label="گارانتی" Variant="Variant.Outlined" />
@ -282,11 +282,11 @@
</MudItem> </MudItem>
<MudItem md="4"> <MudItem md="4">
<MudTextField Disabled="@ViewModel.IsPercentType.Not()" @bind-Value="@ViewModel.Discount.DiscountPercent" T="int" Label="درصد تخفیف" Variant="Variant.Outlined" /> <MudTextField Disabled="@ViewModel.IsPercentType.Not()" @bind-Value="@ViewModel.Discount.DiscountPercent" Format="N0" T="int" Label="درصد تخفیف" Variant="Variant.Outlined" />
</MudItem> </MudItem>
<MudItem md="4"> <MudItem md="4">
<MudTextField Disabled="@ViewModel.IsAmountType.Not()" @bind-Value="@ViewModel.Discount.DiscountAmount" T="long" Label="مبلغ تخفیفــ" Adornment="Adornment.End" AdornmentText="ریالــ" Variant="Variant.Outlined" /> <MudTextField Disabled="@ViewModel.IsAmountType.Not()" @bind-Value="@ViewModel.Discount.DiscountAmount" Format="N0" T="long" Label="مبلغ تخفیفــ" Adornment="Adornment.End" AdornmentText="ریالــ" Variant="Variant.Outlined" />
</MudItem> </MudItem>

View File

@ -31,7 +31,7 @@
</MudItem> </MudItem>
<MudItem sm="12" md="6"> <MudItem sm="12" md="6">
<MudTextField T="double" Label="هزینه ارسال" @bind-Value="@ViewModel.PageDto.DeliveryCost" Variant="Variant.Outlined"></MudTextField> <MudTextField T="double" Label="هزینه ارسال" Adornment="Adornment.End" Format="N0" AdornmentText="ریالــ" @bind-Value="@ViewModel.PageDto.DeliveryCost" Variant="Variant.Outlined"></MudTextField>
</MudItem> </MudItem>

View File

@ -5,8 +5,8 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest> <ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
<AssemblyVersion>0.2.5.11</AssemblyVersion> <AssemblyVersion>0.4.3.12</AssemblyVersion>
<FileVersion>0.2.5.11</FileVersion> <FileVersion>0.4.3.12</FileVersion>
</PropertyGroup> </PropertyGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent"> <Target Name="PostBuild" AfterTargets="PostBuildEvent">

View File

@ -35,12 +35,44 @@
OnAdornmentClick="@ViewModel.SearchAsync"></MudTextField> OnAdornmentClick="@ViewModel.SearchAsync"></MudTextField>
</ToolBarContent> </ToolBarContent>
<Columns> <Columns>
<PropertyColumn Title="کد تخفیفــ" Property="arg => arg.Code" /> <TemplateColumn T="DiscountSDto" Title="کد تخفیفــ">
<PropertyColumn Title="تعداد" Property="arg => arg.Count" /> <CellTemplate>
<PropertyColumn Title="تاریخ شروع" Property="arg => arg.StartDate" /> @if (context.Item.HasCode)
<PropertyColumn Title="تاریخ انقضا" Property="arg => arg.ExpireDate" /> {
<PropertyColumn Title="پیشنهاد ویژه" Property="arg => arg.IsSpecialOffer" /> <p>@context.Item.Code</p>
<PropertyColumn Title="تعداد استفاده شده" Property="arg => arg.UseCount" /> }
else
{
<p>بدون کد</p>
}
</CellTemplate>
</TemplateColumn>
<TemplateColumn T="DiscountSDto" Title="تاریخ شروع">
<CellTemplate>
<p>@context.Item.StartDate.ToPersianDateTime().ToLongDateString()</p>
</CellTemplate>
</TemplateColumn>
<TemplateColumn T="DiscountSDto" Title="تاریخ انقضا">
<CellTemplate>
<p>@context.Item.ExpireDate.ToPersianDateTime().ToLongDateString()</p>
</CellTemplate>
</TemplateColumn>
<TemplateColumn T="DiscountSDto" Title="تعداد قابل استفاده">
<CellTemplate>
@if (context.Item.IsInfinity)
{
<p>--</p>
}
else
{
<p>@context.Item.Count</p>
}
</CellTemplate>
</TemplateColumn>
<TemplateColumn CellClass="d-flex justify-end"> <TemplateColumn CellClass="d-flex justify-end">
<CellTemplate> <CellTemplate>
<MudStack Row="true"> <MudStack Row="true">

View File

@ -1,4 +1,5 @@
using NetinaShop.Domain.Entities.Discounts; using MudBlazor;
using NetinaShop.Domain.Entities.Discounts;
namespace NetinaShop.AdminPanel.PWA.Pages; namespace NetinaShop.AdminPanel.PWA.Pages;
@ -103,7 +104,12 @@ public class DiscountPageViewModel : BaseViewModel<ObservableCollection<Discount
public async Task AddAsync() public async Task AddAsync()
{ {
DialogOptions maxWidth = new DialogOptions() { MaxWidth = MaxWidth.Medium, FullWidth = true, DisableBackdropClick = true }; DialogOptions maxWidth = new DialogOptions() { MaxWidth = MaxWidth.Medium, FullWidth = true, DisableBackdropClick = true };
await _dialogService.ShowAsync<DiscountActionDialogBox>("افزودن بلاگ جدید", maxWidth); var dialogResult = await _dialogService.ShowAsync<DiscountActionDialogBox>("افزودن تخفیف جدید", maxWidth);
var result = await dialogResult.Result;
if (!result.Canceled && result.Data is bool and true)
{
await InitializeAsync();
}
} }
public async Task EditAsync(DiscountSDto discount) public async Task EditAsync(DiscountSDto discount)
@ -111,7 +117,12 @@ public class DiscountPageViewModel : BaseViewModel<ObservableCollection<Discount
DialogOptions maxWidth = new DialogOptions() { MaxWidth = MaxWidth.Medium, FullWidth = true, DisableBackdropClick = true }; DialogOptions maxWidth = new DialogOptions() { MaxWidth = MaxWidth.Medium, FullWidth = true, DisableBackdropClick = true };
var parameters = new DialogParameters<DiscountActionDialogBox>(); var parameters = new DialogParameters<DiscountActionDialogBox>();
parameters.Add(x => x.Discount, discount); parameters.Add(x => x.Discount, discount);
await _dialogService.ShowAsync<DiscountActionDialogBox>($"ویرایش تخفیف {discount.Code}", parameters, maxWidth); var dialogResult= await _dialogService.ShowAsync<DiscountActionDialogBox>($"ویرایش تخفیف {discount.Code}", parameters, maxWidth);
var result = await dialogResult.Result;
if (!result.Canceled && result.Data is bool and true)
{
await InitializeAsync();
}
} }
public async Task DeleteAsync(Guid selectedDiscountId) public async Task DeleteAsync(Guid selectedDiscountId)
@ -119,7 +130,7 @@ public class DiscountPageViewModel : BaseViewModel<ObservableCollection<Discount
var options = new DialogOptions { CloseOnEscapeKey = true }; var options = new DialogOptions { CloseOnEscapeKey = true };
var parameters = new DialogParameters<QuestionDialog>(); var parameters = new DialogParameters<QuestionDialog>();
parameters.Add(x => x.ContentText, "آیا از حذف تخفیف اطمینان دارید ?"); parameters.Add(x => x.ContentText, "آیا از حذف تخفیف اطمینان دارید ?");
var dialogReference = await _dialogService.ShowAsync<QuestionDialog>("حذف بلاگ", parameters, options); var dialogReference = await _dialogService.ShowAsync<QuestionDialog>("حذف تخفیف", parameters, options);
var result = await dialogReference.Result; var result = await dialogReference.Result;
if (!result.Canceled) if (!result.Canceled)
{ {
@ -131,7 +142,7 @@ public class DiscountPageViewModel : BaseViewModel<ObservableCollection<Discount
var token = await _userUtility.GetBearerTokenAsync(); var token = await _userUtility.GetBearerTokenAsync();
if (token == null) if (token == null)
throw new Exception("Token is null"); throw new Exception("Token is null");
await _restWrapper.CrudDtoApiRest<Discount, DiscountSDto, Guid>(Address.BlogController) await _restWrapper.CrudDtoApiRest<Discount, DiscountSDto, Guid>(Address.DiscountController)
.Delete(selectedDiscountId, token); .Delete(selectedDiscountId, token);
_snackbar.Add("حذف تخفیف با موفقیت انجام شد", Severity.Success); _snackbar.Add("حذف تخفیف با موفقیت انجام شد", Severity.Success);

View File

@ -78,7 +78,11 @@
} }
</CellTemplate> </CellTemplate>
</TemplateColumn> </TemplateColumn>
<PropertyColumn Title="قیمتــ" Property="arg => arg.Cost"/> <TemplateColumn T="ProductSDto" Title="قیمتــ">
<CellTemplate>
<p>@context.Item.Cost.ToString("N0") ریالــ</p>
</CellTemplate>
</TemplateColumn>
<TemplateColumn CellClass="d-flex justify-end"> <TemplateColumn CellClass="d-flex justify-end">
<CellTemplate> <CellTemplate>
<MudStack Row="true"> <MudStack Row="true">

View File

@ -1,4 +1,6 @@
namespace NetinaShop.AdminPanel.PWA.Pages; using MudBlazor;
namespace NetinaShop.AdminPanel.PWA.Pages;
public class ProductsPageViewModel : BaseViewModel<ObservableCollection<ProductSDto>> public class ProductsPageViewModel : BaseViewModel<ObservableCollection<ProductSDto>>
{ {
@ -95,7 +97,12 @@ public class ProductsPageViewModel : BaseViewModel<ObservableCollection<ProductS
public async Task AddProductClicked() public async Task AddProductClicked()
{ {
DialogOptions maxWidth = new DialogOptions() { MaxWidth = MaxWidth.Medium, FullWidth = true, DisableBackdropClick = true }; DialogOptions maxWidth = new DialogOptions() { MaxWidth = MaxWidth.Medium, FullWidth = true, DisableBackdropClick = true };
await _dialogService.ShowAsync<ProductActionDialogBox>("افزودن محصول جدید", maxWidth); var dialogResult = await _dialogService.ShowAsync<ProductActionDialogBox>("افزودن محصول جدید", maxWidth);
var result = await dialogResult.Result;
if (!result.Canceled && result.Data is bool and true)
{
await InitializeAsync();
}
} }
public async Task EditProductClicked(ProductSDto product) public async Task EditProductClicked(ProductSDto product)
@ -103,7 +110,12 @@ public class ProductsPageViewModel : BaseViewModel<ObservableCollection<ProductS
DialogOptions maxWidth = new DialogOptions() { MaxWidth = MaxWidth.Medium, FullWidth = true, DisableBackdropClick = true }; DialogOptions maxWidth = new DialogOptions() { MaxWidth = MaxWidth.Medium, FullWidth = true, DisableBackdropClick = true };
var parameters = new DialogParameters<ProductActionDialogBox>(); var parameters = new DialogParameters<ProductActionDialogBox>();
parameters.Add(x => x.Product, product); parameters.Add(x => x.Product, product);
await _dialogService.ShowAsync<ProductActionDialogBox>($"ویرایش محصول {product.PersianName}", parameters, maxWidth); var dialogResult = await _dialogService.ShowAsync<ProductActionDialogBox>($"ویرایش محصول {product.PersianName}", parameters, maxWidth);
var result = await dialogResult.Result;
if (!result.Canceled && result.Data is bool and true)
{
await InitializeAsync();
}
} }
public async Task DeleteProductAsync(Guid selectedCategoryId) public async Task DeleteProductAsync(Guid selectedCategoryId)
@ -124,6 +136,7 @@ public class ProductsPageViewModel : BaseViewModel<ObservableCollection<ProductS
await _restWrapper.CrudDtoApiRest<Product, ProductSDto, Guid>(Address.ProductController) await _restWrapper.CrudDtoApiRest<Product, ProductSDto, Guid>(Address.ProductController)
.Delete(selectedCategoryId, token); .Delete(selectedCategoryId, token);
_snackbar.Add("حذف محصول با موفقیت انجام شد", Severity.Success); _snackbar.Add("حذف محصول با موفقیت انجام شد", Severity.Success);
await InitializeAsync();
} }
catch (ApiException ex) catch (ApiException ex)