[fix] EntityTree 中也要设置SearchFields

This commit is contained in:
大石头 2025-07-05 18:45:29 +08:00
parent 64568c7bdd
commit d69f5e8852
2 changed files with 6 additions and 1 deletions

View File

@ -100,6 +100,11 @@ public class EntityTreeController<TEntity, TModel> : EntityController<TEntity, T
{
var list = SearchData(p);
// 用于显示的列
ViewBag.Fields = OnGetFields(ViewKinds.List, list);
ViewBag.SearchFields = OnGetFields(ViewKinds.Search, list);
// Json输出
if (IsJsonRequest) return Json(0, null, list, new { page = p });
return View("ListTree", list);

View File

@ -8,7 +8,7 @@
var fact = ViewBag.Factory as IEntityFactory;
var page = ViewBag.Page as Pager;
var fi = fact.MasterTime;
var fields = ViewBag.SearchFields as FieldCollection;
var fields = ViewBag.SearchFields as FieldCollection ?? new(ViewKinds.Search);
var dic = new Dictionary<Int32, String>();
dic[1] = "是";