From 003bc56127ea2476eeb40f42bf3030c3a64b0b3f Mon Sep 17 00:00:00 2001 From: zhangxiaofeng <1939543722@qq.com> Date: Mon, 1 Jul 2024 13:55:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=88=E6=9D=83=E8=8F=9C=E5=8D=95=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=9D=A1=E4=BB=B6=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Myshipping.Core/Service/Menu/Dto/MenuInput.cs | 2 +- Myshipping.Core/Service/Menu/SysMenuService.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Myshipping.Core/Service/Menu/Dto/MenuInput.cs b/Myshipping.Core/Service/Menu/Dto/MenuInput.cs index e78dcbd5..9522b018 100644 --- a/Myshipping.Core/Service/Menu/Dto/MenuInput.cs +++ b/Myshipping.Core/Service/Menu/Dto/MenuInput.cs @@ -90,7 +90,7 @@ public class MenuInput /// /// 是否启用数据授权 /// - public bool IsEnableDataScope { get; set; } + public bool? IsEnableDataScope { get; set; } } public class AddMenuInput : MenuInput diff --git a/Myshipping.Core/Service/Menu/SysMenuService.cs b/Myshipping.Core/Service/Menu/SysMenuService.cs index a23ab802..7686a94f 100644 --- a/Myshipping.Core/Service/Menu/SysMenuService.cs +++ b/Myshipping.Core/Service/Menu/SysMenuService.cs @@ -440,7 +440,8 @@ public class SysMenuService : ISysMenuService, IDynamicApiController, ITransient List menus = await _sysMenuRep.AsQueryable() .LeftJoin((t1, t2) => t1.Application == t2.Code) - .Where(t1 => t1.Status == (int)CommonStatus.ENABLE && t1.IsEnableDataScope) + .Where(t1 => t1.Status == (int)CommonStatus.ENABLE) + .WhereIF(input.IsEnableDataScope != null, t1 => t1.IsEnableDataScope == input.IsEnableDataScope) .WhereIF(menuIdList.Any(), t1 => menuIdList.Contains(t1.Id)) .OrderBy(t1 => t1.Sort) .Select((t1, t2) => new MenuTreeOutput