Departments.cshtml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. @using ShwasherSys.Authorization.Permissions
  2. @using ShwasherSys.Models.Layout
  3. @using ShwasherSys.Models.Modal
  4. @{
  5. /**/
  6. ViewBag.ActiveMenu = PermissionNames.PagesBasicInfoDepartments; //The menu item will be active for this page.
  7. ViewBag.Title = "部门信息管理";
  8. // List<SelectListItem> classification = ViewBag.Classification;
  9. }
  10. @section css
  11. {
  12. <link href="~/Content/Plugins/kindeditor/themes/default/default.css" rel="stylesheet" />
  13. }
  14. <div class="table-box mr-4 iwb-bootstrap-table">
  15. <input type="hidden" id="IsLock" value="N" />
  16. @Html.Action("ToolMenu", "Layout", new {pageName = ViewBag.ActiveMenu})
  17. <table id="table"
  18. data-url="/api/services/app/Departments/GetAll"
  19. data-striped="true" data-id-field="id" data-unique-id="id"
  20. data-method="post"
  21. data-side-pagination="server"
  22. data-content-type="application/x-www-form-urlencoded; charset=UTF-8"
  23. data-cache="false"
  24. data-pagination="true" data-page-size="30" data-page-number="1" data-page-list="[30,50,100,200]" data-pagination-detail-h-align="right" data-pagination-h-align="left"
  25. data-query-params="QueryParams"
  26. data-response-handler="ResponseHandler"
  27. data-click-to-select="true"
  28. data-single-select="true">
  29. <thead>
  30. <tr class="row" id="header">
  31. <th data-field="state" data-checkbox="true"></th>
  32. <th data-align="center" data-field="id">部门编号</th>
  33. <th data-align="center" data-field="departmentName">部门名称</th>
  34. <th data-align="center" data-field="remark">备注</th>
  35. </tr>
  36. </thead>
  37. </table>
  38. </div>
  39. @section modal{
  40. <section>
  41. <!--Main Modal-->
  42. <div class="modal fade" id="modal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
  43. <div class="modal-dialog modal-dialog-centered" role="document">
  44. <div class="modal-content">
  45. @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("部门信息"))
  46. @{
  47. var inputs = new List<InputViewModel>
  48. {
  49. new InputViewModel("id", displayName: "编号"),
  50. new InputViewModel("departmentName", displayName: "部门名称"),
  51. new InputViewModel("remark",InputTypes.Textarea, "内容").SetNotRequired(),
  52. };
  53. //var specials = new List<SpecialInputModel>();
  54. }
  55. @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs))
  56. @Html.Partial("Modals/_ModalFooter", "0")
  57. </div>
  58. </div>
  59. </div>
  60. </section>
  61. }
  62. @section scripts
  63. {
  64. <script src="~/Content/Plugins/kindeditor/kindeditor-all.js"></script>
  65. <script src="~/Content/Plugins/kindeditor/lang/zh-CN.js"></script>
  66. <script type="text/javascript">
  67. $(function () {
  68. //show完毕前执行
  69. LoadTable();
  70. var funs = window.funs || { none: function () { console.log("No type"); } };
  71. funs["btnUpdate"] = function () { BtnUpdate({ readonly: "name" }); };
  72. });
  73. function GetSearchList() {
  74. var count = $("#SearchForm").find(".KeyWords").length;
  75. window._searchList = [];
  76. for (var i = 1; i <= count; i++) {
  77. var keyWords = $("#KeyWords-" + i).val();
  78. if (keyWords && keyWords !== "") {
  79. var keyField = $("#KeyField-" + i).val();
  80. var fieldType = $("#FieldType-" + i).val();
  81. var expType = $("#ExpType-" + i).val();
  82. window._searchList.push({ KeyWords: keyWords, KeyField: keyField, FieldType: fieldType, ExpType: expType });
  83. }
  84. }
  85. var isLock = $("#IsLock").val();
  86. window._searchList.push({ KeyWords: isLock, KeyField: "IsLock", FieldType: "0", ExpType: "6" });
  87. }
  88. </script>
  89. }