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 3.3 KiB

4 years ago
4 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  3. * Copyright (c) 2013-2018 北京泉江科技有限公司
  4. * 创建人:陈彬彬
  5. * 日 期:2017.03.22
  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. // 新增
  27. $('#lr_add').on('click', function () {
  28. learun.layerForm({
  29. id: 'InterfaceForm',
  30. title: '添加接口',
  31. url: top.$.rootUrl + '/LR_SystemModule/Interface/Form',
  32. width: 700,
  33. height: 400,
  34. callBack: function (id) {
  35. return top[id].acceptClick(refreshGirdData);
  36. }
  37. });
  38. });
  39. // 编辑
  40. $('#lr_edit').on('click', function () {
  41. var keyValue = $('#gridtable').jfGridValue('F_Id');
  42. if (learun.checkrow(keyValue)) {
  43. learun.layerForm({
  44. id: 'InterfaceForm',
  45. title: '编辑接口',
  46. url: top.$.rootUrl + '/LR_SystemModule/Interface/Form?keyValue=' + keyValue,
  47. width: 700,
  48. height: 400,
  49. callBack: function (id) {
  50. return top[id].acceptClick(refreshGirdData);
  51. }
  52. });
  53. }
  54. });
  55. // 删除
  56. $('#lr_delete').on('click', function () {
  57. var keyValue = $('#gridtable').jfGridValue('F_Id');
  58. if (learun.checkrow(keyValue)) {
  59. learun.layerConfirm('是否确认删除该项!', function (res) {
  60. if (res) {
  61. learun.deleteForm(top.$.rootUrl + '/LR_SystemModule/Interface/DeleteForm', { keyValue: keyValue }, function () {
  62. refreshGirdData();
  63. });
  64. }
  65. });
  66. }
  67. });
  68. },
  69. initGrid: function () {
  70. $('#gridtable').lrAuthorizeJfGrid({
  71. url: top.$.rootUrl + '/LR_SystemModule/Interface/GetPageList',
  72. headData: [
  73. { label: '接口名称', name: 'F_Name', width: 200, align: 'left' },
  74. { label: '接口地址', name: 'F_Address', width: 500, align: 'left' }
  75. ],
  76. isPage: true,
  77. mainId: 'F_Id',
  78. });
  79. page.search();
  80. },
  81. search: function (param) {
  82. $('#gridtable').jfGridSet('reload', param);
  83. }
  84. };
  85. // 保存数据后回调刷新
  86. refreshGirdData = function () {
  87. page.search();
  88. }
  89. page.init();
  90. }