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.
 
 
 
 
 
 

112 lines
4.2 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-11-06 11:46
  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. // 刷新
  17. $('#lr_refresh').on('click', function () {
  18. location.reload();
  19. });
  20. // 新增
  21. $('#lr_add').on('click', function () {
  22. learun.layerForm({
  23. id: 'form',
  24. title: '新增',
  25. url: top.$.rootUrl + '/LR_Desktop/WeChatConfig/Form',
  26. width: 600,
  27. height: 400,
  28. callBack: function (id) {
  29. return top[id].acceptClick(refreshGirdData);
  30. }
  31. });
  32. });
  33. // 编辑
  34. $('#lr_edit').on('click', function () {
  35. var keyValue = $('#gridtable').jfGridValue('ID');
  36. if (learun.checkrow(keyValue)) {
  37. learun.layerForm({
  38. id: 'form',
  39. title: '编辑',
  40. url: top.$.rootUrl + '/LR_Desktop/WeChatConfig/Form?keyValue=' + keyValue,
  41. width: 600,
  42. height: 400,
  43. callBack: function (id) {
  44. return top[id].acceptClick(refreshGirdData);
  45. }
  46. });
  47. }
  48. });
  49. // 编辑模板
  50. $('#lr_Templet').on('click', function () {
  51. var keyValue = $('#gridtable').jfGridValue('ID');
  52. if (learun.checkrow(keyValue)) {
  53. learun.layerForm({
  54. id: 'form',
  55. title: '模板编辑',
  56. url: top.$.rootUrl + '/LR_Desktop/WeChatTemplet/Index?keyValue=' + keyValue,
  57. width: 1200,
  58. height: 700,
  59. btn:['关闭']
  60. //callBack: function (id) {
  61. // return top[id].acceptClick(refreshGirdData);
  62. //}
  63. });
  64. }
  65. });
  66. // 删除
  67. $('#lr_delete').on('click', function () {
  68. var keyValue = $('#gridtable').jfGridValue('ID');
  69. if (learun.checkrow(keyValue)) {
  70. learun.layerConfirm('是否确认删除该项!', function (res) {
  71. if (res) {
  72. learun.deleteForm(top.$.rootUrl + '/LR_Desktop/WeChatConfig/DeleteForm', { keyValue: keyValue}, function () {
  73. refreshGirdData();
  74. });
  75. }
  76. });
  77. }
  78. });
  79. //  编辑模板
  80. $('#lr_Templet').on('click', function () {
  81. });
  82. },
  83. // 初始化列表
  84. initGird: function () {
  85. $('#gridtable').lrAuthorizeJfGrid({
  86. url: top.$.rootUrl + '/LR_Desktop/WeChatConfig/GetPageList',
  87. headData: [
  88. { label: "APPId", name: "APPId", width: 300, align: "left"},
  89. { label: "secret", name: "secret", width: 300, align: "left"},
  90. {
  91. label: "是否启用", name: "IsEnable", width: 100, align: "left",
  92. formatter: function (cellvalue) {
  93. return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  94. }},
  95. ],
  96. mainId:'',
  97. isPage: true
  98. });
  99. page.search();
  100. },
  101. search: function (param) {
  102. param = param || {};
  103. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  104. }
  105. };
  106. refreshGirdData = function () {
  107. page.search();
  108. };
  109. page.init();
  110. }