chore
This commit is contained in:
@@ -5,23 +5,26 @@
|
||||
|
||||
|
||||
|
||||
<PageContainer Title="国家管理">
|
||||
<PageContainer Title="城市地区管理">
|
||||
<Breadcrumb>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbItem>Home</BreadcrumbItem>
|
||||
<BreadcrumbItem>系统配置</BreadcrumbItem>
|
||||
<BreadcrumbItem>国家管理</BreadcrumbItem>
|
||||
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
|
||||
<BreadcrumbItem Href="/settings">系统配置</BreadcrumbItem>
|
||||
<BreadcrumbItem Href="/country/list">国家管理</BreadcrumbItem>
|
||||
<BreadcrumbItem Href="@($"/stateprovince/list/{CountryId}")">州/省管理</BreadcrumbItem>
|
||||
</Breadcrumb>
|
||||
</Breadcrumb>
|
||||
<ChildContent>
|
||||
<Spin Spinning="pageLoading">
|
||||
<Card>
|
||||
<Card>
|
||||
<Form @ref="searchForm" Model="search" Layout="FormLayout.Inline" Class="search-form" OnFinish="OnSearchFinish">
|
||||
<Row Justify="RowJustify.Start" Gutter="16">
|
||||
<Col>
|
||||
<FormItem Label="名称">
|
||||
<Input @bind-Value="search.Name" Placeholder="名称" AllowClear />
|
||||
</FormItem>
|
||||
</Col>
|
||||
<Col>
|
||||
<div class="ant-form-item">
|
||||
<Button Type="ButtonType.Primary" HtmlType="submit">查询</Button>
|
||||
<Button Style="margin: 0 8px;" OnClick="OnSearchReset">重置</Button>
|
||||
@@ -30,33 +33,35 @@
|
||||
</Row>
|
||||
</Form>
|
||||
</Card>
|
||||
<br />
|
||||
<Card Title="" Class="hideborder">
|
||||
<Extra>
|
||||
<div class="extraContent">
|
||||
<Button Type="ButtonType.Primary" HtmlType="submit" OnClick="HandleAddNew">新增国家</Button>
|
||||
<Button Type="ButtonType.Primary" HtmlType="submit" OnClick="HandleAddNew">新增地区</Button>
|
||||
</div>
|
||||
</Extra>
|
||||
<ChildContent>
|
||||
<Table DataSource="PagingList.Items" PageSize="100" HidePagination="true">
|
||||
<Selection CheckStrictly />
|
||||
<PropertyColumn Property="c => c.Name" Title="名称" />
|
||||
<PropertyColumn Property="c => c.StateProvinceName" Title="州/省" />
|
||||
<PropertyColumn Property="c => c.Initial" Title="首字母" />
|
||||
<PropertyColumn Property="c => c.NumericISOCode" Title="ISO代码" />
|
||||
<PropertyColumn Property="c => c.Enabled" Title="状态">
|
||||
@if (context.Enabled)
|
||||
{
|
||||
<Text>已激活</text>
|
||||
<AntDesign.Text Type="TextElementType.Success"><Icon Type="check" Theme=" IconThemeType.Outline" Width="1.3em" Height="1.3em" /></AntDesign.Text>
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
<Text>未激活</text>
|
||||
<Icon Type="close" Theme="IconThemeType.Outline" Width="1.3em" Height="1.3em" />
|
||||
}
|
||||
</PropertyColumn>
|
||||
<PropertyColumn Property="c => c.DisplayOrder" Title="排序" />
|
||||
<ActionColumn Title="操作" Align="ColumnAlign.Right">
|
||||
<Space>
|
||||
<SpaceItem>
|
||||
<a @onclick="(e)=>HandleEdit(context)">编辑</a>
|
||||
<a @onclick="(e) => HandleEdit(context)">编辑</a>
|
||||
</SpaceItem>
|
||||
@*<SpaceItem>
|
||||
<Popconfirm Placement="@Placement.Left" Title="@("删除这条数据无法恢复,您确定要删除吗?")"
|
||||
@@ -86,7 +91,7 @@
|
||||
[Parameter]
|
||||
public string Locale { get; set; } = string.Empty;
|
||||
[Parameter]
|
||||
public long CountryId { get; set; }
|
||||
public long CountryId { get; set; }
|
||||
|
||||
[SupplyParameterFromQuery]
|
||||
int? Page { get; set; }
|
||||
@@ -96,10 +101,10 @@
|
||||
|
||||
bool pageLoading = false;
|
||||
|
||||
Form<CountrySearch> searchForm = new();
|
||||
CountrySearch search = new();
|
||||
Form<AreaSearch> searchForm = new();
|
||||
AreaSearch search = new();
|
||||
|
||||
PagingList<Country> PagingList = new() { Size = 20 };
|
||||
PagingList<AreaItem> PagingList = new() { Size = 20 };
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
@@ -119,6 +124,8 @@
|
||||
var uri = new Uri(Navigation.Uri);
|
||||
var query = uri.Query;
|
||||
search.Name = query.GetQueryString("Name");
|
||||
search.StateProvinceId = query.GetQueryString("StateProvinceId").ToLong();
|
||||
search.CountryId = CountryId;
|
||||
}
|
||||
|
||||
async Task LoadListAsync()
|
||||
@@ -126,8 +133,8 @@
|
||||
try
|
||||
{
|
||||
pageLoading = true;
|
||||
var url = "/api/country/search";
|
||||
var apiResult = await HttpService.GetPagingList<Country>(url, search, Page.GetValueOrDefault(1), PageSize.GetValueOrDefault(20));
|
||||
var url = "/api/area/search";
|
||||
var apiResult = await HttpService.GetPagingList<AreaItem>(url, search, Page.GetValueOrDefault(1), PageSize.GetValueOrDefault(20));
|
||||
if (apiResult.Success)
|
||||
{
|
||||
if (apiResult.Data != null)
|
||||
@@ -150,7 +157,7 @@
|
||||
|
||||
void OnSearchReset()
|
||||
{
|
||||
search = new CountrySearch();
|
||||
search = new();
|
||||
searchForm?.Reset();
|
||||
}
|
||||
|
||||
@@ -161,22 +168,22 @@
|
||||
{
|
||||
if (page > 1)
|
||||
{
|
||||
Navigation.NavigateTo($"/country/list?page={page}");
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}?page={page}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Navigation.NavigateTo($"/country/list");
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (page > 1)
|
||||
{
|
||||
Navigation.NavigateTo($"/country/list?page={page}&{queryString}");
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}?page={page}&{queryString}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Navigation.NavigateTo($"/country/list?{queryString}");
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}?{queryString}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -195,13 +202,13 @@
|
||||
|
||||
void HandleAddNew()
|
||||
{
|
||||
Navigation.NavigateTo($"/country/create");
|
||||
Navigation.NavigateTo($"/area/create/{CountryId}");
|
||||
}
|
||||
|
||||
|
||||
void HandleEdit(Country model)
|
||||
void HandleEdit(Area model)
|
||||
{
|
||||
Navigation.NavigateTo($"/country/edit/{model.Id}");
|
||||
Navigation.NavigateTo($"/area/edit/{model.Id}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user