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.

TeacherIndex.js 4.2 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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_edit').on('click', function () {
  27. var keyValue = $('#gridtable').jfGridValue('UPId');
  28. if (learun.checkrow(keyValue)) {
  29. learun.layerForm({
  30. id: 'form',
  31. title: '编辑',
  32. url: top.$.rootUrl + '/Permission/Perm_Function/FormTeacher?keyValue=' + keyValue,
  33. width: 650,
  34. height: 250,
  35. callBack: function (id) {
  36. return top[id].acceptClick(refreshGirdData);
  37. }
  38. });
  39. }
  40. });
  41. },
  42. inittree: function () {
  43. $('#companyTree').lrtree({
  44. url: top.$.rootUrl + '/Permission/Perm_FunctionType/GetTeacherTree',
  45. nodeClick: page.treeNodeClick
  46. });
  47. },
  48. treeNodeClick: function (item) {
  49. FTId = item.id;
  50. $('#titleinfo').text(item.text);
  51. page.search();
  52. },
  53. // 初始化列表
  54. initGird: function () {
  55. $('#gridtable').lrAuthorizeJfGrid({
  56. url: top.$.rootUrl + '/Permission/Perm_Function/GetPageList',
  57. headData: [
  58. { label: "应用名称", name: "FName", width: 150, align: "left" },
  59. {
  60. label: "分类名称", name: "FTId", width: 150, align: "left",
  61. formatterAsync: function (callback, value, row, op, $cell) {
  62. learun.clientdata.getAsync('custmerData', {
  63. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Perm_FunctionType',
  64. key: value,
  65. keyId: 'ftid',
  66. callback: function (_data) {
  67. callback(_data['ftname']);
  68. }
  69. });
  70. }
  71. },
  72. { label: "应用地址", name: "FUrl", width: 200, align: "left" },
  73. { label: "用户名", name: "UPUserName", width: 200, align: "left" },
  74. {
  75. label: "密码", name: "UPPass", width: 200, align: "left", formatter: function (value) {
  76. if (value) {
  77. return '**********';
  78. }
  79. }
  80. },
  81. {
  82. label: "访问", name: "FInterfaceUrl", width: 200, align: "left", formatter: function (value) {
  83. if (value) {
  84. return '<a class=\"label label-success\" href="'+value+'" target="_blank">转到</a>';
  85. }
  86. }
  87. }
  88. ],
  89. mainId: 'UPId',
  90. isPage: true,
  91. sidx: 'FOrder',
  92. sort: 'ASC'
  93. });
  94. page.search();
  95. },
  96. search: function (param) {
  97. param = param || {};
  98. param.FTId = FTId;
  99. param.UserId = UserId;
  100. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  101. }
  102. };
  103. refreshGirdData = function () {
  104. page.search();
  105. };
  106. page.init();
  107. }