Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

179 lignes
7.3 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-04-22 10:59
  5. * 描 述:应用管理
  6. */
  7. var refreshGirdData;
  8. var FTId;
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. page.inittree();
  14. page.initGird();
  15. page.bind();
  16. },
  17. bind: function () {
  18. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  19. page.search(queryJson);
  20. }, 220, 400);
  21. // 刷新
  22. $('#lr_refresh').on('click', function () {
  23. location.reload();
  24. });
  25. // 新增
  26. $('#lr_add').on('click', function () {
  27. if (!FTId) {
  28. learun.alert.warning('请选择分类!');
  29. return false;
  30. }
  31. learun.layerForm({
  32. id: 'form',
  33. title: '新增',
  34. url: top.$.rootUrl + '/Permission/Perm_Function/Form?FTId=' + FTId,
  35. width: 650,
  36. height: 450,
  37. callBack: function (id) {
  38. return top[id].acceptClick(refreshGirdData);
  39. }
  40. });
  41. });
  42. // 编辑
  43. $('#lr_edit').on('click', function () {
  44. var keyValue = $('#gridtable').jfGridValue('FId');
  45. if (learun.checkrow(keyValue)) {
  46. if (keyValue.indexOf(',') != -1) {
  47. learun.alert.warning("只能选择一条记录进行编辑!");
  48. return;
  49. }
  50. learun.layerForm({
  51. id: 'form',
  52. title: '编辑',
  53. url: top.$.rootUrl + '/Permission/Perm_Function/Form?keyValue=' + keyValue,
  54. width: 650,
  55. height: 450,
  56. callBack: function (id) {
  57. return top[id].acceptClick(refreshGirdData);
  58. }
  59. });
  60. }
  61. });
  62. $('#lr_perm').on('click', function () {
  63. var keyValue = $('#gridtable').jfGridValue('FId');
  64. if (learun.checkrow(keyValue)) {
  65. if (keyValue.indexOf(',') != -1) {
  66. learun.alert.warning("只能选择一条记录进行编辑!");
  67. return;
  68. }
  69. learun.layerForm({
  70. id: 'form',
  71. title: '人员授权',
  72. url: top.$.rootUrl + '/Permission/Perm_UserPermission/SelectForm?objectId=' + keyValue + '&type=up',
  73. width: 800,
  74. height: 520,
  75. callBack: function (id) {
  76. return top[id].acceptClick();
  77. }
  78. });
  79. }
  80. });
  81. //角色授权
  82. $('#lr_permrole').on('click', function () {
  83. var keyValue = $('#gridtable').jfGridValue('FId');
  84. if (learun.checkrow(keyValue)) {
  85. if (keyValue.indexOf(',') != -1) {
  86. learun.alert.warning("只能选择一条记录进行编辑!");
  87. return;
  88. }
  89. learun.layerForm({
  90. id: 'formrole',
  91. title: '角色授权',
  92. url: top.$.rootUrl + '/Permission/Perm_UserPermission/GirdSelectIndex?FId=' + keyValue,
  93. width: 800,
  94. height: 520,
  95. callBack: function (id) {
  96. return top[id].acceptClick(refreshGirdData);
  97. }
  98. });
  99. }
  100. });
  101. // 删除
  102. $('#lr_delete').on('click', function () {
  103. var keyValue = $('#gridtable').jfGridValue('FId');
  104. if (learun.checkrow(keyValue)) {
  105. learun.layerConfirm('是否确认删除该项!', function (res) {
  106. if (res) {
  107. learun.deleteForm(top.$.rootUrl + '/Permission/Perm_Function/DeleteForm', { keyValue: keyValue }, function () {
  108. refreshGirdData();
  109. });
  110. }
  111. });
  112. }
  113. });
  114. },
  115. inittree: function () {
  116. $('#companyTree').lrtree({
  117. url: top.$.rootUrl + '/Permission/Perm_FunctionType/GetAllTree',
  118. nodeClick: page.treeNodeClick
  119. });
  120. },
  121. treeNodeClick: function (item) {
  122. FTId = item.id;
  123. $('#titleinfo').text(item.text);
  124. page.search();
  125. },
  126. // 初始化列表
  127. initGird: function () {
  128. $('#gridtable').lrAuthorizeJfGrid({
  129. url: top.$.rootUrl + '/Permission/Perm_Function/GetPageList',
  130. headData: [
  131. { label: "应用名称", name: "FName", width: 150, align: "left" },
  132. {
  133. label: "分类名称", name: "FTId", width: 150, align: "left",
  134. formatterAsync: function (callback, value, row, op, $cell) {
  135. learun.clientdata.getAsync('custmerData', {
  136. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Perm_FunctionType',
  137. key: value,
  138. keyId: 'ftid',
  139. callback: function (_data) {
  140. callback(_data['ftname']);
  141. }
  142. });
  143. }
  144. },
  145. { label: "应用地址", name: "FUrl", width: 200, align: "left" },
  146. { label: "排序", name: "FOrder", width: 50, align: "left" },
  147. {
  148. label: "是否管理页", name: "FIsManagePage", width: 100, align: "left",
  149. formatter: function (cellvalue) {
  150. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  151. }
  152. },
  153. {
  154. label: "是否启用", name: "FEnabled", width: 100, align: "left",
  155. formatter: function (cellvalue) {
  156. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  157. }
  158. }
  159. ],
  160. mainId: 'FId',
  161. isMultiselect: true,
  162. isPage: true,
  163. sidx: 'FOrder',
  164. sort: 'ASC'
  165. });
  166. page.search();
  167. },
  168. search: function (param) {
  169. param = param || {};
  170. param.FTId = FTId;
  171. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  172. }
  173. };
  174. refreshGirdData = function () {
  175. page.search();
  176. };
  177. page.init();
  178. }