17 changed files with 1381 additions and 12 deletions
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -0,0 +1,30 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
|||
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> |
|||
<xs:element name="Weavers"> |
|||
<xs:complexType> |
|||
<xs:all> |
|||
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1"> |
|||
<xs:complexType> |
|||
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" /> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:all> |
|||
<xs:attribute name="VerifyAssembly" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> |
|||
<xs:annotation> |
|||
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="GenerateXsd" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:schema> |
|||
@ -0,0 +1,25 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net9.0</TargetFramework> |
|||
<AssemblyName>LINGYUN.Abp.UI.Navigation.VueVbenAdmin5</AssemblyName> |
|||
<PackageId>LINGYUN.Abp.UI.Navigation.VueVbenAdmin5</PackageId> |
|||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Volo.Abp.Data" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\..\framework\navigation\LINGYUN.Abp.UI.Navigation\LINGYUN.Abp.UI.Navigation.csproj" /> |
|||
<ProjectReference Include="..\LINGYUN.Platform.Domain\LINGYUN.Platform.Domain.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,18 @@ |
|||
using LINGYUN.Platform; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace LINGYUN.Abp.UI.Navigation.VueVbenAdmin5; |
|||
|
|||
[DependsOn( |
|||
typeof(AbpUINavigationModule), |
|||
typeof(PlatformDomainModule))] |
|||
public class AbpUINavigationVueVbenAdmin5Module : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpNavigationOptions>(options => |
|||
{ |
|||
options.NavigationSeedContributors.Add<VueVbenAdmin5NavigationSeedContributor>(); |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,762 @@ |
|||
using System.Security.Principal; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.MultiTenancy; |
|||
|
|||
namespace LINGYUN.Abp.UI.Navigation.VueVbenAdmin5; |
|||
|
|||
public class AbpUINavigationVueVbenAdmin5NavigationDefinitionProvider : NavigationDefinitionProvider |
|||
{ |
|||
public override void Define(INavigationDefinitionContext context) |
|||
{ |
|||
context.Add(GetDashboard()); |
|||
context.Add(GetAccount()); |
|||
context.Add(GetManage()); |
|||
context.Add(GetSaas()); |
|||
context.Add(GetPlatform()); |
|||
context.Add(GetOssManagement()); |
|||
context.Add(GetTaskManagement()); |
|||
context.Add(GetWebhooksManagement()); |
|||
context.Add(GetTextTemplating()); |
|||
context.Add(GetVbenDemos()); |
|||
} |
|||
|
|||
private static NavigationDefinition[] GetVbenDemos() |
|||
{ |
|||
var project = new ApplicationMenu( |
|||
name: "VbenProject", |
|||
displayName: "项目", |
|||
url: "/vben-admin", |
|||
component: "", |
|||
description: "项目", |
|||
order: 9998, |
|||
icon: "https://unpkg.com/@vbenjs/static-source@0.1.7/source/logo-v1.webp") |
|||
.SetProperty("badgeType", "dot") |
|||
.SetProperty("title", "demos.vben.title"); |
|||
project.AddItem( |
|||
new ApplicationMenu( |
|||
name: "VbenDocument", |
|||
displayName: "文档", |
|||
url: "/vben-admin/document", |
|||
component: "", |
|||
icon: "lucide:book-open-text", |
|||
description: "文档") |
|||
.SetProperty("link", "https://doc.vben.pro") |
|||
.SetProperty("title", "demos.vben.document") |
|||
); |
|||
project.AddItem( |
|||
new ApplicationMenu( |
|||
name: "VbenGithub", |
|||
displayName: "文档", |
|||
url: "/vben-admin/github", |
|||
component: "", |
|||
icon: "mdi:github", |
|||
description: "文档") |
|||
.SetProperty("link", "https://github.com/vbenjs/vue-vben-admin") |
|||
.SetProperty("title", "Github") |
|||
); |
|||
project.AddItem( |
|||
new ApplicationMenu( |
|||
name: "VbenNaive", |
|||
displayName: "Naive UI 版本", |
|||
url: "/vben-admin/naive", |
|||
component: "", |
|||
icon: "logos:naiveui", |
|||
description: "Naive UI 版本") |
|||
.SetProperty("badgeType", "dot") |
|||
.SetProperty("link", "https://naive.vben.pro") |
|||
.SetProperty("title", "demos.vben.naive-ui") |
|||
); |
|||
project.AddItem( |
|||
new ApplicationMenu( |
|||
name: "VbenElementPlus", |
|||
displayName: "Element Plus 版本", |
|||
url: "/vben-admin/ele", |
|||
component: "", |
|||
icon: "logos:element", |
|||
description: "Element Plus 版本") |
|||
.SetProperty("badgeType", "dot") |
|||
.SetProperty("link", "https://ele.vben.pro") |
|||
.SetProperty("title", "demos.vben.element-plus") |
|||
); |
|||
|
|||
var about = new ApplicationMenu( |
|||
name: "VbenAbout", |
|||
displayName: "关于", |
|||
url: "/vben-admin/about", |
|||
component: "/_core/about/index", |
|||
description: "关于", |
|||
order: 9999, |
|||
icon: "lucide:copyright") |
|||
.SetProperty("title", "demos.vben.about"); |
|||
|
|||
return new NavigationDefinition[2] |
|||
{ |
|||
new NavigationDefinition(project), |
|||
new NavigationDefinition(about), |
|||
}; |
|||
} |
|||
|
|||
private static NavigationDefinition GetAccount() |
|||
{ |
|||
var account = new ApplicationMenu( |
|||
name: "Vben5Account", |
|||
displayName: "账户管理", |
|||
url: "/account", |
|||
component: "", |
|||
description: "账户管理", |
|||
icon: "mdi:account-outline") |
|||
.SetProperty("hideInMenu", "true") |
|||
.SetProperty("title", "abp.account.title"); |
|||
|
|||
account.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5AccountMySettings", |
|||
displayName: "个人设置", |
|||
url: "/account/my-settings", |
|||
component: "/account/my-settings/index", |
|||
icon: "tdesign:user-setting", |
|||
description: "个人设置") |
|||
.SetProperty("title", "abp.account.settings.title") |
|||
); |
|||
|
|||
return new NavigationDefinition(account); |
|||
} |
|||
|
|||
private static NavigationDefinition GetDashboard() |
|||
{ |
|||
var dashboard = new ApplicationMenu( |
|||
name: "Vben5Dashboard", |
|||
displayName: "仪表盘", |
|||
url: "/dashboard", |
|||
component: "", |
|||
description: "仪表盘", |
|||
icon: "lucide:layout-dashboard", |
|||
order: -1) |
|||
.SetProperty("title", "page.dashboard.title"); |
|||
|
|||
dashboard.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5Analysis", |
|||
displayName: "分析页", |
|||
url: "/analytics", |
|||
component: "/dashboard/analytics/index", |
|||
icon: "lucide:area-chart", |
|||
description: "分析页") |
|||
.SetProperty("affixTab", "true") |
|||
.SetProperty("title", "page.dashboard.analytics") |
|||
); |
|||
|
|||
dashboard.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5Workbench", |
|||
displayName: "工作台", |
|||
url: "/workspace", |
|||
component: "/dashboard/workspace/index", |
|||
icon: "carbon:workspace", |
|||
description: "工作台") |
|||
.SetProperty("title", "page.dashboard.workspace") |
|||
); |
|||
|
|||
return new NavigationDefinition(dashboard); |
|||
} |
|||
|
|||
private static NavigationDefinition GetManage() |
|||
{ |
|||
var manage = new ApplicationMenu( |
|||
name: "Vben5Manage", |
|||
displayName: "管理", |
|||
url: "/manage", |
|||
component: "", |
|||
description: "管理", |
|||
icon: "arcticons:activity-manager") |
|||
.SetProperty("title", "abp.manage.title"); |
|||
|
|||
var openIddict = manage.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5OpenIddict", |
|||
displayName: "身份认证服务器", |
|||
url: "/manage/openiddict", |
|||
component: "", |
|||
icon: "mdi:openid", |
|||
description: "身份认证服务器(OpenIddict)", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.openiddict.title")); |
|||
openIddict.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5OpenIddictApplications", |
|||
displayName: "应用管理", |
|||
url: "/manage/openiddict/applications", |
|||
component: "/openiddict/applications/index", |
|||
icon: "carbon:application", |
|||
description: "应用管理", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.openiddict.applications")); |
|||
openIddict.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5OpenIddictAuthorizations", |
|||
displayName: "授权管理", |
|||
url: "/manage/openiddict/authorizations", |
|||
component: "/openiddict/authorizations/index", |
|||
icon: "arcticons:ente-authenticator", |
|||
description: "授权管理", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.openiddict.authorizations")); |
|||
openIddict.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5OpenIddictScopes", |
|||
displayName: "范围管理", |
|||
url: "/manage/openiddict/scopes", |
|||
component: "/openiddict/scopes/index", |
|||
icon: "et:scope", |
|||
description: "范围管理", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.openiddict.scopes")); |
|||
openIddict.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5OpenIddictTokens", |
|||
displayName: "授权令牌", |
|||
url: "/manage/openiddict/tokens", |
|||
component: "/openiddict/tokens/index", |
|||
icon: "oui:token-key", |
|||
description: "授权令牌", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.openiddict.tokens")); |
|||
|
|||
var identity = manage.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5Identity", |
|||
displayName: "身份认证管理", |
|||
url: "/manage/identity", |
|||
component: "", |
|||
icon: "teenyicons:id-outline", |
|||
description: "身份认证管理") |
|||
.SetProperty("title", "abp.manage.identity.title")); |
|||
identity.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5IdentityUsers", |
|||
displayName: "用户管理", |
|||
url: "/manage/identity/users", |
|||
component: "/identity/users/index", |
|||
icon: "mdi:user-outline", |
|||
description: "用户管理") |
|||
.SetProperty("title", "abp.manage.identity.user")); |
|||
identity.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5IdentityRoles", |
|||
displayName: "角色管理", |
|||
url: "/manage/identity/roles", |
|||
component: "/identity/roles/index", |
|||
icon: "carbon:user-role", |
|||
description: "角色管理") |
|||
.SetProperty("title", "abp.manage.identity.role")); |
|||
identity.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5IdentityClaimTypes", |
|||
displayName: "身份标识", |
|||
url: "/manage/identity/claim-types", |
|||
component: "/identity/claim-types/index", |
|||
icon: "la:id-card-solid", |
|||
description: "身份标识", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.manage.identity.claimTypes")); |
|||
identity.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5IdentityOrganizationUnits", |
|||
displayName: "组织机构", |
|||
url: "/manage/identity/organization-units", |
|||
component: "/identity/organization-units/index", |
|||
icon: "clarity:organization-line", |
|||
description: "组织机构") |
|||
.SetProperty("title", "abp.manage.identity.organizationUnits")); |
|||
identity.AddItem( |
|||
new ApplicationMenu( |
|||
name: "SecurityLogs", |
|||
displayName: "安全日志", |
|||
url: "/manage/identity/security-logs", |
|||
component: "/identity/security-logs/index", |
|||
icon: "carbon:security", |
|||
description: "安全日志") |
|||
.SetProperty("title", "abp.manage.identity.securityLogs") |
|||
.SetProperty("requiredFeatures", "AbpAuditing.Logging.SecurityLog")); |
|||
identity.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5IdentitySessions", |
|||
displayName: "会话管理", |
|||
url: "/manage/identity/sessions", |
|||
component: "/identity/sessions/index", |
|||
icon: "carbon:prompt-session", |
|||
description: "会话管理") |
|||
.SetProperty("title", "abp.manage.identity.sessions")); |
|||
|
|||
var permissionManagement = manage.AddItem(new ApplicationMenu( |
|||
name: "Vben5Permissions", |
|||
displayName: "权限管理", |
|||
url: "/manage/permissions", |
|||
component: "", |
|||
description: "权限管理", |
|||
icon: "arcticons:permissionsmanager", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.manage.permissions.title")); |
|||
permissionManagement.AddItem(new ApplicationMenu( |
|||
name: "Vben5PermissionsGroupDefinitions", |
|||
displayName: "权限分组", |
|||
url: "/manage/permissions/groups", |
|||
component: "/permissions/groups/index", |
|||
icon: "lucide:group", |
|||
description: "权限分组", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.manage.permissions.groups")); |
|||
permissionManagement.AddItem(new ApplicationMenu( |
|||
name: "Vben5PermissionsDefinitions", |
|||
displayName: "权限定义", |
|||
url: "/manage/permissions/definitions", |
|||
component: "/permissions/definitions/index", |
|||
icon: "icon-park-outline:permissions", |
|||
description: "权限定义", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.manage.permissions.definitions")); |
|||
|
|||
|
|||
var featureManagement = manage.AddItem(new ApplicationMenu( |
|||
name: "Vben5Features", |
|||
displayName: "功能管理", |
|||
url: "/manage/features", |
|||
component: "", |
|||
description: "功能管理", |
|||
icon: "ant-design:gold-outlined", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.manage.features.title")); |
|||
featureManagement.AddItem(new ApplicationMenu( |
|||
name: "Vben5FeaturesGroupDefinitions", |
|||
displayName: "功能分组", |
|||
url: "/manage/features/groups", |
|||
component: "/features/groups/index", |
|||
icon: "lucide:group", |
|||
description: "功能分组", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.manage.features.groups")); |
|||
featureManagement.AddItem(new ApplicationMenu( |
|||
name: "Vben5FeaturesDefinitions", |
|||
displayName: "功能定义", |
|||
url: "/manage/features/definitions", |
|||
component: "/features/definitions/index", |
|||
icon: "pajamas:feature-flag", |
|||
description: "功能定义", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.manage.features.definitions")); |
|||
|
|||
var settingManagement = manage.AddItem(new ApplicationMenu( |
|||
name: "Vben5Settings", |
|||
displayName: "设置管理", |
|||
url: "/manage/settings", |
|||
component: "", |
|||
description: "设置管理", |
|||
icon: "ic:outline-settings") |
|||
.SetProperty("title", "abp.manage.settings.title") |
|||
// 此路由需要依赖设置管理特性
|
|||
.SetProperty("requiredFeatures", "SettingManagement.Enable")); |
|||
settingManagement.AddItem(new ApplicationMenu( |
|||
name: "Vben5SettingsSystem", |
|||
displayName: "系统设置", |
|||
url: "/manage/settings/system", |
|||
component: "/settings/system/index", |
|||
icon: "tabler:settings-cog", |
|||
description: "系统设置") |
|||
.SetProperty("title", "abp.manage.settings.system") |
|||
// 此路由需要依赖设置管理特性
|
|||
.SetProperty("requiredFeatures", "SettingManagement.Enable")); |
|||
settingManagement.AddItem(new ApplicationMenu( |
|||
name: "Vben5SettingsDefinitions", |
|||
displayName: "设置定义", |
|||
url: "/manage/settings/definitions", |
|||
component: "/settings/definitions/index", |
|||
icon: "codicon:settings", |
|||
description: "设置定义", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.manage.settings.definitions")); |
|||
|
|||
var localization = manage.AddItem(new ApplicationMenu( |
|||
name: "Vben5Localizations", |
|||
displayName: "本地化管理", |
|||
url: "/manage/localization", |
|||
component: "", |
|||
description: "本地化管理", |
|||
icon: "ion:globe-outline", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.manage.localization.title")); |
|||
localization.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5LocalizationsLanguages", |
|||
displayName: "语言管理", |
|||
url: "/manage/localization/languages", |
|||
component: "/localization/languages/index", |
|||
icon: "cil:language", |
|||
description: "语言管理", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.manage.localization.languages") |
|||
); |
|||
localization.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5LocalizationsResources", |
|||
displayName: "资源管理", |
|||
url: "/manage/localization/resources", |
|||
component: "/localization/resources/index", |
|||
icon: "grommet-icons:resources", |
|||
description: "资源管理", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.manage.localization.resources") |
|||
); |
|||
localization.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5LocalizationsTexts", |
|||
displayName: "文档管理", |
|||
url: "/manage/localization/texts", |
|||
component: "/localization/texts/index", |
|||
icon: "mi:text", |
|||
description: "文档管理", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.manage.localization.texts") |
|||
); |
|||
|
|||
var dataProtection = manage.AddItem(new ApplicationMenu( |
|||
name: "Vben5DataProtection", |
|||
displayName: "数据保护", |
|||
url: "/manage/data-protection", |
|||
component: "", |
|||
description: "数据保护", |
|||
icon: "icon-park-outline:protect", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.manage.dataProtection.title")); |
|||
dataProtection.AddItem(new ApplicationMenu( |
|||
name: "Vben5DataProtectionEntityTypeInfos", |
|||
displayName: "实体管理", |
|||
url: "/manage/data-protection/entity-type-infos", |
|||
component: "/data-protection/entity-type-infos/index", |
|||
icon: "iconamoon:type", |
|||
description: "实体管理", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.manage.dataProtection.entityTypeInfos")); |
|||
|
|||
manage.AddItem(new ApplicationMenu( |
|||
name: "Vben5AuditingAuditLogs", |
|||
displayName: "审计日志", |
|||
url: "/manage/audit-logs", |
|||
component: "/auditing/audit-logs/index", |
|||
icon: "fluent-mdl2:compliance-audit", |
|||
description: "审计日志") |
|||
.SetProperty("title", "abp.manage.auditLogs") |
|||
// 此路由需要依赖审计日志特性
|
|||
.SetProperty("requiredFeatures", "AbpAuditing.Logging.AuditLog")); |
|||
|
|||
manage.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5AuditingLoggings", |
|||
displayName: "系统日志", |
|||
url: "/manage/sys-logs", |
|||
component: "/auditing/loggings/index", |
|||
icon: "icon-park-outline:log", |
|||
description: "系统日志", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.manage.loggings")); |
|||
|
|||
var notificationManagement = manage.AddItem(new ApplicationMenu( |
|||
name: "Vben5Notifications", |
|||
displayName: "通知管理", |
|||
url: "/manage/notifications", |
|||
component: "", |
|||
description: "通知管理", |
|||
icon: "tabler:notification") |
|||
.SetProperty("title", "abp.manage.notifications.title")); |
|||
notificationManagement.AddItem(new ApplicationMenu( |
|||
name: "Vben5NotificationsMyNotifilers", |
|||
displayName: "我的通知", |
|||
url: "/manage/notifications/my-notifilers", |
|||
component: "/notifications/my-notifilers/index", |
|||
icon: "ant-design:notification-outlined", |
|||
description: "我的通知") |
|||
.SetProperty("title", "abp.manage.notifications.myNotifilers")); |
|||
notificationManagement.AddItem(new ApplicationMenu( |
|||
name: "Vben5NotificationsGroupDefinitions", |
|||
displayName: "通知分组", |
|||
url: "/manage/notifications/groups", |
|||
component: "/notifications/groups/index", |
|||
icon: "lucide:group", |
|||
description: "通知分组", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.manage.notifications.groups")); |
|||
notificationManagement.AddItem(new ApplicationMenu( |
|||
name: "NotificationsDefinitions", |
|||
displayName: "通知定义", |
|||
url: "/manage/notifications/definitions", |
|||
component: "/notifications/definitions/index", |
|||
icon: "nimbus:notification", |
|||
description: "通知定义", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.manage.notifications.definitions")); |
|||
|
|||
manage.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5ApiDocument", |
|||
displayName: "Api 文档", |
|||
url: "/manage/openapi", |
|||
component: "IFrame", |
|||
description: "Api 文档", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.manage.openApi") |
|||
// TODO: 注意在部署完毕之后手动修改此菜单iframe地址
|
|||
.SetProperty("iframeSrc", "http://127.0.0.1:30000/swagger/index.html")); |
|||
|
|||
manage.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5Caches", |
|||
displayName: "缓存管理", |
|||
url: "/manage/cache", |
|||
component: "/caching/caches/index", |
|||
description: "缓存管理") |
|||
.SetProperty("title", "abp.manage.cache")); |
|||
|
|||
return new NavigationDefinition(manage); |
|||
} |
|||
|
|||
private static NavigationDefinition GetSaas() |
|||
{ |
|||
var saas = new ApplicationMenu( |
|||
name: "Vben5Saas", |
|||
displayName: "Saas", |
|||
url: "/saas", |
|||
component: "", |
|||
description: "Saas", |
|||
icon: "ant-design:cloud-server-outlined", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.saas.title"); |
|||
saas.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5SaasTenants", |
|||
displayName: "租户管理", |
|||
url: "/saas/tenants", |
|||
component: "/saas/tenants/index", |
|||
icon: "arcticons:tenantcloud-pro", |
|||
description: "租户管理", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.saas.tenants")); |
|||
saas.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5SaasEditions", |
|||
displayName: "版本管理", |
|||
url: "/saas/editions", |
|||
component: "/saas/editions/index", |
|||
icon: "icon-park-outline:multi-rectangle", |
|||
description: "版本管理", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.saas.editions")); |
|||
|
|||
return new NavigationDefinition(saas); |
|||
} |
|||
|
|||
private static NavigationDefinition GetPlatform() |
|||
{ |
|||
var platform = new ApplicationMenu( |
|||
name: "Vben5Platform", |
|||
displayName: "平台管理", |
|||
url: "/platform", |
|||
component: "", |
|||
description: "平台管理", |
|||
icon: "ep:platform") |
|||
.SetProperty("title", "abp.platform.title"); |
|||
platform.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5PlatformDataDictionaries", |
|||
displayName: "数据字典", |
|||
url: "/platform/data-dictionaries", |
|||
component: "/platform/data-dictionaries/index", |
|||
icon: "material-symbols:dictionary-outline", |
|||
description: "数据字典") |
|||
.SetProperty("title", "abp.platform.dataDictionaries")); |
|||
platform.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5PlatformLayouts", |
|||
displayName: "布局管理", |
|||
url: "/platform/layouts", |
|||
component: "/platform/layouts/index", |
|||
icon: "material-symbols-light:responsive-layout", |
|||
description: "布局管理") |
|||
.SetProperty("title", "abp.platform.layouts")); |
|||
platform.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5PlatformMenus", |
|||
displayName: "菜单管理", |
|||
url: "/platform/menus", |
|||
component: "/platform/menus/index", |
|||
icon: "material-symbols-light:menu", |
|||
description: "菜单管理") |
|||
.SetProperty("title", "abp.platform.menus")); |
|||
|
|||
var messages = platform.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5PlatformMessages", |
|||
displayName: "消息管理", |
|||
url: "/platform/messages", |
|||
component: "", |
|||
icon: "tabler:message-cog", |
|||
description: "消息管理", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.platform.messages.title")); |
|||
messages.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5PlatformEmailMessages", |
|||
displayName: "邮件消息", |
|||
url: "/platform/messages/email", |
|||
component: "/platform/messages/email/index", |
|||
icon: "material-symbols:attach-email-outline", |
|||
description: "邮件消息", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.platform.messages.email")); |
|||
messages.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5PlatformSmsMessages", |
|||
displayName: "短信消息", |
|||
url: "/platform/messages/sms", |
|||
component: "/platform/messages/sms/index", |
|||
icon: "material-symbols:sms-outline", |
|||
description: "短信消息", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.platform.messages.sms")); |
|||
|
|||
return new NavigationDefinition(platform); |
|||
} |
|||
|
|||
private static NavigationDefinition GetOssManagement() |
|||
{ |
|||
var oss = new ApplicationMenu( |
|||
name: "Vben5Oss", |
|||
displayName: "对象存储", |
|||
url: "/oss", |
|||
component: "", |
|||
description: "对象存储", |
|||
icon: "icon-park-outline:cloud-storage") |
|||
.SetProperty("title", "abp.oss.title"); |
|||
oss.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5OssContainers", |
|||
displayName: "容器管理", |
|||
url: "/oss/containers", |
|||
component: "/oss/containers/index", |
|||
icon: "mdi:bucket-outline", |
|||
description: "容器管理") |
|||
.SetProperty("title", "abp.oss.containers")); |
|||
oss.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5OssObjects", |
|||
displayName: "文件管理", |
|||
url: "/oss/objects", |
|||
component: "/oss/objects/index", |
|||
icon: "mdi-light:file", |
|||
description: "文件管理") |
|||
.SetProperty("title", "abp.oss.objects")); |
|||
|
|||
return new NavigationDefinition(oss); |
|||
} |
|||
|
|||
private static NavigationDefinition GetTaskManagement() |
|||
{ |
|||
var task = new ApplicationMenu( |
|||
name: "Vben5Tasks", |
|||
displayName: "任务管理", |
|||
url: "/task-management", |
|||
component: "", |
|||
description: "任务管理", |
|||
icon: "eos-icons:background-tasks") |
|||
.SetProperty("title", "abp.tasks.title"); |
|||
task.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5TasksJobInfos", |
|||
displayName: "任务队列", |
|||
url: "/task-management/background-jobs", |
|||
component: "/tasks/job-infos/index", |
|||
icon: "eos-icons:job", |
|||
description: "任务队列") |
|||
.SetProperty("title", "abp.tasks.jobInfo.title")); |
|||
|
|||
return new NavigationDefinition(task); |
|||
} |
|||
|
|||
private static NavigationDefinition GetWebhooksManagement() |
|||
{ |
|||
var webhooks = new ApplicationMenu( |
|||
name: "Vben5Webhooks", |
|||
displayName: "WebHooks", |
|||
url: "/webhooks", |
|||
component: "", |
|||
description: "WebHooks", |
|||
icon: "material-symbols:webhook", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.webhooks.title"); |
|||
webhooks.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5WebhooksGroupDefinitions", |
|||
displayName: "Webhook分组", |
|||
url: "/webhooks/groups", |
|||
component: "/webhooks/groups/index", |
|||
icon: "lucide:group", |
|||
description: "Webhook分组", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.webhooks.groups")); |
|||
webhooks.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5WebhooksDefinitions", |
|||
displayName: "Webhook定义", |
|||
url: "/webhooks/definitions", |
|||
component: "/webhooks/definitions/index", |
|||
icon: "material-symbols:webhook", |
|||
description: "Webhook定义", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.webhooks.definitions")); |
|||
webhooks.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5WebhooksSubscriptions", |
|||
displayName: "管理订阅", |
|||
url: "/webhooks/subscriptions", |
|||
component: "/webhooks/subscriptions/index", |
|||
icon: "material-symbols:subscriptions", |
|||
description: "管理订阅", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.webhooks.subscriptions")); |
|||
webhooks.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5WebhooksSendAttempts", |
|||
displayName: "管理记录", |
|||
url: "/webhooks/send-attempts", |
|||
component: "/webhooks/send-attempts/index", |
|||
icon: "material-symbols:history", |
|||
description: "管理记录", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.webhooks.sendAttempts")); |
|||
|
|||
return new NavigationDefinition(webhooks); |
|||
} |
|||
|
|||
private static NavigationDefinition GetTextTemplating() |
|||
{ |
|||
var textTemplating = new ApplicationMenu( |
|||
name: "Vben5TextTemplating", |
|||
displayName: "模板管理", |
|||
url: "/text-templating", |
|||
component: "", |
|||
description: "模板管理", |
|||
icon: "tdesign:template", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.textTemplating.title"); |
|||
textTemplating.AddItem( |
|||
new ApplicationMenu( |
|||
name: "Vben5TextTemplatingDefinitions", |
|||
displayName: "模板定义", |
|||
url: "/text-templating/definitions", |
|||
component: "/text-templating/definitions/index", |
|||
icon: "qlementine-icons:template-16", |
|||
description: "模板定义", |
|||
multiTenancySides: MultiTenancySides.Host) |
|||
.SetProperty("title", "abp.textTemplating.definitions")); |
|||
|
|||
return new NavigationDefinition(textTemplating); |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
namespace LINGYUN.Abp.UI.Navigation.VueVbenAdmin5; |
|||
|
|||
public class AbpUINavigationVueVbenAdmin5Options |
|||
{ |
|||
public string UI { get; set; } |
|||
public string LayoutName { get; set; } |
|||
public string LayoutPath { get; set; } |
|||
public AbpUINavigationVueVbenAdmin5Options() |
|||
{ |
|||
UI = "vben5"; |
|||
LayoutName = "Vben5 Admin Layout"; |
|||
LayoutPath = "BasicLayout"; |
|||
} |
|||
} |
|||
@ -0,0 +1,471 @@ |
|||
using LINGYUN.Platform.Datas; |
|||
using LINGYUN.Platform.Layouts; |
|||
using LINGYUN.Platform.Menus; |
|||
using LINGYUN.Platform.Routes; |
|||
using LINGYUN.Platform.Utils; |
|||
using Microsoft.Extensions.Options; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.MultiTenancy; |
|||
using ValueType = LINGYUN.Platform.Datas.ValueType; |
|||
|
|||
namespace LINGYUN.Abp.UI.Navigation.VueVbenAdmin5; |
|||
|
|||
public class VueVbenAdmin5NavigationSeedContributor : NavigationSeedContributor |
|||
{ |
|||
private static int _lastCodeNumber = 0; |
|||
protected ICurrentTenant CurrentTenant { get; } |
|||
protected IGuidGenerator GuidGenerator { get; } |
|||
protected IRouteDataSeeder RouteDataSeeder { get; } |
|||
protected IDataDictionaryDataSeeder DataDictionaryDataSeeder { get; } |
|||
protected IMenuRepository MenuRepository { get; } |
|||
protected ILayoutRepository LayoutRepository { get; } |
|||
protected AbpUINavigationVueVbenAdmin5Options Options { get; } |
|||
|
|||
public VueVbenAdmin5NavigationSeedContributor( |
|||
ICurrentTenant currentTenant, |
|||
IRouteDataSeeder routeDataSeeder, |
|||
IMenuRepository menuRepository, |
|||
ILayoutRepository layoutRepository, |
|||
IGuidGenerator guidGenerator, |
|||
IDataDictionaryDataSeeder dataDictionaryDataSeeder, |
|||
IOptions<AbpUINavigationVueVbenAdmin5Options> options) |
|||
{ |
|||
CurrentTenant = currentTenant; |
|||
GuidGenerator = guidGenerator; |
|||
RouteDataSeeder = routeDataSeeder; |
|||
MenuRepository = menuRepository; |
|||
LayoutRepository = layoutRepository; |
|||
DataDictionaryDataSeeder = dataDictionaryDataSeeder; |
|||
|
|||
Options = options.Value; |
|||
} |
|||
|
|||
public override async Task SeedAsync(NavigationSeedContext context) |
|||
{ |
|||
var uiDataItem = await SeedUIFrameworkDataAsync(CurrentTenant.Id); |
|||
|
|||
var layoutData = await SeedLayoutDataAsync(CurrentTenant.Id); |
|||
|
|||
var layout = await SeedDefaultLayoutAsync(layoutData, uiDataItem); |
|||
|
|||
var latMenu = await MenuRepository.GetLastMenuAsync(); |
|||
|
|||
if (int.TryParse(CodeNumberGenerator.GetLastCode(latMenu?.Code ?? "0"), out int _lastNumber)) |
|||
{ |
|||
Interlocked.Exchange(ref _lastCodeNumber, _lastNumber); |
|||
} |
|||
|
|||
await SeedDefinitionMenusAsync(layout, layoutData, context.Menus, context.MultiTenancySides); |
|||
} |
|||
|
|||
private async Task SeedDefinitionMenusAsync( |
|||
Layout layout, |
|||
Data data, |
|||
IReadOnlyCollection<ApplicationMenu> menus, |
|||
MultiTenancySides multiTenancySides) |
|||
{ |
|||
foreach (var menu in menus) |
|||
{ |
|||
if (!menu.MultiTenancySides.HasFlag(multiTenancySides)) |
|||
{ |
|||
continue; |
|||
} |
|||
|
|||
var menuMeta = new Dictionary<string, object>() |
|||
{ |
|||
{ "icon", menu.Icon ?? "" }, |
|||
{ "order", menu.Order }, |
|||
}; |
|||
foreach (var prop in menu.ExtraProperties) |
|||
{ |
|||
if (menuMeta.ContainsKey(prop.Key)) |
|||
{ |
|||
menuMeta[prop.Key] = prop.Value; |
|||
} |
|||
else |
|||
{ |
|||
menuMeta.Add(prop.Key, prop.Value); |
|||
} |
|||
} |
|||
|
|||
var seedMenu = await SeedMenuAsync( |
|||
layout: layout, |
|||
data: data, |
|||
name: menu.Name, |
|||
path: menu.Url, |
|||
code: CodeNumberGenerator.CreateCode(GetNextCode()), |
|||
component: layout.Path, |
|||
displayName: menu.DisplayName, |
|||
redirect: menu.Redirect, |
|||
description: menu.Description, |
|||
parentId: null, |
|||
tenantId: layout.TenantId, |
|||
meta: menuMeta, |
|||
roles: new string[] { "admin" }); |
|||
|
|||
await SeedDefinitionMenuItemsAsync(layout, data, seedMenu, menu.Items, multiTenancySides); |
|||
} |
|||
} |
|||
|
|||
private async Task SeedDefinitionMenuItemsAsync( |
|||
Layout layout, |
|||
Data data, |
|||
Menu menu, |
|||
ApplicationMenuList items, |
|||
MultiTenancySides multiTenancySides) |
|||
{ |
|||
int index = 1; |
|||
foreach (var item in items) |
|||
{ |
|||
if (!item.MultiTenancySides.HasFlag(multiTenancySides)) |
|||
{ |
|||
continue; |
|||
} |
|||
|
|||
var menuMeta = new Dictionary<string, object>() |
|||
{ |
|||
{ "icon", item.Icon ?? "" }, |
|||
{ "order", item.Order }, |
|||
}; |
|||
foreach (var prop in item.ExtraProperties) |
|||
{ |
|||
if (menuMeta.ContainsKey(prop.Key)) |
|||
{ |
|||
menuMeta[prop.Key] = prop.Value; |
|||
} |
|||
else |
|||
{ |
|||
menuMeta.Add(prop.Key, prop.Value); |
|||
} |
|||
} |
|||
|
|||
var seedMenu = await SeedMenuAsync( |
|||
layout: layout, |
|||
data: data, |
|||
name: item.Name, |
|||
path: item.Url, |
|||
code: CodeNumberGenerator.AppendCode(menu.Code, CodeNumberGenerator.CreateCode(index)), |
|||
component: item.Component.IsNullOrWhiteSpace() ? layout.Path : item.Component, |
|||
displayName: item.DisplayName, |
|||
redirect: item.Redirect, |
|||
description: item.Description, |
|||
parentId: menu.Id, |
|||
tenantId: menu.TenantId, |
|||
meta: menuMeta, |
|||
roles: new string[] { "admin" }); |
|||
|
|||
await SeedDefinitionMenuItemsAsync(layout, data, seedMenu, item.Items, multiTenancySides); |
|||
|
|||
index++; |
|||
} |
|||
} |
|||
|
|||
private async Task<Menu> SeedMenuAsync( |
|||
Layout layout, |
|||
Data data, |
|||
string name, |
|||
string path, |
|||
string code, |
|||
string component, |
|||
string displayName, |
|||
string redirect = "", |
|||
string description = "", |
|||
Guid? parentId = null, |
|||
Guid? tenantId = null, |
|||
Dictionary<string, object> meta = null, |
|||
string[] roles = null, |
|||
Guid[] users = null, |
|||
bool isPublic = false |
|||
) |
|||
{ |
|||
var menu = await RouteDataSeeder.SeedMenuAsync( |
|||
layout, |
|||
name, |
|||
path, |
|||
code, |
|||
component, |
|||
displayName, |
|||
redirect, |
|||
description, |
|||
parentId, |
|||
tenantId, |
|||
isPublic |
|||
); |
|||
foreach (var item in data.Items) |
|||
{ |
|||
menu.SetProperty(item.Name, item.DefaultValue); |
|||
} |
|||
if (meta != null) |
|||
{ |
|||
foreach (var item in meta) |
|||
{ |
|||
menu.SetProperty(item.Key, item.Value); |
|||
} |
|||
} |
|||
|
|||
if (roles != null) |
|||
{ |
|||
foreach (var role in roles) |
|||
{ |
|||
await RouteDataSeeder.SeedRoleMenuAsync(role, menu, tenantId); |
|||
} |
|||
} |
|||
|
|||
if (users != null) |
|||
{ |
|||
foreach (var user in users) |
|||
{ |
|||
await RouteDataSeeder.SeedUserMenuAsync(user, menu, tenantId); |
|||
} |
|||
} |
|||
|
|||
return menu; |
|||
} |
|||
|
|||
private async Task<DataItem> SeedUIFrameworkDataAsync(Guid? tenantId) |
|||
{ |
|||
var data = await DataDictionaryDataSeeder |
|||
.SeedAsync( |
|||
"UI Framework", |
|||
CodeNumberGenerator.CreateCode(30), |
|||
"UI框架", |
|||
"UI Framework", |
|||
null, |
|||
tenantId, |
|||
true); |
|||
|
|||
data.AddItem( |
|||
GuidGenerator, |
|||
Options.UI, |
|||
Options.UI, |
|||
Options.UI, |
|||
ValueType.String, |
|||
Options.UI, |
|||
isStatic: true); |
|||
|
|||
return data.FindItem(Options.UI); |
|||
} |
|||
|
|||
private async Task<Layout> SeedDefaultLayoutAsync(Data data, DataItem uiDataItem) |
|||
{ |
|||
var layout = await RouteDataSeeder.SeedLayoutAsync( |
|||
Options.LayoutName, |
|||
Options.LayoutPath, // 路由层面已经处理好了,只需要传递LAYOUT可自动引用布局
|
|||
Options.LayoutName, |
|||
data.Id, |
|||
uiDataItem.Name, |
|||
"", |
|||
Options.LayoutName, |
|||
data.TenantId |
|||
); |
|||
|
|||
return layout; |
|||
} |
|||
|
|||
private async Task<Data> SeedLayoutDataAsync(Guid? tenantId) |
|||
{ |
|||
var data = await DataDictionaryDataSeeder |
|||
.SeedAsync( |
|||
Options.LayoutName, |
|||
CodeNumberGenerator.CreateCode(40), |
|||
"Vben5 Admin 布局约束", |
|||
"Vben5 Admin模板布局约束", |
|||
null, |
|||
tenantId, |
|||
true); |
|||
|
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"title", |
|||
"标题", |
|||
"", |
|||
ValueType.String, |
|||
"用于配置页面的标题,会在菜单和标签页中显示。一般会配合国际化使用。", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"icon", |
|||
"图标", |
|||
"", |
|||
ValueType.String, |
|||
"用于配置页面的图标,会在菜单和标签页中显示。一般会配合图标库使用,如果是http链接,会自动加载图片。", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"activeIcon", |
|||
"激活图标", |
|||
"", |
|||
ValueType.String, |
|||
"用于配置页面的激活图标,会在菜单中显示。一般会配合图标库使用,如果是http链接,会自动加载图片。", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"keepAlive", |
|||
"是否开启缓存", |
|||
"true", |
|||
ValueType.Boolean, |
|||
"用于配置页面是否开启缓存,开启后页面会缓存,不会重新加载,仅在标签页启用时有效。", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"hideInMenu", |
|||
"是否在菜单中隐藏", |
|||
"false", |
|||
ValueType.Boolean, |
|||
"用于配置页面是否在菜单中隐藏,隐藏后页面不会在菜单中显示。", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"hideInTab", |
|||
"是否在标签页中隐藏", |
|||
"false", |
|||
ValueType.Boolean, |
|||
"用于配置页面是否在标签页中隐藏,隐藏后页面不会在标签页中显示。", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"hideInBreadcrumb", |
|||
"是否在面包屑中隐藏", |
|||
"false", |
|||
ValueType.Boolean, |
|||
"用于配置页面是否在面包屑中隐藏,隐藏后页面不会在面包屑中显示。", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"hideChildrenInMenu", |
|||
"是否隐藏子菜单", |
|||
"false", |
|||
ValueType.Boolean, |
|||
"用于配置页面的子页面是否在菜单中隐藏,隐藏后子页面不会在菜单中显示。", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"authority", |
|||
"页面权限", |
|||
"", |
|||
ValueType.Array, |
|||
"用于配置页面的权限,只有拥有对应权限的用户才能访问页面,不配置则不需要权限。", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"badge", |
|||
"页面徽标", |
|||
"", |
|||
ValueType.String, |
|||
"用于配置页面的徽标,会在菜单显示。", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"badgeType", |
|||
"徽标类型", |
|||
"normal", |
|||
ValueType.String, |
|||
"用于配置页面的徽标类型,dot 为小红点,normal 为文本。", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"badgeVariants", |
|||
"徽标颜色", |
|||
"success", |
|||
ValueType.String, |
|||
"用于配置页面的徽标颜色,'default' | 'destructive' | 'primary' | 'success' | 'warning' | string", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"activePath", |
|||
"当前激活的菜单", |
|||
"", |
|||
ValueType.String, |
|||
"用于配置当前激活的菜单,有时候页面没有显示在菜单内,需要激活父级菜单时使用。", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"affixTab", |
|||
"是否固定标签页", |
|||
"false", |
|||
ValueType.Boolean, |
|||
"用于配置页面是否固定标签页,固定后页面不可关闭。", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"affixTabOrder", |
|||
"固定标签页排序,", |
|||
"0", |
|||
ValueType.Numeic, |
|||
"用于配置页面固定标签页的排序, 采用升序排序。", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"iframeSrc", |
|||
"内嵌页面地址", |
|||
"", |
|||
ValueType.String, |
|||
"用于配置内嵌页面的 iframe 地址,设置后会在当前页面内嵌对应的页面。", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"ignoreAccess", |
|||
"是否忽略权限", |
|||
"false", |
|||
ValueType.Boolean, |
|||
"用于配置页面是否忽略权限,直接可以访问。", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"link", |
|||
"外链跳转路径", |
|||
"", |
|||
ValueType.String, |
|||
"用于配置外链跳转路径,会在新窗口打开。", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"maxNumOfOpenTab", |
|||
"标签页最大打开数量", |
|||
"-1", |
|||
ValueType.Numeic, |
|||
"用于配置标签页最大打开数量,设置后会在打开新标签页时自动关闭最早打开的标签页(仅在打开同名标签页时生效)。", |
|||
isStatic: true); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"menuVisibleWithForbidden", |
|||
"是否可见菜单无权限", |
|||
"false", |
|||
ValueType.Boolean, |
|||
"用于配置页面在菜单可以看到,但是访问会被重定向到403。"); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"openInNewWindow", |
|||
"是否在新页面打开", |
|||
"false", |
|||
ValueType.Boolean, |
|||
"设置为 true 时,会在新窗口打开页面。"); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"order", |
|||
"页面排序", |
|||
"0", |
|||
ValueType.Numeic, |
|||
"用于配置页面的排序,用于路由到菜单排序。注意: 排序仅针对一级菜单有效,二级菜单的排序需要在对应的一级菜单中按代码顺序设置。"); |
|||
data.AddItem( |
|||
GuidGenerator, |
|||
"noBasicLayout", |
|||
"是否不使用基础布局", |
|||
"false", |
|||
ValueType.Boolean, |
|||
"用于配置当前路由不使用基础布局,仅在顶级时生效。默认情况下,所有的路由都会被包裹在基础布局中(包含顶部以及侧边等导航部件),如果你的页面不需要这些部件,可以设置 noBasicLayout 为 true。"); |
|||
|
|||
return data; |
|||
} |
|||
|
|||
private int GetNextCode() |
|||
{ |
|||
Interlocked.Increment(ref _lastCodeNumber); |
|||
return _lastCodeNumber; |
|||
} |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
using LINGYUN.Platform.Menus; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace LINGYUN.Abp.UI.Navigation.VueVbenAdmin5; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
public class VueVbenAdmin5StandardMenuConverter : IStandardMenuConverter, ISingletonDependency |
|||
{ |
|||
public StandardMenu Convert(Menu menu) |
|||
{ |
|||
var standardMenu = new StandardMenu |
|||
{ |
|||
Icon = "", |
|||
Name = menu.Name, |
|||
Path = menu.Path, |
|||
DisplayName = menu.DisplayName, |
|||
Description = menu.Description, |
|||
Redirect = menu.Redirect, |
|||
}; |
|||
|
|||
if (menu.ExtraProperties.TryGetValue("icon", out var icon)) |
|||
{ |
|||
standardMenu.Icon = icon.ToString(); |
|||
} |
|||
|
|||
return standardMenu; |
|||
} |
|||
} |
|||
Loading…
Reference in new issue