@using Microsoft.AspNetCore.Mvc.Rendering @using VberAdmin.Web.Models.Input @using VberAdmin.Web.Models.Modals @using VberAdmin.Web.Models.Search @using VberAdmin.Web.Models.Table @using VberZero @using VberZero.Session @using VberZero.Tools.StringModel @{ string activeMenu = PermissionNames.VberSystemMgRoleMg; //The menu item will be active for this page. ViewBag.ActiveMenu = activeMenu; ViewBag.Title = L("RoleTitle"); string roleTypeSelect = ViewBag.RoleType, activeTypeSelect = ViewBag.IsActive, accountTypeSelect = ViewBag.AccountType; var accountType = AbpSession.GetAccountType(); var searchItem = new List() { new VmSearchItem("name", L("roleName")), new VmSearchItem("displayName", L("roleDisplayName")), new VmSearchItem("userType", L("roleType"), FType.I, EType.Equal).WithSelect(roleTypeSelect, true), }; if (accountType == VzDefinition.AccountType.System) { searchItem.Add(new VmSearchItem("accountType", "账号类型", FType.I, EType.Equal).WithSelect(accountTypeSelect, true)); } var searchForm = new VmSearch(searchItem); var table = new VmTable(VzConsts.ApiAppUrl + "Role/GetAll", activeMenu, searchForm).AddItems(new List() { new VmTableItem("name", L("roleName")), new VmTableItem("displayName", L("roleDisplayName")), new VmTableItem("userType", L("roleType"), "RoleTypeFormatter"), new VmTableItem("accountType", L("accountType"), "AccountTypeFormatter"), }); var tab1 = new VmModalTab("role-info", "角色信息") .AddInputs(new List() { new VmInputHidden("id"), }) .AddGroup(new List() { new VmInput("name", L("roleName")), new VmInput("displayName", L("roleDisplayName")).WithRequired(), }); if (accountType == VzDefinition.AccountType.System) { tab1.AddGroup(new List() { new VmInput("userType", L("roleType")).WithSelect(roleTypeSelect), new VmInput("accountType", L("accountType")).WithSelect(accountTypeSelect), }); } else { tab1.AddInputs(new List() { new VmInput("userType", L("roleType")).WithSelect(roleTypeSelect), new VmInputHidden("accountType").WithDefaultValue(accountType.ToStr()) }); } tab1.AddInput(new VmInputTextarea("description", L("roleDescription"))); var modalBody = new VmModalBody() .AddTab(tab1) .AddTab("auth-info", "角色权限", "
"); var modal = new VmModal().WithHeaderAndFooter(L("role"), "").WithBody(modalBody); } @section styles{ } @await Html.PartialAsync("_Table", table) @await Html.PartialAsync("_Modal", modal) @section scripts { }