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.8 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-11-10 17:25
  5. * 描 述:民体活动管理
  6. */
  7. var selectedRow;
  8. var refreshGirdData;
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. page.initGird();
  14. page.bind();
  15. },
  16. bind: function () {
  17. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  18. page.search(queryJson);
  19. }, 220, 400);
  20. // 刷新
  21. $('#lr_refresh').on('click', function () {
  22. location.reload();
  23. });
  24. // 新增
  25. $('#lr_add').on('click', function () {
  26. selectedRow = null;
  27. learun.layerForm({
  28. id: 'form',
  29. title: '新增',
  30. url: top.$.rootUrl + '/EducationalAdministration/PeopleSportsActivities/Form',
  31. width: 700,
  32. height: 400,
  33. callBack: function (id) {
  34. return top[id].acceptClick(refreshGirdData);
  35. }
  36. });
  37. });
  38. // 编辑
  39. $('#lr_edit').on('click', function () {
  40. var keyValue = $('#gridtable').jfGridValue('ID');
  41. selectedRow = $('#gridtable').jfGridGet('rowdata');
  42. if (learun.checkrow(keyValue)) {
  43. learun.layerForm({
  44. id: 'form',
  45. title: '编辑',
  46. url: top.$.rootUrl + '/EducationalAdministration/PeopleSportsActivities/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('ID');
  58. if (learun.checkrow(keyValue)) {
  59. learun.layerConfirm('是否确认删除该项!', function (res) {
  60. if (res) {
  61. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/PeopleSportsActivities/DeleteForm', { keyValue: keyValue}, function () {
  62. refreshGirdData();
  63. });
  64. }
  65. });
  66. }
  67. });
  68. },
  69. initGird: function () {
  70. $('#gridtable').lrAuthorizeJfGrid({
  71. url: top.$.rootUrl + '/EducationalAdministration/PeopleSportsActivities/GetPageList',
  72. headData: [
  73. { label: '赛事', name: 'ContestItem', width: 200, align: "left" },
  74. { label: '内容', name: 'Contents', width: 300, align: "left" },
  75. { label: '单位', name: 'Unit', width: 200, align: "left" },
  76. { label: '时间', name: 'MatchTime', width: 200, align: "left" },
  77. { label: '荣誉', name: 'Honour', width: 200, align: "left" },
  78. { label: '备注', name: 'Remark', width: 300, align: "left" },
  79. ],
  80. mainId:'ID',
  81. isPage: true
  82. });
  83. page.search();
  84. },
  85. search: function (param) {
  86. param = param || {};
  87. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  88. }
  89. };
  90. refreshGirdData = function () {
  91. $('#gridtable').jfGridSet('reload');
  92. };
  93. page.init();
  94. }