Skip to content

Commit

Permalink
解决跨区域映射字段时,链接也是不对的问题。
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueSky-AI committed Aug 30, 2023
1 parent de45b9c commit 7a07c1b
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions NewLife.CubeNC/Views/Shared/_List_Data_Item.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,26 @@ else
}
else
{
var val = value;
var val = value;
if (!item.MapField.IsNullOrEmpty() && val + "" != "")
{
if (item.MapProvider != null)
{
var name = item.MapProvider.EntityType.Name;
var key = item.MapProvider.Key;
val = entity[item.MapField];
<td class="text-center"><a href="@name?@key=@val">@value</a></td>
//从菜单查找相关
var menu = Menu.FindForName(@name);
if (menu!=null)
{
//获取控制器名称,拼接全路径
var fullPath = $"{this.Context.Request.Scheme}://{this.Context.Request.Host}/{menu.ParentNodeName}/{@name}?{@key}={@val}";
<td class="text-center"><a href="@fullPath">@value</a></td>
}
else
{
<td class="text-center"><a href="@name?@key=@val">@value</a></td>
}
}
else
{
Expand All @@ -192,7 +203,17 @@ else
}
else
{
<td>@value</td>
if (!item.ItemType.IsNullOrEmpty() && item.ItemType.EqualIgnoreCase("file-WebUploader"))
{

<td class="text-center">@Html.Partial("_View_ImgView",value)</td>

}
else
{
<td>@value</td>
}

}
}
break;
Expand Down

0 comments on commit 7a07c1b

Please sign in to comment.