@using WeApp @using WeApp.Authorization @using WeApp.Configuration @using WeApp.Views.Shared.Modals @using WeApp.Views.Shared.SearchForm @using WeApp.Views.Shared.Table @{ string activeMenu = PermissionNames.PagesSystemMgUserMg; //The menu item will be active for this page. ViewBag.ActiveMenu = activeMenu; ViewBag.Title = L("UserTitle"); List userType = ViewBag.UserType; List activeType = ViewBag.IsActive; List accountType = ViewBag.AccountType; var searchItem = new List() { new SearchItem("userName", L("userName")), new SearchItem("name", L("realName")), new SearchItem("userType", L("userType"), FieldType.I, ExpType.Equal).SetSelectItem(userType,true), new SearchItem("emailAddress", L("emailAddress")), new SearchItem("isActive", L("activeState"), FieldType.B, ExpType.Equal).SetSelectItem(activeType,true), //new SearchItem("lastLoginTime", "最后登陆时间", FieldType.Dn).SetDateItem(0), }; if (AbpSession.AccountType == 1) { searchItem.Add(new SearchItem("accountType", L("accountType"), FieldType.In, ExpType.Equal).SetSelectItem(accountType, true)); } var searchForm = new SearchFormViewModel(searchItem); var table = new TableViewModel(IwbConsts.ApiAppUrl + "Users/GetAll", activeMenu, searchForm).SetFields(new List() { new FieldItem("userName", L("userName")), new FieldItem("name", L("realName")), new FieldItem("emailAddress", L("emailAddress")), new FieldItem("userType", L("userType"), "UserTypeFormatter"), new FieldItem("accountType", L("accountType"), "AccountTypeFormatter"), new FieldItem("", L("accountState"), "AccountStateFormatter"), new FieldItem("isActive", L("activeState"), "ActiveStateFormatter"), }); } @section styles{ } @Html.Partial("Table/_Table", table) @section modal{ @{ var inputs = new List() { new InputHide("id"), new InputHide("userName"), new Input("userType", L("userType")).SetSelectOptions(userType), new Input("name", L("realName")), new Input("emailAddress", L("emailAddress")), new Input("isActive", L("activeState")).SetSelectOptions(activeType) }; if (AbpSession.AccountType == AccountTypeDefinition.System) { inputs.Add(new Input("accountType", L("accountType")) .SetSelectOptions(accountType)); //inputs.Add(new Input("accountNo", InputTypes.List, "账号所属").SetNotRequired()); } else { inputs.Add(new Input("accountType", value: AbpSession.AccountType + "", hide: true)); inputs.Add(new Input("accountTypeName", L("accountType"), value: ViewBag.AccountTypeName).SetNotRequired()); //inputs.Add(new Input("accountNo", InputTypes.List, "账号所属").SetNotRequired()); } if (AbpSession.UserType == UsersAndRolesTypeDefinition.Supper || AbpSession.UserType == UsersAndRolesTypeDefinition.System) { inputs.Add(new Input("roleNames", L("roleInfos")).SetNotRequired() .SetSelectOptions((List)ViewBag.Roles, true)); } var modal = new ModalViewModel(L("user"), new ModalBodyViewModel(inputs)); } @Html.Partial("Modals/_Modal", modal)
} @section scripts { }
@Html.DropDownList("hid-accountType", accountType) @Html.DropDownList("hid-activeType", activeType)