diff --git a/AdminBlazor.Test/Components/Blog/_Article.razor b/AdminBlazor.Test/Components/Blog/_Article.razor index 295dfc8..c517078 100644 --- a/AdminBlazor.Test/Components/Blog/_Article.razor +++ b/AdminBlazor.Test/Components/Blog/_Article.razor @@ -11,7 +11,7 @@
+ OnQuery="OnQuery" InitQuery="InitQuery" OnEdit="OnEdit" OnSaving="OnSaving"> 随笔专栏 @@ -222,27 +222,14 @@ await Task.Yield(); } - async Task OnSave(Article item) + async Task OnSaving(AdminConfirmEventArgs
item) { //检查必须录入 - if (string.IsNullOrWhiteSpace(item.Content)) + if (string.IsNullOrWhiteSpace(item.Argument.Content)) { await JS.Error("提示", "正文必须录入"); - return false; + item.Cancel = true; } - - if (item.Id == default) - { - await repo.InsertAsync(item); - - } - else - { - if (await JS.Confirm($"确定要修改数据吗?") == false) return false; - await repo.UpdateAsync(item); - } - - return true; } }