BulletinInfos.cshtml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. @using ShwasherSys.Authorization.Permissions
  2. @using ShwasherSys.Models.Layout
  3. @using ShwasherSys.Models.Modal
  4. @{
  5. /**/
  6. ViewBag.ActiveMenu = PermissionNames.PagesNotificationInfoBulletinInfos; //The menu item will be active for this page.
  7. ViewBag.Title = "通知管理";
  8. List<SelectListItem> bulletinType = ViewBag.BulletinType;
  9. }
  10. @section css
  11. {
  12. <link rel="stylesheet" href="~/Content/Plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker-wr.css" />
  13. <link href="~/Content/Plugins/kindeditor/themes/default/default.css" rel="stylesheet" />
  14. }
  15. <div class="table-box mr-4 iwb-bootstrap-table">
  16. <input type="hidden" id="IsLock" value="N" />
  17. @Html.Action("ToolMenu", "Layout", new { pageName = ViewBag.ActiveMenu })
  18. <table id="table"
  19. data-url="/api/services/app/BulletinInfos/GetAll"
  20. data-striped="true" data-id-field="id" data-unique-id="id"
  21. data-method="post"
  22. data-side-pagination="server"
  23. data-content-type="application/x-www-form-urlencoded; charset=UTF-8"
  24. data-cache="false"
  25. 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"
  26. data-query-params="QueryParams"
  27. data-response-handler="ResponseHandler"
  28. data-click-to-select="true"
  29. data-single-select="true">
  30. <thead>
  31. <tr class="row" id="header">
  32. <th data-field="state" data-checkbox="true"></th>
  33. <th data-align="center" data-field="bulletinTypeName">通知类型</th>
  34. <th data-align="center" data-field="promulgator">发布者</th>
  35. <th data-align="center" data-field="promulgatTime">发布时间</th>
  36. <th data-align="center" data-field="title">通知标题</th>
  37. </tr>
  38. </thead>
  39. </table>
  40. </div>
  41. @section modal{
  42. <section>
  43. <!--Main Modal-->
  44. <div class="modal fade" id="modal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
  45. <div class="modal-dialog modal-dialog-centered" role="document">
  46. <div class="modal-content">
  47. @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("通知"))
  48. @{
  49. var inputs = new List<InputViewModel>
  50. {
  51. new InputViewModel("id", hide: true),
  52. new InputViewModel("bulletinType",InputTypes.List, displayName: "通知类型").SetSelectOptions(bulletinType),
  53. new InputViewModel("title", displayName: "通知标题"),
  54. new InputViewModel("promulgator", displayName: "发布者"),
  55. new InputViewModel("promulgatTime", displayName: "发布时间"),
  56. new InputViewModel("expirationDate", displayName: "截止时间"),
  57. new InputViewModel("content",InputTypes.Textarea, "标准描述").SetNotRequired(),
  58. };
  59. //var specials = new List<SpecialInputModel>();
  60. }
  61. @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs))
  62. @Html.Partial("Modals/_ModalFooter", "0")
  63. </div>
  64. </div>
  65. </div>
  66. </section>
  67. }
  68. @section scripts
  69. {
  70. <script src="~/Content/Plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
  71. <script src="~/Content/Plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
  72. <script src="~/Content/Plugins/kindeditor/kindeditor-all.js"></script>
  73. <script src="~/Content/Plugins/kindeditor/lang/zh-CN.js"></script>
  74. <script type="text/javascript">
  75. var KeditOptions = {
  76. resizeType: 1,
  77. width: "100%",
  78. height: "300px",
  79. uploadJson: '@Url.Action("KindEditorUploadFile", "System")',
  80. allowImageUpload: true,
  81. allowImageRemote: false,
  82. formatUploadUrl: false,
  83. afterChange: function() {
  84. this.sync();
  85. },
  86. afterBlur: function() {
  87. this.sync();
  88. },
  89. items: [
  90. 'formatblock', 'fontname', 'fontsize', 'forecolor', 'hilitecolor', 'bold',
  91. 'italic', 'underline', '|', 'justifyleft', 'justifycenter', 'justifyright',
  92. 'justifyfull', 'strikethrough', 'lineheight', 'removeformat', '|', 'source', 'preview', '/', 'undo',
  93. 'redo', 'template',
  94. 'plainpaste', 'wordpaste', '|', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent',
  95. 'subscript',
  96. 'superscript', 'clearhtml', 'quickformat', 'selectall',
  97. 'image',
  98. 'insertfile', 'table', 'hr', 'emoticons', 'pagebreak', 'fullscreen',
  99. 'link', 'unlink'
  100. ]
  101. };
  102. /*var editor;
  103. function Kedit($Content){
  104. editor = KindEditor.create($Content, KeditOptions);
  105. }*/
  106. var datePickerOpt = {
  107. language: 'zh-CN',
  108. format: "yyyy-mm-dd",
  109. todayBtn: true,
  110. autoclose: true,
  111. startView: 2,
  112. minView: 2,
  113. maxView: 4
  114. //showSecond: true,
  115. //showHours: true,
  116. //minuteStep: 10
  117. };
  118. $(function () {
  119. //show完毕前执行
  120. LoadTable();
  121. var funs = window.funs || { none: function () { console.log("No type"); } };
  122. //funs["btnUpdate"] = function () { BtnUpdate({ readonly: "standardName" }); };
  123. $("#promulgatTime").datetimepicker(datePickerOpt).on('show',function(event) {
  124. event.preventDefault();
  125. event.stopPropagation();
  126. }).on('hide',
  127. function(event) {
  128. event.preventDefault();
  129. event.stopPropagation();
  130. });
  131. $("#expirationDate").datetimepicker(datePickerOpt).on('show',function(event) {
  132. event.preventDefault();
  133. event.stopPropagation();
  134. }).on('hide',
  135. function(event) {
  136. event.preventDefault();
  137. event.stopPropagation();
  138. });
  139. //show完毕前执行
  140. /*$('#modal').on('shown.bs.modal',function() {
  141. //加上下面这句!解决了~
  142. $(document).off('focusin.modal');
  143. // 打开Dialog后创建编辑器
  144. Kedit("#content");
  145. });
  146. //hide完毕前执行
  147. $('#modal').on('hidden.bs.modal',function() {
  148. // 关闭Dialog前移除编辑器
  149. KindEditor.remove('#content');
  150. });*/
  151. KindEditor.create("#content", KeditOptions);
  152. funs["btnUpdate"] = function() {
  153. var rows = config.table.bootstrapTable("getSelections");
  154. if (rows.length === 1) {
  155. BtnUpdate({ readonly: "" });
  156. setTimeout(function() {
  157. KindEditor.html("#content",rows[0].content);
  158. },
  159. 500);
  160. }
  161. };
  162. funs["btnCreate"] = function() {
  163. BtnCreate({ data: { bulletinType:1}});
  164. //KindEditor.html("#discription", '');
  165. setTimeout(function() {
  166. //editor.html("");
  167. KindEditor.html("#content","");
  168. },
  169. 500);
  170. }
  171. });
  172. </script>
  173. }