chore
This commit is contained in:
@@ -111,7 +111,7 @@
|
||||
|
||||
async Task LoadStateProvinceAndCities()
|
||||
{
|
||||
var url = $"/api/stateprovince/tree/{CountryId}";
|
||||
var url = $"/api/area/tree/{CountryId}";
|
||||
var apiResult = await HttpService.Get<ApiResult<List<KeyValueTree>>>(url);
|
||||
if (apiResult.Success)
|
||||
{
|
||||
@@ -164,14 +164,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.StateProvinceId},{model.ParentId}";
|
||||
// }
|
||||
// else if (model.StateProvinceId > 0)
|
||||
// {
|
||||
// cities = $"{model.StateProvinceId}";
|
||||
// }
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -186,13 +186,7 @@
|
||||
void OnCitiesChange(CascaderNode[] selectedNodes)
|
||||
{
|
||||
Console.WriteLine($"value: {cities} selected: {string.Join(",", selectedNodes.Select(x => x.Value))}");
|
||||
|
||||
model.StateProvinceId = long.Parse(selectedNodes.First().Value.ToString() ?? "0");
|
||||
model.ParentId = long.Parse(selectedNodes.Last().Value.ToString() ?? "0");
|
||||
if (model.StateProvinceId == model.ParentId)
|
||||
{
|
||||
model.ParentId = 0;
|
||||
}
|
||||
}
|
||||
|
||||
async void OnFormFinishAsync()
|
||||
|
||||
@@ -57,11 +57,11 @@
|
||||
public long Id { get; set; }
|
||||
|
||||
[SupplyParameterFromForm]
|
||||
StateProvinceModel model { get; set; } = new();
|
||||
Form<StateProvinceModel> editform = null!;
|
||||
AreaModel model { get; set; } = new();
|
||||
Form<AreaModel> editform = null!;
|
||||
List<KeyValue> languageList = new();
|
||||
Country country = new();
|
||||
StateProvinceLocalizedModel stateProvince = new();
|
||||
AreaLocalizedModel stateProvince = new();
|
||||
bool pageLoading = false;
|
||||
bool saving = false;
|
||||
|
||||
@@ -125,8 +125,8 @@
|
||||
async void LoadData()
|
||||
{
|
||||
pageLoading = true;
|
||||
var url = $"/api/stateprovince/detail?id={Id}";
|
||||
var apiResult = await HttpService.Get<ApiResult<StateProvinceLocalizedModel>>(url);
|
||||
var url = $"/api/area/detail?id={Id}";
|
||||
var apiResult = await HttpService.Get<ApiResult<AreaLocalizedModel>>(url);
|
||||
if (apiResult.Success)
|
||||
{
|
||||
if (apiResult.Data == null)
|
||||
@@ -136,7 +136,7 @@
|
||||
else
|
||||
{
|
||||
stateProvince = apiResult.Data;
|
||||
model = apiResult.Data.Adapt<StateProvinceModel>();
|
||||
model = apiResult.Data.Adapt<AreaModel>();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -153,7 +153,7 @@
|
||||
if (editform.Validate())
|
||||
{
|
||||
saving = true;
|
||||
var url = $"api/stateprovince/save";
|
||||
var url = $"api/area/save";
|
||||
var result = new ApiResult<string>();
|
||||
result = await HttpService.Post<ApiResult<string>>(url, model);
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
Form<StateProvinceSearch> searchForm = new();
|
||||
StateProvinceSearch search = new();
|
||||
|
||||
PagingList<StateProvince> PagingList = new() { Size = 20 };
|
||||
PagingList<Area> PagingList = new() { Size = 20 };
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
@@ -136,8 +136,8 @@
|
||||
try
|
||||
{
|
||||
pageLoading = true;
|
||||
var url = "/api/stateprovince/search";
|
||||
var apiResult = await HttpService.GetPagingList<StateProvince>(url, search, Page.GetValueOrDefault(1), PageSize.GetValueOrDefault(20));
|
||||
var url = "/api/area/stateprovince/search";
|
||||
var apiResult = await HttpService.GetPagingList<Area>(url, search, Page.GetValueOrDefault(1), PageSize.GetValueOrDefault(20));
|
||||
if (apiResult.Success)
|
||||
{
|
||||
if (apiResult.Data != null)
|
||||
@@ -209,12 +209,12 @@
|
||||
}
|
||||
|
||||
|
||||
void HandleEdit(StateProvince model)
|
||||
void HandleEdit(Area model)
|
||||
{
|
||||
Navigation.NavigateTo($"/stateprovince/{CountryId}/edit/{model.Id}");
|
||||
}
|
||||
|
||||
void GotoArea(StateProvince model)
|
||||
void GotoArea(Area model)
|
||||
{
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}/{model.Id}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user