fix 省市地区管理
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
<Input @bind-Value="@country.Name" Placeholder="国家名称" Disabled />
|
||||
</FormItem>
|
||||
<FormItem Label="州/省/城市">
|
||||
<Cascader Options="@stateProvinceTrees" @bind-Value="cities" SelectedNodesChanged="OnCitiesChange"></Cascader>
|
||||
<Cascader Options="@stateProvinceTrees" @bind-Value="cities" ChangeOnSelect="true" SelectedNodesChanged="OnCitiesChange"></Cascader>
|
||||
</FormItem>
|
||||
<FormItem Label="名称" Required>
|
||||
<Input @bind-Value="@context.Name" Placeholder="名称" />
|
||||
@@ -81,9 +81,10 @@
|
||||
{
|
||||
model.CountryId = CountryId;
|
||||
|
||||
_ = LoadStateProvinceAndCities();
|
||||
_ = LoadLanguage();
|
||||
_ = LoadCountry();
|
||||
_ = LoadStateProvinceAndCities();
|
||||
|
||||
if (Id > 0)
|
||||
{
|
||||
LoadData();
|
||||
@@ -164,14 +165,14 @@
|
||||
{
|
||||
area = apiResult.Data;
|
||||
model = apiResult.Data.Adapt<AreaModel>();
|
||||
// if (model.ParentId > 0)
|
||||
// {
|
||||
// cities = $"{model.StateProvinceId},{model.ParentId}";
|
||||
// }
|
||||
// else if (model.StateProvinceId > 0)
|
||||
// {
|
||||
// cities = $"{model.StateProvinceId}";
|
||||
// }
|
||||
if (model.ParentId > 0)
|
||||
{
|
||||
cities = $"{model.ParentId}";
|
||||
}
|
||||
else if (model.StateProvinceId > 0)
|
||||
{
|
||||
cities = $"{model.StateProvinceId}";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -203,7 +204,7 @@
|
||||
{
|
||||
saving = false;
|
||||
await ModalService.InfoAsync(new ConfirmOptions() { Title = "提示", Content = "数据提交成功!" });
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}");
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}/{StateProvinceId}");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
<PropertyColumn Property="c => c.Name" Title="名称" />
|
||||
<PropertyColumn Property="c => c.StateProvinceName" Title="州/省" />
|
||||
<PropertyColumn Property="c => c.Initial" Title="首字母" />
|
||||
<PropertyColumn Property="c => c.Count" Title="地区数量" />
|
||||
<PropertyColumn Property="c => c.Enabled" Title="状态">
|
||||
@if (context.Enabled)
|
||||
{
|
||||
@@ -172,22 +173,52 @@
|
||||
{
|
||||
if (page > 1)
|
||||
{
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}?page={page}");
|
||||
if (StateProvinceId > 0)
|
||||
{
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}/{StateProvinceId}?page={page}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}?page={page}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}");
|
||||
if (StateProvinceId > 0)
|
||||
{
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}/{StateProvinceId}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (page > 1)
|
||||
{
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}?page={page}&{queryString}");
|
||||
if (StateProvinceId > 0)
|
||||
{
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}/{StateProvinceId}?page={page}&{queryString}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}?page={page}&{queryString}");
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}?{queryString}");
|
||||
if (StateProvinceId > 0)
|
||||
{
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}/{StateProvinceId}?{queryString}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}?{queryString}");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
<PropertyColumn Property="c => c.Name" Title="名称" />
|
||||
<PropertyColumn Property="c => c.Initial" Title="首字母" />
|
||||
<PropertyColumn Property="c => c.Abbreviation" Title="缩写" />
|
||||
<PropertyColumn Property="c => c.Count" Title="城市数量" />
|
||||
<PropertyColumn Property="c => c.Enabled" Title="状态">
|
||||
@if (context.Enabled)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user