You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

122 lines
4.9 KiB

  1. /*
  2. * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  3. * Copyright (c) 2013-2018 北京泉江科技有限公司
  4. * 创建人:陈彬彬
  5. * 日 期:2017.07.11
  6. * 描 述:公告通知
  7. */
  8. var refreshGirdData; // 更新数据
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. page.initGrid();
  14. page.bind();
  15. },
  16. bind: function () {
  17. // 查询
  18. $('#btn_Search').on('click', function () {
  19. var keyword = $('#txt_Keyword').val();
  20. page.search({ keyword: keyword });
  21. });
  22. // 刷新
  23. $('#lr_refresh').on('click', function () {
  24. location.reload();
  25. });
  26. // 新增
  27. $('#lr_add').on('click', function () {
  28. learun.layerForm({
  29. id: 'form',
  30. title: '添加公告',
  31. url: top.$.rootUrl + '/LR_OAModule/Notice/Form',
  32. width: 1000,
  33. height: 650,
  34. maxmin: true,
  35. callBack: function (id) {
  36. return top[id].acceptClick(refreshGirdData);
  37. }
  38. });
  39. });
  40. // 编辑
  41. $('#lr_edit').on('click', function () {
  42. var keyValue = $('#gridtable').jfGridValue('F_NewsId');
  43. if (learun.checkrow(keyValue)) {
  44. if (keyValue.indexOf(",") != -1) {
  45. learun.alert.warning("只能选择一条记录进行编辑!");
  46. return false;
  47. }
  48. learun.layerForm({
  49. id: 'formedit',
  50. title: '编辑公告',
  51. url: top.$.rootUrl + '/LR_OAModule/Notice/Form?keyValue=' + keyValue,
  52. width: 1000,
  53. height: 650,
  54. maxmin: true,
  55. callBack: function (id) {
  56. return top[id].acceptClick(refreshGirdData);
  57. }
  58. });
  59. }
  60. });
  61. // 删除
  62. $('#lr_delete').on('click', function () {
  63. var keyValue = $('#gridtable').jfGridValue('F_NewsId');
  64. if (learun.checkrow(keyValue)) {
  65. learun.layerConfirm('是否确认删除该项!', function (res) {
  66. if (res) {
  67. learun.deleteForm(top.$.rootUrl + '/LR_OAModule/Notice/DeleteForm', { keyValue: keyValue }, function () {
  68. refreshGirdData();
  69. });
  70. }
  71. });
  72. }
  73. });
  74. },
  75. initGrid: function () {
  76. $('#gridtable').jfGrid({
  77. url: top.$.rootUrl + '/LR_OAModule/Notice/GetPageList',
  78. headData: [
  79. { label: '公告标题', name: 'F_FullHead', index: 'F_FullHead', width: 600, align: 'left' },
  80. { label: '公告类别', name: 'F_Category', index: 'F_Category', width: 100, align: 'center' },
  81. {
  82. label: "发布时间", name: "F_ReleaseTime", index: "F_ReleaseTime", width: 140, align: "center",
  83. formatter: function (cellvalue) {
  84. return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm');
  85. }
  86. },
  87. { label: '信息来源', name: 'F_SourceName', index: 'F_SourceName', width: 100, align: 'center' },
  88. { label: '阅读次数', name: 'F_PV', index: 'F_PV', width: 80, align: 'center' },
  89. {
  90. label: "发布状态", name: "F_EnabledMark", index: "F_EnabledMark", width: 80, align: "center", autowidth: false,
  91. formatter: function (cellvalue) {
  92. if (cellvalue == 1) {
  93. return "<span class=\"label label-success\">已发布</span>";
  94. } else {
  95. return "<span class=\"label label-danger\">未发布</span>";
  96. }
  97. }
  98. },
  99. { label: "创建时间", name: "F_CreateDate", index: "F_CreateDate", width: 130, align: "center" }
  100. ],
  101. mainId: 'F_NewsId',
  102. reloadSelected: true,
  103. isMultiselect: true,
  104. isPage: true,
  105. sidx: 'F_CreateDate',
  106. sord: 'desc'
  107. });
  108. page.search();
  109. },
  110. search: function (param) {
  111. $('#gridtable').jfGridSet('reload', param);
  112. }
  113. };
  114. // 保存数据后回调刷新
  115. refreshGirdData = function () {
  116. page.search();
  117. }
  118. page.init();
  119. }