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.
 
 
 
 
 
 

99 lines
3.8 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2023-03-13 15:02
  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. $('#IsEnabled').lrRadioCheckbox({
  20. type: 'radio',
  21. code: 'YesOrNoBit',
  22. });
  23. // 刷新
  24. $('#lr_refresh').on('click', function () {
  25. location.reload();
  26. });
  27. // 新增
  28. $('#lr_add').on('click', function () {
  29. learun.layerForm({
  30. id: 'form',
  31. title: '新增',
  32. url: top.$.rootUrl + '/PersonnelManagement/WP_OfficeConfig/Form',
  33. width: 600,
  34. height: 400,
  35. callBack: function (id) {
  36. return top[id].acceptClick(refreshGirdData);
  37. }
  38. });
  39. });
  40. // 编辑
  41. $('#lr_edit').on('click', function () {
  42. var keyValue = $('#gridtable').jfGridValue('Id');
  43. if (learun.checkrow(keyValue)) {
  44. learun.layerForm({
  45. id: 'form',
  46. title: '编辑',
  47. url: top.$.rootUrl + '/PersonnelManagement/WP_OfficeConfig/Form?keyValue=' + keyValue,
  48. width: 600,
  49. height: 400,
  50. callBack: function (id) {
  51. return top[id].acceptClick(refreshGirdData);
  52. }
  53. });
  54. }
  55. });
  56. // 删除
  57. $('#lr_delete').on('click', function () {
  58. var keyValue = $('#gridtable').jfGridValue('Id');
  59. if (learun.checkrow(keyValue)) {
  60. learun.layerConfirm('是否确认删除该项!', function (res) {
  61. if (res) {
  62. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/WP_OfficeConfig/DeleteForm', { keyValue: keyValue }, function () {
  63. refreshGirdData();
  64. });
  65. }
  66. });
  67. }
  68. });
  69. },
  70. // 初始化列表
  71. initGird: function () {
  72. $('#gridtable').lrAuthorizeJfGrid({
  73. url: top.$.rootUrl + '/PersonnelManagement/WP_OfficeConfig/GetPageList',
  74. headData: [
  75. { label: "名称", name: "Name", width: 150, align: "left" },
  76. { label: "内容", name: "Contents", width: 200, align: "left" },
  77. {
  78. label: "是否启用", name: "IsEnabled", width: 100, align: "left",
  79. formatter: function (cellvalue) {
  80. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  81. }
  82. },
  83. ],
  84. mainId: 'Id',
  85. isPage: true
  86. });
  87. page.search();
  88. },
  89. search: function (param) {
  90. param = param || {};
  91. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  92. }
  93. };
  94. refreshGirdData = function () {
  95. $('#gridtable').jfGridSet('reload');
  96. };
  97. page.init();
  98. }