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.

FileAuthIndex.js 4.4 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. var bootstrap = function ($, learun) {
  2. "use strict";
  3. var folderId = "0";
  4. var page = {
  5. init: function () {
  6. // 查询
  7. $('#btn_Search').on('click', function () {
  8. var keyword = $('#txt_Keyword').val();
  9. page.search({ keyword: keyword });
  10. });
  11. $('#lr_auth').on('click', function () {
  12. var keyValue = $('#gridtable').jfGridValue('F_Id');
  13. var name = $('#gridtable').jfGridValue('F_Name');
  14. var type = $('#gridtable').jfGridValue('Type');
  15. if (learun.checkrow(keyValue)) {
  16. var isFolder = '0';
  17. if (type == '2') {
  18. isFolder = '1'
  19. }
  20. learun.layerForm({
  21. id: 'FileAuthFrom',
  22. title: '授权【' + name + '】',
  23. url: top.$.rootUrl + '/LR_SystemModule/Files/FileAuthFrom?fileInfoId=' + keyValue + "&isFolder=" + isFolder,
  24. width: 800,
  25. height: 500,
  26. maxmin: true,
  27. btn: null
  28. });
  29. }
  30. });
  31. $('#lr_main_auth').on('click', function () {
  32. learun.layerForm({
  33. id: 'FileAuthFrom',
  34. title: '授权主目录',
  35. url: top.$.rootUrl + '/LR_SystemModule/Files/FileAuthFrom?fileInfoId=0&isFolder=1',
  36. width: 800,
  37. height: 500,
  38. maxmin: true,
  39. btn: null,
  40. end: function () {
  41. }
  42. });
  43. });
  44. $('#pathList').on('click', '.path-item', function () {
  45. var $this = $(this);
  46. $this.nextAll().remove();
  47. folderId = $this.attr('data-fileid');
  48. page.openFolder();
  49. });
  50. $('#gridtable').jfGrid({
  51. url: top.$.rootUrl + '/LR_SystemModule/Files/GetAllPublishPageList',
  52. headData: [
  53. {
  54. label: '文件名', name: 'F_Name', width: 400, align: 'left',
  55. formatter: function (cellvalue, row) {
  56. return "<div style='cursor:pointer;'><div style='float: left;'><img src='" + top.$.rootUrl + "/Content/images/filetype/" + row.F_FileType + ".png' style='width:30px;height:30px;padding:5px;margin-left:-5px;margin-right:5px;' /></div><div style='float: left;line-height:35px;'>" + cellvalue + "</div></div>";
  57. }
  58. },
  59. {
  60. label: '文件编号', name: 'F_Code', width: 120, align: 'left'
  61. },
  62. {
  63. label: '文件版本', name: 'F_Ver', width: 60, align: 'center'
  64. },
  65. {
  66. label: '操作', name: 'F_Id', width: 200, align: 'left',
  67. formatter: function (value, row, op, $cell) {
  68. var $div = $('<div></div>');
  69. if (row.Type == '2') {
  70. var $openFolder = $('<span class=\"label label-success\" style=\"cursor: pointer;\">打开</span>');
  71. $openFolder.on('click', function () {
  72. folderId = value;
  73. page.openFolder();
  74. $('#pathList').append('<span data-fileid="' + value + '" class="path-item">/&nbsp;' + row.F_Name + '</span>');
  75. });
  76. $div.append($openFolder);
  77. }
  78. return $div;
  79. }
  80. }
  81. ],
  82. mainId: 'F_Id'
  83. });
  84. page.search();
  85. },
  86. openFolder: function () {
  87. page.search();
  88. },
  89. search: function (param) {
  90. param = param || {};
  91. param.folderId = folderId || "0";
  92. if (param.folderId == "0") {
  93. $('#pathList [data-fileid="0"]').nextAll().remove();
  94. }
  95. $('#gridtable').jfGridSet('reload', param);
  96. }
  97. };
  98. page.init();
  99. }