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.
 
 
 
 
 
 

128 lines
5.4 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-07-09 10:45
  5. * 描 述:统一认证访问日志
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var page = {
  11. init: function () {
  12. page.initGird();
  13. page.bind();
  14. },
  15. bind: function () {
  16. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  17. page.search(queryJson);
  18. }, 220, 400);
  19. // 刷新
  20. $('#lr_refresh').on('click', function () {
  21. location.reload();
  22. });
  23. // 新增
  24. $('#lr_add').on('click', function () {
  25. learun.layerForm({
  26. id: 'form',
  27. title: '新增',
  28. url: top.$.rootUrl + '/Permission/Perm_FunctionVisit/Form',
  29. width: 600,
  30. height: 400,
  31. callBack: function (id) {
  32. return top[id].acceptClick(refreshGirdData);
  33. }
  34. });
  35. });
  36. // 编辑
  37. $('#lr_edit').on('click', function () {
  38. var keyValue = $('#gridtable').jfGridValue('PVId');
  39. if (learun.checkrow(keyValue)) {
  40. learun.layerForm({
  41. id: 'form',
  42. title: '编辑',
  43. url: top.$.rootUrl + '/Permission/Perm_FunctionVisit/Form?keyValue=' + keyValue,
  44. width: 600,
  45. height: 400,
  46. callBack: function (id) {
  47. return top[id].acceptClick(refreshGirdData);
  48. }
  49. });
  50. }
  51. });
  52. // 删除
  53. $('#lr_delete').on('click', function () {
  54. var keyValue = $('#gridtable').jfGridValue('PVId');
  55. if (learun.checkrow(keyValue)) {
  56. learun.layerConfirm('是否确认删除该项!', function (res) {
  57. if (res) {
  58. learun.deleteForm(top.$.rootUrl + '/Permission/Perm_FunctionVisit/DeleteForm', { keyValue: keyValue }, function () {
  59. refreshGirdData();
  60. });
  61. }
  62. });
  63. }
  64. });
  65. // 退出
  66. $('#lr_outhandle').on('click', function () {
  67. var keyValue = $('#gridtable').jfGridValue('PVId');
  68. if (learun.checkrow(keyValue)) {
  69. var PIsLoginSuccess = $('#gridtable').jfGridValue('PIsLoginSuccess');
  70. if (PIsLoginSuccess != true && PIsLoginSuccess != "true") {
  71. learun.alert.warning("此应用无法退出!");
  72. return false;
  73. }
  74. var IsOut = $('#gridtable').jfGridValue('IsOut');
  75. if (IsOut == true || IsOut == "true") {
  76. learun.alert.warning("此应用已退出!");
  77. return false;
  78. }
  79. learun.layerConfirm('是否确认退出该项!', function (res) {
  80. if (res) {
  81. learun.postForm(top.$.rootUrl + '/Permission/Perm_FunctionVisit/DoOutHandle', { keyValue: keyValue }, function () {
  82. refreshGirdData();
  83. });
  84. }
  85. });
  86. }
  87. });
  88. },
  89. // 初始化列表
  90. initGird: function () {
  91. $('#gridtable').jfGrid({
  92. url: top.$.rootUrl + '/Permission/Perm_FunctionVisit/GetPageList',
  93. headData: [
  94. { label: "系统名称", name: "FName", width: 200, align: "left" },
  95. { label: "访问日期", name: "PDate", width: 150, align: "left" },
  96. {
  97. label: "是否成功", name: "PIsLoginSuccess", width: 70, align: "center", formatter: function (cellvalue) {
  98. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  99. }
  100. },
  101. { label: "用户名称", name: "PUName", width: 100, align: "left" },
  102. { label: "访问情况", name: "PContent", width: 400, align: "left" },
  103. {
  104. label: "是否退出", name: "IsOut", width: 70, align: "center", formatter: function (cellvalue) {
  105. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  106. }
  107. },
  108. { label: "退出日期", name: "OutDate", width: 150, align: "left" },
  109. ],
  110. mainId: 'PVId',
  111. isPage: true,
  112. rows: 100,
  113. sidx: 'PDate desc',
  114. });
  115. page.search();
  116. },
  117. search: function (param) {
  118. param = param || {};
  119. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  120. }
  121. };
  122. refreshGirdData = function () {
  123. page.search();
  124. };
  125. page.init();
  126. }