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.
 
 
 
 
 
 

103 lines
4.0 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 category = request('F_CategoryId');
  10. var bootstrap = function ($, learun) {
  11. "use strict";
  12. var page = {
  13. init: function () {
  14. page.initGrid();
  15. page.bind();
  16. },
  17. bind: function () {
  18. $('#IsRead').lrselect({
  19. placeholder: '请选择阅读状态',
  20. data: [{ id: '1', text: '已阅读' }, { id: '0', text: '未阅读' }],
  21. value: "id",
  22. text: "text"
  23. });
  24. // 查询
  25. $('#btn_Search').on('click', function () {
  26. var keyword = $('#txt_Keyword').val();
  27. var IsRead = $('#IsRead').lrselectGet();
  28. page.search({ keyword: keyword, IsRead: IsRead });
  29. });
  30. // 刷新
  31. $('#lr_refresh').on('click', function () {
  32. location.reload();
  33. });
  34. // 查看
  35. $('#lr_view').on('click', function () {
  36. var keyValue = $('#gridtable').jfGridValue('F_NewsId');
  37. if (learun.checkrow(keyValue)) {
  38. learun.layerForm({
  39. id: 'formview',
  40. title: '查看公告',
  41. url: top.$.rootUrl + '/Utility/ListContentIndex?id=' + keyValue,
  42. width: 1000,
  43. height: 650,
  44. maxmin: true,
  45. btn: null
  46. });
  47. }
  48. });
  49. },
  50. initGrid: function () {
  51. $('#gridtable').jfGrid({
  52. url: top.$.rootUrl + '/LR_OAModule/Notice/GetListOfSelfForView',
  53. headData: [
  54. { label: '公告标题', name: 'F_FullHead', index: 'F_FullHead', width: 600, align: 'left' },
  55. { label: '公告类别', name: 'F_Category', index: 'F_Category', width: 100, align: 'center' },
  56. {
  57. label: "发布时间", name: "F_ReleaseTime", index: "F_ReleaseTime", width: 140, align: "center",
  58. formatter: function (cellvalue) {
  59. return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm');
  60. }
  61. },
  62. { label: '信息来源', name: 'F_SourceName', index: 'F_SourceName', width: 100, align: 'center' },
  63. {
  64. label: "阅读状态", name: "RNewsId", index: "RNewsId", width: 80, align: "center", autowidth: false,
  65. formatter: function (cellvalue) {
  66. if (cellvalue != null && cellvalue != "") {
  67. return "<span class=\"label label-success\">已阅读</span>";
  68. } else {
  69. return "<span class=\"label label-danger\">未阅读</span>";
  70. }
  71. }
  72. },
  73. {
  74. label: "阅读时间", name: "RTime", index: "RTime", width: 130, align: "center",
  75. formatter: function (cellvalue) {
  76. return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm:ss');
  77. }
  78. }
  79. ],
  80. mainId: 'F_NewsId',
  81. isPage: false,
  82. sidx: 'F_CreateDate',
  83. sord: 'desc'
  84. });
  85. page.search();
  86. },
  87. search: function (param) {
  88. param = param || {};
  89. if (category) {
  90. param.categoryId = category;
  91. }
  92. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  93. }
  94. };
  95. // 保存数据后回调刷新
  96. refreshGirdData = function () {
  97. page.search();
  98. }
  99. page.init();
  100. }