From 0c3ec1402e2f9aabc82d930ac2c4e7c7f07b3c5a Mon Sep 17 00:00:00 2001 From: NewOnePerson Date: Sat, 3 Aug 2024 13:00:33 +0800 Subject: [PATCH] fix bug --- .../Components/Blog/_Article.razor | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) 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; } }