Просмотр исходного кода

feat: 给各模块增加租户查询条件

喵你个旺呀 1 год назад
Родитель
Сommit
72f9be6ae1
53 измененных файлов с 354 добавлено и 49 удалено
  1. 5 0
      Admin.NET/Admin.NET.Core/Service/Auth/Dto/SysLdapInput.cs
  2. 4 1
      Admin.NET/Admin.NET.Core/Service/Auth/SysLdapService.cs
  3. 5 0
      Admin.NET/Admin.NET.Core/Service/File/Dto/FileInput.cs
  4. 1 0
      Admin.NET/Admin.NET.Core/Service/File/SysFileService.cs
  5. 5 0
      Admin.NET/Admin.NET.Core/Service/Log/Dto/LogInput.cs
  6. 4 1
      Admin.NET/Admin.NET.Core/Service/Log/SysLogDiffService.cs
  7. 4 1
      Admin.NET/Admin.NET.Core/Service/Log/SysLogExService.cs
  8. 4 1
      Admin.NET/Admin.NET.Core/Service/Log/SysLogOpService.cs
  9. 4 1
      Admin.NET/Admin.NET.Core/Service/Log/SysLogVisService.cs
  10. 5 0
      Admin.NET/Admin.NET.Core/Service/OnlineUser/Dto/OnlineUserInput.cs
  11. 5 1
      Admin.NET/Admin.NET.Core/Service/OnlineUser/SysOnlineUserService.cs
  12. 5 0
      Admin.NET/Admin.NET.Core/Service/Org/Dto/OrgInput.cs
  13. 3 1
      Admin.NET/Admin.NET.Core/Service/Org/SysOrgService.cs
  14. 5 0
      Admin.NET/Admin.NET.Core/Service/Plugin/Dto/PluginInput.cs
  15. 5 1
      Admin.NET/Admin.NET.Core/Service/Plugin/SysPluginService.cs
  16. 5 0
      Admin.NET/Admin.NET.Core/Service/Pos/Dto/PosInput.cs
  17. 1 0
      Admin.NET/Admin.NET.Core/Service/Pos/SysPosService.cs
  18. 5 0
      Admin.NET/Admin.NET.Core/Service/Print/Dto/PrintInput.cs
  19. 4 1
      Admin.NET/Admin.NET.Core/Service/Print/SysPrintService.cs
  20. 5 0
      Admin.NET/Admin.NET.Core/Service/Role/Dto/RoleInput.cs
  21. 1 0
      Admin.NET/Admin.NET.Core/Service/Role/SysRoleService.cs
  22. 5 0
      Admin.NET/Admin.NET.Core/Service/Schedule/Dto/ScheduleInput.cs
  23. 1 0
      Admin.NET/Admin.NET.Core/Service/Schedule/SysScheduleService.cs
  24. 5 0
      Admin.NET/Admin.NET.Core/Service/User/Dto/UserInput.cs
  25. 1 0
      Admin.NET/Admin.NET.Core/Service/User/SysUserService.cs
  26. 15 7
      Web/src/api-services/apis/sys-org-api.ts
  27. 15 7
      Web/src/api-services/apis/sys-pos-api.ts
  28. 6 0
      Web/src/api-services/models/list-schedule-input.ts
  29. 6 0
      Web/src/api-services/models/page-ex-log-input.ts
  30. 6 0
      Web/src/api-services/models/page-file-input.ts
  31. 6 0
      Web/src/api-services/models/page-log-input.ts
  32. 6 0
      Web/src/api-services/models/page-online-user-input.ts
  33. 6 0
      Web/src/api-services/models/page-op-log-input.ts
  34. 6 0
      Web/src/api-services/models/page-plugin-input.ts
  35. 6 0
      Web/src/api-services/models/page-print-input.ts
  36. 6 0
      Web/src/api-services/models/page-role-input.ts
  37. 6 0
      Web/src/api-services/models/page-user-input.ts
  38. 6 0
      Web/src/api-services/models/page-vis-log-input.ts
  39. 6 0
      Web/src/api-services/models/sys-ldap-input.ts
  40. 13 1
      Web/src/views/system/file/index.vue
  41. 14 2
      Web/src/views/system/ldap/index.vue
  42. 13 1
      Web/src/views/system/log/difflog/index.vue
  43. 13 1
      Web/src/views/system/log/exlog/index.vue
  44. 13 1
      Web/src/views/system/log/oplog/index.vue
  45. 13 2
      Web/src/views/system/log/vislog/index.vue
  46. 0 1
      Web/src/views/system/menu/index.vue
  47. 13 2
      Web/src/views/system/onlineUser/index.vue
  48. 5 5
      Web/src/views/system/org/index.vue
  49. 14 2
      Web/src/views/system/plugin/index.vue
  50. 15 3
      Web/src/views/system/pos/index.vue
  51. 14 2
      Web/src/views/system/print/index.vue
  52. 14 2
      Web/src/views/system/role/index.vue
  53. 1 1
      Web/src/views/system/user/index.vue

+ 5 - 0
Admin.NET/Admin.NET.Core/Service/Auth/Dto/SysLdapInput.cs

@@ -15,6 +15,11 @@ public class SysLdapInput : BasePageInput
     /// 主机
     /// </summary>
     public string? Host { get; set; }
+    
+    /// <summary>
+    /// 租户Id
+    /// </summary>
+    public long TenantId { get; set; }
 }
 
 public class AddSysLdapInput : SysLdap

+ 4 - 1
Admin.NET/Admin.NET.Core/Service/Auth/SysLdapService.cs

@@ -15,10 +15,12 @@ namespace Admin.NET.Core;
 public class SysLdapService : IDynamicApiController, ITransient
 {
     private readonly SqlSugarRepository<SysLdap> _sysLdapRep;
+    private readonly UserManager _userManager;
 
-    public SysLdapService(SqlSugarRepository<SysLdap> sysLdapRep)
+    public SysLdapService(SqlSugarRepository<SysLdap> sysLdapRep, UserManager userManager)
     {
         _sysLdapRep = sysLdapRep;
+        _userManager = userManager;
     }
 
     /// <summary>
@@ -30,6 +32,7 @@ public class SysLdapService : IDynamicApiController, ITransient
     public async Task<SqlSugarPagedList<SysLdap>> Page(SysLdapInput input)
     {
         return await _sysLdapRep.AsQueryable()
+            .WhereIF(_userManager.SuperAdmin && input.TenantId > 0, u => u.TenantId == input.TenantId)
             .WhereIF(!string.IsNullOrWhiteSpace(input.Keyword), u => u.Host.Contains(input.Keyword.Trim()))
             .WhereIF(!string.IsNullOrWhiteSpace(input.Host), u => u.Host.Contains(input.Host.Trim()))
             .OrderBy(u => u.CreateTime, OrderByType.Desc)

+ 5 - 0
Admin.NET/Admin.NET.Core/Service/File/Dto/FileInput.cs

@@ -30,6 +30,11 @@ public class PageFileInput : BasePageInput
     /// 结束时间
     /// </summary>
     public DateTime? EndTime { get; set; }
+    
+    /// <summary>
+    /// 租户Id
+    /// </summary>
+    public long TenantId { get; set; }
 }
 
 public class FileInput : BaseIdInput

+ 1 - 0
Admin.NET/Admin.NET.Core/Service/File/SysFileService.cs

@@ -50,6 +50,7 @@ public class SysFileService : IDynamicApiController, ITransient
         var privateList = _sysFileRep.AsQueryable().Where(u => u.IsPublic == false);
         // 合并公开和私有附件并分页
         return await _sysFileRep.Context.UnionAll(publicList, privateList)
+            .WhereIF(_userManager.SuperAdmin && input.TenantId > 0, u => u.TenantId == input.TenantId)
             .WhereIF(!string.IsNullOrWhiteSpace(input.FileName), u => u.FileName.Contains(input.FileName.Trim()))
             .WhereIF(!string.IsNullOrWhiteSpace(input.StartTime.ToString()) && !string.IsNullOrWhiteSpace(input.EndTime.ToString()),
                 u => u.CreateTime >= input.StartTime && u.CreateTime <= input.EndTime)

+ 5 - 0
Admin.NET/Admin.NET.Core/Service/Log/Dto/LogInput.cs

@@ -57,6 +57,11 @@ public class PageLogInput : BasePageInput
     /// IP地址
     /// </summary>
     public string? RemoteIp { get; set; }
+    
+    /// <summary>
+    /// 租户Id
+    /// </summary>
+    public long TenantId { get; set; }
 }
 
 public class LogInput

