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.

Index.js 5.8 KiB

4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  53. page.search(queryJson);
  54. }, 200, 400);
  55. // 刷新
  56. $('#lr_refresh').on('click', function () {
  57. location.reload();
  58. });
  59. // 清空
  60. $('#lr_removelog').on('click', function () {
  61. learun.layerForm({
  62. id: 'form',
  63. title: '清空',
  64. url: top.$.rootUrl + '/LR_SystemModule/Log/Form?categoryId=' + categoryId,
  65. height: 200,
  66. width: 400,
  67. callBack: function (id) {
  68. return top[id].acceptClick(refreshGirdData);
  69. }
  70. });
  71. });
  72. // 导出
  73. $('#lr_export').on('click', function () {
  74. learun.layerForm({
  75. id: "ExcelExportForm",
  76. title: '导出Excel数据',
  77. url: top.$.rootUrl + '/Utility/ExcelExportForm?gridId=gridtable&filename=log',
  78. width: 500,
  79. height: 380,
  80. callBack: function (id) {
  81. return top[id].acceptClick();
  82. },
  83. btn: ['导出Excel', '关闭']
  84. });
  85. });
  86. },
  87. initleft: function () {
  88. $('#lr_left_list li').on('click', function () {
  89. var $this = $(this);
  90. var $parent = $this.parent();
  91. $parent.find('.active').removeClass('active');
  92. $this.addClass('active');
  93. categoryId = $this.attr('data-value');
  94. page.search();
  95. });
  96. },
  97. initGrid: function () {
  98. $('#gridtable').jfGrid({
  99. url: top.$.rootUrl + '/LR_SystemModule/Log/GetPageList',
  100. headData: [
  101. {
  102. label: "操作时间", name: "F_OperateTime",width: 135, align: "left",
  103. formatter: function (cellvalue) {
  104. return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm:ss');
  105. }
  106. },
  107. { label: "操作用户", name: "F_OperateAccount",width: 140, align: "left" },
  108. { label: "IP地址", name: "F_IPAddress", width: 100, align: "left" },
  109. { label: "系统功能", name: "F_Module", width: 150, align: "left" },
  110. { label: "操作类型", name: "F_OperateType", width: 70, align: "center" },
  111. {
  112. label: "执行结果", name: "F_ExecuteResult", width: 70, align: "center",
  113. formatter: function (cellvalue) {
  114. if (cellvalue == '1') {
  115. return "<span class=\"label label-success\">成功</span>";
  116. } else {
  117. return "<span class=\"label label-danger\">失败</span>";
  118. }
  119. }
  120. },
  121. { label: "执行结果描述", name: "F_ExecuteResultJson", width: 300, align: "left" }
  122. ],
  123. mainId: 'F_ItemDetailId',
  124. isPage: true,
  125. sidx: 'F_OperateTime'
  126. });
  127. },
  128. search: function (param) {
  129. param = param || {};
  130. param.CategoryId = categoryId;
  131. param.StartTime = logbegin;
  132. param.EndTime = logend;
  133. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  134. }
  135. };
  136. page.init();
  137. }