chore
This commit is contained in:
@@ -62,19 +62,19 @@
|
||||
<ActionColumn Title="操作" Align="ColumnAlign.Right">
|
||||
<Space>
|
||||
<SpaceItem>
|
||||
<a @onclick="(e) => GotoArea(context)">城市管理</a>
|
||||
<a @onclick="(e) => GotoArea(context)">查看城市</a>
|
||||
</SpaceItem>
|
||||
<SpaceItem>
|
||||
<a @onclick="(e) => HandleEdit(context)">编辑</a>
|
||||
</SpaceItem>
|
||||
@*<SpaceItem>
|
||||
<SpaceItem>
|
||||
<Popconfirm Placement="@Placement.Left" Title="@("删除这条数据无法恢复,您确定要删除吗?")"
|
||||
OnConfirm="@(e=>HandleDeleteConfirmAsync(e,context.Id))"
|
||||
OkText="确定"
|
||||
CancelText="取消">
|
||||
<a>删除</a>
|
||||
</Popconfirm>
|
||||
</SpaceItem>*@
|
||||
</SpaceItem>
|
||||
</Space>
|
||||
</ActionColumn>
|
||||
</Table>
|
||||
@@ -220,4 +220,18 @@
|
||||
Navigation.NavigateTo($"/area/list/{CountryId}/{model.Id}");
|
||||
}
|
||||
|
||||
async Task HandleDeleteConfirmAsync(MouseEventArgs e, long id)
|
||||
{
|
||||
var url = $"/api/area/delete/{id}";
|
||||
var apiResult = await HttpService.Post<ApiResult<string>>(url, new());
|
||||
if (apiResult.Success)
|
||||
{
|
||||
await LoadListAsync();
|
||||
await ModalService.InfoAsync(new ConfirmOptions() { Title = "操作提示", Content = "删除数据成功" });
|
||||
}
|
||||
else
|
||||
{
|
||||
await ModalService.ErrorAsync(new ConfirmOptions() { Title = "操作提示", Content = $"数据删除失败.{apiResult.Message}" });
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user