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.
 
 
 
 
 
 

100 lines
3.6 KiB

  1. /*
  2. * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  3. * Copyright (c) 2013-2018 北京泉江科技有限公司
  4. * 创建人:陈彬彬
  5. * 日 期:2017.04.17
  6. * 描 述:自定义查询
  7. */
  8. var refreshGirdData; // 更新数据
  9. var selectedRow;
  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. // 查询
  19. $('#btn_Search').on('click', function () {
  20. var keyword = $('#txt_Keyword').val();
  21. page.search({ keyword: keyword });
  22. });
  23. // 刷新
  24. $('#lr_refresh').on('click', function () {
  25. location.reload();
  26. });
  27. // 新增
  28. $('#lr_add').on('click', function () {
  29. selectedRow = null;
  30. learun.layerForm({
  31. id: 'Form',
  32. title: '添加公共自定义查询',
  33. url: top.$.rootUrl + '/LR_SystemModule/CustmerQuery/Form',
  34. width: 700,
  35. height: 400,
  36. callBack: function (id) {
  37. return top[id].acceptClick(refreshGirdData);
  38. }
  39. });
  40. });
  41. // 编辑
  42. $('#lr_edit').on('click', function () {
  43. selectedRow = $('#gridtable').jfGridGet('rowdata');
  44. var keyValue = $('#gridtable').jfGridValue('F_CustmerQueryId');
  45. if (learun.checkrow(keyValue)) {
  46. learun.layerForm({
  47. id: 'Form',
  48. title: '编辑公共自定义查询',
  49. url: top.$.rootUrl + '/LR_SystemModule/CustmerQuery/Form',
  50. width: 700,
  51. height: 400,
  52. callBack: function (id) {
  53. return top[id].acceptClick(refreshGirdData);
  54. }
  55. });
  56. }
  57. });
  58. // 删除
  59. $('#lr_delete').on('click', function () {
  60. var keyValue = $('#gridtable').jfGridValue('F_CustmerQueryId');
  61. if (learun.checkrow(keyValue)) {
  62. learun.layerConfirm('是否确认删除该项!', function (res) {
  63. if (res) {
  64. learun.deleteForm(top.$.rootUrl + '/LR_SystemModule/CustmerQuery/DeleteForm', { keyValue: keyValue }, function () {
  65. refreshGirdData();
  66. });
  67. }
  68. });
  69. }
  70. });
  71. },
  72. initGrid: function () {
  73. $('#gridtable').lrAuthorizeJfGrid({
  74. url: top.$.rootUrl + '/LR_SystemModule/CustmerQuery/GetPageList',
  75. headData: [
  76. { label: "功能名称", name: "ModuleName", width: 150, align: "left" },
  77. { label: "查询名称", name: "F_Name", width: 150, align: "left" },
  78. { label: "功能地址", name: "F_ModuleUrl", width: 500, align: "left" }
  79. ],
  80. mainId: 'F_CustmerQueryId',
  81. reloadSelected: true,
  82. isPage:true
  83. });
  84. page.search();
  85. },
  86. search: function (param) {
  87. $('#gridtable').jfGridSet('reload', param);
  88. }
  89. };
  90. // 保存数据后回调刷新
  91. refreshGirdData = function () {
  92. page.search();
  93. }
  94. page.init();
  95. }