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.
 
 
 
 
 
 

127 lines
5.1 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. $('#IsSend').lrselect({
  27. data: [{ text: "是", value: "1" }, { text: "是", value: "否" }],
  28. text: "text",
  29. value: "value"
  30. });
  31. // 新增
  32. $('#lr_add').on('click', function () {
  33. learun.layerForm({
  34. id: 'form',
  35. title: '添加公告',
  36. url: top.$.rootUrl + '/LR_OAModule/Notice/Form',
  37. width: 1000,
  38. height: 650,
  39. maxmin: true,
  40. callBack: function (id) {
  41. return top[id].acceptClick(refreshGirdData);
  42. }
  43. });
  44. });
  45. // 编辑
  46. $('#lr_edit').on('click', function () {
  47. var keyValue = $('#gridtable').jfGridValue('F_NewsId');
  48. if (learun.checkrow(keyValue)) {
  49. if (keyValue.indexOf(",") != -1) {
  50. learun.alert.warning("只能选择一条记录进行编辑!");
  51. return false;
  52. }
  53. learun.layerForm({
  54. id: 'formedit',
  55. title: '编辑公告',
  56. url: top.$.rootUrl + '/LR_OAModule/Notice/Form?keyValue=' + keyValue,
  57. width: 1000,
  58. height: 650,
  59. maxmin: true,
  60. callBack: function (id) {
  61. return top[id].acceptClick(refreshGirdData);
  62. }
  63. });
  64. }
  65. });
  66. // 删除
  67. $('#lr_delete').on('click', function () {
  68. var keyValue = $('#gridtable').jfGridValue('F_NewsId');
  69. if (learun.checkrow(keyValue)) {
  70. learun.layerConfirm('是否确认删除该项!', function (res) {
  71. if (res) {
  72. learun.deleteForm(top.$.rootUrl + '/LR_OAModule/Notice/DeleteForm', { keyValue: keyValue }, function () {
  73. refreshGirdData();
  74. });
  75. }
  76. });
  77. }
  78. });
  79. },
  80. initGrid: function () {
  81. $('#gridtable').jfGrid({
  82. url: top.$.rootUrl + '/LR_OAModule/Notice/GetPageList',
  83. headData: [
  84. { label: '公告标题', name: 'F_FullHead', index: 'F_FullHead', width: 600, align: 'left' },
  85. { label: '公告类别', name: 'F_Category', index: 'F_Category', width: 100, align: 'center' },
  86. {
  87. label: "发布时间", name: "F_ReleaseTime", index: "F_ReleaseTime", width: 140, align: "center",
  88. formatter: function (cellvalue) {
  89. return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm');
  90. }
  91. },
  92. { label: '信息来源', name: 'F_SourceName', index: 'F_SourceName', width: 100, align: 'center' },
  93. { label: '阅读次数', name: 'F_PV', index: 'F_PV', width: 80, align: 'center' },
  94. {
  95. label: "发布状态", name: "F_EnabledMark", index: "F_EnabledMark", width: 80, align: "center", autowidth: false,
  96. formatter: function (cellvalue) {
  97. if (cellvalue == 1) {
  98. return "<span class=\"label label-success\">已发布</span>";
  99. } else {
  100. return "<span class=\"label label-danger\">未发布</span>";
  101. }
  102. }
  103. },
  104. { label: "创建时间", name: "F_CreateDate", index: "F_CreateDate", width: 130, align: "center" }
  105. ],
  106. mainId: 'F_NewsId',
  107. reloadSelected: true,
  108. isMultiselect: true,
  109. isPage: true,
  110. sidx: 'F_CreateDate',
  111. sord: 'desc'
  112. });
  113. page.search();
  114. },
  115. search: function (param) {
  116. $('#gridtable').jfGridSet('reload', param);
  117. }
  118. };
  119. // 保存数据后回调刷新
  120. refreshGirdData = function () {
  121. page.search();
  122. }
  123. page.init();
  124. }