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.
 
 
 
 
 
 

150 lines
5.8 KiB

  1. /*
  2. * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  3. * Copyright (c) 2013-2018 北京泉江科技有限公司
  4. * 创建人:陈彬彬
  5. * 日 期:2017.03.22
  6. * 描 述:日志管理
  7. */
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var categoryId = '1';
  11. var logbegin = '';
  12. var logend = '';
  13. var refreshGirdData = function () {
  14. page.search();
  15. }
  16. var page = {
  17. init: function () {
  18. page.initleft();
  19. page.initGrid();
  20. page.bind();
  21. },
  22. bind: function () {
  23. $('.datetime').each(function () {
  24. $(this).lrdate({
  25. dfdata: [
  26. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  27. { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  28. { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  29. { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  30. ],
  31. // 月
  32. mShow: false,
  33. premShow: false,
  34. // 季度
  35. jShow: false,
  36. prejShow: false,
  37. // 年
  38. ysShow: false,
  39. yxShow: false,
  40. preyShow: false,
  41. yShow: false,
  42. // 默认
  43. dfvalue: '1',
  44. selectfn: function (begin, end) {
  45. logbegin = begin;
  46. logend = end;
  47. page.search();
  48. }
  49. });
  50. });
  51. // 查询
  52. $('#btn_Search').on('click', function () {
  53. var keyword = $('#txt_Keyword').val();
  54. page.search({ keyword: keyword });
  55. });
  56. // 刷新
  57. $('#lr_refresh').on('click', function () {
  58. location.reload();
  59. });
  60. // 清空
  61. $('#lr_removelog').on('click', function () {
  62. learun.layerForm({
  63. id: 'form',
  64. title: '清空',
  65. url: top.$.rootUrl + '/LR_SystemModule/Log/Form?categoryId=' + categoryId,
  66. height: 200,
  67. width: 400,
  68. callBack: function (id) {
  69. return top[id].acceptClick(refreshGirdData);
  70. }
  71. });
  72. });
  73. // 导出
  74. $('#lr_export').on('click', function () {
  75. learun.layerForm({
  76. id: "ExcelExportForm",
  77. title: '导出Excel数据',
  78. url: top.$.rootUrl + '/Utility/ExcelExportForm?gridId=gridtable&filename=log',
  79. width: 500,
  80. height: 380,
  81. callBack: function (id) {
  82. return top[id].acceptClick();
  83. },
  84. btn: ['导出Excel', '关闭']
  85. });
  86. });
  87. },
  88. initleft: function () {
  89. $('#lr_left_list li').on('click', function () {
  90. var $this = $(this);
  91. var $parent = $this.parent();
  92. $parent.find('.active').removeClass('active');
  93. $this.addClass('active');
  94. categoryId = $this.attr('data-value');
  95. page.search();
  96. });
  97. },
  98. initGrid: function () {
  99. $('#gridtable').jfGrid({
  100. url: top.$.rootUrl + '/LR_SystemModule/Log/GetPageList',
  101. headData: [
  102. {
  103. label: "操作时间", name: "F_OperateTime",width: 135, align: "left",
  104. formatter: function (cellvalue) {
  105. return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm:ss');
  106. }
  107. },
  108. { label: "操作用户", name: "F_OperateAccount",width: 140, align: "left" },
  109. { label: "IP地址", name: "F_IPAddress", width: 100, align: "left" },
  110. { label: "系统功能", name: "F_Module", width: 150, align: "left" },
  111. { label: "操作类型", name: "F_OperateType", width: 70, align: "center" },
  112. {
  113. label: "执行结果", name: "F_ExecuteResult", width: 70, align: "center",
  114. formatter: function (cellvalue) {
  115. if (cellvalue == '1') {
  116. return "<span class=\"label label-success\">成功</span>";
  117. } else {
  118. return "<span class=\"label label-danger\">失败</span>";
  119. }
  120. }
  121. },
  122. { label: "执行结果描述", name: "F_ExecuteResultJson", width: 300, align: "left" }
  123. ],
  124. mainId: 'F_ItemDetailId',
  125. isPage: true,
  126. sidx: 'F_OperateTime'
  127. });
  128. },
  129. search: function (param) {
  130. param = param || {};
  131. param.CategoryId = categoryId;
  132. param.StartTime = logbegin;
  133. param.EndTime = logend;
  134. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  135. }
  136. };
  137. page.init();
  138. }