Merge branch 'refs/heads/pure-dev' into abp
This commit is contained in:
@@ -24,5 +24,7 @@ namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Menu
|
|||||||
public string? Component { get; set; }
|
public string? Component { get; set; }
|
||||||
public string? Query { get; set; }
|
public string? Query { get; set; }
|
||||||
public int OrderNum { get; set; }
|
public int OrderNum { get; set; }
|
||||||
|
public MenuSourceEnum MenuSource { get; set; } = MenuSourceEnum.Ruoyi;
|
||||||
|
public string? RouterName { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Volo.Abp.Application.Dtos;
|
using Volo.Abp.Application.Dtos;
|
||||||
|
using Yi.Framework.Rbac.Domain.Shared.Enums;
|
||||||
|
|
||||||
namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Menu
|
namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Menu
|
||||||
{
|
{
|
||||||
@@ -7,6 +8,6 @@ namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Menu
|
|||||||
|
|
||||||
public bool? State { get; set; }
|
public bool? State { get; set; }
|
||||||
public string? MenuName { get; set; }
|
public string? MenuName { get; set; }
|
||||||
|
public MenuSourceEnum MenuSource { get; set; } = MenuSourceEnum.Ruoyi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Menu
|
|||||||
public string? Component { get; set; }
|
public string? Component { get; set; }
|
||||||
public string? Query { get; set; }
|
public string? Query { get; set; }
|
||||||
public int OrderNum { get; set; }
|
public int OrderNum { get; set; }
|
||||||
|
public string? RouterName { get; set; }
|
||||||
//public List<MenuEntity>? Children { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -275,11 +275,12 @@ namespace Yi.Framework.Rbac.Application.Services
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取当前登录用户的前端路由
|
/// 获取当前登录用户的前端路由
|
||||||
|
/// 支持ruoyi/pure
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[Route("account/Vue3Router")]
|
[Route("account/Vue3Router/{routerType?}")]
|
||||||
public async Task<List<Vue3RouterDto>> GetVue3Router()
|
public async Task<object> GetVue3Router([FromRoute]string? routerType)
|
||||||
{
|
{
|
||||||
var userId = _currentUser.Id;
|
var userId = _currentUser.Id;
|
||||||
if (_currentUser.Id is null)
|
if (_currentUser.Id is null)
|
||||||
@@ -296,10 +297,20 @@ namespace Yi.Framework.Rbac.Application.Services
|
|||||||
menus = ObjectMapper.Map<List<MenuAggregateRoot>, List<MenuDto>>(await _menuRepository.GetListAsync());
|
menus = ObjectMapper.Map<List<MenuAggregateRoot>, List<MenuDto>>(await _menuRepository.GetListAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
//将后端菜单转换成前端路由,组件级别需要过滤
|
object output = null;
|
||||||
List<Vue3RouterDto> routers =
|
if (routerType is null ||routerType=="ruoyi")
|
||||||
ObjectMapper.Map<List<MenuDto>, List<MenuAggregateRoot>>(menus).Vue3RouterBuild();
|
{
|
||||||
return routers;
|
//将后端菜单转换成前端路由,组件级别需要过滤
|
||||||
|
output =
|
||||||
|
ObjectMapper.Map<List<MenuDto>, List<MenuAggregateRoot>>(menus).Vue3RuoYiRouterBuild();
|
||||||
|
}
|
||||||
|
else if (routerType =="pure")
|
||||||
|
{
|
||||||
|
//将后端菜单转换成前端路由,组件级别需要过滤
|
||||||
|
output =
|
||||||
|
ObjectMapper.Map<List<MenuDto>, List<MenuAggregateRoot>>(menus).Vue3PureRouterBuild();
|
||||||
|
}
|
||||||
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
|||||||
|
|
||||||
var entities = await _repository._DbQueryable.WhereIF(!string.IsNullOrEmpty(input.MenuName), x => x.MenuName.Contains(input.MenuName!))
|
var entities = await _repository._DbQueryable.WhereIF(!string.IsNullOrEmpty(input.MenuName), x => x.MenuName.Contains(input.MenuName!))
|
||||||
.WhereIF(input.State is not null, x => x.State == input.State)
|
.WhereIF(input.State is not null, x => x.State == input.State)
|
||||||
|
.Where(x=>x.MenuSource==input.MenuSource)
|
||||||
.OrderByDescending(x => x.OrderNum)
|
.OrderByDescending(x => x.OrderNum)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
//.ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
|
//.ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
|
||||||
@@ -45,5 +46,15 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
|||||||
|
|
||||||
return await MapToGetListOutputDtosAsync(entities);
|
return await MapToGetListOutputDtosAsync(entities);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override Task<MenuGetOutputDto> UpdateAsync(Guid id, MenuUpdateInputVo input)
|
||||||
|
{
|
||||||
|
return base.UpdateAsync(id, input);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Task<MenuGetOutputDto> CreateAsync(MenuCreateInputVo input)
|
||||||
|
{
|
||||||
|
return base.CreateAsync(input);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,6 +195,11 @@ namespace Yi.Framework.Rbac.Domain.Shared.Dtos
|
|||||||
public class MenuDto
|
public class MenuDto
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单来源
|
||||||
|
/// </summary>
|
||||||
|
public MenuSourceEnum MenuSource { get; set; }
|
||||||
|
public string? RouterName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 逻辑删除
|
/// 逻辑删除
|
||||||
|
|||||||
@@ -2,10 +2,13 @@
|
|||||||
|
|
||||||
public class Vue3PureRouterDto
|
public class Vue3PureRouterDto
|
||||||
{
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
public Guid ParentId { get; set; }
|
||||||
public string Path { get; set; }
|
public string Path { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public MetaPureRouterDto Meta { get; set; } = new MetaPureRouterDto();
|
public MetaPureRouterDto Meta { get; set; } = new MetaPureRouterDto();
|
||||||
|
|
||||||
|
public string? component { get; set; }
|
||||||
public List<Vue3PureRouterDto>? Children { get; set; }
|
public List<Vue3PureRouterDto>? Children { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -14,11 +17,6 @@ public class MetaPureRouterDto
|
|||||||
public string Icon { get; set; }
|
public string Icon { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 排序
|
|
||||||
/// </summary>
|
|
||||||
public string Rank { get; set; }
|
|
||||||
|
|
||||||
public List<string>? Roles { get; set; }
|
public List<string>? Roles { get; set; }
|
||||||
|
|
||||||
public List<string>? Auths { get; set; }
|
public List<string>? Auths { get; set; }
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Yi.Framework.Rbac.Domain.Shared.Enums;
|
||||||
|
|
||||||
|
public enum MenuSourceEnum
|
||||||
|
{
|
||||||
|
Ruoyi=0,
|
||||||
|
Pure=1
|
||||||
|
}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
using SqlSugar;
|
using System.Web;
|
||||||
|
using NUglify.Helpers;
|
||||||
|
using SqlSugar;
|
||||||
using Volo.Abp;
|
using Volo.Abp;
|
||||||
using Volo.Abp.Auditing;
|
using Volo.Abp.Auditing;
|
||||||
using Volo.Abp.Domain.Entities;
|
using Volo.Abp.Domain.Entities;
|
||||||
@@ -75,7 +77,12 @@ namespace Yi.Framework.Rbac.Domain.Entities
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 菜单名
|
/// 菜单名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string MenuName { get; set; } = string.Empty;
|
public string MenuName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 路由名称
|
||||||
|
/// </summary>
|
||||||
|
public string? RouterName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -137,6 +144,11 @@ namespace Yi.Framework.Rbac.Domain.Entities
|
|||||||
[SugarColumn(ColumnName = "Component")]
|
[SugarColumn(ColumnName = "Component")]
|
||||||
public string? Component { get; set; }
|
public string? Component { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单来源
|
||||||
|
/// </summary>
|
||||||
|
public MenuSourceEnum MenuSource { get; set; } = MenuSourceEnum.Ruoyi;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 路由参数
|
/// 路由参数
|
||||||
///</summary>
|
///</summary>
|
||||||
@@ -156,9 +168,13 @@ namespace Yi.Framework.Rbac.Domain.Entities
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="menus"></param>
|
/// <param name="menus"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static List<Vue3RouterDto> Vue3RouterBuild(this List<MenuAggregateRoot> menus)
|
public static List<Vue3RouterDto> Vue3RuoYiRouterBuild(this List<MenuAggregateRoot> menus)
|
||||||
{
|
{
|
||||||
menus = menus.Where(m => m.MenuType != MenuTypeEnum.Component).ToList();
|
menus = menus
|
||||||
|
.Where(m => m.State == true)
|
||||||
|
.Where(m => m.MenuType != MenuTypeEnum.Component)
|
||||||
|
.Where(m => m.MenuSource == MenuSourceEnum.Ruoyi)
|
||||||
|
.ToList();
|
||||||
List<Vue3RouterDto> routers = new();
|
List<Vue3RouterDto> routers = new();
|
||||||
foreach (var m in menus)
|
foreach (var m in menus)
|
||||||
{
|
{
|
||||||
@@ -216,16 +232,58 @@ namespace Yi.Framework.Rbac.Domain.Entities
|
|||||||
return TreeHelper.SetTree(routers);
|
return TreeHelper.SetTree(routers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构建vue3 pure路由
|
/// 构建vue3 pure路由
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="menus"></param>
|
/// <param name="menus"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
|
||||||
public static List<Vue3PureRouterDto> Vue3PureRouterBuild(this List<MenuAggregateRoot> menus)
|
public static List<Vue3PureRouterDto> Vue3PureRouterBuild(this List<MenuAggregateRoot> menus)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
//pure的菜单为树形
|
||||||
|
var allRouters = menus
|
||||||
|
.Where(m => m.State == true)
|
||||||
|
.Where(m => m.MenuType != MenuTypeEnum.Component)
|
||||||
|
.Where(m => m.MenuSource == MenuSourceEnum.Pure)
|
||||||
|
.Select(m => new Vue3PureRouterDto
|
||||||
|
{
|
||||||
|
Path =m.Router.StartsWith("/")?m.Router:"/"+m.Router,
|
||||||
|
Name =m.IsLink==true?"Link": m.RouterName,
|
||||||
|
component = m.Component,
|
||||||
|
Meta = new MetaPureRouterDto()
|
||||||
|
{
|
||||||
|
showLink = m.IsShow,
|
||||||
|
FrameSrc = m.IsLink == true ? m.Router : null,
|
||||||
|
Auths = new List<string>() { m.PermissionCode },
|
||||||
|
Icon = m.MenuIcon,
|
||||||
|
Title = m.MenuName,
|
||||||
|
|
||||||
|
},
|
||||||
|
Children =null,
|
||||||
|
Id = m.Id,
|
||||||
|
ParentId = m.ParentId
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
|
||||||
|
var routerDic = allRouters.GroupBy(x => x.ParentId).ToDictionary(x => x.Key,y=>y.ToList());
|
||||||
|
//根路由
|
||||||
|
if (!routerDic.TryGetValue(Guid.Empty, out var rootRouters))
|
||||||
|
{
|
||||||
|
return new List<Vue3PureRouterDto>();
|
||||||
|
}
|
||||||
|
Stack<Vue3PureRouterDto> stack = new Stack<Vue3PureRouterDto>(rootRouters);
|
||||||
|
while (stack.Count > 0)
|
||||||
|
{
|
||||||
|
var currentRouter = stack.Pop();
|
||||||
|
if (routerDic.TryGetValue(currentRouter.Id, out var items))
|
||||||
|
{
|
||||||
|
currentRouter.Children = items;
|
||||||
|
items?.ForEach(x => stack.Push(x));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return rootRouters;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -231,10 +231,11 @@ namespace Yi.Framework.Rbac.Domain.Managers
|
|||||||
|
|
||||||
var userRoleMenu = new UserRoleMenuDto();
|
var userRoleMenu = new UserRoleMenuDto();
|
||||||
//首先获取到该用户全部信息,导航到角色、菜单,(菜单需要去重,完全交给Set来处理即可)
|
//首先获取到该用户全部信息,导航到角色、菜单,(菜单需要去重,完全交给Set来处理即可)
|
||||||
//if (user is null)
|
if (user is null)
|
||||||
//{
|
{
|
||||||
// throw new UserFriendlyException($"数据错误,用户id:{nameof(userId)} 不存在,请重新登录");
|
//为了解决token前端缓存,后端数据库重新dbseed
|
||||||
//}
|
throw new UserFriendlyException($"数据错误,查询用户不存在,请重新登录");
|
||||||
|
}
|
||||||
user.EncryPassword.Password = string.Empty;
|
user.EncryPassword.Password = string.Empty;
|
||||||
user.EncryPassword.Salt = string.Empty;
|
user.EncryPassword.Salt = string.Empty;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,519 @@
|
|||||||
|
using Volo.Abp.Data;
|
||||||
|
using Volo.Abp.DependencyInjection;
|
||||||
|
using Volo.Abp.Guids;
|
||||||
|
using Yi.Framework.Rbac.Domain.Entities;
|
||||||
|
using Yi.Framework.Rbac.Domain.Shared.Enums;
|
||||||
|
using Yi.Framework.SqlSugarCore.Abstractions;
|
||||||
|
|
||||||
|
namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
|
||||||
|
{
|
||||||
|
public class MenuPureDataSeed : IDataSeedContributor, ITransientDependency
|
||||||
|
{
|
||||||
|
private ISqlSugarRepository<MenuAggregateRoot> _repository;
|
||||||
|
private IGuidGenerator _guidGenerator;
|
||||||
|
public MenuPureDataSeed(ISqlSugarRepository<MenuAggregateRoot> repository, IGuidGenerator guidGenerator)
|
||||||
|
{
|
||||||
|
_repository = repository;
|
||||||
|
_guidGenerator = guidGenerator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task SeedAsync(DataSeedContext context)
|
||||||
|
{
|
||||||
|
if (!await _repository.IsAnyAsync(x => x.MenuName == "系统管理"&&x.MenuSource==MenuSourceEnum.Pure))
|
||||||
|
{
|
||||||
|
await _repository.InsertManyAsync(GetSeedData());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public List<MenuAggregateRoot> GetSeedData()
|
||||||
|
{
|
||||||
|
List<MenuAggregateRoot> entities = new List<MenuAggregateRoot>();
|
||||||
|
//系统管理
|
||||||
|
MenuAggregateRoot system = new MenuAggregateRoot(_guidGenerator.Create(), Guid.Empty)
|
||||||
|
{
|
||||||
|
MenuName = "系统管理",
|
||||||
|
MenuType = MenuTypeEnum.Catalogue,
|
||||||
|
Router = "/system",
|
||||||
|
MenuIcon = "ri:settings-3-line",
|
||||||
|
OrderNum = 100
|
||||||
|
};
|
||||||
|
entities.Add(system);
|
||||||
|
|
||||||
|
//系统监控
|
||||||
|
MenuAggregateRoot monitoring = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
MenuName = "系统监控",
|
||||||
|
MenuType = MenuTypeEnum.Catalogue,
|
||||||
|
Router = "/monitor",
|
||||||
|
MenuIcon = "ep:monitor",
|
||||||
|
OrderNum = 99,
|
||||||
|
};
|
||||||
|
entities.Add(monitoring);
|
||||||
|
|
||||||
|
|
||||||
|
//在线用户
|
||||||
|
MenuAggregateRoot online = new MenuAggregateRoot(_guidGenerator.Create(), monitoring.Id)
|
||||||
|
{
|
||||||
|
MenuName = "在线用户",
|
||||||
|
PermissionCode = "monitor:online:list",
|
||||||
|
MenuType = MenuTypeEnum.Menu,
|
||||||
|
Router = "/monitor/online-user",
|
||||||
|
MenuIcon = "ri:user-voice-line",
|
||||||
|
OrderNum = 100,
|
||||||
|
RouterName = "OnlineUser",
|
||||||
|
Component = "monitor/online/index"
|
||||||
|
};
|
||||||
|
entities.Add(online);
|
||||||
|
|
||||||
|
|
||||||
|
//Yi框架
|
||||||
|
MenuAggregateRoot guide = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
MenuName = "Yi框架",
|
||||||
|
MenuType = MenuTypeEnum.Catalogue,
|
||||||
|
Router = "https://ccnetcore.com",
|
||||||
|
IsLink = true,
|
||||||
|
MenuIcon = "ri:at-line",
|
||||||
|
OrderNum = 90,
|
||||||
|
Component = null
|
||||||
|
};
|
||||||
|
entities.Add(guide);
|
||||||
|
|
||||||
|
//用户管理
|
||||||
|
MenuAggregateRoot user = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
MenuName = "用户管理",
|
||||||
|
PermissionCode = "system:user:list",
|
||||||
|
MenuType = MenuTypeEnum.Menu,
|
||||||
|
Router = "/system/user/index",
|
||||||
|
MenuIcon = "ri:admin-line",
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = system.Id,
|
||||||
|
RouterName = "SystemUser"
|
||||||
|
};
|
||||||
|
entities.Add(user);
|
||||||
|
|
||||||
|
MenuAggregateRoot userQuery = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "用户查询",
|
||||||
|
PermissionCode = "system:user:query",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = user.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(userQuery);
|
||||||
|
|
||||||
|
MenuAggregateRoot userAdd = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "用户新增",
|
||||||
|
PermissionCode = "system:user:add",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = user.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(userAdd);
|
||||||
|
|
||||||
|
MenuAggregateRoot userEdit = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "用户修改",
|
||||||
|
PermissionCode = "system:user:edit",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = user.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(userEdit);
|
||||||
|
|
||||||
|
MenuAggregateRoot userRemove = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "用户删除",
|
||||||
|
PermissionCode = "system:user:remove",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = user.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(userRemove);
|
||||||
|
|
||||||
|
|
||||||
|
MenuAggregateRoot userResetPwd = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "重置密码",
|
||||||
|
PermissionCode = "system:user:resetPwd",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = user.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(userResetPwd);
|
||||||
|
|
||||||
|
|
||||||
|
//角色管理
|
||||||
|
MenuAggregateRoot role = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "角色管理",
|
||||||
|
PermissionCode = "system:role:list",
|
||||||
|
MenuType = MenuTypeEnum.Menu,
|
||||||
|
Router = "/system/role/index",
|
||||||
|
MenuIcon = "ri:admin-fill",
|
||||||
|
OrderNum = 99,
|
||||||
|
ParentId = system.Id,
|
||||||
|
RouterName = "SystemRole"
|
||||||
|
};
|
||||||
|
entities.Add(role);
|
||||||
|
|
||||||
|
MenuAggregateRoot roleQuery = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "角色查询",
|
||||||
|
PermissionCode = "system:role:query",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = role.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(roleQuery);
|
||||||
|
|
||||||
|
MenuAggregateRoot roleAdd = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "角色新增",
|
||||||
|
PermissionCode = "system:role:add",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = role.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(roleAdd);
|
||||||
|
|
||||||
|
MenuAggregateRoot roleEdit = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "角色修改",
|
||||||
|
PermissionCode = "system:role:edit",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = role.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(roleEdit);
|
||||||
|
|
||||||
|
MenuAggregateRoot roleRemove = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "角色删除",
|
||||||
|
PermissionCode = "system:role:remove",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = role.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(roleRemove);
|
||||||
|
|
||||||
|
|
||||||
|
//菜单管理
|
||||||
|
MenuAggregateRoot menu = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "菜单管理",
|
||||||
|
PermissionCode = "system:menu:list",
|
||||||
|
MenuType = MenuTypeEnum.Menu,
|
||||||
|
Router = "/system/menu/index",
|
||||||
|
MenuIcon = "ep:menu",
|
||||||
|
OrderNum = 98,
|
||||||
|
ParentId = system.Id,
|
||||||
|
RouterName = "SystemMenu"
|
||||||
|
};
|
||||||
|
entities.Add(menu);
|
||||||
|
|
||||||
|
MenuAggregateRoot menuQuery = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "菜单查询",
|
||||||
|
PermissionCode = "system:menu:query",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = menu.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(menuQuery);
|
||||||
|
|
||||||
|
MenuAggregateRoot menuAdd = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "菜单新增",
|
||||||
|
PermissionCode = "system:menu:add",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = menu.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(menuAdd);
|
||||||
|
|
||||||
|
MenuAggregateRoot menuEdit = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "菜单修改",
|
||||||
|
PermissionCode = "system:menu:edit",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = menu.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(menuEdit);
|
||||||
|
|
||||||
|
MenuAggregateRoot menuRemove = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "菜单删除",
|
||||||
|
PermissionCode = "system:menu:remove",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = menu.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(menuRemove);
|
||||||
|
|
||||||
|
//部门管理
|
||||||
|
MenuAggregateRoot dept = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "部门管理",
|
||||||
|
PermissionCode = "system:dept:list",
|
||||||
|
MenuType = MenuTypeEnum.Menu,
|
||||||
|
Router = "/system/dept/index",
|
||||||
|
MenuIcon = "ri:git-branch-line",
|
||||||
|
OrderNum = 97,
|
||||||
|
ParentId = system.Id,
|
||||||
|
RouterName = "SystemDept"
|
||||||
|
};
|
||||||
|
entities.Add(dept);
|
||||||
|
|
||||||
|
MenuAggregateRoot deptQuery = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "部门查询",
|
||||||
|
PermissionCode = "system:dept:query",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = dept.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(deptQuery);
|
||||||
|
|
||||||
|
MenuAggregateRoot deptAdd = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "部门新增",
|
||||||
|
PermissionCode = "system:dept:add",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = dept.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(deptAdd);
|
||||||
|
|
||||||
|
MenuAggregateRoot deptEdit = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "部门修改",
|
||||||
|
PermissionCode = "system:dept:edit",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = dept.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(deptEdit);
|
||||||
|
|
||||||
|
MenuAggregateRoot deptRemove = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "部门删除",
|
||||||
|
PermissionCode = "system:dept:remove",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = dept.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(deptRemove);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//岗位管理
|
||||||
|
MenuAggregateRoot post = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "岗位管理",
|
||||||
|
PermissionCode = "system:post:list",
|
||||||
|
MenuType = MenuTypeEnum.Menu,
|
||||||
|
Router = "/system/post/index",
|
||||||
|
MenuIcon = "ant-design:deployment-unit-outlined",
|
||||||
|
OrderNum = 96,
|
||||||
|
ParentId = system.Id,
|
||||||
|
RouterName = "SystemPost"
|
||||||
|
};
|
||||||
|
entities.Add(post);
|
||||||
|
|
||||||
|
MenuAggregateRoot postQuery = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "岗位查询",
|
||||||
|
PermissionCode = "system:post:query",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = post.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(postQuery);
|
||||||
|
|
||||||
|
MenuAggregateRoot postAdd = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "岗位新增",
|
||||||
|
PermissionCode = "system:post:add",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = post.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(postAdd);
|
||||||
|
|
||||||
|
MenuAggregateRoot postEdit = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "岗位修改",
|
||||||
|
PermissionCode = "system:post:edit",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = post.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(postEdit);
|
||||||
|
|
||||||
|
MenuAggregateRoot postRemove = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "岗位删除",
|
||||||
|
PermissionCode = "system:post:remove",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = post.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(postRemove);
|
||||||
|
|
||||||
|
|
||||||
|
//操作日志
|
||||||
|
MenuAggregateRoot operationLog = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "操作日志",
|
||||||
|
PermissionCode = "monitor:operlog:list",
|
||||||
|
MenuType = MenuTypeEnum.Menu,
|
||||||
|
Router = "/monitor/operation-logs",
|
||||||
|
MenuIcon = "ri:history-fill",
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = monitoring.Id,
|
||||||
|
RouterName = "OperationLog",
|
||||||
|
Component = "monitor/logs/operation/index"
|
||||||
|
};
|
||||||
|
entities.Add(operationLog);
|
||||||
|
|
||||||
|
MenuAggregateRoot operationLogQuery = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "操作查询",
|
||||||
|
PermissionCode = "monitor:operlog:query",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = operationLog.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(operationLogQuery);
|
||||||
|
|
||||||
|
MenuAggregateRoot operationLogRemove = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "操作删除",
|
||||||
|
PermissionCode = "monitor:operlog:remove",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = operationLog.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(operationLogRemove);
|
||||||
|
|
||||||
|
|
||||||
|
//登录日志
|
||||||
|
MenuAggregateRoot loginLog = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "登录日志",
|
||||||
|
PermissionCode = "monitor:logininfor:list",
|
||||||
|
MenuType = MenuTypeEnum.Menu,
|
||||||
|
Router = "/monitor/login-logs",
|
||||||
|
IsShow = true,
|
||||||
|
IsLink = false,
|
||||||
|
IsCache = true,
|
||||||
|
Component = "monitor/logs/login/index",
|
||||||
|
MenuIcon = "ri:window-line",
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = monitoring.Id,
|
||||||
|
RouterName = "LoginLog",
|
||||||
|
};
|
||||||
|
entities.Add(loginLog);
|
||||||
|
|
||||||
|
MenuAggregateRoot loginLogQuery = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "登录查询",
|
||||||
|
PermissionCode = "monitor:logininfor:query",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = loginLog.Id,
|
||||||
|
IsDeleted = false
|
||||||
|
};
|
||||||
|
entities.Add(loginLogQuery);
|
||||||
|
|
||||||
|
MenuAggregateRoot loginLogRemove = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
|
{
|
||||||
|
|
||||||
|
MenuName = "登录删除",
|
||||||
|
PermissionCode = "monitor:logininfor:remove",
|
||||||
|
MenuType = MenuTypeEnum.Component,
|
||||||
|
OrderNum = 100,
|
||||||
|
ParentId = loginLog.Id,
|
||||||
|
IsDeleted = false,
|
||||||
|
|
||||||
|
};
|
||||||
|
entities.Add(loginLogRemove);
|
||||||
|
|
||||||
|
//默认值
|
||||||
|
entities.ForEach(m =>
|
||||||
|
{
|
||||||
|
m.IsDeleted = false;
|
||||||
|
m.State = true;
|
||||||
|
m.MenuSource = MenuSourceEnum.Pure;
|
||||||
|
m.IsShow = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
var p = entities.GroupBy(x => x.Id);
|
||||||
|
foreach (var k in p)
|
||||||
|
{
|
||||||
|
if (k.ToList().Count > 1)
|
||||||
|
{
|
||||||
|
Console.WriteLine("菜单id重复");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return entities;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,11 +7,11 @@ using Yi.Framework.SqlSugarCore.Abstractions;
|
|||||||
|
|
||||||
namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
|
namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
|
||||||
{
|
{
|
||||||
public class MenuDataSeed : IDataSeedContributor, ITransientDependency
|
public class MenuRuoYiDataSeed : IDataSeedContributor, ITransientDependency
|
||||||
{
|
{
|
||||||
private ISqlSugarRepository<MenuAggregateRoot> _repository;
|
private ISqlSugarRepository<MenuAggregateRoot> _repository;
|
||||||
private IGuidGenerator _guidGenerator;
|
private IGuidGenerator _guidGenerator;
|
||||||
public MenuDataSeed(ISqlSugarRepository<MenuAggregateRoot> repository, IGuidGenerator guidGenerator)
|
public MenuRuoYiDataSeed(ISqlSugarRepository<MenuAggregateRoot> repository, IGuidGenerator guidGenerator)
|
||||||
{
|
{
|
||||||
_repository = repository;
|
_repository = repository;
|
||||||
_guidGenerator = guidGenerator;
|
_guidGenerator = guidGenerator;
|
||||||
@@ -19,7 +19,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
|
|||||||
|
|
||||||
public async Task SeedAsync(DataSeedContext context)
|
public async Task SeedAsync(DataSeedContext context)
|
||||||
{
|
{
|
||||||
if (!await _repository.IsAnyAsync(x => x.MenuName == "系统管理"))
|
if (!await _repository.IsAnyAsync(x => x.MenuName == "系统管理"&&x.MenuSource==MenuSourceEnum.Ruoyi))
|
||||||
{
|
{
|
||||||
await _repository.InsertManyAsync(GetSeedData());
|
await _repository.InsertManyAsync(GetSeedData());
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
|
|||||||
IsLink = false,
|
IsLink = false,
|
||||||
MenuIcon = "build",
|
MenuIcon = "build",
|
||||||
OrderNum = 91,
|
OrderNum = 91,
|
||||||
IsDeleted = false
|
IsDeleted = false,
|
||||||
};
|
};
|
||||||
entities.Add(code);
|
entities.Add(code);
|
||||||
|
|
||||||
@@ -229,332 +229,332 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
|
|||||||
entities.Add(swagger);
|
entities.Add(swagger);
|
||||||
|
|
||||||
|
|
||||||
//ERP
|
// //ERP
|
||||||
MenuAggregateRoot erp = new MenuAggregateRoot(_guidGenerator.Create())
|
// MenuAggregateRoot erp = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
{
|
// {
|
||||||
MenuName = "ERP(待更新)",
|
// MenuName = "ERP(待更新)",
|
||||||
MenuType = MenuTypeEnum.Catalogue,
|
// MenuType = MenuTypeEnum.Catalogue,
|
||||||
Router = "/erp",
|
// Router = "/erp",
|
||||||
IsShow = true,
|
// IsShow = true,
|
||||||
IsLink = false,
|
// IsLink = false,
|
||||||
MenuIcon = "international",
|
// MenuIcon = "international",
|
||||||
OrderNum = 96,
|
// OrderNum = 96,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(erp);
|
// entities.Add(erp);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
//供应商定义
|
// //供应商定义
|
||||||
MenuAggregateRoot supplier = new MenuAggregateRoot(_guidGenerator.Create(), erp.Id)
|
// MenuAggregateRoot supplier = new MenuAggregateRoot(_guidGenerator.Create(), erp.Id)
|
||||||
{
|
// {
|
||||||
MenuName = "供应商定义",
|
// MenuName = "供应商定义",
|
||||||
PermissionCode = "erp:supplier:list",
|
// PermissionCode = "erp:supplier:list",
|
||||||
MenuType = MenuTypeEnum.Menu,
|
// MenuType = MenuTypeEnum.Menu,
|
||||||
Router = "supplier",
|
// Router = "supplier",
|
||||||
IsShow = true,
|
// IsShow = true,
|
||||||
IsLink = false,
|
// IsLink = false,
|
||||||
IsCache = true,
|
// IsCache = true,
|
||||||
Component = "erp/supplier/index",
|
// Component = "erp/supplier/index",
|
||||||
MenuIcon = "education",
|
// MenuIcon = "education",
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(supplier);
|
// entities.Add(supplier);
|
||||||
|
//
|
||||||
MenuAggregateRoot supplierQuery = new MenuAggregateRoot(_guidGenerator.Create(), supplier.Id)
|
// MenuAggregateRoot supplierQuery = new MenuAggregateRoot(_guidGenerator.Create(), supplier.Id)
|
||||||
{
|
// {
|
||||||
MenuName = "供应商查询",
|
// MenuName = "供应商查询",
|
||||||
PermissionCode = "erp:supplier:query",
|
// PermissionCode = "erp:supplier:query",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(supplierQuery);
|
// entities.Add(supplierQuery);
|
||||||
|
//
|
||||||
MenuAggregateRoot supplierAdd = new MenuAggregateRoot(_guidGenerator.Create(), supplier.Id)
|
// MenuAggregateRoot supplierAdd = new MenuAggregateRoot(_guidGenerator.Create(), supplier.Id)
|
||||||
{
|
// {
|
||||||
MenuName = "供应商新增",
|
// MenuName = "供应商新增",
|
||||||
PermissionCode = "erp:supplier:add",
|
// PermissionCode = "erp:supplier:add",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
|
//
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(supplierAdd);
|
// entities.Add(supplierAdd);
|
||||||
|
//
|
||||||
MenuAggregateRoot supplierEdit = new MenuAggregateRoot(_guidGenerator.Create(), supplier.Id)
|
// MenuAggregateRoot supplierEdit = new MenuAggregateRoot(_guidGenerator.Create(), supplier.Id)
|
||||||
{
|
// {
|
||||||
MenuName = "供应商修改",
|
// MenuName = "供应商修改",
|
||||||
PermissionCode = "erp:supplier:edit",
|
// PermissionCode = "erp:supplier:edit",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(supplierEdit);
|
// entities.Add(supplierEdit);
|
||||||
|
//
|
||||||
MenuAggregateRoot supplierRemove = new MenuAggregateRoot(_guidGenerator.Create(), supplier.Id)
|
// MenuAggregateRoot supplierRemove = new MenuAggregateRoot(_guidGenerator.Create(), supplier.Id)
|
||||||
{
|
// {
|
||||||
MenuName = "供应商删除",
|
// MenuName = "供应商删除",
|
||||||
PermissionCode = "erp:supplier:remove",
|
// PermissionCode = "erp:supplier:remove",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(supplierRemove);
|
// entities.Add(supplierRemove);
|
||||||
|
//
|
||||||
|
//
|
||||||
//仓库定义
|
// //仓库定义
|
||||||
MenuAggregateRoot warehouse = new MenuAggregateRoot(_guidGenerator.Create(), erp.Id)
|
// MenuAggregateRoot warehouse = new MenuAggregateRoot(_guidGenerator.Create(), erp.Id)
|
||||||
{
|
// {
|
||||||
MenuName = "仓库定义",
|
// MenuName = "仓库定义",
|
||||||
PermissionCode = "erp:warehouse:list",
|
// PermissionCode = "erp:warehouse:list",
|
||||||
MenuType = MenuTypeEnum.Menu,
|
// MenuType = MenuTypeEnum.Menu,
|
||||||
Router = "warehouse",
|
// Router = "warehouse",
|
||||||
IsShow = true,
|
// IsShow = true,
|
||||||
IsLink = false,
|
// IsLink = false,
|
||||||
IsCache = true,
|
// IsCache = true,
|
||||||
Component = "erp/warehouse/index",
|
// Component = "erp/warehouse/index",
|
||||||
MenuIcon = "education",
|
// MenuIcon = "education",
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(warehouse);
|
// entities.Add(warehouse);
|
||||||
|
//
|
||||||
MenuAggregateRoot warehouseQuery = new MenuAggregateRoot(_guidGenerator.Create(), warehouse.Id)
|
// MenuAggregateRoot warehouseQuery = new MenuAggregateRoot(_guidGenerator.Create(), warehouse.Id)
|
||||||
{
|
// {
|
||||||
MenuName = "仓库查询",
|
// MenuName = "仓库查询",
|
||||||
PermissionCode = "erp:warehouse:query",
|
// PermissionCode = "erp:warehouse:query",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
ParentId = warehouse.Id,
|
// ParentId = warehouse.Id,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(warehouseQuery);
|
// entities.Add(warehouseQuery);
|
||||||
|
//
|
||||||
MenuAggregateRoot warehouseAdd = new MenuAggregateRoot(_guidGenerator.Create(), warehouse.Id)
|
// MenuAggregateRoot warehouseAdd = new MenuAggregateRoot(_guidGenerator.Create(), warehouse.Id)
|
||||||
{
|
// {
|
||||||
MenuName = "仓库新增",
|
// MenuName = "仓库新增",
|
||||||
PermissionCode = "erp:warehouse:add",
|
// PermissionCode = "erp:warehouse:add",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(warehouseAdd);
|
// entities.Add(warehouseAdd);
|
||||||
|
//
|
||||||
MenuAggregateRoot warehouseEdit = new MenuAggregateRoot(_guidGenerator.Create(), warehouse.Id)
|
// MenuAggregateRoot warehouseEdit = new MenuAggregateRoot(_guidGenerator.Create(), warehouse.Id)
|
||||||
{
|
// {
|
||||||
MenuName = "仓库修改",
|
// MenuName = "仓库修改",
|
||||||
PermissionCode = "erp:warehouse:edit",
|
// PermissionCode = "erp:warehouse:edit",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(warehouseEdit);
|
// entities.Add(warehouseEdit);
|
||||||
|
//
|
||||||
MenuAggregateRoot warehouseRemove = new MenuAggregateRoot(_guidGenerator.Create(), warehouse.Id)
|
// MenuAggregateRoot warehouseRemove = new MenuAggregateRoot(_guidGenerator.Create(), warehouse.Id)
|
||||||
{
|
// {
|
||||||
MenuName = "仓库删除",
|
// MenuName = "仓库删除",
|
||||||
PermissionCode = "erp:warehouse:remove",
|
// PermissionCode = "erp:warehouse:remove",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(warehouseRemove);
|
// entities.Add(warehouseRemove);
|
||||||
|
//
|
||||||
|
//
|
||||||
//单位定义
|
// //单位定义
|
||||||
MenuAggregateRoot unit = new MenuAggregateRoot(_guidGenerator.Create(), erp.Id)
|
// MenuAggregateRoot unit = new MenuAggregateRoot(_guidGenerator.Create(), erp.Id)
|
||||||
{
|
// {
|
||||||
MenuName = "单位定义",
|
// MenuName = "单位定义",
|
||||||
PermissionCode = "erp:unit:list",
|
// PermissionCode = "erp:unit:list",
|
||||||
MenuType = MenuTypeEnum.Menu,
|
// MenuType = MenuTypeEnum.Menu,
|
||||||
Router = "unit",
|
// Router = "unit",
|
||||||
IsShow = true,
|
// IsShow = true,
|
||||||
IsLink = false,
|
// IsLink = false,
|
||||||
IsCache = true,
|
// IsCache = true,
|
||||||
Component = "erp/unit/index",
|
// Component = "erp/unit/index",
|
||||||
MenuIcon = "education",
|
// MenuIcon = "education",
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(unit);
|
// entities.Add(unit);
|
||||||
|
//
|
||||||
MenuAggregateRoot unitQuery = new MenuAggregateRoot(_guidGenerator.Create(), unit.Id)
|
// MenuAggregateRoot unitQuery = new MenuAggregateRoot(_guidGenerator.Create(), unit.Id)
|
||||||
{
|
// {
|
||||||
MenuName = "单位查询",
|
// MenuName = "单位查询",
|
||||||
PermissionCode = "erp:unit:query",
|
// PermissionCode = "erp:unit:query",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(unitQuery);
|
// entities.Add(unitQuery);
|
||||||
|
//
|
||||||
MenuAggregateRoot unitAdd = new MenuAggregateRoot(_guidGenerator.Create(), unit.Id)
|
// MenuAggregateRoot unitAdd = new MenuAggregateRoot(_guidGenerator.Create(), unit.Id)
|
||||||
{
|
// {
|
||||||
MenuName = "单位新增",
|
// MenuName = "单位新增",
|
||||||
PermissionCode = "erp:unit:add",
|
// PermissionCode = "erp:unit:add",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(unitAdd);
|
// entities.Add(unitAdd);
|
||||||
|
//
|
||||||
MenuAggregateRoot unitEdit = new MenuAggregateRoot(_guidGenerator.Create(), unit.Id)
|
// MenuAggregateRoot unitEdit = new MenuAggregateRoot(_guidGenerator.Create(), unit.Id)
|
||||||
{
|
// {
|
||||||
MenuName = "单位修改",
|
// MenuName = "单位修改",
|
||||||
PermissionCode = "erp:unit:edit",
|
// PermissionCode = "erp:unit:edit",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(unitEdit);
|
// entities.Add(unitEdit);
|
||||||
|
//
|
||||||
MenuAggregateRoot unitRemove = new MenuAggregateRoot(_guidGenerator.Create(), unit.Id)
|
// MenuAggregateRoot unitRemove = new MenuAggregateRoot(_guidGenerator.Create(), unit.Id)
|
||||||
{
|
// {
|
||||||
MenuName = "单位删除",
|
// MenuName = "单位删除",
|
||||||
PermissionCode = "erp:unit:remove",
|
// PermissionCode = "erp:unit:remove",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(unitRemove);
|
// entities.Add(unitRemove);
|
||||||
|
//
|
||||||
|
//
|
||||||
//物料定义
|
// //物料定义
|
||||||
MenuAggregateRoot material = new MenuAggregateRoot(_guidGenerator.Create())
|
// MenuAggregateRoot material = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
{
|
// {
|
||||||
|
//
|
||||||
MenuName = "物料定义",
|
// MenuName = "物料定义",
|
||||||
PermissionCode = "erp:material:list",
|
// PermissionCode = "erp:material:list",
|
||||||
MenuType = MenuTypeEnum.Menu,
|
// MenuType = MenuTypeEnum.Menu,
|
||||||
Router = "material",
|
// Router = "material",
|
||||||
IsShow = true,
|
// IsShow = true,
|
||||||
IsLink = false,
|
// IsLink = false,
|
||||||
IsCache = true,
|
// IsCache = true,
|
||||||
Component = "erp/material/index",
|
// Component = "erp/material/index",
|
||||||
MenuIcon = "education",
|
// MenuIcon = "education",
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
ParentId = erp.Id,
|
// ParentId = erp.Id,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(material);
|
// entities.Add(material);
|
||||||
|
//
|
||||||
MenuAggregateRoot materialQuery = new MenuAggregateRoot(_guidGenerator.Create())
|
// MenuAggregateRoot materialQuery = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
{
|
// {
|
||||||
|
//
|
||||||
MenuName = "物料查询",
|
// MenuName = "物料查询",
|
||||||
PermissionCode = "erp:material:query",
|
// PermissionCode = "erp:material:query",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
ParentId = material.Id,
|
// ParentId = material.Id,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(materialQuery);
|
// entities.Add(materialQuery);
|
||||||
|
//
|
||||||
MenuAggregateRoot materialAdd = new MenuAggregateRoot(_guidGenerator.Create())
|
// MenuAggregateRoot materialAdd = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
{
|
// {
|
||||||
|
//
|
||||||
MenuName = "物料新增",
|
// MenuName = "物料新增",
|
||||||
PermissionCode = "erp:material:add",
|
// PermissionCode = "erp:material:add",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
ParentId = material.Id,
|
// ParentId = material.Id,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(materialAdd);
|
// entities.Add(materialAdd);
|
||||||
|
//
|
||||||
MenuAggregateRoot materialEdit = new MenuAggregateRoot(_guidGenerator.Create())
|
// MenuAggregateRoot materialEdit = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
{
|
// {
|
||||||
|
//
|
||||||
MenuName = "物料修改",
|
// MenuName = "物料修改",
|
||||||
PermissionCode = "erp:material:edit",
|
// PermissionCode = "erp:material:edit",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
ParentId = material.Id,
|
// ParentId = material.Id,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(materialEdit);
|
// entities.Add(materialEdit);
|
||||||
|
//
|
||||||
MenuAggregateRoot materialRemove = new MenuAggregateRoot(_guidGenerator.Create())
|
// MenuAggregateRoot materialRemove = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
{
|
// {
|
||||||
|
//
|
||||||
MenuName = "物料删除",
|
// MenuName = "物料删除",
|
||||||
PermissionCode = "erp:material:remove",
|
// PermissionCode = "erp:material:remove",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
ParentId = material.Id,
|
// ParentId = material.Id,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(materialRemove);
|
// entities.Add(materialRemove);
|
||||||
|
//
|
||||||
|
//
|
||||||
//采购订单
|
// //采购订单
|
||||||
MenuAggregateRoot purchase = new MenuAggregateRoot(_guidGenerator.Create())
|
// MenuAggregateRoot purchase = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
{
|
// {
|
||||||
|
//
|
||||||
MenuName = "采购订单",
|
// MenuName = "采购订单",
|
||||||
PermissionCode = "erp:purchase:list",
|
// PermissionCode = "erp:purchase:list",
|
||||||
MenuType = MenuTypeEnum.Menu,
|
// MenuType = MenuTypeEnum.Menu,
|
||||||
Router = "purchase",
|
// Router = "purchase",
|
||||||
IsShow = true,
|
// IsShow = true,
|
||||||
IsLink = false,
|
// IsLink = false,
|
||||||
IsCache = true,
|
// IsCache = true,
|
||||||
Component = "erp/purchase/index",
|
// Component = "erp/purchase/index",
|
||||||
MenuIcon = "education",
|
// MenuIcon = "education",
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
ParentId = erp.Id,
|
// ParentId = erp.Id,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(purchase);
|
// entities.Add(purchase);
|
||||||
|
//
|
||||||
MenuAggregateRoot purchaseQuery = new MenuAggregateRoot(_guidGenerator.Create())
|
// MenuAggregateRoot purchaseQuery = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
{
|
// {
|
||||||
|
//
|
||||||
MenuName = "采购订单查询",
|
// MenuName = "采购订单查询",
|
||||||
PermissionCode = "erp:purchase:query",
|
// PermissionCode = "erp:purchase:query",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
ParentId = purchase.Id,
|
// ParentId = purchase.Id,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(purchaseQuery);
|
// entities.Add(purchaseQuery);
|
||||||
|
//
|
||||||
MenuAggregateRoot purchaseAdd = new MenuAggregateRoot(_guidGenerator.Create())
|
// MenuAggregateRoot purchaseAdd = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
{
|
// {
|
||||||
|
//
|
||||||
MenuName = "采购订单新增",
|
// MenuName = "采购订单新增",
|
||||||
PermissionCode = "erp:purchase:add",
|
// PermissionCode = "erp:purchase:add",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
ParentId = purchase.Id,
|
// ParentId = purchase.Id,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(purchaseAdd);
|
// entities.Add(purchaseAdd);
|
||||||
|
//
|
||||||
MenuAggregateRoot purchaseEdit = new MenuAggregateRoot(_guidGenerator.Create())
|
// MenuAggregateRoot purchaseEdit = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
{
|
// {
|
||||||
|
//
|
||||||
MenuName = "采购订单修改",
|
// MenuName = "采购订单修改",
|
||||||
PermissionCode = "erp:purchase:edit",
|
// PermissionCode = "erp:purchase:edit",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
ParentId = purchase.Id,
|
// ParentId = purchase.Id,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(purchaseEdit);
|
// entities.Add(purchaseEdit);
|
||||||
|
//
|
||||||
MenuAggregateRoot purchaseRemove = new MenuAggregateRoot(_guidGenerator.Create())
|
// MenuAggregateRoot purchaseRemove = new MenuAggregateRoot(_guidGenerator.Create())
|
||||||
{
|
// {
|
||||||
|
//
|
||||||
MenuName = "采购订单删除",
|
// MenuName = "采购订单删除",
|
||||||
PermissionCode = "erp:purchase:remove",
|
// PermissionCode = "erp:purchase:remove",
|
||||||
MenuType = MenuTypeEnum.Component,
|
// MenuType = MenuTypeEnum.Component,
|
||||||
OrderNum = 100,
|
// OrderNum = 100,
|
||||||
ParentId = purchase.Id,
|
// ParentId = purchase.Id,
|
||||||
IsDeleted = false
|
// IsDeleted = false
|
||||||
};
|
// };
|
||||||
entities.Add(purchaseRemove);
|
// entities.Add(purchaseRemove);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -564,7 +564,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
|
|||||||
|
|
||||||
MenuName = "Yi框架",
|
MenuName = "Yi框架",
|
||||||
MenuType = MenuTypeEnum.Catalogue,
|
MenuType = MenuTypeEnum.Catalogue,
|
||||||
Router = "https://gitee.com/ccnetcore/yi",
|
Router = "https://ccnetcore.com",
|
||||||
IsShow = true,
|
IsShow = true,
|
||||||
IsLink = true,
|
IsLink = true,
|
||||||
MenuIcon = "guide",
|
MenuIcon = "guide",
|
||||||
@@ -1317,6 +1317,8 @@ namespace Yi.Framework.Rbac.SqlSugarCore.DataSeeds
|
|||||||
{
|
{
|
||||||
m.IsDeleted = false;
|
m.IsDeleted = false;
|
||||||
m.State = true;
|
m.State = true;
|
||||||
|
m.MenuSource = MenuSourceEnum.Ruoyi;
|
||||||
|
m.IsShow = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
var p = entities.GroupBy(x => x.Id);
|
var p = entities.GroupBy(x => x.Id);
|
||||||
@@ -7,6 +7,72 @@ import { system, monitor } from "@/router/enums";
|
|||||||
* admin:管理员角色
|
* admin:管理员角色
|
||||||
* common:普通角色
|
* common:普通角色
|
||||||
*/
|
*/
|
||||||
|
const testRouter = [
|
||||||
|
{
|
||||||
|
id: "906c8094-21a1-1042-f151-3a14dab3cadb",
|
||||||
|
parentId: "00000000-0000-0000-0000-000000000000",
|
||||||
|
path: "/monitor",
|
||||||
|
name: null,
|
||||||
|
meta: {
|
||||||
|
icon: "menus.pureSysMonitor",
|
||||||
|
title: "系统监控",
|
||||||
|
component: null,
|
||||||
|
roles: null,
|
||||||
|
auths: [null],
|
||||||
|
frameSrc: null,
|
||||||
|
frameLoading: null,
|
||||||
|
keepAlive: null,
|
||||||
|
showLink: true
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
id: "c765691a-32e4-4e88-6e8a-3a14dab3cadb",
|
||||||
|
parentId: "906c8094-21a1-1042-f151-3a14dab3cadb",
|
||||||
|
path: "/monitor/online-user",
|
||||||
|
name: "OnlineUser",
|
||||||
|
meta: {
|
||||||
|
icon: "ri:user-voice-line",
|
||||||
|
title: "在线用户",
|
||||||
|
component: null,
|
||||||
|
roles: null,
|
||||||
|
auths: ["monitor:online:list"],
|
||||||
|
frameSrc: null,
|
||||||
|
frameLoading: null,
|
||||||
|
keepAlive: null,
|
||||||
|
showLink: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/monitor/operation-logs",
|
||||||
|
name: "OperationLog",
|
||||||
|
meta: {
|
||||||
|
icon: "ri:history-fill",
|
||||||
|
title: "操作日志",
|
||||||
|
component: "monitor/logs/operation/index",
|
||||||
|
showLink: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "580a7b97-15ab-6d43-d011-3a14dab3cadc",
|
||||||
|
parentId: "906c8094-21a1-1042-f151-3a14dab3cadb",
|
||||||
|
path: "/monitor/login-logs",
|
||||||
|
name: "LoginLog",
|
||||||
|
meta: {
|
||||||
|
icon: "ri:window-line",
|
||||||
|
title: "登录日志",
|
||||||
|
component: "monitor/logs/login/index",
|
||||||
|
roles: null,
|
||||||
|
auths: ["monitor:logininfor:list"],
|
||||||
|
frameSrc: null,
|
||||||
|
frameLoading: null,
|
||||||
|
keepAlive: null,
|
||||||
|
showLink: true
|
||||||
|
},
|
||||||
|
children: null
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
const systemManagementRouter = {
|
const systemManagementRouter = {
|
||||||
path: "/system",
|
path: "/system",
|
||||||
@@ -334,6 +400,7 @@ export default defineFakeRoute([
|
|||||||
url: `/dev-api/get-async-routes`,
|
url: `/dev-api/get-async-routes`,
|
||||||
method: "get",
|
method: "get",
|
||||||
response: () => {
|
response: () => {
|
||||||
|
return testRouter;
|
||||||
return [
|
return [
|
||||||
systemManagementRouter,
|
systemManagementRouter,
|
||||||
systemMonitorRouter
|
systemMonitorRouter
|
||||||
|
|||||||
24
Yi.Pure.Vue3/publish.bat
Normal file
24
Yi.Pure.Vue3/publish.bat
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
@echo on
|
||||||
|
|
||||||
|
set SERVER_USER=root
|
||||||
|
set SERVER_IP=ccnetcore.com
|
||||||
|
set FILE_PATH=publish_pure_02.zip
|
||||||
|
set REMOTE_PATH=/home/yi/build/publish_pure_02.zip
|
||||||
|
set REMOTE_COMMAND="cd /home/yi/pure&&pwd&&unzip -o /home/yi/build/publish_pure_02.zip -d ./"
|
||||||
|
set sevenzip_Path="D:\Program Files\7-Zip\7z.exe"
|
||||||
|
|
||||||
|
echo start
|
||||||
|
echo 1-build-start
|
||||||
|
:: npm run build
|
||||||
|
echo 1-build-end
|
||||||
|
echo 2-zip-start
|
||||||
|
|
||||||
|
%sevenzip_Path% a ./publish_pure_02.zip ./dist/*
|
||||||
|
:: tar -cvf publish_bbs_02.zip -C "dist" "*"
|
||||||
|
echo 2-zip-end
|
||||||
|
echo 3-publish-start
|
||||||
|
scp %FILE_PATH% %SERVER_USER%@%SERVER_IP%:%REMOTE_PATH%
|
||||||
|
ssh %SERVER_USER%@%SERVER_IP% %REMOTE_COMMAND%
|
||||||
|
echo 3-publish-end
|
||||||
|
echo end
|
||||||
|
pause
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
import { http } from "@/utils/http";
|
import { http } from "@/utils/http";
|
||||||
|
import type { Result } from "@/api/result";
|
||||||
type Result = {
|
|
||||||
success: boolean;
|
|
||||||
data: Array<any>;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const getAsyncRoutes = () => {
|
export const getAsyncRoutes = () => {
|
||||||
return http.request<Result>("get", "/get-async-routes");
|
return http.request<Result>("get", "/get-async-routes");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getRoutes = () => {
|
||||||
|
return http.request<Result>("get", "/account/Vue3Router/pure");
|
||||||
|
};
|
||||||
|
|||||||
@@ -1,52 +0,0 @@
|
|||||||
import { http } from "@/utils/http";
|
|
||||||
import type { Result, ResultList, ResultPage } from "./result.ts";
|
|
||||||
|
|
||||||
/** 新增角色 */
|
|
||||||
export const addRole = (data: any) => {
|
|
||||||
return http.request<Result>("post", `/role`, { data });
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 获取系统管理-角色管理列表 */
|
|
||||||
export const getRoleList = (data?: object) => {
|
|
||||||
return http.request<ResultPage>("post", "/role", { data });
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 获取系统管理-菜单管理列表 */
|
|
||||||
export const getMenuList = (data?: object) => {
|
|
||||||
return http.request<Result>("post", "/menu", { data });
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 获取系统监控-在线用户列表 */
|
|
||||||
export const getOnlineLogsList = (data?: object) => {
|
|
||||||
return http.request<ResultPage>("post", "/online-logs", { data });
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 获取系统监控-登录日志列表 */
|
|
||||||
export const getLoginLogsList = (data?: object) => {
|
|
||||||
return http.request<ResultPage>("post", "/login-logs", { data });
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 获取系统监控-操作日志列表 */
|
|
||||||
export const getOperationLogsList = (data?: object) => {
|
|
||||||
return http.request<ResultPage>("post", "/operation-logs", { data });
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 获取系统监控-系统日志列表 */
|
|
||||||
export const getSystemLogsList = (data?: object) => {
|
|
||||||
return http.request<ResultPage>("post", "/system-logs", { data });
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 获取系统监控-系统日志-根据 id 查日志详情 */
|
|
||||||
export const getSystemLogsDetail = (data?: object) => {
|
|
||||||
return http.request<ResultList>("post", "/system-logs-detail", { data });
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 获取角色管理-权限-菜单权限 */
|
|
||||||
export const getRoleMenu = (data?: object) => {
|
|
||||||
return http.request<ResultList>("post", "/role-menu", { data });
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 获取角色管理-权限-菜单权限-根据角色 id 查对应菜单 */
|
|
||||||
export const getRoleMenuIds = (data?: object) => {
|
|
||||||
return http.request<ResultList>("post", "/role-menu-ids", { data });
|
|
||||||
};
|
|
||||||
@@ -27,7 +27,8 @@ const IFrame = () => import("@/layout/frame.vue");
|
|||||||
const modulesRoutes = import.meta.glob("/src/views/**/*.{vue,tsx}");
|
const modulesRoutes = import.meta.glob("/src/views/**/*.{vue,tsx}");
|
||||||
|
|
||||||
// 动态路由
|
// 动态路由
|
||||||
import { getAsyncRoutes } from "@/api/routes";
|
// getAsyncRoutes
|
||||||
|
import { getRoutes } from "@/api/routes";
|
||||||
|
|
||||||
function handRank(routeInfo: any) {
|
function handRank(routeInfo: any) {
|
||||||
const { name, path, parentId, meta } = routeInfo;
|
const { name, path, parentId, meta } = routeInfo;
|
||||||
@@ -202,7 +203,7 @@ function initRouter() {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
getAsyncRoutes().then(({ data }) => {
|
getRoutes().then(({ data }) => {
|
||||||
handleAsyncRoutes(cloneDeep(data));
|
handleAsyncRoutes(cloneDeep(data));
|
||||||
storageLocal().setItem(key, data);
|
storageLocal().setItem(key, data);
|
||||||
resolve(router);
|
resolve(router);
|
||||||
@@ -211,7 +212,7 @@ function initRouter() {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
getAsyncRoutes().then(({ data }) => {
|
getRoutes().then(({ data }) => {
|
||||||
handleAsyncRoutes(cloneDeep(data));
|
handleAsyncRoutes(cloneDeep(data));
|
||||||
resolve(router);
|
resolve(router);
|
||||||
});
|
});
|
||||||
@@ -303,6 +304,9 @@ function addAsyncRoutes(arrRoutes: Array<RouteRecordRaw>) {
|
|||||||
if (!arrRoutes || !arrRoutes.length) return;
|
if (!arrRoutes || !arrRoutes.length) return;
|
||||||
const modulesRoutesKeys = Object.keys(modulesRoutes);
|
const modulesRoutesKeys = Object.keys(modulesRoutes);
|
||||||
arrRoutes.forEach((v: RouteRecordRaw) => {
|
arrRoutes.forEach((v: RouteRecordRaw) => {
|
||||||
|
if (v.children == null) {
|
||||||
|
v.children = undefined;
|
||||||
|
}
|
||||||
// 将backstage属性加入meta,标识此路由为后端返回路由
|
// 将backstage属性加入meta,标识此路由为后端返回路由
|
||||||
v.meta.backstage = true;
|
v.meta.backstage = true;
|
||||||
// 父级的redirect属性取值:如果子级存在且父级的redirect属性不存在,默认取第一个子级的path;如果子级存在且父级的redirect属性存在,取存在的redirect属性,会覆盖默认值
|
// 父级的redirect属性取值:如果子级存在且父级的redirect属性不存在,默认取第一个子级的path;如果子级存在且父级的redirect属性存在,取存在的redirect属性,会覆盖默认值
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
getLogin,
|
getLogin,
|
||||||
getUserInfo,
|
getUserInfo,
|
||||||
refreshTokenApi
|
refreshTokenApi
|
||||||
} from "@/api/user";
|
} from "@/api/account";
|
||||||
import { useMultiTagsStoreHook } from "./multiTags";
|
import { useMultiTagsStoreHook } from "./multiTags";
|
||||||
import { type DataInfo, setToken, removeToken, userKey } from "@/utils/auth";
|
import { type DataInfo, setToken, removeToken, userKey } from "@/utils/auth";
|
||||||
|
|
||||||
|
|||||||
@@ -19,12 +19,11 @@ import LoginQrCode from "./components/LoginQrCode.vue";
|
|||||||
import { useUserStoreHook } from "@/store/modules/user";
|
import { useUserStoreHook } from "@/store/modules/user";
|
||||||
import { initRouter, getTopMenu } from "@/router/utils";
|
import { initRouter, getTopMenu } from "@/router/utils";
|
||||||
import { bg, avatar, illustration } from "./utils/static";
|
import { bg, avatar, illustration } from "./utils/static";
|
||||||
import { ReImageVerify } from "@/components/ReImageVerify";
|
|
||||||
import { ref, toRaw, reactive, watch, computed } from "vue";
|
import { ref, toRaw, reactive, watch, computed } from "vue";
|
||||||
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||||
import { useTranslationLang } from "@/layout/hooks/useTranslationLang";
|
import { useTranslationLang } from "@/layout/hooks/useTranslationLang";
|
||||||
import { useDataThemeChange } from "@/layout/hooks/useDataThemeChange";
|
import { useDataThemeChange } from "@/layout/hooks/useDataThemeChange";
|
||||||
import { getCodeImg } from "@/api/user";
|
import { getCodeImg } from "@/api/account";
|
||||||
|
|
||||||
import dayIcon from "@/assets/svg/day.svg?component";
|
import dayIcon from "@/assets/svg/day.svg?component";
|
||||||
import darkIcon from "@/assets/svg/dark.svg?component";
|
import darkIcon from "@/assets/svg/dark.svg?component";
|
||||||
@@ -59,8 +58,8 @@ const { title, getDropdownItemStyle, getDropdownItemClass } = useNav();
|
|||||||
const { locale, translationCh, translationEn } = useTranslationLang();
|
const { locale, translationCh, translationEn } = useTranslationLang();
|
||||||
|
|
||||||
const ruleForm = reactive({
|
const ruleForm = reactive({
|
||||||
username: "cc",
|
username: "",
|
||||||
password: "123456",
|
password: "",
|
||||||
verifyCode: "",
|
verifyCode: "",
|
||||||
uuid: ""
|
uuid: ""
|
||||||
});
|
});
|
||||||
@@ -101,7 +100,7 @@ const onLogin = async (formEl: FormInstance | undefined) => {
|
|||||||
message(t("login.pureLoginFail"), { type: "error" });
|
message(t("login.pureLoginFail"), { type: "error" });
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(() => {
|
||||||
getCode();
|
getCode();
|
||||||
})
|
})
|
||||||
.finally(() => (loading.value = false));
|
.finally(() => (loading.value = false));
|
||||||
@@ -138,7 +137,7 @@ getCode();
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="select-none">
|
<div class="select-none">
|
||||||
<img :src="bg" class="wave" />
|
<img :src="bg" class="wave" alt="" />
|
||||||
<div class="flex-c absolute right-5 top-3">
|
<div class="flex-c absolute right-5 top-3">
|
||||||
<!-- 主题 -->
|
<!-- 主题 -->
|
||||||
<el-switch
|
<el-switch
|
||||||
|
|||||||
@@ -42,12 +42,12 @@ const dataList = ref([
|
|||||||
{
|
{
|
||||||
title: "响应体",
|
title: "响应体",
|
||||||
name: "requestResult",
|
name: "requestResult",
|
||||||
data: (props.data[0] as any).requestResult
|
data: (props.data[0] as any)?.requestResult
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "请求体",
|
title: "请求体",
|
||||||
name: "requestParam",
|
name: "requestParam",
|
||||||
data: (props.data[0] as any).requestParam
|
data: (props.data[0] as any)?.requestParam
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import Detail from "../detail.vue";
|
|
||||||
import { message } from "@/utils/message";
|
import { message } from "@/utils/message";
|
||||||
import { addDialog } from "@/components/ReDialog";
|
|
||||||
import type { PaginationProps } from "@pureadmin/table";
|
import type { PaginationProps } from "@pureadmin/table";
|
||||||
import { type Ref, reactive, ref, onMounted, toRaw } from "vue";
|
import { type Ref, reactive, ref, onMounted } from "vue";
|
||||||
import { getKeyList, useCopyToClipboard } from "@pureadmin/utils";
|
import { getKeyList, useCopyToClipboard } from "@pureadmin/utils";
|
||||||
import { getSystemLogsList, getSystemLogsDetail } from "@/api/system";
|
|
||||||
import Info from "@iconify-icons/ri/question-line";
|
import Info from "@iconify-icons/ri/question-line";
|
||||||
|
|
||||||
export function useRole(tableRef: Ref) {
|
export function useRole(tableRef: Ref) {
|
||||||
@@ -189,28 +186,29 @@ export function useRole(tableRef: Ref) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onDetail(row) {
|
function onDetail(row) {
|
||||||
getSystemLogsDetail({ id: row.id }).then(res => {
|
console.log(row);
|
||||||
addDialog({
|
// getSystemLogsDetail({ id: row.id }).then(res => {
|
||||||
title: "系统日志详情",
|
// addDialog({
|
||||||
fullscreen: true,
|
// title: "系统日志详情",
|
||||||
hideFooter: true,
|
// fullscreen: true,
|
||||||
contentRenderer: () => Detail,
|
// hideFooter: true,
|
||||||
props: {
|
// contentRenderer: () => Detail,
|
||||||
data: [res]
|
// props: {
|
||||||
}
|
// data: [res]
|
||||||
});
|
// }
|
||||||
});
|
// });
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onSearch() {
|
async function onSearch() {
|
||||||
loading.value = true;
|
// loading.value = true;
|
||||||
const { data } = await getSystemLogsList(toRaw(form));
|
// const { data } = await getSystemLogsList(toRaw(form));
|
||||||
dataList.value = data.items;
|
// dataList.value = data.items;
|
||||||
pagination.total = data.totalCount;
|
// pagination.total = data.totalCount;
|
||||||
|
//
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
loading.value = false;
|
// loading.value = false;
|
||||||
}, 500);
|
// }, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
const resetForm = formEl => {
|
const resetForm = formEl => {
|
||||||
|
|||||||
@@ -28,11 +28,13 @@ const props = withDefaults(defineProps<FormProps>(), {
|
|||||||
router: "",
|
router: "",
|
||||||
component: "",
|
component: "",
|
||||||
orderNum: 0,
|
orderNum: 0,
|
||||||
icon: "",
|
menuIcon: "",
|
||||||
permissionCode: "",
|
permissionCode: "",
|
||||||
isShow: true,
|
isShow: true,
|
||||||
isLink: false,
|
isLink: false,
|
||||||
state: true
|
state: true,
|
||||||
|
routerName: "",
|
||||||
|
menuSource: "Pure"
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -93,7 +95,7 @@ defineExpose({ getRef });
|
|||||||
:sm="24"
|
:sm="24"
|
||||||
>
|
>
|
||||||
<el-form-item label="菜单图标">
|
<el-form-item label="菜单图标">
|
||||||
<IconSelect v-model="newFormInline.icon" class="w-full" />
|
<IconSelect v-model="newFormInline.menuIcon" class="w-full" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</re-col>
|
</re-col>
|
||||||
<re-col :value="12" :xs="24" :sm="24">
|
<re-col :value="12" :xs="24" :sm="24">
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ import { menuTypeOptions } from "@/views/system/menu/utils/enums";
|
|||||||
|
|
||||||
export function useMenu() {
|
export function useMenu() {
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
menuName: ""
|
menuName: "",
|
||||||
|
menuSource: "Pure"
|
||||||
});
|
});
|
||||||
|
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
@@ -44,7 +45,7 @@ export function useMenu() {
|
|||||||
cellRenderer: ({ row }) => (
|
cellRenderer: ({ row }) => (
|
||||||
<>
|
<>
|
||||||
<span class="inline-block mr-1">
|
<span class="inline-block mr-1">
|
||||||
{h(useRenderIcon(row.icon), {
|
{h(useRenderIcon(row.menuIcon), {
|
||||||
style: { paddingTop: "1px" }
|
style: { paddingTop: "1px" }
|
||||||
})}
|
})}
|
||||||
</span>
|
</span>
|
||||||
@@ -137,7 +138,7 @@ export function useMenu() {
|
|||||||
async function openDialog(title = "新增", row?: FormItemProps) {
|
async function openDialog(title = "新增", row?: FormItemProps) {
|
||||||
let data: any = null;
|
let data: any = null;
|
||||||
if (title == "修改") {
|
if (title == "修改") {
|
||||||
data = await getMenu(row.id);
|
data = (await getMenu(row.id)).data;
|
||||||
}
|
}
|
||||||
addDialog({
|
addDialog({
|
||||||
title: `${title}菜单`,
|
title: `${title}菜单`,
|
||||||
@@ -156,11 +157,13 @@ export function useMenu() {
|
|||||||
router: data?.router ?? "",
|
router: data?.router ?? "",
|
||||||
component: data?.component ?? "",
|
component: data?.component ?? "",
|
||||||
orderNum: data?.orderNum ?? 0,
|
orderNum: data?.orderNum ?? 0,
|
||||||
icon: data?.icon ?? "",
|
menuIcon: data?.menuIcon ?? "",
|
||||||
permissionCode: data?.permissionCode ?? "",
|
permissionCode: data?.permissionCode ?? "",
|
||||||
showLink: data?.isShow ?? true,
|
showLink: data?.isShow ?? true,
|
||||||
isLink: data?.isLink ?? false,
|
isLink: data?.isLink ?? false,
|
||||||
state: data?.state ?? true
|
state: data?.state ?? true,
|
||||||
|
routerName: data?.routerName ?? "",
|
||||||
|
menuSource: data?.menuSource ?? "Pure"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
width: "45%",
|
width: "45%",
|
||||||
|
|||||||
@@ -8,11 +8,13 @@ interface FormItemProps {
|
|||||||
router: string;
|
router: string;
|
||||||
component: string;
|
component: string;
|
||||||
orderNum: number;
|
orderNum: number;
|
||||||
icon: string;
|
menuIcon: string;
|
||||||
permissionCode: string;
|
permissionCode: string;
|
||||||
isShow: boolean;
|
isShow: boolean;
|
||||||
isLink: boolean;
|
isLink: boolean;
|
||||||
state: boolean;
|
state: boolean;
|
||||||
|
routerName: string;
|
||||||
|
menuSource: string;
|
||||||
}
|
}
|
||||||
interface FormProps {
|
interface FormProps {
|
||||||
formInline: FormItemProps;
|
formInline: FormItemProps;
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ export function usePost() {
|
|||||||
const columns: TableColumnList = [
|
const columns: TableColumnList = [
|
||||||
{
|
{
|
||||||
label: "岗位编号",
|
label: "岗位编号",
|
||||||
prop: "id"
|
prop: "id",
|
||||||
|
width: 300
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "岗位名称",
|
label: "岗位名称",
|
||||||
|
|||||||
@@ -66,7 +66,9 @@ export function useRole(treeRef: Ref) {
|
|||||||
const columns: TableColumnList = [
|
const columns: TableColumnList = [
|
||||||
{
|
{
|
||||||
label: "角色编号",
|
label: "角色编号",
|
||||||
prop: "id"
|
prop: "id",
|
||||||
|
width: "300",
|
||||||
|
fixed: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "角色名称",
|
label: "角色名称",
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
|
|||||||
{
|
{
|
||||||
label: "用户编号",
|
label: "用户编号",
|
||||||
prop: "id",
|
prop: "id",
|
||||||
width: 200
|
width: 300
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "用户头像",
|
label: "用户头像",
|
||||||
|
|||||||
24
Yi.RuoYi.Vue3/publish.bat
Normal file
24
Yi.RuoYi.Vue3/publish.bat
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
@echo on
|
||||||
|
|
||||||
|
set SERVER_USER=root
|
||||||
|
set SERVER_IP=ccnetcore.com
|
||||||
|
set FILE_PATH=publish_ruoyi_02.zip
|
||||||
|
set REMOTE_PATH=/home/yi/build/publish_ruoyi_02.zip
|
||||||
|
set REMOTE_COMMAND="cd /home/yi/ruoyi&&pwd&&unzip -o /home/yi/build/publish_ruoyi_02.zip -d ./"
|
||||||
|
set sevenzip_Path="D:\Program Files\7-Zip\7z.exe"
|
||||||
|
|
||||||
|
echo start
|
||||||
|
echo 1-build-start
|
||||||
|
:: npm run build
|
||||||
|
echo 1-build-end
|
||||||
|
echo 2-zip-start
|
||||||
|
|
||||||
|
%sevenzip_Path% a ./publish_ruoyi_02.zip ./dist/*
|
||||||
|
:: tar -cvf publish_bbs_02.zip -C "dist" "*"
|
||||||
|
echo 2-zip-end
|
||||||
|
echo 3-publish-start
|
||||||
|
scp %FILE_PATH% %SERVER_USER%@%SERVER_IP%:%REMOTE_PATH%
|
||||||
|
ssh %SERVER_USER%@%SERVER_IP% %REMOTE_COMMAND%
|
||||||
|
echo 3-publish-end
|
||||||
|
echo end
|
||||||
|
pause
|
||||||
Reference in New Issue
Block a user