Browse Source

add layout view

pull/159/head
cKey 5 years ago
parent
commit
a54aeee0b1
  1. 4
      aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutDto.cs
  2. 4
      aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/ILayoutAppService.cs
  3. 2
      aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetAllInput.cs
  4. 2
      aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetListInput.cs
  5. 26
      aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Layouts/LayoutAppService.cs
  6. 6
      aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Menus/MenuAppService.cs
  7. 4
      aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN.Platform.Domain.Shared.csproj
  8. 13
      aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/en.json
  9. 7
      aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/zh-Hans.json
  10. 7
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/ILayoutRepository.cs
  11. 9
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/Layout.cs
  12. 3
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IMenuRepository.cs
  13. 20
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDataSeedContributor.cs
  14. 1
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/IRouteDataSeeder.cs
  15. 2
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/RouteDataSeeder.cs
  16. 14
      aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Layouts/EfCoreLayoutRepository.cs
  17. 6
      aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreMenuRepository.cs
  18. 7
      aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Layouts/LayoutController.cs
  19. 24
      aspnet-core/modules/platform/README.md
  20. BIN
      aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/event-bus-cap.db
  21. 641
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20201221093615_Remove-Layout-Column-Code.Designer.cs
  22. 23
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20201221093615_Remove-Layout-Column-Code.cs
  23. 3
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/PlatformHttpApiHostMigrationsDbContextModelSnapshot.cs
  24. 1
      vueJs/debug.log
  25. 8
      vueJs/src/api/layout.ts
  26. 3
      vueJs/src/api/menu.ts
  27. 5
      vueJs/src/router/index.ts
  28. 20
      vueJs/src/router/modules/admin.ts
  29. 37
      vueJs/src/router/modules/container.ts
  30. 275
      vueJs/src/views/container/layouts/components/CreateOrUpdateLayoutDialog.vue
  31. 237
      vueJs/src/views/container/layouts/index.vue
  32. 4
      vueJs/src/views/container/menus/components/CreateOrUpdateMenuDialog.vue
  33. 0
      vueJs/src/views/container/menus/components/MenuMetaInput.vue
  34. 131
      vueJs/src/views/container/menus/index.vue

4
aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutDto.cs

@ -5,10 +5,6 @@ namespace LINGYUN.Platform.Layouts
{
public class LayoutDto : RouteDto
{
/// <summary>
/// 布局编号
/// </summary>
public string Code { get; set; }
/// <summary>
/// 所属平台
/// </summary>

4
aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/ILayoutAppService.cs

@ -1,4 +1,6 @@
using System;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace LINGYUN.Platform.Layouts
@ -11,6 +13,6 @@ namespace LINGYUN.Platform.Layouts
LayoutCreateDto,
LayoutUpdateDto>
{
Task<ListResultDto<LayoutDto>> GetAllListAsync();
}
}

2
aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetAllInput.cs

@ -14,5 +14,7 @@ namespace LINGYUN.Platform.Menus
public Guid? ParentId { get; set; }
public string Sorting { get; set; }
public Guid? LayoutId { get; set; }
}
}

2
aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetListInput.cs

@ -12,5 +12,7 @@ namespace LINGYUN.Platform.Menus
public bool Reverse { get; set; }
public Guid? ParentId { get; set; }
public Guid? LayoutId { get; set; }
}
}

26
aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Layouts/LayoutAppService.cs

