@using VberZero.Session @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.Tools.StringModel @{ string activeMenu = PermissionNames.VberSystemMgUserMg; //The menu item will be active for this page. ViewBag.ActiveMenu = activeMenu; ViewBag.Title = L("UserTitle"); string userTypeSelect = ViewBag.UserType, activeTypeSelect = ViewBag.IsActive, accountTypeSelect = ViewBag.AccountType, gender = ViewBag.Gender; string[] gender2 = ViewBag.Gender2,activeTypeSelect2=ViewBag.IsActive2; var accountType = AbpSession.GetAccountType(); var userType = AbpSession.GetUserType(); var userName = AbpSession.GetUserName(); var searchItem = new List() { new VmSearchItem("userName", L("userName")), new VmSearchItem("surname", L("realName")), new VmSearchItem("phoneNumber", L("phoneNumber")), new VmSearchItem("emailAddress", L("emailAddress")), new VmSearchItem("gender", L("genderType"), FType.I, EType.Equal).WithRadio(gender2), new VmSearchItem("isActive", L("activeState"), FType.B, EType.Equal).WithRadio(activeTypeSelect2 ), new VmSearchItem("userType", L("userType"), FType.I, EType.Equal).WithSelect(userTypeSelect ), //new SearchItem("lastLoginTime", "最后登陆时间", FieldType.Dn).SetDateItem(0), }; if (accountType == VzDefinition.AccountType.System) { searchItem.Add(new VmSearchItem("accountType", L("accountType"), FType.In, EType.Equal).WithSelect(accountTypeSelect, true)); } var searchForm = new VmSearch(searchItem); var table = new VmTable(VzConsts.ApiAppUrl + "User/GetAll", activeMenu, searchForm).AddItems(new List() { new VmTableItem("userName", L("userName")).WithSort(), new VmTableItem("surname", L("realName")), new VmTableItem("emailAddress", L("emailAddress")), new VmTableItem("phoneNumber", L("phoneNumber")), new VmTableItem("gender", L("genderType"), "GenderFormatter").WithSort(), new VmTableItem("userType", L("userType"), "UserTypeFormatter").WithSort(), new VmTableItem("accountType", L("accountType"), "AccountTypeFormatter").WithSort(), new VmTableItem("accountNo", L("accountState"), "AccountStateFormatter").WithSort(), new VmTableItem("isActive", L("activeState"), "ActiveStateFormatter").WithSort(), }); var modalBody = new VmModalBody(); modalBody.AddTab(new VmModalTab("base-info", "用户信息") .AddInputs( new List() { new VmInputHidden("id"), new VmInputHidden("userName"), }) .AddGroup(new List { new VmInput("surname", L("realName")).WithRequired(), new VmInput("emailAddress", L("emailAddress")).WithRequired(), new VmInput("phoneNumber", L("phoneNumber")), },3) .AddGroup( new List() { new VmInput("accountType", L("accountType")) .WithSelect(accountTypeSelect) .WithRequired(), new VmInput("userType", L("userType")) .WithSelect(userTypeSelect) .WithRequired() }) .AddGroup(new List { new VmInput("gender", L("genderType")).WithRadio(gender2).WithDefaultValue(VzDefinition.GenderType.Man.ToStr()), new VmInput("isActive", L("activeState")).WithRadio(activeTypeSelect2) }) ); if (userType == VzDefinition.UserType.Supper || userType == VzDefinition.UserType.System) { modalBody.AddTab("role-info", "用户角色", "
"); } modalBody.AddTab("auth-info", "用户权限", "
"); var modal = new VmModal() .WithHeaderAndFooter(L("user"),"") .WithBody(modalBody); } @await Html.PartialAsync("_Table", table) @await Html.PartialAsync("_Modal", modal) @section styles { } @section scripts { }