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.
 
 
 
 
 
 

107 lines
4.1 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-03-18 15:59
  5. * 描 述:精品课程管理
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var page = {
  11. init: function () {
  12. page.initGird();
  13. page.bind();
  14. },
  15. bind: function () {
  16. // 初始化左侧树形数据
  17. $('#dataTree').lrtree({
  18. url: top.$.rootUrl + '/PersonnelManagement/BC_ExcellentCourse/GetTree',
  19. nodeClick: function (item) {
  20. page.search({ Name: item.value });
  21. }
  22. });
  23. // 刷新
  24. $('#lr_refresh').on('click', function () {
  25. location.reload();
  26. });
  27. // 新增
  28. $('#lr_add').on('click', function () {
  29. learun.layerForm({
  30. id: 'form',
  31. title: '新增',
  32. url: top.$.rootUrl + '/PersonnelManagement/BC_ExcellentCourse/Form',
  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: 'form',
  46. title: '编辑',
  47. url: top.$.rootUrl + '/PersonnelManagement/BC_ExcellentCourse/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 + '/PersonnelManagement/BC_ExcellentCourse/DeleteForm', { keyValue: keyValue}, function () {
  63. refreshGirdData();
  64. });
  65. }
  66. });
  67. }
  68. });
  69. // 打印
  70. $('#lr_print').on('click', function () {
  71. $('#gridtable').jqprintTable();
  72. });
  73. },
  74. // 初始化列表
  75. initGird: function () {
  76. $('#gridtable').lrAuthorizeJfGrid({
  77. url: top.$.rootUrl + '/PersonnelManagement/BC_ExcellentCourse/GetPageList',
  78. headData: [
  79. { label: "课程名称", name: "Name", width: 100, align: "left"},
  80. { label: "课程内容", name: "Content", width: 100, align: "left"},
  81. { label: "是否审核", name: "Status", width: 100, align: "left",
  82. formatterAsync: function (callback, value, row, op,$cell) {
  83. learun.clientdata.getAsync('dataItem', {
  84. key: value,
  85. code: 'YesOrNoInt',
  86. callback: function (_data) {
  87. callback(_data.text);
  88. }
  89. });
  90. }},
  91. ],
  92. mainId:'ID',
  93. isPage: true
  94. });
  95. page.search();
  96. },
  97. search: function (param) {
  98. param = param || {};
  99. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  100. }
  101. };
  102. refreshGirdData = function () {
  103. page.search();
  104. };
  105. page.init();
  106. }