11@inherits AuthBlazorComponentBase
22@inject NavigationManager NavigationManager
33
4- <AutoQueryGrid Model =" ArtifactReport" Apis =" Apis.AutoQuery<QueryArtifactReports, UpdateArtifactReport>()"
5- @ref =" autoQueryGrid"
6- RowSelected =" RowSelected" >
4+ <AutoQueryGrid @ref =" grid" Model =" ArtifactReport" Apis =" Apis.AutoQuery<QueryArtifactReports,UpdateArtifactReport>()" >
75 <EditForm >
8- @if (reviewItem != null )
9- {
106 <div class =" relative z-10" aria-labelledby =" slide-over-title" role =" dialog" aria-modal =" true" >
11- <div class =" " >
12- <div class =" " >
13- <div class =" pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10 sm:pl-16" >
14- <ArtifactEdit Artifact =" reviewItem.Artifact" OnClose =" Close" OnSave =" Save" EditPanelClass =@editPanelClass >
15- <div class =" flex flex-1 flex-col justify-between" >
16- <div class =" divide-y divide-gray-200 px-4 sm:px-6" >
17- <div class =" space-y-6 pt-6 pb-5" >
18- <h2 >Artifact Report Info (@reviewItem .Type )</h2 >
19- <div >
20- <TextInput @bind-Value =" reviewItem.AppUserId" disabled />
21- </div >
22- <div >
23- <TextInput @bind-Value =" reviewItem.Description" disabled />
24- </div >
25- </div >
7+ <div class =" pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10 sm:pl-16" >
8+ <ArtifactEdit Artifact =" context.Artifact" OnClose =" grid!.OnEditDone" OnSave =" _ => SaveAsync(context)" >
9+ <div class =" flex flex-1 flex-col justify-between" >
10+ <div class =" divide-y divide-gray-200 px-4 sm:px-6" >
11+ <div class =" space-y-6 pt-6 pb-5" >
12+ <h2 >Artifact Report Info (@context.Type) </h2 >
13+ <div >
14+ <TextInput @bind-Value =" context.AppUserId" disabled />
15+ </div >
16+ <div >
17+ <TextInput @bind-Value =" context.Description" disabled />
2618 </div >
2719 </div >
28- </ArtifactEdit >
20+ </div >
2921 </div >
30- </div >
22+ </ArtifactEdit >
3123 </div >
3224 </div >
33- }
3425 </EditForm >
3526 <Columns >
3627 <Column Title =" Artifact" Field =" (ArtifactReport x) => x.ArtifactId" >
5142</AutoQueryGrid >
5243
5344@code {
54- AutoQueryGrid <ArtifactReport >? autoQueryGrid ;
55- public ArtifactReport ? reviewItem = null ;
56-
57- string editPanelClass = " show" ;
45+ AutoQueryGrid <ArtifactReport >? grid ;
5846
5947 void NavigateToArtifact (int artifactId )
6048 {
6149 NavigationManager .NavigateTo ($" /admin/artifacts?id={artifactId }&tab=All" );
6250 }
6351
64- void RowSelected (ArtifactReport item )
65- {
66- reviewItem = item ;
67- editPanelClass = " show" ;
68- StateHasChanged ();
69- }
70-
71- void Close ()
72- {
73- editPanelClass = " hidden" ;
74- reviewItem = null ;
75- }
76-
77- async Task Save ()
52+ async Task SaveAsync (ArtifactReport reviewItem )
7853 {
7954 var request = new DeleteArtifactReport
8055 {
81- ArtifactId = reviewItem ! .ArtifactId
56+ ArtifactId = reviewItem .ArtifactId
8257 };
8358 var api = await ApiAsync (request );
84- await autoQueryGrid ! .RefreshAsync ();
59+ await grid ! .RefreshAsync ();
8560 }
86-
8761}
0 commit comments