@@ -172,12 +172,20 @@ public static List<IFilterAction> ToSearches(this IEnumerable<ITableColumn> colu
172172 return searches ;
173173 }
174174
175- internal static RenderFragment RenderValue < TItem > ( this ITableColumn col , TItem item ) => builder =>
175+ /// <summary>
176+ /// 当前单元格方法
177+ /// </summary>
178+ /// <typeparam name="TItem"></typeparam>
179+ /// <param name="col"></param>
180+ /// <param name="item"></param>
181+ /// <param name="lookupService"></param>
182+ /// <returns></returns>
183+ public static RenderFragment RenderValue < TItem > ( this ITableColumn col , TItem item , ILookupService lookupService ) => builder =>
176184 {
177185 var val = col . GetItemValue ( item ) ;
178186 if ( col . IsLookup ( ) && val != null )
179187 {
180- builder . AddContent ( 10 , col . RenderTooltip ( val . ToString ( ) , item ) ) ;
188+ builder . AddContent ( 10 , col . RenderTooltip ( val . ToString ( ) , item , lookupService ) ) ;
181189 }
182190 else if ( val is bool v1 )
183191 {
@@ -213,7 +221,7 @@ internal static RenderFragment RenderValue<TItem>(this ITableColumn col, TItem i
213221 {
214222 content = val ? . ToString ( ) ;
215223 }
216- builder . AddContent ( 30 , col . RenderTooltip ( content , item ) ) ;
224+ builder . AddContent ( 30 , col . RenderTooltip ( content , item , lookupService ) ) ;
217225 }
218226 }
219227 } ;
@@ -238,7 +246,7 @@ internal static RenderFragment RenderColor<TItem>(this ITableColumn col, TItem i
238246 builder . CloseElement ( ) ;
239247 } ;
240248
241- private static RenderFragment RenderTooltip < TItem > ( this ITableColumn col , string ? text , TItem item ) => pb =>
249+ private static RenderFragment RenderTooltip < TItem > ( this ITableColumn col , string ? text , TItem item , ILookupService lookupService ) => pb =>
242250 {
243251 if ( col . GetShowTips ( ) )
244252 {
@@ -249,9 +257,13 @@ private static RenderFragment RenderTooltip<TItem>(this ITableColumn col, string
249257 {
250258 pb . AddAttribute ( 10 , nameof ( Tooltip . GetTitleCallback ) , new Func < Task < string ? > > ( ( ) => col . GetTooltipTextCallback ( item ) ) ) ;
251259 }
252- else if ( col . IsLookup ( ) )
260+ else if ( col . IsLookup ( ) )
253261 {
254-
262+ pb . AddAttribute ( 10 , nameof ( Tooltip . GetTitleCallback ) , new Func < Task < string ? > > ( async ( ) =>
263+ {
264+ var lookup = await col . GetLookupService ( lookupService ) . GetItemsAsync ( col . LookupServiceKey , col . LookupServiceData ) ;
265+ return lookup ? . FirstOrDefault ( l => l . Value . Equals ( text , col . LookupStringComparison ) ) ? . Text ?? text ;
266+ } ) ) ;
255267 }
256268 else
257269 {
0 commit comments