@ -1,5 +1,6 @@
using LINGYUN.Platform.Datas;
using LINGYUN.Platform.Permissions;
using LINGYUN.Platform.Routes;
using LINGYUN.Platform.Utils;
using Microsoft.AspNetCore.Authorization;
using System;
@ -13,42 +14,27 @@ namespace LINGYUN.Platform.Layouts
[Authorize(PlatformPermissions.Layout.Default)]
public class LayoutAppService : PlatformApplicationServiceBase, ILayoutAppService
{
protected IDataRepository DataRepository { get; }
protected ILayoutRepository LayoutRepository { get; }
public LayoutAppService(
IDataRepository dataRepository,
ILayoutRepository layoutRepository)
{
DataRepository = dataRepository;
LayoutRepository = layoutRepository;
}
[Authorize(PlatformPermissions.Layout.Create)]
public virtual async Task<LayoutDto> CreateAsync(LayoutCreateDto input)
{
var data = DataRepository.FindAsync(input.DataId);
if (data == null)
{
throw new UserFriendlyException($"数据字典 {input.DataId} 的不存在或已删除!");
}
var layout = await LayoutRepository.FindByNameAsync(input.Name);
if (layout != null)
{
throw new UserFriendlyException($"已经存在名为 {input.Name} 的布局!");
}
var lastLayout = await LayoutRepository.GetLastOrNullAsync();
var code = lastLayout != null
? CodeNumberGenerator.CalculateNextCode(lastLayout.Code)
: CodeNumberGenerator.CreateCode(1);
layout = new Layout(
GuidGenerator.Create(),
input.Path,
input.Name,
code,
input.DisplayName,
input.DataId,
input.PlatformType,
@ -83,11 +69,19 @@ namespace LINGYUN.Platform.Layouts
return ObjectMapper.Map<Layout, LayoutDto>(layout);
}
public virtual async Task<ListResultDto<LayoutDto>> GetAllListAsync()
{
var layouts = await LayoutRepository.GetListAsync();
return new ListResultDto<LayoutDto>(
ObjectMapper.Map<List<Layout>, List<LayoutDto>>(layouts));
}
public virtual async Task<PagedResultDto<LayoutDto>> GetListAsync(GetLayoutListInput input)
{
var count = await LayoutRepository.GetCountAsync(input.PlatformType, input.Filter);
var layouts = await LayoutRepository.GetListAsync(
var layouts = await LayoutRepository.GetPagedListAsync(
input.PlatformType, input.Filter,
input.Sorting, input.Reverse, false,
input.SkipCount, input.MaxResultCount);

6
aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Menus/MenuAppService.cs

@ -60,7 +60,7 @@ namespace LINGYUN.Platform.Menus
{
var menus = await MenuRepository.GetAllAsync(
input.Filter, input.Sorting, input.Reverse,
input.PlatformType, input.ParentId);
input.PlatformType, input.ParentId, input.LayoutId);
return new ListResultDto<MenuDto>(
ObjectMapper.Map<List<Menu>, List<MenuDto>>(menus));
@ -68,11 +68,11 @@ namespace LINGYUN.Platform.Menus
public virtual async Task<PagedResultDto<MenuDto>> GetListAsync(MenuGetListInput input)
{
var count = await MenuRepository.GetCountAsync(input.Filter, input.PlatformType, input.ParentId);
var count = await MenuRepository.GetCountAsync(input.Filter, input.PlatformType, input.ParentId, input.LayoutId);
var menus = await MenuRepository.GetListAsync(
input.Filter, input.Sorting, input.Reverse,
input.PlatformType, input.ParentId,
input.PlatformType, input.ParentId, input.LayoutId,
input.SkipCount, input.MaxResultCount);
return new PagedResultDto<MenuDto>(count,

4
aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN.Platform.Domain.Shared.csproj

@ -21,4 +21,8 @@
<PackageReference Include="Volo.Abp.Validation" Version="3.3.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="LINGYUN\Platform\Layouts\" />
</ItemGroup>
</Project>

13
aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/en.json

@ -28,22 +28,25 @@
"DisplayName:Component": "Component",
"DisplayName:Filter": "Filter",
"DisplayName:PlatformType": "Platform Type",
"DisplayName:SecrchMenu": "Secrch",
"DisplayName:SecrchMenu": "Secrch Menu",
"DisplayName:SecrchLayout": "Secrch Layout",
"DisplayName:Layout": "Layout",
"DisplayName:Basic": "Basic",
"DisplayName:DataDictionary": "Data Dictionary",
"Layout:AddNew": "Add New",
"Layout:Edit": "Edit",
"Layout:EditByName": "Edit Layout - {0}",
"Layout:Delete": "Delete Layout",
"Menu:AddNew": "Add New",
"Menu:AddChildren": "Add Children",
"Menu:Edit": "Edit",
"Menu:EditByName": "Edit Menu - {0}",
"Menu:Delete": "Delete",
"Menu:WillDelete": "The menu {0} will be deleted",
"Data:WillDelete": "The dictionary {0} will be deleted",
"Menu:Delete": "Delete Menu",
"Menu:Manage": "Manage Menus",
"Data:AddNew": "Add New",
"Data:AddChildren": "Add Children",
"Data:Edit": "Edit",
"Data:Delete": "Delete",
"Data:Delete": "Delete Data",
"Data:AppendItem": "Append Item",
"Data:EditItem": "Edit Item",
"Data:RemoveItem": "Remove Item",

7
aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/zh-Hans.json

@ -29,17 +29,20 @@
"DisplayName:Filter": "筛选",
"DisplayName:PlatformType": "平台类型",
"DisplayName:SecrchMenu": "查询菜单",
"DisplayName:SecrchLayout": "查询布局",
"DisplayName:Layout": "布局",
"DisplayName:Basic": "基础信息",
"DisplayName:DataDictionary": "数据字典",
"Layout:AddNew": "添加新布局",
"Layout:Edit": "编辑布局",
"Layout:EditByName": "编辑布局 - {0}",
"Layout:Delete": "删除布局",
"Menu:AddNew": "添加新菜单",
"Menu:AddChildren": "添加子菜单",
"Menu:Edit": "编辑菜单",
"Menu:EditByName": "编辑菜单 - {0}",
"Menu:Delete": "删除菜单",
"Menu:WillDelete": "将要删除菜单 {0}",
"Menu:Manage": "管理菜单",
"Data:WillDelete": "将要删除字典 {0}",
"Data:AddNew": "添加新字典",
"Data:AddChildren": "添加下级字典",
"Data:Edit": "编辑字典",

7
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/ILayoutRepository.cs

@ -20,18 +20,15 @@ namespace LINGYUN.Platform.Layouts
bool includeDetails = true,
CancellationToken cancellationToken = default);
Task<Layout> GetLastOrNullAsync(
CancellationToken cancellationToken = default);
Task<int> GetCountAsync(
PlatformType? platformType = null,
string filter = "",
CancellationToken cancellationToken = default);
Task<List<Layout>> GetListAsync(
Task<List<Layout>> GetPagedListAsync(
PlatformType? platformType = null,
string filter = "",
string sorting = nameof(Layout.Code),
string sorting = nameof(Layout.Name),
bool reverse = false,
bool includeDetails = false,
int skipCount = 0,

9
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/Layout.cs

@ -1,7 +1,6 @@
using JetBrains.Annotations;
using LINGYUN.Platform.Routes;
using System;
using Volo.Abp;
namespace LINGYUN.Platform.Layouts
{
@ -10,10 +9,6 @@ namespace LINGYUN.Platform.Layouts
/// </summary>
public class Layout : Route
{
/// <summary>
/// 布局编号
/// </summary>
public virtual string Code { get; set; }
/// <summary>
/// 所属平台
/// </summary>
@ -29,7 +24,6 @@ namespace LINGYUN.Platform.Layouts
[NotNull] Guid id,
[NotNull] string path,
[NotNull] string name,
[NotNull] string code,
[NotNull] string displayName,
[NotNull] Guid dataId,
[NotNull] PlatformType platformType = PlatformType.None,
@ -38,9 +32,6 @@ namespace LINGYUN.Platform.Layouts
[CanBeNull] Guid? tenantId = null)
: base(id, path, name, displayName, redirect, description, tenantId)
{
Check.NotNullOrWhiteSpace(code, nameof(code));
Code = code;
DataId = dataId;
PlatformType = platformType;
}

3
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IMenuRepository.cs

@ -77,6 +77,7 @@ namespace LINGYUN.Platform.Menus
string filter = "",
PlatformType? platformType = null,
Guid? parentId = null,
Guid? layoutId = null,
CancellationToken cancellationToken = default);
Task<List<Menu>> GetListAsync(
@ -85,6 +86,7 @@ namespace LINGYUN.Platform.Menus
bool reverse = false,
PlatformType? platformType = null,
Guid? parentId = null,
Guid? layoutId = null,
int skipCount = 0,
int maxResultCount = 10,
CancellationToken cancellationToken = default);
@ -95,6 +97,7 @@ namespace LINGYUN.Platform.Menus
bool reverse = false,
PlatformType? platformType = null,
Guid? parentId = null,
Guid? layoutId = null,
CancellationToken cancellationToken = default);
Task RemoveAllRolesAsync(

20
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDataSeedContributor.cs

@ -138,7 +138,6 @@ namespace LINGYUN.Platform
var layout = await RouteDataSeeder.SeedLayoutAsync(
"Layout",
"layout/index.vue",
CodeNumberGenerator.CreateCode(1),
"Vue Admin Layout",
data.Id,
PlatformType.WebMvvm, // 针对当前的vue管理页
@ -567,10 +566,10 @@ namespace LINGYUN.Platform
await SeedMenuAsync(
layout,
data,
"layout",
"layout",
"layouts",
"layouts",
CodeNumberGenerator.AppendCode(containerRoot.Code, CodeNumberGenerator.CreateCode(1)),
"views/admin/layouts/index.vue",
"views/container/layouts/index.vue",
"Manage Layouts",
"",
"Manage Layouts",
@ -578,7 +577,7 @@ namespace LINGYUN.Platform
containerRoot.TenantId,
new Dictionary<string, object>()
{
{ "title", "layout" },
{ "title", "layouts" },
{ "icon", "layout" }
},
new string[] { "admin" });
@ -589,7 +588,7 @@ namespace LINGYUN.Platform
"menus",
"menus",
CodeNumberGenerator.AppendCode(containerRoot.Code, CodeNumberGenerator.CreateCode(2)),
"views/admin/menus/index.vue",
"views/container/menus/index.vue",
"Manage Menus",
"",
"Manage Menus",
@ -718,6 +717,7 @@ namespace LINGYUN.Platform
Guid? tenantId = null,
Dictionary<string, object> meta = null,
string[] roles = null,
Guid[] users = null,
bool isPublic = false
)
{
@ -754,6 +754,14 @@ namespace LINGYUN.Platform
}
}
if (users != null)
{
foreach (var user in users)
{
await RouteDataSeeder.SeedUserMenuAsync(user, menu, tenantId);
}
}
return menu;
}
}

1
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/IRouteDataSeeder.cs

@ -11,7 +11,6 @@ namespace LINGYUN.Platform.Routes
Task<Layout> SeedLayoutAsync(
string name,
string path,
string code,
string displayName,
Guid dataId,
PlatformType platformType = PlatformType.None,

2
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/RouteDataSeeder.cs

@ -34,7 +34,6 @@ namespace LINGYUN.Platform.Routes
public virtual async Task<Layout> SeedLayoutAsync(
string name,
string path,
string code,
string displayName,
Guid dataId,
PlatformType platformType = PlatformType.None,
@ -50,7 +49,6 @@ namespace LINGYUN.Platform.Routes
GuidGenerator.Create(),
path,
name,
code,
displayName,
dataId,
platformType,

14
aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Layouts/EfCoreLayoutRepository.cs

@ -42,25 +42,17 @@ namespace LINGYUN.Platform.Layouts
.CountAsync(GetCancellationToken(cancellationToken));
}
public virtual async Task<Layout> GetLastOrNullAsync(
CancellationToken cancellationToken = default)
{
return await DbSet
.OrderByDescending(x => x.Code)
.FirstOrDefaultAsync(GetCancellationToken(cancellationToken));
}
public virtual async Task<List<Layout>> GetListAsync(
public virtual async Task<List<Layout>> GetPagedListAsync(
PlatformType? platformType = null,
string filter = "",
string sorting = "Code",
string sorting = nameof(Layout.Name),
bool reverse = false,
bool includeDetails = false,
int skipCount = 0,
int maxResultCount = 10,
CancellationToken cancellationToken = default)
{
sorting ??= nameof(Layout.Code);
sorting ??= nameof(Layout.Name);
sorting = reverse ? sorting + " DESC" : sorting;
return await DbSet

6
aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreMenuRepository.cs

@ -148,6 +148,7 @@ namespace LINGYUN.Platform.Menus
bool reverse = false,
PlatformType? platformType = null,
Guid? parentId = null,
Guid? layoutId = null,
CancellationToken cancellationToken = default)
{
sorting ??= nameof(Menu.Code);
@ -155,6 +156,7 @@ namespace LINGYUN.Platform.Menus
return await DbSet
.WhereIf(parentId.HasValue, x => x.ParentId == parentId)
.WhereIf(layoutId.HasValue, x => x.LayoutId == layoutId)
.WhereIf(platformType.HasValue, menu => menu.PlatformType.HasFlag(platformType.Value))
.WhereIf(!filter.IsNullOrWhiteSpace(), menu =>
menu.Path.Contains(filter) || menu.Name.Contains(filter) ||
@ -168,10 +170,12 @@ namespace LINGYUN.Platform.Menus
string filter = "",
PlatformType? platformType = null,
Guid? parentId = null,
Guid? layoutId = null,
CancellationToken cancellationToken = default)
{
return await DbSet
.WhereIf(parentId.HasValue, x => x.ParentId == parentId)
.WhereIf(layoutId.HasValue, x => x.LayoutId == layoutId)
.WhereIf(platformType.HasValue, menu => menu.PlatformType.HasFlag(platformType.Value))
.WhereIf(!filter.IsNullOrWhiteSpace(), menu =>
menu.Path.Contains(filter) || menu.Name.Contains(filter) ||
@ -186,6 +190,7 @@ namespace LINGYUN.Platform.Menus
bool reverse = false,
PlatformType? platformType = null,
Guid? parentId = null,
Guid? layoutId = null,
int skipCount = 0,
int maxResultCount = 10,
CancellationToken cancellationToken = default)
@ -195,6 +200,7 @@ namespace LINGYUN.Platform.Menus
return await DbSet
.WhereIf(parentId.HasValue, x => x.ParentId == parentId)
.WhereIf(layoutId.HasValue, x => x.LayoutId == layoutId)
.WhereIf(platformType.HasValue, menu => menu.PlatformType.HasFlag(platformType.Value))
.WhereIf(!filter.IsNullOrWhiteSpace(), menu =>
menu.Path.Contains(filter) || menu.Name.Contains(filter) ||

7
aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Layouts/LayoutController.cs

@ -40,6 +40,13 @@ namespace LINGYUN.Platform.Layouts
return await LayoutAppService.GetAsync(id);
}
[HttpGet]
[Route("all")]
public virtual async Task<ListResultDto<LayoutDto>> GetAllListAsync()
{
return await LayoutAppService.GetAllListAsync();
}
[HttpGet]
public virtual async Task<PagedResultDto<LayoutDto>> GetListAsync(GetLayoutListInput input)
{

24
aspnet-core/modules/platform/README.md

@ -0,0 +1,24 @@
# LINGYUN.Platform.Domain
平台管理模块
#### 注意
> 动态菜单管理
## IDataSeedContributor
说明: 用于预置菜单数据的接口,模块默认已初始化与vue-admin相关的菜单
## 其他注意事项
不论是布局(path)还是菜单(component),都不需要添加 @/ 的前缀(这通常在前端定义路由时需要),因为前端不支持这样的形式
## 配置使用
```csharp
[DependsOn(typeof(PlatformDomainModule))]
public class YouProjectModule : AbpModule
{
// other
}

BIN
aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/event-bus-cap.db

Binary file not shown.

641
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20201221093615_Remove-Layout-Column-Code.Designer.cs

@ -0,0 +1,641 @@
// <auto-generated />
using System;
using LINGYUN.Platform.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Platform.Migrations
{
[DbContext(typeof(PlatformHttpApiHostMigrationsDbContext))]
[Migration("20201221093615_Remove-Layout-Column-Code")]
partial class RemoveLayoutColumnCode
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "3.1.8")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Code")
.IsRequired()
.HasColumnName("Code")
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4")
.HasMaxLength(1024);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4")
.HasMaxLength(1024);
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(30) CHARACTER SET utf8mb4")
.HasMaxLength(30);
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("Name");
b.ToTable("AppPlatformDatas");
});
modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<bool>("AllowBeNull")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(true);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid>("DataId")
.HasColumnType("char(36)");
b.Property<string>("DefaultValue")
.HasColumnName("DefaultValue")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4")
.HasMaxLength(1024);
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(30) CHARACTER SET utf8mb4")
.HasMaxLength(30);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("ValueType")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("DataId");
b.HasIndex("Name");
b.ToTable("AppPlatformDataItems");
});
modelBuilder.Entity("LINGYUN.Platform.Layouts.Layout", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid>("DataId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Path")
.HasColumnName("Path")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<int>("PlatformType")
.HasColumnType("int");
b.Property<string>("Redirect")
.HasColumnName("Redirect")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.ToTable("AppPlatformLayouts");
});
modelBuilder.Entity("LINGYUN.Platform.Menus.Menu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Code")
.IsRequired()
.HasColumnName("Code")
.HasColumnType("varchar(23) CHARACTER SET utf8mb4")
.HasMaxLength(23);
b.Property<string>("Component")
.IsRequired()
.HasColumnName("Component")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<bool>("IsPublic")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<Guid>("LayoutId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<string>("Path")
.HasColumnName("Path")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<int>("PlatformType")
.HasColumnType("int");
b.Property<string>("Redirect")
.HasColumnName("Redirect")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.ToTable("AppPlatformMenus");
});
modelBuilder.Entity("LINGYUN.Platform.Menus.RoleMenu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<Guid>("MenuId")
.HasColumnType("char(36)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnName("RoleName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("RoleName", "MenuId");
b.ToTable("AppPlatformRoleMenus");
});
modelBuilder.Entity("LINGYUN.Platform.Menus.UserMenu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<Guid>("MenuId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("UserId", "MenuId");
b.ToTable("AppPlatformUserMenus");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.AppVersion", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(2048);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<int>("PlatformType")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Title")
.IsRequired()
.HasColumnName("Title")
.HasColumnType("varchar(50) CHARACTER SET utf8mb4")
.HasMaxLength(50);
b.Property<string>("Version")
.IsRequired()
.HasColumnName("Version")
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.HasKey("Id");
b.HasIndex("Version");
b.ToTable("AppPlatformVersion");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.VersionFile", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<Guid>("AppVersionId")
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<int>("DownloadCount")
.HasColumnType("int");
b.Property<int>("FileType")
.HasColumnType("int");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("Path")
.HasColumnName("Path")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("SHA256")
.IsRequired()
.HasColumnName("SHA256")
.HasColumnType("varchar(65) CHARACTER SET utf8mb4")
.HasMaxLength(65);
b.Property<long>("Size")
.HasColumnType("bigint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Version")
.IsRequired()
.HasColumnName("Version")
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.HasKey("Id");
b.HasIndex("AppVersionId");
b.HasIndex("Path", "Name", "Version")
.IsUnique();
b.ToTable("AppPlatformVersionFile");
});
modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b =>
{
b.HasOne("LINGYUN.Platform.Datas.Data", null)
.WithMany("Items")
.HasForeignKey("DataId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LINGYUN.Platform.Versions.VersionFile", b =>
{
b.HasOne("LINGYUN.Platform.Versions.AppVersion", "AppVersion")
.WithMany("Files")
.HasForeignKey("AppVersionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}

23
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20201221093615_Remove-Layout-Column-Code.cs

@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Platform.Migrations
{
public partial class RemoveLayoutColumnCode : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Code",
table: "AppPlatformLayouts");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Code",
table: "AppPlatformLayouts",
type: "longtext CHARACTER SET utf8mb4",
nullable: true);
}
}
}

3
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/PlatformHttpApiHostMigrationsDbContextModelSnapshot.cs

@ -200,9 +200,6 @@ namespace LINGYUN.Platform.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Code")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")

1
vueJs/debug.log

@ -3,3 +3,4 @@
[1211/094715.020:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
[1219/155359.779:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
[1220/155401.094:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
[1221/155401.113:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)

8
vueJs/src/api/layout.ts

@ -1,6 +1,6 @@
import ApiService from './serviceBase'
import { urlStringify } from '@/utils/index'
import { FullAuditedEntityDto, PagedResultDto, PagedAndSortedResultRequestDto } from './types'
import { ListResultDto, PagedResultDto, PagedAndSortedResultRequestDto } from './types'
const sourceUrl = '/api/platform/layouts'
/** 远程服务地址 */
@ -13,6 +13,11 @@ export default class LayoutService {
return ApiService.Get<Layout>(_url, serviceUrl)
}
public static getAllList() {
const _url = sourceUrl + '/all'
return ApiService.Get<ListResultDto<Layout >>(_url, serviceUrl)
}
public static getList(payload: GetLayoutByPaged) {
const _url = sourceUrl + '?' + urlStringify(payload)
return ApiService.Get<PagedResultDto<Layout >>(_url, serviceUrl)
@ -76,7 +81,6 @@ export class Route {
}
export class Layout extends Route {
code!: string
platformType!: PlatformType
dataId!: string
}

3
vueJs/src/api/menu.ts

@ -80,6 +80,7 @@ export class GetAllMenu implements ISortedResultRequest {
sorting = ''
reverse = false
parentId?: string
layoutId?: string
platformType?: PlatformType
}
@ -91,6 +92,8 @@ export class GetRoleMenu {
export class GetMenuByPaged extends PagedAndSortedResultRequestDto {
filter = ''
reverse = false
layoutId?: string
parentId?: string
platformType?: PlatformType
}

5
vueJs/src/router/index.ts

@ -10,11 +10,15 @@ import Layout from '@/layout/index.vue'
// import tableRouter from './modules/table'
// import nestedRouter from './modules/nested'
// import taskRouter from './modules/task'
// 就算是动态菜单,依然要在这里定义一下路径,这是为了告诉webpack哪些文件需要打包,否则会找不到页面路径
// 当然,更好的方法是指定webpack配置
import adminRouter from './modules/admin'
import auditingRouter from './modules/auditing'
import apigatewayRouter from './modules/apigateway'
import identityServerRouter from './modules/identityServer'
import fileManagementRouter from './modules/file-management'
import containerRouter from './modules/container'
Vue.use(Router)
/*
@ -164,6 +168,7 @@ export const asyncRoutes: RouteConfig[] = [
apigatewayRouter,
identityServerRouter,
fileManagementRouter,
containerRouter,
{
path: '*',
component: () => import(/* webpackChunkName: "error-page-404" */ '@/views/error-page/404.vue'),

20
vueJs/src/router/modules/admin.ts

@ -70,26 +70,6 @@ const adminRouter: RouteConfig = {
icon: 'claim-type',
roles: ['AbpIdentity.IdentityClaimTypes']
}
},
{
path: 'data-dictionary',
component: () => import(/* webpackChunkName: "claim-type" */ '@/views/admin/data-dictionary/index.vue'),
name: 'data-dictionary',
meta: {
title: '数据字典',
icon: 'data-dictionary',
roles: ['AbpIdentity.IdentityClaimTypes']
}
},
{
path: 'menus',
component: () => import(/* webpackChunkName: "claim-type" */ '@/views/admin/menus/index.vue'),
name: 'menus',
meta: {
title: '菜单',
icon: 'menus',
roles: ['AbpIdentity.IdentityClaimTypes']
}
}
]
}

37
vueJs/src/router/modules/container.ts

@ -0,0 +1,37 @@
import { RouteConfig } from 'vue-router'
import Layout from '@/layout/index.vue'
const containerRouter: RouteConfig = {
path: '/container',
component: Layout,
meta: {
title: 'container',
icon: 'container',
roles: ['Platform.Layout', 'Platform.Menus'],
alwaysShow: true
},
children: [
{
path: 'layouts',
component: () => import(/* webpackChunkName: "layouts" */ '@/views/container/layouts/index.vue'),
name: 'layouts',
meta: {
title: 'layouts',
icon: 'layouts',
roles: ['Platform.Layout']
}
},
{
path: 'menus',
component: () => import(/* webpackChunkName: "menus" */ '@/views/container/menus/index.vue'),
name: 'menus',
meta: {
title: 'menus',
icon: 'menus',
roles: ['ApiGateway.Menus']
}
}
]
}
export default containerRouter

275
vueJs/src/views/container/layouts/components/CreateOrUpdateLayoutDialog.vue

@ -0,0 +1,275 @@
<template>
<el-dialog
v-el-draggable-dialog
width="800px"
:visible="showDialog"
:title="title"
custom-class="modal-form"
:show-close="false"
:close-on-click-modal="false"
:close-on-press-escape="false"
@close="onFormClosed(false)"
>
<el-form
ref="formLayout"
:model="layout"
label-width="120px"
>
<el-form-item
:label="$t('AppPlatform.DisplayName:PlatformType')"
:rules="{
required: true,
message: $t('pleaseInputBy', {key: $t('AppPlatform.DisplayName:PlatformType')}),
trigger: 'blur'
}"
>
<el-select
v-model="layout.platformType"
style="width: 100%;"
class="filter-item"
clearable
:placeholder="$t('pleaseSelectBy', {name: $t('AppPlatform.DisplayName:PlatformType')})"
>
<el-option
v-for="platformType in platformTypes"
:key="platformType.key"
:label="platformType.key"
:value="platformType.value"
/>
</el-select>
</el-form-item>
<el-form-item
v-if="!isEdit"
:label="$t('AppPlatform.DisplayName:DataDictionary')"
:rules="{
required: true
}"
>
<el-select
v-model="dataId"
style="width: 100%;"
class="filter-item"
clearable
:placeholder="$t('pleaseSelectBy', {name: $t('AppPlatform.DisplayName:DataDictionary')})"
>
<el-option
v-for="data in datas"
:key="data.name"
:label="data.displayName"
:value="data.id"
/>
</el-select>
</el-form-item>
<el-form-item
prop="name"
:label="$t(('AppPlatform.DisplayName:Name'))"
:rules="{
required: true,
message: $t('pleaseInputBy', {key: $t('AppPlatform.DisplayName:Name')}),
trigger: 'blur'
}"
>
<el-input
v-model="layout.name"
/>
</el-form-item>
<el-form-item
prop="displayName"
:label="$t(('AppPlatform.DisplayName:DisplayName'))"
:rules="{
required: true,
message: $t('pleaseInputBy', {key: $t('AppPlatform.DisplayName:DisplayName')}),
trigger: 'blur'
}"
>
<el-input
v-model="layout.displayName"
/>
</el-form-item>
<el-form-item
prop="path"
:label="$t(('AppPlatform.DisplayName:Path'))"
:rules="{
required: true,
message: $t('pleaseInputBy', {key: $t('AppPlatform.DisplayName:Path')}),
trigger: 'blur'
}"
>
<el-input
v-model="layout.path"
/>
</el-form-item>
<el-form-item
prop="redirect"
:label="$t(('AppPlatform.DisplayName:Redirect'))"
>
<el-input
v-model="layout.redirect"
/>
</el-form-item>
<el-form-item
prop="description"
:label="$t(('AppPlatform.DisplayName:Description'))"
>
<el-input
v-model="layout.description"
type="textarea"
/>
</el-form-item>
<el-form-item>
<el-button
class="cancel"
type="info"
@click="onFormClosed(false)"
>
{{ $t('AbpUi.Cancel') }}
</el-button>
<el-button
class="confirm"
type="primary"
icon="el-icon-check"
@click="onSave"
>
{{ $t('AbpUi.Save') }}
</el-button>
</el-form-item>
</el-form>
</el-dialog>
</template>
<script lang="ts">
import { Component, Vue, Prop, Watch } from 'vue-property-decorator'
import { Form } from 'element-ui'
import DataService, { Data } from '@/api/data-dictionary'
import LayoutService, {
Layout,
LayoutCreateOrUpdate,
LayoutCreate,
LayoutUpdate,
PlatformTypes
} from '@/api/layout'
@Component({
name: 'CreateOrUpdateLayoutDialog'
})
export default class CreateOrUpdateLayoutDialog extends Vue {
@Prop({ default: false })
private showDialog!: boolean
@Prop({ default: null })
private layoutId!: string
private layout = new Layout()
private datas = new Array<Data>()
private platformTypes = PlatformTypes
private dataId = ''
get isEdit() {
if (this.layoutId) {
return true
}
return false
}
get title() {
if (this.isEdit) {
return this.$t('AppPlatform.Layout:EditByName', { 0: this.layout.displayName })
}
return this.$t('AppPlatform.Layout:AddNew')
}
@Watch('showDialog')
private onShowDialogChanged() {
this.handleGetLayout()
}
mounted() {
this.handleGetDataDictionarys()
}
private handleGetDataDictionarys() {
DataService
.getAll()
.then(res => {
this.datas = res.items
})
}
private handleGetLayout() {
if (this.showDialog && this.layoutId) {
LayoutService
.get(this.layoutId)
.then(res => {
this.layout = res
})
} else {
this.layout = new Layout()
}
}
private onSave() {
const formLayout = this.$refs.formLayout as Form
formLayout
.validate(valid => {
if (valid) {
if (this.isEdit) {
const update = new LayoutUpdate()
this.updateMenuByInput(update)
LayoutService
.update(this.layoutId, update)
.then(res => {
this.layout = res
this.$message.success(this.$t('successful').toString())
this.onFormClosed(true)
})
} else {
if (!this.dataId) {
this.$message.warning(this.$t('pleaseSelectBy', { key: this.$t('AppPlatform.DisplayName:DataDictionary') }).toString())
return
}
const create = new LayoutCreate()
this.updateMenuByInput(create)
create.dataId = this.dataId
LayoutService
.create(create)
.then(res => {
this.layout = res
this.$message.success(this.$t('successful').toString())
this.onFormClosed(true)
})
}
}
})
}
private onFormClosed(changed: boolean) {
const formLayout = this.$refs.formLayout as Form
formLayout.resetFields()
this.$emit('closed', changed)
}
private updateMenuByInput(update: LayoutCreateOrUpdate) {
update.name = this.layout.name
update.path = this.layout.path
update.displayName = this.layout.displayName
update.description = this.layout.description
update.redirect = this.layout.redirect
update.platformType = this.layout.platformType
}
}
</script>
<style scoped>
.confirm {
position: absolute;
right: 10px;
width:100px;
}
.cancel {
position: absolute;
right: 120px;
width:100px;
}
</style>

237
vueJs/src/views/container/layouts/index.vue

@ -0,0 +1,237 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-form inline>
<el-form-item
label-width="100px"
:label="$t('AppPlatform.DisplayName:Filter')"
>
<el-input
v-model="dataFilter.filter"
/>
</el-form-item>
<el-form-item
label-width="100px"
:label="$t('AppPlatform.DisplayName:PlatformType')"
>
<el-select
v-model="dataFilter.platformType"
class="filter-item"
clearable
:placeholder="$t('pleaseSelectBy', {name: $t('AppPlatform.DisplayName:PlatformType')})"
>
<el-option
v-for="item in platformTypes"
:key="item.key"
:label="item.key"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-button
class="filter-item"
style="width: 150px; margin-left: 10px;"
type="primary"
@click="refreshPagedData"
>
<i class="el-icon-search" />
{{ $t('AppPlatform.DisplayName:SecrchLayout') }}
</el-button>
<el-button
class="filter-item"
style="width: 150px; margin-left: 10px;"
type="success"
@click="handleAddLayout"
>
<i class="ivu-icon ivu-icon-md-add" />
{{ $t('AppPlatform.Layout:AddNew') }}
</el-button>
</el-form>
</div>
<el-table
v-loading="dataLoading"
row-key="id"
:data="dataList"
border
fit
highlight-current-row
style="width: 100%;"
@sort-change="handleSortChange"
>
<el-table-column
:label="$t('AppPlatform.DisplayName:Name')"
prop="Name"
sortable
width="200px"
>
<template slot-scope="{row}">
<span>{{ row.name }}</span>
</template>
</el-table-column>
<el-table-column
:label="$t('AppPlatform.DisplayName:Path')"
prop="path"
sortable
width="250px"
>
<template slot-scope="{row}">
<el-tag>
{{ row.path }}
</el-tag>
</template>
</el-table-column>
<el-table-column
:label="$t('AppPlatform.DisplayName:DisplayName')"
prop="displayName"
sortable
width="250px"
>
<template slot-scope="{row}">
<span>{{ row.displayName }}</span>
</template>
</el-table-column>
<el-table-column
:label="$t('AppPlatform.DisplayName:Description')"
prop="description"
sortable
width="250px"
>
<template slot-scope="{row}">
<span>{{ row.description }}</span>
</template>
</el-table-column>
<el-table-column
:label="$t('AppPlatform.DisplayName:Redirect')"
prop="redirect"
sortable
width="250px"
>
<template slot-scope="{row}">
<span>{{ row.redirect }}</span>
</template>
</el-table-column>
<el-table-column
:label="$t('operaActions')"
align="center"
min-width="200px"
>
<template slot-scope="{row}">
<el-button
:disabled="!checkPermission(['Platform.Layout.Update'])"
size="mini"
type="primary"
icon="el-icon-edit"
@click="handleEditLayout(row.id)"
/>
<el-button
:disabled="!checkPermission(['Platform.Layout.Delete'])"
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleRemoveLayout(row)"
/>
</template>
</el-table-column>
</el-table>
<pagination
v-show="dataTotal>0"
:total="dataTotal"
:page.sync="currentPage"
:limit.sync="pageSize"
@pagination="refreshPagedData"
@sort-change="handleSortChange"
/>
<create-or-update-layout-dialog
:show-dialog="showEditDialog"
:layout-id="editLayoutId"
@closed="onLayoutEditDialogClosed"
/>
</div>
</template>
<script lang="ts">
import { dateFormat, abpPagerFormat } from '@/utils'
import { checkPermission } from '@/utils/permission'
import LayoutService, { Layout, GetLayoutByPaged, PlatformTypes } from '@/api/layout'
import DataListMiXin from '@/mixins/DataListMiXin'
import Component, { mixins } from 'vue-class-component'
import Pagination from '@/components/Pagination/index.vue'
import CreateOrUpdateLayoutDialog from './components/CreateOrUpdateLayoutDialog.vue'
@Component({
name: 'Layouts',
components: {
Pagination,
CreateOrUpdateLayoutDialog
},
filters: {
dateTimeFormatFilter(dateTime: Date) {
return dateFormat(new Date(dateTime), 'YYYY-mm-dd HH:MM:SS:NS')
}
},
methods: {
checkPermission
}
})
export default class extends mixins(DataListMiXin) {
public dataFilter = new GetLayoutByPaged()
private showEditDialog = false
private editLayoutId = ''
private platformTypes = PlatformTypes
mounted() {
this.refreshPagedData()
}
protected processDataFilter() {
this.dataFilter.skipCount = abpPagerFormat(this.currentPage, this.pageSize)
}
protected getPagedList(filter: any) {
return LayoutService.getList(filter)
}
private handleRemoveLayout(layout: Layout) {
this.$confirm(this.l('questingDeleteByMessage', { message: layout.displayName }),
this.l('AppPlatform.Layout:Delete'), {
callback: (action) => {
if (action === 'confirm') {
LayoutService
.delete(layout.id)
.then(() => {
this.$message.success(this.l('successful'))
this.refreshPagedData()
})
}
}
})
}
private handleAddLayout() {
this.editLayoutId = ''
this.showEditDialog = true
}
private handleEditLayout(id: string) {
this.editLayoutId = id
this.showEditDialog = true
}
private onLayoutEditDialogClosed(changed: boolean) {
this.showEditDialog = false
if (changed) {
this.refreshPagedData()
}
}
}
</script>
<style lang="scss" scoped>
.data-filter-collapse-title {
font-size: 15px;
}
</style>

4
vueJs/src/views/admin/menus/components/CreateOrUpdateMenuDialog.vue → vueJs/src/views/container/menus/components/CreateOrUpdateMenuDialog.vue

@ -282,6 +282,10 @@ export default class CreateOrUpdateMenuDialog extends Vue {
private onLayoutChanged() {
const layout = this.layouts.find(x => x.id === this.layoutId)
if (layout) {
if (!this.parentId) {
// ,
this.menu.component = layout.path
}
DataService
.get(layout.dataId)
.then(res => {

0
vueJs/src/views/admin/menus/components/MenuMetaInput.vue → vueJs/src/views/container/menus/components/MenuMetaInput.vue

131
vueJs/src/views/admin/menus/index.vue → vueJs/src/views/container/menus/index.vue

@ -1,60 +1,69 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-form>
<el-row>
<el-col :span="6">
<el-form-item
label-width="100px"
:label="$t('AppPlatform.DisplayName:Filter')"
>
<el-input
v-model="dataQueryFilter.filter"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
label-width="100px"
:label="$t('AppPlatform.DisplayName:PlatformType')"
>
<el-select
v-model="dataQueryFilter.platformType"
style="width: 250px;margin-left: 10px;"
class="filter-item"
clearable
:placeholder="$t('pleaseSelectBy', {name: $t('AppPlatform.DisplayName:PlatformType')})"
>
<el-option
v-for="item in platformTypes"
:key="item.key"
:label="item.key"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10">
<el-button
class="filter-item"
style="width: 150px;"
type="primary"
@click="resetList"
>
<i class="el-icon-search" />
{{ $t('AppPlatform.DisplayName:SecrchMenu') }}
</el-button>
<el-button
class="filter-item"
style="width: 150px;"
type="success"
@click="handleAddMenu('')"
>
<i class="ivu-icon ivu-icon-md-add" />
{{ $t('AppPlatform.Menu:AddNew') }}
</el-button>
</el-col>
</el-row>
<el-form inline>
<el-form-item
label-width="100px"
:label="$t('AppPlatform.DisplayName:Filter')"
>
<el-input
v-model="dataQueryFilter.filter"
/>
</el-form-item>
<el-form-item
label-width="100px"
:label="$t('AppPlatform.DisplayName:PlatformType')"
>
<el-select
v-model="dataQueryFilter.platformType"
class="filter-item"
clearable
:placeholder="$t('pleaseSelectBy', {name: $t('AppPlatform.DisplayName:PlatformType')})"
>
<el-option
v-for="item in platformTypes"
:key="item.key"
:label="item.key"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item
label-width="100px"
:label="$t('AppPlatform.DisplayName:Layout')"
>
<el-select
v-model="dataQueryFilter.layoutId"
class="filter-item"
clearable
:placeholder="$t('pleaseSelectBy', {name: $t('AppPlatform.DisplayName:Layout')})"
>
<el-option
v-for="layout in layouts"
:key="layout.id"
:label="layout.displayName"
:value="layout.id"
/>
</el-select>
</el-form-item>
<el-button
class="filter-item"
style="width: 150px; margin-left: 10px;"
type="primary"
@click="resetList"
>
<i class="el-icon-search" />
{{ $t('AppPlatform.DisplayName:SecrchMenu') }}
</el-button>
<el-button
class="filter-item"
style="width: 150px; margin-left: 10px;"
type="success"
@click="handleAddMenu('')"
>
<i class="ivu-icon ivu-icon-md-add" />
{{ $t('AppPlatform.Menu:AddNew') }}
</el-button>
</el-form>
</div>
@ -177,7 +186,7 @@
<script lang="ts">
import { dateFormat, generateTree } from '@/utils'
import { checkPermission } from '@/utils/permission'
import { PlatformTypes } from '@/api/layout'
import LayoutService, { PlatformTypes, Layout } from '@/api/layout'
import MenuService, { Menu, GetAllMenu } from '@/api/menu'
import DataListMiXin from '@/mixins/DataListMiXin'
import Component, { mixins } from 'vue-class-component'
@ -204,10 +213,12 @@ export default class extends mixins(DataListMiXin) {
private showEditDialog = false
private editMenuId = ''
private parentMenuId = ''
private layouts = new Array<Layout>()
private platformTypes = PlatformTypes
mounted() {
this.handleGetLayouts()
this.refreshData()
}
@ -224,9 +235,17 @@ export default class extends mixins(DataListMiXin) {
})
}
private handleGetLayouts() {
LayoutService
.getAllList()
.then(res => {
this.layouts = res.items
})
}
private handleRemoveMenu(menu: Menu) {
this.$confirm(this.l('questingDeleteByMessage', { message: menu.displayName }),
this.l('AppPlatform.RemoveMenu'), {
this.l('AppPlatform.Menu:Delete'), {
callback: (action) => {
if (action === 'confirm') {
MenuService
Loading…
Cancel
Save