ABP 添加菜单

Posted guxingy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ABP 添加菜单相关的知识,希望对你有一定的参考价值。

项目版本:ABP Zero 4.9.0


1、BIMMP.CoreLocalizationSourceFilesBIMMP-zh-CN.xml

<text name="OAOfficeSuppliesManage">办公用品管理</text>
<text name="OAOfficeSupply">办公用品</text>
<text name="OAOfficeSupplyApply">办公用品申请</text>
<text name="OAOfficeSupplyPutIn">办公用品入库</text>
<text name="OAOfficeSupplyType">办公用品分类</text>

2、BIMMP.WebApp.Areas.OAMS.Startup.OAMS

public const string OAOfficeSuppliesManage = "OAMS.OAOfficeSuppliesManage";
public static class OAOfficeSuppliesManages
{
    public const string OAOfficeSupply = "OAMS.OAOfficeSupplies.OAOfficeSupply";
    public const string OAOfficeSupplyApply = "OAMS.OAOfficeSupplies.OAOfficeSupplyApply";
    public const string OAOfficeSupplyPutIn = "OAMS.OAOfficeSupplies.OAOfficeSupplyPutIn";
    public const string OAOfficeSupplyType = "OAMS.OAOfficeSupplies.OAOfficeSupplyType";
}

3、BIMMP.Authorization.PermissionNames

public const string Pages_OAMS_OAOfficeSuppliesManage = "Pages.OAMS.OAOfficeSuppliesManage";
public const string Pages_OAMS_OAOfficeSuppliesManage_OAOfficeSupply = "Pages.OAMS.OAOfficeSuppliesManage.OAOfficeSupply";
public const string Pages_OAMS_OAOfficeSuppliesManage_OAOfficeSupplyApply = "Pages.OAMS.OAOfficeSuppliesManage.OAOfficeSupplyApply";
public const string Pages_OAMS_OAOfficeSuppliesManage_OAOfficeSupplyPutIn = "Pages.OAMS.OAOfficeSuppliesManage.OAOfficeSupplyPutIn";
public const string Pages_OAMS_OAOfficeSuppliesManage_OAOfficeSupplyType = "Pages.OAMS.OAOfficeSuppliesManage.OAOfficeSupplyType";

4、BIMMP.WebApp.Areas.OAMS.Startup.OAMSNavigationProvider

//办公用品
.AddItem(new MenuItemDefinition(
        OAMSPageNames.OAMS.OAOfficeSuppliesManage,
        L("OAOfficeSuppliesManage"),
        icon: "layui-icon-notice",
        requiredPermissionName: PermissionNames.Pages_OAMS_OAOfficeSuppliesManage
    ).AddItem(new MenuItemDefinition(
            OAMSPageNames.OAMS.OAOfficeSuppliesManages.OAOfficeSupply,
            L("OAOfficeSupply"),
            icon: "layui-icon-align-left",
            url: "/OAMS/OAOfficeSupplies/OAOfficeSupply",
            requiredPermissionName: PermissionNames.Pages_OAMS_OAOfficeSuppliesManage_OAOfficeSupply
        )
    ).AddItem(new MenuItemDefinition(
            OAMSPageNames.OAMS.OAOfficeSuppliesManages.OAOfficeSupplyApply,
            L("OAOfficeSupplyApply"),
            icon: "layui-icon-speaker",
            url: "/OAMS/OAOfficeSupplies/OAOfficeSupplyApply",
            requiredPermissionName: PermissionNames.Pages_OAMS_OAOfficeSuppliesManage_OAOfficeSupplyApply
        )
    ).AddItem(new MenuItemDefinition(
            OAMSPageNames.OAMS.OAOfficeSuppliesManages.OAOfficeSupplyPutIn,
            L("OAOfficeSupplyPutIn"),
            icon: "layui-icon-chat",
            url: "/OAMS/OAOfficeSupplies/OAOfficeSupplyPutIn",
            requiredPermissionName: PermissionNames.Pages_OAMS_OAOfficeSuppliesManage_OAOfficeSupplyPutIn
        )
    ).AddItem(new MenuItemDefinition(
            OAMSPageNames.OAMS.OAOfficeSuppliesManages.OAOfficeSupplyType,
            L("OAOfficeSupplyType"),
            icon: "layui-icon-chat",
            url: "/OAMS/OAOfficeSupplies/OAOfficeSupplyType",
            requiredPermissionName: PermissionNames.Pages_OAMS_OAOfficeSuppliesManage_OAOfficeSupplyType
        )
    )
)

5、BIMMP.Authorization.BIMMPAuthorizationProvider

var oAOfficeSuppliesManage = oams.CreateChildPermission(PermissionNames.Pages_OAMS_OAOfficeSuppliesManage, L("OAOfficeSuppliesManage"));
oAOfficeSuppliesManage.CreateChildPermission(PermissionNames.Pages_OAMS_OAOfficeSuppliesManage_OAOfficeSupply, L("OAOfficeSupply"));
oAOfficeSuppliesManage.CreateChildPermission(PermissionNames.Pages_OAMS_OAOfficeSuppliesManage_OAOfficeSupplyApply, L("OAOfficeSupplyApply"));
oAOfficeSuppliesManage.CreateChildPermission(PermissionNames.Pages_OAMS_OAOfficeSuppliesManage_OAOfficeSupplyPutIn, L("OAOfficeSupplyPutIn"));
oAOfficeSuppliesManage.CreateChildPermission(PermissionNames.Pages_OAMS_OAOfficeSuppliesManage_OAOfficeSupplyType, L("OAOfficeSupplyType"));





以上是关于ABP 添加菜单的主要内容,如果未能解决你的问题,请参考以下文章

ABP 添加菜单

ABP 菜单和权限

添加片段时的 FlyOut 菜单设计问题

ABP框架详解Navigation

从外部片段内的 FragmentTabHost 的子片段添加新的选项菜单

52ABP实战教程0.3-- 从github推送代码回vsts实现双向同步