+ 4 - 1
Admin.NET/Admin.NET.Core/Service/Log/SysLogDiffService.cs

@@ -13,10 +13,12 @@ namespace Admin.NET.Core.Service;
 public class SysLogDiffService : IDynamicApiController, ITransient
 {
     private readonly SqlSugarRepository<SysLogDiff> _sysLogDiffRep;
+    private readonly UserManager _userManager;
 
-    public SysLogDiffService(SqlSugarRepository<SysLogDiff> sysLogDiffRep)
+    public SysLogDiffService(UserManager userManager, SqlSugarRepository<SysLogDiff> sysLogDiffRep)
     {
         _sysLogDiffRep = sysLogDiffRep;
+        _userManager = userManager;
     }
 
     /// <summary>
@@ -28,6 +30,7 @@ public class SysLogDiffService : IDynamicApiController, ITransient
     public async Task<SqlSugarPagedList<SysLogDiff>> Page(PageLogInput input)
     {
         return await _sysLogDiffRep.AsQueryable()
+            .WhereIF(_userManager.SuperAdmin && input.TenantId > 0, u => u.TenantId == input.TenantId)
             .WhereIF(!string.IsNullOrWhiteSpace(input.StartTime.ToString()), u => u.CreateTime >= input.StartTime)
             .WhereIF(!string.IsNullOrWhiteSpace(input.EndTime.ToString()), u => u.CreateTime <= input.EndTime)
             .OrderBy(u => u.CreateTime, OrderByType.Desc)

+ 4 - 1
Admin.NET/Admin.NET.Core/Service/Log/SysLogExService.cs

@@ -13,10 +13,12 @@ namespace Admin.NET.Core.Service;
 public class SysLogExService : IDynamicApiController, ITransient
 {
     private readonly SqlSugarRepository<SysLogEx> _sysLogExRep;
+    private readonly UserManager _userManager;
 
-    public SysLogExService(SqlSugarRepository<SysLogEx> sysLogExRep)
+    public SysLogExService(UserManager userManager, SqlSugarRepository<SysLogEx> sysLogExRep)
     {
         _sysLogExRep = sysLogExRep;
+        _userManager = userManager;
     }
 
     /// <summary>
@@ -28,6 +30,7 @@ public class SysLogExService : IDynamicApiController, ITransient
     public async Task<SqlSugarPagedList<SysLogEx>> Page(PageExLogInput input)
     {
         return await _sysLogExRep.AsQueryable()
+            .WhereIF(_userManager.SuperAdmin && input.TenantId > 0, u => u.TenantId == input.TenantId)
             .WhereIF(!string.IsNullOrWhiteSpace(input.StartTime.ToString()), u => u.CreateTime >= input.StartTime)
             .WhereIF(!string.IsNullOrWhiteSpace(input.EndTime.ToString()), u => u.CreateTime <= input.EndTime)
             .WhereIF(!string.IsNullOrWhiteSpace(input.Account), u => u.Account == input.Account)

+ 4 - 1
Admin.NET/Admin.NET.Core/Service/Log/SysLogOpService.cs

@@ -13,10 +13,12 @@ namespace Admin.NET.Core.Service;
 public class SysLogOpService : IDynamicApiController, ITransient
 {
     private readonly SqlSugarRepository<SysLogOp> _sysLogOpRep;
+    private readonly UserManager _userManager;
 
-    public SysLogOpService(SqlSugarRepository<SysLogOp> sysLogOpRep)
+    public SysLogOpService(UserManager userManager, SqlSugarRepository<SysLogOp> sysLogOpRep)
     {
         _sysLogOpRep = sysLogOpRep;
+        _userManager = userManager;
     }
 
     /// <summary>
@@ -28,6 +30,7 @@ public class SysLogOpService : IDynamicApiController, ITransient
     public async Task<SqlSugarPagedList<SysLogOp>> Page(PageOpLogInput input)
     {
         return await _sysLogOpRep.AsQueryable()
+            .WhereIF(_userManager.SuperAdmin && input.TenantId > 0, u => u.TenantId == input.TenantId)
             .WhereIF(!string.IsNullOrWhiteSpace(input.StartTime.ToString()), u => u.CreateTime >= input.StartTime)
             .WhereIF(!string.IsNullOrWhiteSpace(input.EndTime.ToString()), u => u.CreateTime <= input.EndTime)
             .WhereIF(!string.IsNullOrWhiteSpace(input.Account), u => u.Account == input.Account)

+ 4 - 1
Admin.NET/Admin.NET.Core/Service/Log/SysLogVisService.cs

@@ -13,10 +13,12 @@ namespace Admin.NET.Core.Service;
 public class SysLogVisService : IDynamicApiController, ITransient
 {
     private readonly SqlSugarRepository<SysLogVis> _sysLogVisRep;
+    private readonly UserManager _userManager;
 
-    public SysLogVisService(SqlSugarRepository<SysLogVis> sysLogVisRep)
+    public SysLogVisService(UserManager userManager, SqlSugarRepository<SysLogVis> sysLogVisRep)
     {
         _sysLogVisRep = sysLogVisRep;
+        _userManager = userManager;
     }
 
     /// <summary>
@@ -28,6 +30,7 @@ public class SysLogVisService : IDynamicApiController, ITransient
     public async Task<SqlSugarPagedList<SysLogVis>> Page(PageVisLogInput input)
     {
         return await _sysLogVisRep.AsQueryable()
+            .WhereIF(_userManager.SuperAdmin && input.TenantId > 0, u => u.TenantId == input.TenantId)
             .WhereIF(!string.IsNullOrWhiteSpace(input.StartTime.ToString()), u => u.CreateTime >= input.StartTime)
             .WhereIF(!string.IsNullOrWhiteSpace(input.EndTime.ToString()), u => u.CreateTime <= input.EndTime)
             .WhereIF(!string.IsNullOrWhiteSpace(input.Account), u => u.Account == input.Account)

+ 5 - 0
Admin.NET/Admin.NET.Core/Service/OnlineUser/Dto/OnlineUserInput.cs

@@ -17,4 +17,9 @@ public class PageOnlineUserInput : BasePageInput
     /// 真实姓名
     /// </summary>
     public string RealName { get; set; }
+    
+    /// <summary>
+    /// 租户Id
+    /// </summary>
+    public long TenantId { get; set; }
 }

+ 5 - 1
Admin.NET/Admin.NET.Core/Service/OnlineUser/SysOnlineUserService.cs

@@ -14,14 +14,17 @@ namespace Admin.NET.Core.Service;
 [ApiDescriptionSettings(Order = 300)]
 public class SysOnlineUserService : IDynamicApiController, ITransient
 {
+    private readonly UserManager _userManager;
     private readonly SysConfigService _sysConfigService;
     private readonly IHubContext<OnlineUserHub, IOnlineUserHub> _onlineUserHubContext;
     private readonly SqlSugarRepository<SysOnlineUser> _sysOnlineUerRep;
 
     public SysOnlineUserService(SysConfigService sysConfigService,
         IHubContext<OnlineUserHub, IOnlineUserHub> onlineUserHubContext,
-        SqlSugarRepository<SysOnlineUser> sysOnlineUerRep)
+        SqlSugarRepository<SysOnlineUser> sysOnlineUerRep,
+        UserManager userManager)
     {
+        _userManager = userManager;
         _sysConfigService = sysConfigService;
         _onlineUserHubContext = onlineUserHubContext;
         _sysOnlineUerRep = sysOnlineUerRep;
@@ -35,6 +38,7 @@ public class SysOnlineUserService : IDynamicApiController, ITransient
     public async Task<SqlSugarPagedList<SysOnlineUser>> Page(PageOnlineUserInput input)
     {
         return await _sysOnlineUerRep.AsQueryable()
+            .WhereIF(_userManager.SuperAdmin && input.TenantId > 0, u => u.TenantId == input.TenantId)
             .WhereIF(!string.IsNullOrWhiteSpace(input.UserName), u => u.UserName.Contains(input.UserName))
             .WhereIF(!string.IsNullOrWhiteSpace(input.RealName), u => u.RealName.Contains(input.RealName))
             .ToPagedListAsync(input.Page, input.PageSize);

+ 5 - 0
Admin.NET/Admin.NET.Core/Service/Org/Dto/OrgInput.cs

@@ -22,6 +22,11 @@ public class OrgInput : BaseIdInput
     /// 机构类型
     /// </summary>
     public string Type { get; set; }
+    
+    /// <summary>
+    /// 租户Id
+    /// </summary>
+    public long TenantId { get; set; }
 }
 
 public class AddOrgInput : SysOrg

+ 3 - 1
Admin.NET/Admin.NET.Core/Service/Org/SysOrgService.cs

@@ -44,7 +44,9 @@ public class SysOrgService : IDynamicApiController, ITransient
         // 获取拥有的机构Id集合
         var userOrgIdList = await GetUserOrgIdList();
 
-        var iSugarQueryable = _sysOrgRep.AsQueryable().OrderBy(u => new { u.OrderNo, u.Id });
+        var iSugarQueryable = _sysOrgRep.AsQueryable()
+            .WhereIF(_userManager.SuperAdmin && input.TenantId > 0, u => u.TenantId == input.TenantId)
+            .OrderBy(u => new { u.OrderNo, u.Id });
 
         // 带条件筛选时返回列表数据
         if (!string.IsNullOrWhiteSpace(input.Name) || !string.IsNullOrWhiteSpace(input.Code) || !string.IsNullOrWhiteSpace(input.Type))

+ 5 - 0
Admin.NET/Admin.NET.Core/Service/Plugin/Dto/PluginInput.cs

@@ -17,6 +17,11 @@ public class PagePluginInput : BasePageInput
     /// 编码
     /// </summary>
     public string Code { get; set; }
+    
+    /// <summary>
+    /// 租户Id
+    /// </summary>
+    public long TenantId { get; set; }
 }
 
 public class AddPluginInput : SysPlugin

+ 5 - 1
Admin.NET/Admin.NET.Core/Service/Plugin/SysPluginService.cs

@@ -14,11 +14,14 @@ public class SysPluginService : IDynamicApiController, ITransient
 {
     private readonly IDynamicApiRuntimeChangeProvider _provider;
     private readonly SqlSugarRepository<SysPlugin> _sysPluginRep;
+    private readonly UserManager _userManager;
 
     public SysPluginService(IDynamicApiRuntimeChangeProvider provider,
-        SqlSugarRepository<SysPlugin> sysPluginRep)
+        SqlSugarRepository<SysPlugin> sysPluginRep,
+        UserManager userManager)
     {
         _provider = provider;
+        _userManager = userManager;
         _sysPluginRep = sysPluginRep;
     }
 
@@ -31,6 +34,7 @@ public class SysPluginService : IDynamicApiController, ITransient
     public async Task<SqlSugarPagedList<SysPlugin>> Page(PagePluginInput input)
     {
         return await _sysPluginRep.AsQueryable()
+            .WhereIF(_userManager.SuperAdmin && input.TenantId > 0, u => u.TenantId == input.TenantId)
             .WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name))
             .OrderBy(u => new { u.OrderNo, u.Id })
             .ToPagedListAsync(input.Page, input.PageSize);

+ 5 - 0
Admin.NET/Admin.NET.Core/Service/Pos/Dto/PosInput.cs

@@ -17,6 +17,11 @@ public class PosInput
     /// 编码
     /// </summary>
     public string Code { get; set; }
+    
+    /// <summary>
+    /// 租户Id
+    /// </summary>
+    public long TenantId { get; set; }
 }
 
 public class AddPosInput : SysPos

+ 1 - 0
Admin.NET/Admin.NET.Core/Service/Pos/SysPosService.cs

@@ -34,6 +34,7 @@ public class SysPosService : IDynamicApiController, ITransient
     public async Task<List<SysPos>> GetList([FromQuery] PosInput input)
     {
         return await _sysPosRep.AsQueryable()
+            .WhereIF(_userManager.SuperAdmin && input.TenantId > 0, u => u.TenantId == input.TenantId)
             .WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name))
             .WhereIF(!string.IsNullOrWhiteSpace(input.Code), u => u.Code.Contains(input.Code))
             .OrderBy(u => new { u.OrderNo, u.Id })

+ 5 - 0
Admin.NET/Admin.NET.Core/Service/Print/Dto/PrintInput.cs

@@ -17,6 +17,11 @@ public class PagePrintInput : BasePageInput
     /// 编码
     /// </summary>
     public string Code { get; set; }
+    
+    /// <summary>
+    /// 租户Id
+    /// </summary>
+    public long TenantId { get; set; }
 }
 
 public class AddPrintInput : SysPrint

+ 4 - 1
Admin.NET/Admin.NET.Core/Service/Print/SysPrintService.cs

@@ -13,10 +13,12 @@ namespace Admin.NET.Core.Service;
 public class SysPrintService : IDynamicApiController, ITransient
 {
     private readonly SqlSugarRepository<SysPrint> _sysPrintRep;
+    private readonly UserManager _userManager;
 
-    public SysPrintService(SqlSugarRepository<SysPrint> sysPrintRep)
+    public SysPrintService(SqlSugarRepository<SysPrint> sysPrintRep, UserManager userManager)
     {
         _sysPrintRep = sysPrintRep;
+        _userManager = userManager;
     }
 
     /// <summary>
@@ -28,6 +30,7 @@ public class SysPrintService : IDynamicApiController, ITransient
     public async Task<SqlSugarPagedList<SysPrint>> Page(PagePrintInput input)
     {
         return await _sysPrintRep.AsQueryable()
+            .WhereIF(_userManager.SuperAdmin && input.TenantId > 0, u => u.TenantId == input.TenantId)
             .WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name))
             .OrderBy(u => new { u.OrderNo, u.Id })
             .ToPagedListAsync(input.Page, input.PageSize);

+ 5 - 0
Admin.NET/Admin.NET.Core/Service/Role/Dto/RoleInput.cs

@@ -16,6 +16,11 @@ public class RoleInput : BaseIdInput
 
 public class PageRoleInput : BasePageInput
 {
+    /// <summary>
+    /// 租户Id
+    /// </summary>
+    public long TenantId { get; set; }
+    
     /// <summary>
     /// 名称
     /// </summary>

+ 1 - 0
Admin.NET/Admin.NET.Core/Service/Role/SysRoleService.cs

@@ -45,6 +45,7 @@ public class SysRoleService : IDynamicApiController, ITransient
         // 当前用户已拥有的角色集合
         var roleIdList = _userManager.SuperAdmin ? new List<long>() : await _sysUserRoleService.GetUserRoleIdList(_userManager.UserId);
         return await _sysRoleRep.AsQueryable()
+            .WhereIF(_userManager.SuperAdmin && input.TenantId > 0, u => u.TenantId == input.TenantId)
             .WhereIF(!_userManager.SuperAdmin, u => u.TenantId == _userManager.TenantId) // 若非超管,则只能操作本租户的角色
             .WhereIF(!_userManager.SuperAdmin && !_userManager.SysAdmin, u => u.CreateUserId == _userManager.UserId || roleIdList.Contains(u.Id)) // 若非超管且非系统管理员,则只能操作自己创建的角色|自己拥有的角色
             .WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name))

+ 5 - 0
Admin.NET/Admin.NET.Core/Service/Schedule/Dto/ScheduleInput.cs

@@ -19,6 +19,11 @@ public class ListScheduleInput
     public DateTime? StartTime { get; set; }
 
     public DateTime? EndTime { get; set; }
+    
+    /// <summary>
+    /// 租户Id
+    /// </summary>
+    public long TenantId { get; set; }
 }
 
 public class AddScheduleInput : SysSchedule

+ 1 - 0
Admin.NET/Admin.NET.Core/Service/Schedule/SysScheduleService.cs

@@ -31,6 +31,7 @@ public class SysScheduleService : IDynamicApiController, ITransient
     {
         return await _sysSchedule.AsQueryable()
             .Where(u => u.UserId == _userManager.UserId)
+            .WhereIF(_userManager.SuperAdmin && input.TenantId > 0, u => u.TenantId == input.TenantId)
             .WhereIF(!string.IsNullOrWhiteSpace(input.StartTime.ToString()), u => u.ScheduleTime >= input.StartTime)
             .WhereIF(!string.IsNullOrWhiteSpace(input.EndTime.ToString()), u => u.ScheduleTime <= input.EndTime)
             .OrderBy(u => u.StartTime, OrderByType.Asc)

+ 5 - 0
Admin.NET/Admin.NET.Core/Service/User/Dto/UserInput.cs

@@ -18,6 +18,11 @@ public class UserInput : BaseStatusInput
 /// </summary>
 public class PageUserInput : BasePageInput
 {
+    /// <summary>
+    /// 租户Id
+    /// </summary>
+    public long TenantId { get; set; }
+    
     /// <summary>
     /// 账号
     /// </summary>

+ 1 - 0
Admin.NET/Admin.NET.Core/Service/User/SysUserService.cs

@@ -76,6 +76,7 @@ public class SysUserService : IDynamicApiController, ITransient
             .Where(u => u.AccountType != AccountTypeEnum.SuperAdmin)
             .WhereIF(orgList != null, u => orgList.Contains(u.OrgId))
             .WhereIF(!_userManager.SuperAdmin, u => u.AccountType != AccountTypeEnum.SysAdmin)
+            .WhereIF(_userManager.SuperAdmin && input.TenantId > 0, u => u.TenantId == input.TenantId)
             .WhereIF(!string.IsNullOrWhiteSpace(input.Account), u => u.Account.Contains(input.Account))
             .WhereIF(!string.IsNullOrWhiteSpace(input.RealName), u => u.RealName.Contains(input.RealName))
             .WhereIF(!string.IsNullOrWhiteSpace(input.PosName), (u, a, b) => b.Name.Contains(input.PosName))

+ 15 - 7
Web/src/api-services/apis/sys-org-api.ts

@@ -130,10 +130,11 @@ export const SysOrgApiAxiosParamCreator = function (configuration?: Configuratio
          * @param {string} [name] 名称
          * @param {string} [code] 编码
          * @param {string} [type] 机构类型
+         * @param {number} [tenantId] 租户Id
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        apiSysOrgListGet: async (id: number, name?: string, code?: string, type?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+        apiSysOrgListGet: async (id: number, name?: string, code?: string, type?: string, tenantId?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
             // verify required parameter 'id' is not null or undefined
             if (id === null || id === undefined) {
                 throw new RequiredError('id','Required parameter id was null or undefined when calling apiSysOrgListGet.');
@@ -170,6 +171,10 @@ export const SysOrgApiAxiosParamCreator = function (configuration?: Configuratio
                 localVarQueryParameter['Type'] = type;
             }
 
+            if (tenantId !== undefined) {
+                localVarQueryParameter['TenantId'] = tenantId;
+            }
+
             if (id !== undefined) {
                 localVarQueryParameter['Id'] = id;
             }
@@ -282,11 +287,12 @@ export const SysOrgApiFp = function(configuration?: Configuration) {
          * @param {string} [name] 名称
          * @param {string} [code] 编码
          * @param {string} [type] 机构类型
+         * @param {number} [tenantId] 租户Id
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async apiSysOrgListGet(id: number, name?: string, code?: string, type?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListSysOrg>>> {
-            const localVarAxiosArgs = await SysOrgApiAxiosParamCreator(configuration).apiSysOrgListGet(id, name, code, type, options);
+        async apiSysOrgListGet(id: number, name?: string, code?: string, type?: string, tenantId?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListSysOrg>>> {
+            const localVarAxiosArgs = await SysOrgApiAxiosParamCreator(configuration).apiSysOrgListGet(id, name, code, type, tenantId, options);
             return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                 const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                 return axios.request(axiosRequestArgs);
@@ -342,11 +348,12 @@ export const SysOrgApiFactory = function (configuration?: Configuration, basePat
          * @param {string} [name] 名称
          * @param {string} [code] 编码
          * @param {string} [type] 机构类型
+         * @param {number} [tenantId] 租户Id
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async apiSysOrgListGet(id: number, name?: string, code?: string, type?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListSysOrg>> {
-            return SysOrgApiFp(configuration).apiSysOrgListGet(id, name, code, type, options).then((request) => request(axios, basePath));
+        async apiSysOrgListGet(id: number, name?: string, code?: string, type?: string, tenantId?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListSysOrg>> {
+            return SysOrgApiFp(configuration).apiSysOrgListGet(id, name, code, type, tenantId, options).then((request) => request(axios, basePath));
         },
         /**
          * 
@@ -397,12 +404,13 @@ export class SysOrgApi extends BaseAPI {
      * @param {string} [name] 名称
      * @param {string} [code] 编码
      * @param {string} [type] 机构类型
+     * @param {number} [tenantId] 租户Id
      * @param {*} [options] Override http request option.
      * @throws {RequiredError}
      * @memberof SysOrgApi
      */
-    public async apiSysOrgListGet(id: number, name?: string, code?: string, type?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListSysOrg>> {
-        return SysOrgApiFp(this.configuration).apiSysOrgListGet(id, name, code, type, options).then((request) => request(this.axios, this.basePath));
+    public async apiSysOrgListGet(id: number, name?: string, code?: string, type?: string, tenantId?: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListSysOrg>> {
+        return SysOrgApiFp(this.configuration).apiSysOrgListGet(id, name, code, type, tenantId, options).then((request) => request(this.axios, this.basePath));
     }
     /**
      * 

+ 15 - 7
Web/src/api-services/apis/sys-pos-api.ts

@@ -127,10 +127,11 @@ export const SysPosApiAxiosParamCreator = function (configuration?: Configuratio
          * @summary 获取职位列表 🔖
          * @param {string} [name] 名称
          * @param {string} [code] 编码
+         * @param {number} [tenantId] 租户Id
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        apiSysPosListGet: async (name?: string, code?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+        apiSysPosListGet: async (name?: string, code?: string, tenantId?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
             const localVarPath = `/api/sysPos/list`;
             // use dummy base URL string because the URL constructor only accepts absolute URLs.
             const localVarUrlObj = new URL(localVarPath, 'https://example.com');
@@ -159,6 +160,10 @@ export const SysPosApiAxiosParamCreator = function (configuration?: Configuratio
                 localVarQueryParameter['Code'] = code;
             }
 
+            if (tenantId !== undefined) {
+                localVarQueryParameter['TenantId'] = tenantId;
+            }
+
             const query = new URLSearchParams(localVarUrlObj.search);
             for (const key in localVarQueryParameter) {
                 query.set(key, localVarQueryParameter[key]);
@@ -265,11 +270,12 @@ export const SysPosApiFp = function(configuration?: Configuration) {
          * @summary 获取职位列表 🔖
          * @param {string} [name] 名称
          * @param {string} [code] 编码
+         * @param {number} [tenantId] 租户Id
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async apiSysPosListGet(name?: string, code?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListSysPos>>> {
-            const localVarAxiosArgs = await SysPosApiAxiosParamCreator(configuration).apiSysPosListGet(name, code, options);
+        async apiSysPosListGet(name?: string, code?: string, tenantId?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListSysPos>>> {
+            const localVarAxiosArgs = await SysPosApiAxiosParamCreator(configuration).apiSysPosListGet(name, code, tenantId, options);
             return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                 const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                 return axios.request(axiosRequestArgs);
@@ -323,11 +329,12 @@ export const SysPosApiFactory = function (configuration?: Configuration, basePat
          * @summary 获取职位列表 🔖
          * @param {string} [name] 名称
          * @param {string} [code] 编码
+         * @param {number} [tenantId] 租户Id
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async apiSysPosListGet(name?: string, code?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListSysPos>> {
-            return SysPosApiFp(configuration).apiSysPosListGet(name, code, options).then((request) => request(axios, basePath));
+        async apiSysPosListGet(name?: string, code?: string, tenantId?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListSysPos>> {
+            return SysPosApiFp(configuration).apiSysPosListGet(name, code, tenantId, options).then((request) => request(axios, basePath));
         },
         /**
          * 
@@ -376,12 +383,13 @@ export class SysPosApi extends BaseAPI {
      * @summary 获取职位列表 🔖
      * @param {string} [name] 名称
      * @param {string} [code] 编码
+     * @param {number} [tenantId] 租户Id
      * @param {*} [options] Override http request option.
      * @throws {RequiredError}
      * @memberof SysPosApi
      */
-    public async apiSysPosListGet(name?: string, code?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListSysPos>> {
-        return SysPosApiFp(this.configuration).apiSysPosListGet(name, code, options).then((request) => request(this.axios, this.basePath));
+    public async apiSysPosListGet(name?: string, code?: string, tenantId?: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListSysPos>> {
+        return SysPosApiFp(this.configuration).apiSysPosListGet(name, code, tenantId, options).then((request) => request(this.axios, this.basePath));
     }
     /**
      * 

+ 6 - 0
Web/src/api-services/models/list-schedule-input.ts

@@ -29,4 +29,10 @@ export interface ListScheduleInput {
      * @memberof ListScheduleInput
      */
     endTime?: Date | null;
+    /**
+     * 租户Id
+     * @type {number}
+     * @memberof ListScheduleInput
+     */
+    tenantId?: number;
 }

+ 6 - 0
Web/src/api-services/models/page-ex-log-input.ts

@@ -103,6 +103,12 @@ export interface PageExLogInput {
      * @memberof PageExLogInput
      */
     remoteIp?: string | null;
+    /**
+     * 租户Id
+     * @type {number}
+     * @memberof PageExLogInput
+     */
+    tenantId?: number;
     /**
      * 方法名称
      * @type {string}

+ 6 - 0
Web/src/api-services/models/page-file-input.ts

@@ -91,4 +91,10 @@ export interface PageFileInput {
      * @memberof PageFileInput
      */
     endTime?: Date | null;
+    /**
+     * 租户Id
+     * @type {number}
+     * @memberof PageFileInput
+     */
+    tenantId?: number;
 }

+ 6 - 0
Web/src/api-services/models/page-log-input.ts

@@ -103,4 +103,10 @@ export interface PageLogInput {
      * @memberof PageLogInput
      */
     remoteIp?: string | null;
+    /**
+     * 租户Id
+     * @type {number}
+     * @memberof PageLogInput
+     */
+    tenantId?: number;
 }

+ 6 - 0
Web/src/api-services/models/page-online-user-input.ts

@@ -79,4 +79,10 @@ export interface PageOnlineUserInput {
      * @memberof PageOnlineUserInput
      */
     realName?: string | null;
+    /**
+     * 租户Id
+     * @type {number}
+     * @memberof PageOnlineUserInput
+     */
+    tenantId?: number;
 }

+ 6 - 0
Web/src/api-services/models/page-op-log-input.ts

@@ -103,6 +103,12 @@ export interface PageOpLogInput {
      * @memberof PageOpLogInput
      */
     remoteIp?: string | null;
+    /**
+     * 租户Id
+     * @type {number}
+     * @memberof PageOpLogInput
+     */
+    tenantId?: number;
     /**
      * 方法名称
      * @type {string}

+ 6 - 0
Web/src/api-services/models/page-plugin-input.ts

@@ -79,4 +79,10 @@ export interface PagePluginInput {
      * @memberof PagePluginInput
      */
     code?: string | null;
+    /**
+     * 租户Id
+     * @type {number}
+     * @memberof PagePluginInput
+     */
+    tenantId?: number;
 }

+ 6 - 0
Web/src/api-services/models/page-print-input.ts

@@ -79,4 +79,10 @@ export interface PagePrintInput {
      * @memberof PagePrintInput
      */
     code?: string | null;
+    /**
+     * 租户Id
+     * @type {number}
+     * @memberof PagePrintInput
+     */
+    tenantId?: number;
 }

+ 6 - 0
Web/src/api-services/models/page-role-input.ts

@@ -67,6 +67,12 @@ export interface PageRoleInput {
      * @memberof PageRoleInput
      */
     descStr?: string | null;
+    /**
+     * 租户Id
+     * @type {number}
+     * @memberof PageRoleInput
+     */
+    tenantId?: number;
     /**
      * 名称
      * @type {string}

+ 6 - 0
Web/src/api-services/models/page-user-input.ts

@@ -67,6 +67,12 @@ export interface PageUserInput {
      * @memberof PageUserInput
      */
     descStr?: string | null;
+    /**
+     * 租户Id
+     * @type {number}
+     * @memberof PageUserInput
+     */
+    tenantId?: number;
     /**
      * 账号
      * @type {string}

+ 6 - 0
Web/src/api-services/models/page-vis-log-input.ts

@@ -103,6 +103,12 @@ export interface PageVisLogInput {
      * @memberof PageVisLogInput
      */
     remoteIp?: string | null;
+    /**
+     * 租户Id
+     * @type {number}
+     * @memberof PageVisLogInput
+     */
+    tenantId?: number;
     /**
      * 方法名称
      * @type {string}

+ 6 - 0
Web/src/api-services/models/sys-ldap-input.ts

@@ -73,4 +73,10 @@ export interface SysLdapInput {
      * @memberof SysLdapInput
      */
     host?: string | null;
+    /**
+     * 租户Id
+     * @type {number}
+     * @memberof SysLdapInput
+     */
+    tenantId?: number;
 }

+ 13 - 1
Web/src/views/system/file/index.vue

@@ -2,6 +2,11 @@
 	<div class="sys-file-container">
 		<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
 			<el-form :model="state.queryParams" ref="queryForm" :inline="true">
+				<el-form-item label="租户" v-if="userStore.userInfos.accountType == 999">
+					<el-select v-model="state.queryParams.tenantId" placeholder="租户" style="width: 100%">
+						<el-option :value="item.value" :label="`${item.label} (${item.host})`" v-for="(item, index) in state.tenantList" :key="index" />
+					</el-select>
+				</el-form-item>
 				<el-form-item label="文件名称" prop="fileName">
 					<el-input v-model="state.queryParams.fileName" placeholder="文件名称" clearable />
 				</el-form-item>
@@ -154,16 +159,19 @@ import ModifyRecord from '/@/components/table/modifyRecord.vue';
 
 import { downloadByUrl } from '/@/utils/download';
 import { getAPI } from '/@/utils/axios-utils';
-import { SysFileApi } from '/@/api-services/api';
+import {SysFileApi, SysTenantApi} from '/@/api-services/api';
 import { SysFile } from '/@/api-services/models';
+import { useUserInfo } from "/@/stores/userInfo";
 
 // const baseUrl = window.__env__.VITE_API_URL;
+const userStore = useUserInfo();
 const uploadRef = ref<UploadInstance>();
 const editSysFileRef = ref<InstanceType<typeof EditSysFile>>();
 const state = reactive({
 	loading: false,
 	fileData: [] as Array<SysFile>,
 	queryParams: {
+		tenantId: undefined,
 		fileName: undefined,
 		startTime: undefined,
 		endTime: undefined,
@@ -190,6 +198,10 @@ const state = reactive({
 });
 
 onMounted(async () => {
+	if (userStore.userInfos.accountType == 999) {
+		state.tenantList = await getAPI(SysTenantApi).apiSysTenantListGet().then(res => res.data.result ?? []);
+		state.queryParams.tenantId = state.tenantList[0].value;
+	}
 	handleQuery();
 });
 

+ 14 - 2
Web/src/views/system/ldap/index.vue

@@ -2,6 +2,11 @@
 	<div class="sysLdap-container">
 		<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
 			<el-form :model="state.queryParams" ref="queryForm" :inline="true">
+				<el-form-item label="租户" v-if="userStore.userInfos.accountType == 999">
+					<el-select v-model="state.queryParams.tenantId" placeholder="租户" style="width: 100%">
+						<el-option :value="item.value" :label="`${item.label} (${item.host})`" v-for="(item, index) in state.tenantList" :key="index" />
+					</el-select>
+				</el-form-item>
 				<el-form-item label="关键字">
 					<el-input v-model="state.queryParams.keyword" clearable placeholder="请输入模糊查询关键字" />
 				</el-form-item>
@@ -71,15 +76,18 @@ import { onMounted, reactive, ref } from 'vue';
 import { ElMessageBox, ElMessage } from 'element-plus';
 import { auth } from '/@/utils/authFunction';
 import { getAPI } from '/@/utils/axios-utils';
-import { SysLdapApi } from '/@/api-services/api';
+import {SysLdapApi, SysTenantApi} from '/@/api-services/api';
 import ModifyRecord from '/@/components/table/modifyRecord.vue';
 import EditLdap from './component/editLdap.vue';
+import { useUserInfo } from "/@/stores/userInfo";
 
+const userStore = useUserInfo();
 const editLdapRef = ref<InstanceType<typeof EditLdap>>();
 const state = reactive({
 	loading: false,
 	tableData: [] as any,
 	queryParams: {
+		tenantId: undefined,
 		keyword: undefined,
 		host: undefined,
 	},
@@ -92,6 +100,10 @@ const state = reactive({
 });
 
 onMounted(async () => {
+	if (userStore.userInfos.accountType == 999) {
+		state.tenantList = await getAPI(SysTenantApi).apiSysTenantListGet().then(res => res.data.result ?? []);
+		state.queryParams.tenantId = state.tenantList[0].value;
+	}
 	handleQuery();
 });
 
@@ -115,7 +127,7 @@ const resetQuery = () => {
 // 打开新增页面
 const openAddSysLdap = () => {
 	state.dialogTitle = '添加系统域登录信息配置';
-	editLdapRef.value?.openDialog({});
+	editLdapRef.value?.openDialog({ tenantId: state.queryParams.tenantId });
 };
 
 // 打开编辑页面

+ 13 - 1
Web/src/views/system/log/difflog/index.vue

@@ -2,6 +2,11 @@
 	<div class="sys-difflog-container">
 		<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
 			<el-form :model="state.queryParams" ref="queryForm" :inline="true">
+				<el-form-item label="租户" v-if="userStore.userInfos.accountType == 999">
+					<el-select v-model="state.queryParams.tenantId" placeholder="租户" style="width: 100%">
+						<el-option :value="item.value" :label="`${item.label} (${item.host})`" v-for="(item, index) in state.tenantList" :key="index" />
+					</el-select>
+				</el-form-item>
 				<el-form-item label="开始时间">
 					<el-date-picker v-model="state.queryParams.startTime" type="datetime" placeholder="开始时间" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
 				</el-form-item>
@@ -83,12 +88,15 @@
 import { onMounted, reactive } from 'vue';
 
 import { getAPI } from '/@/utils/axios-utils';
-import { SysLogDiffApi } from '/@/api-services/api';
+import { SysLogDiffApi, SysTenantApi } from '/@/api-services/api';
 import { SysLogDiff } from '/@/api-services/models';
+import { useUserInfo } from "/@/stores/userInfo";
 
+const userStore = useUserInfo();
 const state = reactive({
 	loading: false,
 	queryParams: {
+		tenantId: undefined,
 		startTime: undefined,
 		endTime: undefined,
 	},
@@ -101,6 +109,10 @@ const state = reactive({
 });
 
 onMounted(async () => {
+	if (userStore.userInfos.accountType == 999) {
+		state.tenantList = await getAPI(SysTenantApi).apiSysTenantListGet().then(res => res.data.result ?? []);
+		state.queryParams.tenantId = state.tenantList[0].value;
+	}
 	handleQuery();
 });
 

+ 13 - 1
Web/src/views/system/log/exlog/index.vue

@@ -2,6 +2,11 @@
 	<div class="sys-exlog-container" v-loading="state.loading">
 		<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
 			<el-form :model="state.queryParams" ref="queryForm" :inline="true">
+				<el-form-item label="租户" v-if="userStore.userInfos.accountType == 999">
+					<el-select v-model="state.queryParams.tenantId" placeholder="租户" style="width: 100%">
+						<el-option :value="item.value" :label="`${item.label} (${item.host})`" v-for="(item, index) in state.tenantList" :key="index" />
+					</el-select>
+				</el-form-item>
 				<el-form-item label="开始时间">
 					<el-date-picker v-model="state.queryParams.startTime" type="datetime" placeholder="开始时间" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
 				</el-form-item>
@@ -118,13 +123,16 @@ import { ElMessage } from 'element-plus';
 import { downloadByData, getFileName } from '/@/utils/download';
 
 import { getAPI } from '/@/utils/axios-utils';
-import { SysLogExApi } from '/@/api-services/api';
+import { SysLogExApi, SysTenantApi } from '/@/api-services/api';
 import { SysLogEx } from '/@/api-services/models';
+import { useUserInfo } from "/@/stores/userInfo";
 
+const userStore = useUserInfo();
 const state = reactive({
 	loading: false,
 	loadingDetail: false,
 	queryParams: {
+		tenantId: undefined,
 		startTime: undefined,
 		endTime: undefined,
 		status: undefined,
@@ -148,6 +156,10 @@ const state = reactive({
 });
 
 onMounted(async () => {
+	if (userStore.userInfos.accountType == 999) {
+		state.tenantList = await getAPI(SysTenantApi).apiSysTenantListGet().then(res => res.data.result ?? []);
+		state.queryParams.tenantId = state.tenantList[0].value;
+	}
 	handleQuery();
 });
 

+ 13 - 1
Web/src/views/system/log/oplog/index.vue

@@ -2,6 +2,11 @@
 	<div class="sys-oplog-container" v-loading="state.loading">
 		<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
 			<el-form :model="state.queryParams" ref="queryForm" :inline="true">
+				<el-form-item label="租户" v-if="userStore.userInfos.accountType == 999">
+					<el-select v-model="state.queryParams.tenantId" placeholder="租户" style="width: 100%">
+						<el-option :value="item.value" :label="`${item.label} (${item.host})`" v-for="(item, index) in state.tenantList" :key="index" />
+					</el-select>
+				</el-form-item>
 				<el-form-item label="开始时间">
 					<el-date-picker v-model="state.queryParams.startTime" type="datetime" placeholder="开始时间" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
 				</el-form-item>
@@ -112,13 +117,16 @@ import { ElMessage } from 'element-plus';
 import { downloadByData, getFileName } from '/@/utils/download';
 
 import { getAPI } from '/@/utils/axios-utils';
-import { SysLogOpApi } from '/@/api-services/api';
 import { SysLogOp } from '/@/api-services/models';
+import { useUserInfo } from "/@/stores/userInfo";
+import { SysLogOpApi, SysTenantApi } from '/@/api-services/api';
 
+const userStore = useUserInfo();
 const state = reactive({
 	loading: false,
 	loadingDetail: false,
 	queryParams: {
+		tenantId: undefined,
 		startTime: undefined,
 		endTime: undefined,
 		controllerName: undefined,
@@ -141,6 +149,10 @@ const state = reactive({
 });
 
 onMounted(async () => {
+	if (userStore.userInfos.accountType == 999) {
+		state.tenantList = await getAPI(SysTenantApi).apiSysTenantListGet().then(res => res.data.result ?? []);
+		state.queryParams.tenantId = state.tenantList[0].value;
+	}
 	handleQuery();
 });
 

+ 13 - 2
Web/src/views/system/log/vislog/index.vue

@@ -2,6 +2,11 @@
 	<div class="sys-vislog-container">
 		<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
 			<el-form :model="state.queryParams" ref="queryForm" :inline="true">
+				<el-form-item label="租户" v-if="userStore.userInfos.accountType == 999">
+					<el-select v-model="state.queryParams.tenantId" placeholder="租户" style="width: 100%">
+						<el-option :value="item.value" :label="`${item.label} (${item.host})`" v-for="(item, index) in state.tenantList" :key="index" />
+					</el-select>
+				</el-form-item>
 				<el-form-item label="开始时间">
 					<el-date-picker v-model="state.queryParams.startTime" type="datetime" placeholder="开始时间" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
 				</el-form-item>
@@ -78,14 +83,16 @@
 <script lang="ts" setup name="sysVisLog">
 import { onMounted, reactive } from 'vue';
 import { ElMessage } from 'element-plus';
-
 import { getAPI } from '/@/utils/axios-utils';
-import { SysLogVisApi } from '/@/api-services/api';
 import { SysLogVis } from '/@/api-services/models';
+import { useUserInfo } from "/@/stores/userInfo";
+import { SysLogVisApi, SysTenantApi } from '/@/api-services/api';
 
+const userStore = useUserInfo();
 const state = reactive({
 	loading: false,
 	queryParams: {
+		tenantId: undefined,
 		startTime: undefined,
 		endTime: undefined,
 		status: undefined,
@@ -103,6 +110,10 @@ const state = reactive({
 });
 
 onMounted(async () => {
+	if (userStore.userInfos.accountType == 999) {
+		state.tenantList = await getAPI(SysTenantApi).apiSysTenantListGet().then(res => res.data.result ?? []);
+		state.queryParams.tenantId = state.tenantList[0].value;
+	}
 	handleQuery();
 });
 

+ 0 - 1
Web/src/views/system/menu/index.vue

@@ -125,7 +125,6 @@ const openAddMenu = () => {
 // 打开编辑页面
 const openEditMenu = (row: any) => {
 	state.editMenuTitle = '编辑菜单';
-	if (userStore.userInfos.accountType == 999) row.tenantId = state.queryParams.tenantId;
 	editMenuRef.value?.openDialog(row);
 };
 

+ 13 - 2
Web/src/views/system/onlineUser/index.vue

@@ -3,6 +3,11 @@
 		<el-drawer v-model="state.isVisible" title="在线用户列表" size="45%">
 			<el-card shadow="hover" :body-style="{ paddingBottom: '0' }" style="margin: 8px">
 				<el-form :model="state.queryParams" ref="queryForm" :inline="true">
+					<el-form-item label="租户" v-if="userStore.userInfos.accountType == 999">
+						<el-select v-model="state.queryParams.tenantId" placeholder="租户" style="width: 100%">
+							<el-option :value="item.value" :label="`${item.label} (${item.host})`" v-for="(item, index) in state.tenantList" :key="index" />
+						</el-select>
+					</el-form-item>
 					<el-form-item label="账号" prop="userName">
 						<el-input placeholder="账号" clearable @keyup.enter="handleQuery" v-model="state.queryParams.userName" />
 					</el-form-item>
@@ -55,17 +60,19 @@ import { ElMessageBox, ElNotification } from 'element-plus';
 import { throttle } from 'lodash-es';
 
 import { getAPI, clearAccessTokens } from '/@/utils/axios-utils';
-import { SysOnlineUserApi, SysAuthApi } from '/@/api-services/api';
+import {SysOnlineUserApi, SysAuthApi, SysTenantApi} from '/@/api-services/api';
 import { SysOnlineUser } from '/@/api-services/models';
-
+import { useUserInfo } from "/@/stores/userInfo";
 import { signalR } from './signalR';
 
+const userStore = useUserInfo();
 const state = reactive({
 	loading: false,
 	isVisible: false,
 	queryParams: {
 		userName: undefined,
 		realName: undefined,
+		tenantId: undefined,
 	},
 	tableParams: {
 		page: 1,
@@ -80,6 +87,10 @@ const state = reactive({
 });
 
 onMounted(async () => {
+	if (userStore.userInfos.accountType == 999) {
+		state.tenantList = await getAPI(SysTenantApi).apiSysTenantListGet().then(res => res.data.result ?? []);
+		state.queryParams.tenantId = state.tenantList[0].value;
+	}
 	// 在线用户列表
 	signalR.off('OnlineUserList');
 	signalR.on('OnlineUserList', (data: any) => {

+ 5 - 5
Web/src/views/system/org/index.vue

@@ -99,19 +99,19 @@ onMounted(async () => {
 // 查询操作
 const handleQuery = async (updateTree: boolean = false) => {
 	state.loading = true;
-	var res = await getAPI(SysOrgApi).apiSysOrgListGet(state.queryParams.id, state.queryParams.name, state.queryParams.code, state.queryParams.type);
+	let res = await getAPI(SysOrgApi).apiSysOrgListGet(state.queryParams.id, state.queryParams.name, state.queryParams.code, state.queryParams.type);
 	state.orgData = res.data.result ?? [];
 	state.loading = false;
 	// 是否更新左侧机构列表树
-	if (updateTree == true) {
+	if (updateTree) {
 		orgTreeRef.value?.initTreeData();
 		// 更新编辑页面机构列表树
-		var res = await getAPI(SysOrgApi).apiSysOrgListGet(0);
+		res = await getAPI(SysOrgApi).apiSysOrgListGet(0);
 		state.orgTreeData = res.data.result ?? [];
 	}
 
 	// 若无选择节点并且查询条件为空时,更新编辑页面机构列表树
-	if (state.queryParams.id == 0 && state.queryParams.name == undefined && state.queryParams.code == undefined && state.queryParams.type == undefined && updateTree == false)
+	if (state.queryParams.id == 0 && state.queryParams.name == undefined && state.queryParams.code == undefined && state.queryParams.type == undefined && !updateTree)
 		state.orgTreeData = state.orgData;
 };
 
@@ -127,7 +127,7 @@ const resetQuery = () => {
 // 打开新增页面
 const openAddOrg = () => {
 	state.editOrgTitle = '添加机构';
-	editOrgRef.value?.openDialog({ status: 1, orderNo: 100 });
+	editOrgRef.value?.openDialog({ status: 1, tenantId: state.queryParams.tenantId, orderNo: 100 });
 };
 
 // 打开编辑页面

+ 14 - 2
Web/src/views/system/plugin/index.vue

@@ -2,6 +2,11 @@
 	<div class="sys-plugin-container">
 		<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
 			<el-form :model="state.queryParams" ref="queryForm" :inline="true">
+				<el-form-item label="租户" v-if="userStore.userInfos.accountType == 999">
+					<el-select v-model="state.queryParams.tenantId" placeholder="租户" style="width: 100%">
+						<el-option :value="item.value" :label="`${item.label} (${item.host})`" v-for="(item, index) in state.tenantList" :key="index" />
+					</el-select>
+				</el-form-item>
 				<el-form-item label="功能名称">
 					<el-input v-model="state.queryParams.name" placeholder="功能名称" clearable />
 				</el-form-item>
@@ -63,14 +68,17 @@ import { ElMessageBox, ElMessage } from 'element-plus';
 import EditPlugin from '/@/views/system/plugin/component/editPlugin.vue';
 import ModifyRecord from '/@/components/table/modifyRecord.vue';
 import { getAPI } from '/@/utils/axios-utils';
-import { SysPluginApi } from '/@/api-services/api';
+import { SysPluginApi, SysTenantApi } from '/@/api-services/api';
 import { SysPlugin } from '/@/api-services/models';
+import { useUserInfo } from "/@/stores/userInfo";
 
+const userStore = useUserInfo();
 const editPluginRef = ref<InstanceType<typeof EditPlugin>>();
 const state = reactive({
 	loading: false,
 	pluginData: [] as Array<SysPlugin>,
 	queryParams: {
+		tenantId: undefined,
 		name: undefined,
 	},
 	tableParams: {
@@ -82,6 +90,10 @@ const state = reactive({
 });
 
 onMounted(async () => {
+	if (userStore.userInfos.accountType == 999) {
+		state.tenantList = await getAPI(SysTenantApi).apiSysTenantListGet().then(res => res.data.result ?? []);
+		state.queryParams.tenantId = state.tenantList[0].value;
+	}
 	handleQuery();
 });
 
@@ -104,7 +116,7 @@ const resetQuery = () => {
 // 打开新增页面
 const openAddPlugin = () => {
 	state.editPluginTitle = '添加动态插件';
-	editPluginRef.value?.openDialog({ orderNo: 100, status: 1 });
+	editPluginRef.value?.openDialog({ orderNo: 100, tenantId: state.queryParams.tenantId, status: 1 });
 };
 
 // 打开编辑页面

+ 15 - 3
Web/src/views/system/pos/index.vue

@@ -2,6 +2,11 @@
 	<div class="sys-pos-container">
 		<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
 			<el-form :model="state.queryParams" ref="queryForm" :inline="true">
+				<el-form-item label="租户" v-if="userStore.userInfos.accountType == 999">
+					<el-select v-model="state.queryParams.tenantId" placeholder="租户" style="width: 100%">
+						<el-option :value="item.value" :label="`${item.label} (${item.host})`" v-for="(item, index) in state.tenantList" :key="index" />
+					</el-select>
+				</el-form-item>
 				<el-form-item label="职位名称">
 					<el-input v-model="state.queryParams.name" placeholder="职位名称" clearable />
 				</el-form-item>
@@ -76,14 +81,17 @@ import EditPos from '/@/views/system/pos/component/editPos.vue';
 import ModifyRecord from '/@/components/table/modifyRecord.vue';
 
 import { getAPI } from '/@/utils/axios-utils';
-import { SysPosApi } from '/@/api-services/api';
+import {SysPosApi, SysTenantApi} from '/@/api-services/api';
 import { SysPos, UpdatePosInput } from '/@/api-services/models';
+import { useUserInfo } from "/@/stores/userInfo";
 
+const userStore = useUserInfo();
 const editPosRef = ref<InstanceType<typeof EditPos>>();
 const state = reactive({
 	loading: false,
 	posData: [] as Array<SysPos>,
 	queryParams: {
+		tenantId: undefined,
 		name: undefined,
 		code: undefined,
 	},
@@ -91,13 +99,17 @@ const state = reactive({
 });
 
 onMounted(async () => {
+	if (userStore.userInfos.accountType == 999) {
+		state.tenantList = await getAPI(SysTenantApi).apiSysTenantListGet().then(res => res.data.result ?? []);
+		state.queryParams.tenantId = state.tenantList[0].value;
+	}
 	handleQuery();
 });
 
 // 查询操作
 const handleQuery = async () => {
 	state.loading = true;
-	var res = await getAPI(SysPosApi).apiSysPosListGet(state.queryParams.name, state.queryParams.code);
+	var res = await getAPI(SysPosApi).apiSysPosListGet(state.queryParams.name, state.queryParams.code, state.queryParams.tenantId);
 	state.posData = res.data.result ?? [];
 	state.loading = false;
 };
@@ -112,7 +124,7 @@ const resetQuery = () => {
 // 打开新增页面
 const openAddPos = () => {
 	state.editPosTitle = '添加职位';
-	editPosRef.value?.openDialog({ status: 1, orderNo: 100 });
+	editPosRef.value?.openDialog({ status: 1, tenantId: state.queryParams.tenantId, orderNo: 100 });
 };
 
 // 打开编辑页面

+ 14 - 2
Web/src/views/system/print/index.vue

@@ -2,6 +2,11 @@
 	<div class="sys-print-container">
 		<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
 			<el-form :model="state.queryParams" ref="queryForm" :inline="true">
+				<el-form-item label="租户" v-if="userStore.userInfos.accountType == 999">
+					<el-select v-model="state.queryParams.tenantId" placeholder="租户" style="width: 100%">
+						<el-option :value="item.value" :label="`${item.label} (${item.host})`" v-for="(item, index) in state.tenantList" :key="index" />
+					</el-select>
+				</el-form-item>
 				<el-form-item label="模板名称">
 					<el-input v-model="state.queryParams.name" placeholder="模板名称" clearable />
 				</el-form-item>
@@ -63,14 +68,17 @@ import { ElMessageBox, ElMessage } from 'element-plus';
 import EditPrint from '/@/views/system/print/component/editPrint.vue';
 import ModifyRecord from '/@/components/table/modifyRecord.vue';
 import { getAPI } from '/@/utils/axios-utils';
-import { SysPrintApi } from '/@/api-services/api';
+import {SysPrintApi, SysTenantApi} from '/@/api-services/api';
 import { SysPrint } from '/@/api-services/models';
+import { useUserInfo } from "/@/stores/userInfo";
 
+const userStore = useUserInfo();
 const editPrintRef = ref<InstanceType<typeof EditPrint>>();
 const state = reactive({
 	loading: false,
 	printData: [] as Array<SysPrint>,
 	queryParams: {
+		tenantId: undefined,
 		name: undefined,
 	},
 	tableParams: {
@@ -82,6 +90,10 @@ const state = reactive({
 });
 
 onMounted(async () => {
+	if (userStore.userInfos.accountType == 999) {
+		state.tenantList = await getAPI(SysTenantApi).apiSysTenantListGet().then(res => res.data.result ?? []);
+		state.queryParams.tenantId = state.tenantList[0].value;
+	}
 	handleQuery();
 });
 
@@ -104,7 +116,7 @@ const resetQuery = () => {
 // 打开新增页面
 const openAddPrint = () => {
 	state.editPrintTitle = '添加打印模板';
-	editPrintRef.value?.openDialog({});
+	editPrintRef.value?.openDialog({ tenantId: state.queryParams.tenantId });
 };
 
 // 打开编辑页面

+ 14 - 2
Web/src/views/system/role/index.vue

@@ -2,6 +2,11 @@
 	<div class="sys-role-container">
 		<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
 			<el-form :model="state.queryParams" ref="queryForm" :inline="true">
+				<el-form-item label="租户" v-if="userStore.userInfos.accountType == 999">
+					<el-select v-model="state.queryParams.tenantId" placeholder="租户" style="width: 100%">
+						<el-option :value="item.value" :label="`${item.label} (${item.host})`" v-for="(item, index) in state.tenantList" :key="index" />
+					</el-select>
+				</el-form-item>
 				<el-form-item label="角色名称">
 					<el-input v-model="state.queryParams.name" placeholder="角色名称" clearable />
 				</el-form-item>
@@ -74,15 +79,18 @@ import EditRole from '/@/views/system/role/component/editRole.vue';
 import GrantData from '/@/views/system/role/component/grantData.vue';
 import ModifyRecord from '/@/components/table/modifyRecord.vue';
 import { getAPI } from '/@/utils/axios-utils';
-import { SysRoleApi } from '/@/api-services/api';
+import { SysRoleApi, SysTenantApi } from '/@/api-services/api';
 import { SysRole } from '/@/api-services/models';
+import { useUserInfo } from "/@/stores/userInfo";
 
+const userStore = useUserInfo();
 const editRoleRef = ref<InstanceType<typeof EditRole>>();
 const grantDataRef = ref<InstanceType<typeof GrantData>>();
 const state = reactive({
 	loading: false,
 	roleData: [] as Array<SysRole>,
 	queryParams: {
+		tenantId: undefined,
 		name: undefined,
 		code: undefined,
 	},
@@ -95,6 +103,10 @@ const state = reactive({
 });
 
 onMounted(async () => {
+	if (userStore.userInfos.accountType == 999) {
+		state.tenantList = await getAPI(SysTenantApi).apiSysTenantListGet().then(res => res.data.result ?? []);
+		state.queryParams.tenantId = state.tenantList[0].value;
+	}
 	await handleQuery();
 });
 
@@ -118,7 +130,7 @@ const resetQuery = async () => {
 // 打开新增页面
 const openAddRole = () => {
 	state.editRoleTitle = '添加角色';
-	editRoleRef.value?.openDialog({ id: undefined, status: 1, orderNo: 100 });
+	editRoleRef.value?.openDialog({ id: undefined, status: 1, tenantId: state.queryParams.tenantId, orderNo: 100 });
 };
 
 // 打开编辑页面

+ 1 - 1
Web/src/views/system/user/index.vue

@@ -179,7 +179,7 @@ const resetQuery = async () => {
 // 打开新增页面
 const openAddUser = () => {
 	state.editUserTitle = '添加账号';
-	editUserRef.value?.openDialog({ id: undefined, birthday: '2000-01-01', sex: 1, orderNo: 100, cardType: 0, cultureLevel: 5 });
+	editUserRef.value?.openDialog({ id: undefined, birthday: '2000-01-01', sex: 1, tenantId: state.queryParams.tenantId, orderNo: 100, cardType: 0, cultureLevel: 5 });
 };
 
 // 打开编辑页面