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.
 
 
 
 
 
 

113 lines
4.6 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-12-22 11:35
  5. * 描 述:公告发布权限设置
  6. */
  7. var refreshGirdData;
  8. var departmentId = request('departmentId');
  9. console.log(123 + departmentId);
  10. var bootstrap = function ($, learun) {
  11. "use strict";
  12. var page = {
  13. init: function () {
  14. page.initGird();
  15. page.bind();
  16. },
  17. bind: function () {
  18. console.log(departmentId);
  19. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  20. page.search(queryJson);
  21. }, 220, 400);
  22. $('#DepartmentID').lrDataSourceSelect({ code: 'classdata',value: 'id',text: 'name' });
  23. // 刷新
  24. $('#lr_refresh').on('click', function () {
  25. location.reload();
  26. });
  27. // 新增
  28. $('#lr_add').on('click', function () {
  29. learun.layerForm({
  30. id: 'form1',
  31. title: '新增',
  32. url: top.$.rootUrl + '/Permission/DepartmentReleasePermissions/Form?departmentId='+departmentId,
  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: 'form1',
  46. title: '编辑',
  47. url: top.$.rootUrl + '/Permission/DepartmentReleasePermissions/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 + '/Permission/DepartmentReleasePermissions/DeleteForm', { keyValue: keyValue}, function () {
  63. refreshGirdData();
  64. });
  65. }
  66. });
  67. }
  68. });
  69. },
  70. // 初始化列表
  71. initGird: function () {
  72. $('#gridtable').lrAuthorizeJfGrid({
  73. url: top.$.rootUrl + '/Permission/DepartmentReleasePermissions/GetPageList',
  74. headData: [
  75. { label: "发布人员", name: "UserID", width: 100, align: "left",
  76. formatterAsync: function (callback, value, row, op,$cell) {
  77. learun.clientdata.getAsync('custmerData', {
  78. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
  79. key: value,
  80. keyId: 'f_userid',
  81. callback: function (_data) {
  82. callback(_data['f_realname']);
  83. }
  84. });
  85. }},
  86. { label: "公告类型", name: "Permission", width: 100, align: "left",
  87. formatterAsync: function (callback, value, row, op, $cell) {
  88. learun.clientdata.getsAsync('dataItem', {
  89. key: value,
  90. code: 'NoticeCategory',
  91. callback: function (_data) {
  92. callback(_data);
  93. }
  94. });
  95. }},
  96. ],
  97. mainId:'ID',
  98. isPage: true
  99. });
  100. page.search();
  101. },
  102. search: function (param) {
  103. param = param || {};
  104. param.DepartmentID = departmentId;
  105. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  106. }
  107. };
  108. refreshGirdData = function () {
  109. $('#gridtable').jfGridSet('reload');
  110. };
  111. page.init();
  112. }