RoleList.cshtml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. @using EMIS.Web.Controls;
  2. @using Bowin.Web.Controls.Mvc;
  3. @{
  4. ViewBag.Title = "StaffList";
  5. Guid? userID = new Guid(Request["userID"]);
  6. //角色信息
  7. ComboGridOptions cgopRole = new ComboGridOptions
  8. {
  9. TextField = "RoleName",
  10. ValueField = "RoleID",
  11. ID = "RoleDropdown",
  12. Name = "RoleDropdown",
  13. OnSelect = "reload",
  14. GridOptions = new DataGridOptions
  15. {
  16. Columns = new List<DataGridColumn>()
  17. {
  18. //new LinkButtonColumn { FieldName="OrderNo", HeaderText="序号", Align=AlignStyle.Center, Width=0.1 },
  19. new BoundFieldColumn { FieldName="RoleName", HeaderText="角色名称", Align=AlignStyle.Center, Width=0.2 }
  20. },
  21. IsCheckOnSelect = true,
  22. DataSourceUrl = Url.Content("~/Role/List"),
  23. IsPagination = true,
  24. IsShowRowNumbers = true,
  25. IsSingleSelect = false
  26. }
  27. };
  28. }
  29. @section scripts{
  30. <script type="text/javascript">
  31. var nonSelect = "@DropdownList.SELECT_ALL";
  32. //刷新
  33. function reload() {
  34. $("#dgRoleList").cmsXDataTable("load", $.getDataGridParams("dgRoleList"));
  35. }
  36. //设置列颜色为红色
  37. function SetRedColumn(index, row, value) {
  38. return " <span style=\"color: red;\">" + value + "</span>";
  39. }
  40. //Excel导出
  41. function StaffRole_DetailExport() {
  42. $("#formQuery").submit();
  43. }
  44. </script>
  45. }
  46. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  47. <form id="formQuery" method="post" action="@Url.Content("~/Staff/RoleListExcel?userID=" + userID)">
  48. @Html.PositionCondition("StaffRole")
  49. <div class="search_keyword">
  50. <div class="search_input">
  51. <ul>
  52. <li class="sn" style="padding-left: 5px;">角色名称:</li>
  53. <li class="sv">
  54. @Html.ComboGrid(cgopRole, new Dictionary<string, string> { { "data-condition", "dgRoleList" } })
  55. </li>
  56. <li class="sn" style="padding-left: 5px;">数据范围:</li>
  57. <li class="sv">
  58. @Html.DictionaryComboGrid(EMIS.ViewModel.DictionaryItem.SYS_DataRange, DropdownListBindType.SelectAll,
  59. new ComboGridOptions
  60. {
  61. ID = "DictionaryDataRange",
  62. Name = "DictionaryDataRange",
  63. OnSelect = "reload"
  64. }, new Dictionary<string, string> { { "data-condition", "dgRoleList" } })
  65. </li>
  66. <li class="sn" style="padding-left: 5px;color: red;">角色状态:</li>
  67. <li class="sv">
  68. @Html.DictionaryComboGrid(EMIS.ViewModel.DictionaryItem.SYS_STATUS, DropdownListBindType.SelectAll,
  69. new ComboGridOptions
  70. {
  71. ID = "DictionaryRoleStatus",
  72. Name = "DictionaryRoleStatus",
  73. OnSelect = "reload"
  74. }, new Dictionary<string, string> { { "data-condition", "dgRoleList" } })
  75. </li>
  76. </ul>
  77. </div>
  78. </div>
  79. <div class="p_title">
  80. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;"></div>
  81. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("RoleDetail")</div>
  82. </div>
  83. </form>
  84. <div class="search_list">
  85. @Html.DataGrid(new DataGridOptions
  86. {
  87. Columns = new List<DataGridColumn>()
  88. {
  89. new CheckBoxFieldColumn{ HeaderText="", FieldName="UserID" },
  90. new BoundFieldColumn { FieldName="LoginID", HeaderText="教职工号", Align=AlignStyle.Center, Width=0.04 },
  91. new BoundFieldColumn { FieldName="Name", HeaderText="姓名", Align=AlignStyle.Center, Width=0.04 },
  92. new BoundFieldColumn { FieldName="SexName", HeaderText="性别", Align=AlignStyle.Center, OrderFieldName="SexID", Width=0.02 },
  93. //new BoundFieldColumn { FieldName="BirthDate", HeaderText="出生日期", Align=AlignStyle.Center, Width=0.05, Formatter = Formatter.OnlyYearMonthDay },
  94. //new BoundFieldColumn { FieldName="NationName", HeaderText="民族", Align=AlignStyle.Center, OrderFieldName="NationID", Width=0.03 },
  95. //new BoundFieldColumn { FieldName="TeacherTypeName", HeaderText="教师类型", Align=AlignStyle.Center, OrderFieldName="TeacherTypeID", Width=0.04 },
  96. //new BoundFieldColumn { FieldName="IncumbencyStateName", HeaderText="在职状态", Align=AlignStyle.Center, OrderFieldName="IncumbencyState", Width=0.04 },
  97. //new BoundFieldColumn { FieldName="TitleName", HeaderText="职称", Align=AlignStyle.Center, OrderFieldName="TitleID", Width=0.04 },
  98. //new BoundFieldColumn { FieldName="OfficeTelephone", HeaderText="办公电话", Align=AlignStyle.Center, Width=0.065 },
  99. //new BoundFieldColumn { FieldName="Mobile", HeaderText="移动电话", Align=AlignStyle.Center, Width=0.06 },
  100. //new BoundFieldColumn { FieldName="PhotoHasValueName", HeaderText="照片", Align=AlignStyle.Center, OrderFieldName="PhotoHasValue", Width=0.02 },
  101. //new BoundFieldColumn { FieldName="CampusCode", HeaderText=@EMIS.Utility.RSL.Get("CampusCode"), Align=AlignStyle.Center, Width=0.05 },
  102. new BoundFieldColumn { FieldName="CampusName", HeaderText=@EMIS.Utility.RSL.Get("Campus"), Align=AlignStyle.Center, Width=0.06, OverflowLength=6 },
  103. //new BoundFieldColumn { FieldName="CollegeNo", HeaderText=@EMIS.Utility.RSL.Get("CollegeCode"), Align=AlignStyle.Center, Width=0.05 },
  104. new BoundFieldColumn { FieldName="CollegeName", HeaderText=@EMIS.Utility.RSL.Get("College"), Align=AlignStyle.Center, Width=0.08, OverflowLength=10 },
  105. //new BoundFieldColumn { FieldName="DepartmentCode", HeaderText="教研室代码", Align=AlignStyle.Center, Width=0.05 },
  106. new BoundFieldColumn { FieldName="DepartmentName", HeaderText="教研室", Align=AlignStyle.Center, Width=0.08, OverflowLength=10 },
  107. new BoundFieldColumn { FieldName="RoleOrderNo", HeaderText="角色序号", Align=AlignStyle.Center, Width=0.04 },
  108. new BoundFieldColumn { FieldName="RoleName", HeaderText="角色名称", Align=AlignStyle.Center, Width=0.05, OverflowLength=6 },
  109. //new BoundFieldColumn { FieldName="TypeName", HeaderText="角色类型", Align=AlignStyle.Center, OrderFieldName="TypeID", Width=0.04 },
  110. new BoundFieldColumn { FieldName="DataRangeName", HeaderText="数据范围", Align=AlignStyle.Center, OrderFieldName="DataRange", Width=0.04 },
  111. new BoundFieldColumn { FieldName="RoleStatusName", HeaderText="角色状态", Align=AlignStyle.Center, OrderFieldName="RoleStatus", Width=0.04, CustomFormatFun="SetRedColumn" },
  112. new BoundFieldColumn { FieldName="Remark", HeaderText="备注", Align=AlignStyle.Center, Width=0.03, OverflowLength=5 }
  113. },
  114. IsPostBack = true,
  115. IsCheckOnSelect = true,
  116. DataSourceUrl = Url.Content("~/Staff/RoleList?userID=" + userID),
  117. ID = "dgRoleList",
  118. IsPagination = true,
  119. IsShowRowNumbers = true,
  120. IsSingleSelect = false
  121. })
  122. </div>
  123. </div>