SysHelps.cshtml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. @using ShwasherSys.Authorization.Permissions
  2. @using ShwasherSys.Models.Layout
  3. @using ShwasherSys.Models.Modal
  4. @{
  5. /**/
  6. ViewBag.ActiveMenu = PermissionNames.PagesSystemSysHelp; //The menu item will be active for this page.
  7. ViewBag.Title = "系统帮助管理";
  8. List<SelectListItem> classification = ViewBag.Classification;
  9. var searchForm = new SearchFormViewModal(new List<SearchItem>()
  10. {
  11. new SearchItem("classification","帮助类别",FiledType.S )
  12. .SetSearchItem(classification)
  13. }, false);
  14. }
  15. @section css
  16. {
  17. <link href="~/Content/Plugins/kindeditor/themes/default/default.css" rel="stylesheet" />
  18. }
  19. <div class="table-box mr-4 iwb-bootstrap-table">
  20. @Html.Action("ToolMenu", "Layout", new { pageName = ViewBag.ActiveMenu, searchForm })
  21. <table id="table"
  22. data-url="/api/services/app/SysHelps/GetAll"
  23. data-striped="true" data-id-field="id" data-unique-id="id"
  24. data-method="post"
  25. data-side-pagination="server"
  26. data-content-type="application/x-www-form-urlencoded; charset=UTF-8"
  27. data-cache="false"
  28. 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"
  29. data-query-params="QueryParams"
  30. data-response-handler="ResponseHandler"
  31. data-click-to-select="true"
  32. data-single-select="true">
  33. <thead>
  34. <tr class="row" id="header">
  35. <th data-field="state" data-checkbox="true"></th>
  36. <th data-align="center" data-field="helpTitle">角色编号</th>
  37. <th data-align="center" data-field="helpKeyWords">关键字信息</th>
  38. <th data-align="center" data-field="classificationShow">帮助类别</th>
  39. <th data-align="center" data-field="sequence">排序</th>
  40. </tr>
  41. </thead>
  42. </table>
  43. </div>
  44. @section modal{
  45. <section>
  46. <!--Main Modal-->
  47. <div class="modal fade" id="modal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
  48. <div class="modal-dialog modal-dialog-centered" role="document">
  49. <div class="modal-content">
  50. @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("系统帮助"))
  51. @{
  52. var inputs = new List<InputViewModel>
  53. {
  54. new InputViewModel("id", hide: true),
  55. new InputViewModel("helpTitle", displayName: "标题"),
  56. new InputViewModel("helpKeyWords", displayName: "关键字信息"),
  57. new InputViewModel("sequence", displayName: "序列"),
  58. new InputViewModel("classification",InputTypes.List, "帮助类别")
  59. .SetSelectOptions(classification),
  60. new InputViewModel("helpContent",InputTypes.Textarea, "内容").SetNotRequired(),
  61. };
  62. //var specials = new List<SpecialInputModel>();
  63. }
  64. @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs))
  65. @Html.Partial("Modals/_ModalFooter", "0")
  66. </div>
  67. </div>
  68. </div>
  69. </section>
  70. }
  71. @section scripts
  72. {
  73. <script src="~/Content/Plugins/kindeditor/kindeditor-all.js"></script>
  74. <script src="~/Content/Plugins/kindeditor/lang/zh-CN.js"></script>
  75. <script type="text/javascript">
  76. var KeditOptions = {
  77. resizeType: 1,
  78. width: "100%",
  79. height: "300px",
  80. uploadJson: '@Url.Action("KindEditorUploadFile", "System")',
  81. allowUpload: true,
  82. //allowImageUpload: true,
  83. //allowImageRemote: false,
  84. //formatUploadUrl: false,
  85. afterChange: function() {
  86. this.sync();
  87. },
  88. afterBlur: function() {
  89. this.sync();
  90. },
  91. items: [
  92. 'formatblock', 'fontname', 'fontsize', 'forecolor', 'hilitecolor', 'bold',
  93. 'italic', 'underline', '|', 'justifyleft', 'justifycenter', 'justifyright',
  94. 'justifyfull', 'strikethrough', 'lineheight', 'removeformat', '|', 'source', 'preview', '/', 'undo',
  95. 'redo', 'template',
  96. 'plainpaste', 'wordpaste', '|', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent',
  97. 'subscript',
  98. 'superscript', 'clearhtml', 'quickformat', 'selectall',
  99. 'image',
  100. 'insertfile', 'table', 'hr', 'emoticons', 'pagebreak', 'fullscreen',
  101. 'link', 'unlink'
  102. ]
  103. }
  104. /*var editor;
  105. function Kedit($Content) {
  106. editor = KindEditor.create($Content, KeditOptions);
  107. }*/
  108. $(function () {
  109. //show完毕前执行
  110. /*$('#modal').on('shown.bs.modal',
  111. function () {
  112. //加上下面这句!解决了~
  113. $(document).off('focusin.modal');
  114. // 打开Dialog后创建编辑器
  115. //Kedit("#helpContent");
  116. });
  117. //hide完毕前执行
  118. $('#modal').on('hidden.bs.modal',
  119. function () {
  120. // 关闭Dialog前移除编辑器
  121. //KindEditor.remove('#helpContent');
  122. });//show完毕前执行*/
  123. LoadTable();
  124. var funs = window.funs || { none: function () { console.log("No type"); } };
  125. //funs["btnUpdate"] = function () { BtnUpdate({ readonly: "name" }); };
  126. KindEditor.create("#helpContent", KeditOptions);
  127. funs["btnUpdate"] = function () {
  128. var rows = config.table.bootstrapTable("getSelections");
  129. if (rows.length === 1) {
  130. BtnUpdate({ readonly: "" });
  131. setTimeout(function () {
  132. KindEditor.html("#helpContent", rows[0].helpContent);
  133. },
  134. 500);
  135. } else
  136. abp.message.warn(abp.localization.localize("ChooseOneToOp"));
  137. };
  138. funs["btnCreate"] = function () {
  139. BtnCreate();
  140. //KindEditor.html("#discription", '');
  141. setTimeout(function() {
  142. KindEditor.html("#helpContent", "");
  143. },
  144. 500);
  145. }
  146. });
  147. </script>
  148. }