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.

FileAuthFrom.js 3.7 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. var fileInfoId = request('fileInfoId');
  2. var isFolder = request('isFolder');
  3. var refreshGirdData;
  4. var bootstrap = function ($, learun) {
  5. "use strict";
  6. var page = {
  7. init: function () {
  8. // 新增
  9. $('#lr_add').on('click', function () {
  10. learun.layerForm({
  11. id: 'FolderForm',
  12. title: '添加授权对象',
  13. url: top.$.rootUrl + '/LR_SystemModule/Files/FileAuthAddFrom?fileInfoId=' + fileInfoId + "&isFolder=" + isFolder,
  14. width: 500,
  15. height: 400,
  16. callBack: function (id) {
  17. return top[id].acceptClick(refreshGirdData);
  18. }
  19. });
  20. });
  21. // 编辑
  22. $('#lr_edit').on('click', function () {
  23. var keyValue = $('#gridtable').jfGridValue('F_Id');
  24. if (learun.checkrow(keyValue)) {
  25. learun.layerForm({
  26. id: 'FileAuthAddFrom',
  27. title: '编辑授权对象',
  28. url: top.$.rootUrl + '/LR_SystemModule/Files/FileAuthAddFrom?keyValue=' + keyValue + '&fileInfoId=' + fileInfoId + "&isFolder=" + isFolder,
  29. width: 500,
  30. height: 400,
  31. callBack: function (id) {
  32. return top[id].acceptClick(refreshGirdData);
  33. }
  34. });
  35. }
  36. });
  37. // 删除
  38. $('#lr_delete').on('click', function () {
  39. var keyValue = $('#gridtable').jfGridValue('F_Id');
  40. if (learun.checkrow(keyValue)) {
  41. learun.layerConfirm('是否确认删除该授权对象!', function (res) {
  42. if (res) {
  43. learun.deleteForm(top.$.rootUrl + '/LR_SystemModule/Files/DeleteAuth', { keyValue: keyValue }, function () {
  44. refreshGirdData();
  45. });
  46. }
  47. });
  48. }
  49. });
  50. $('#gridtable').jfGrid({
  51. url: top.$.rootUrl + '/LR_SystemModule/Files/GetAuthList',
  52. headData: [
  53. { label: '角色名称', name: 'F_ObjName', width: 100, align: 'left' },
  54. {
  55. label: '到期时间', name: 'F_Time', width: 120, align: 'left',
  56. formatter: function (cellvalue) {
  57. if (cellvalue == '9999-12-31 00:00:00') {
  58. return '<span class=\"label label-success\" style=\"cursor: pointer;\">永久</span>';
  59. } else if (cellvalue == 0) {
  60. return learun.formatDate(cellvalue,'yyyy-MM-dd');
  61. }
  62. }
  63. },
  64. {
  65. label: '权限类型', name: 'F_AuthType', width: 300, align: 'left', formatter: function (cellvalue) {
  66. cellvalue = cellvalue || '';
  67. return cellvalue.replace('1', '查看').replace('2', '上传').replace('3', '下载').replace('4', '删除').replace('5', '复原');
  68. }
  69. }
  70. ],
  71. mainId: 'F_Id'
  72. });
  73. page.search();
  74. },
  75. search: function (param) {
  76. $('#gridtable').jfGridSet('reload', { fileInfoId: fileInfoId});
  77. }
  78. };
  79. // 保存数据后回调刷新
  80. refreshGirdData = function () {
  81. $('#gridtable').jfGridSet('reload');
  82. }
  83. page.init();
  84. }