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.
 
 
 
 
 
 

118 lines
4.7 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-07-08 17:19
  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. $('#lr_refresh').on('click', function () {
  18. location.reload();
  19. });
  20. // 新增
  21. $('#lr_add').on('click', function () {
  22. learun.layerForm({
  23. id: 'form',
  24. title: '新增',
  25. url: top.$.rootUrl + '/EducationalAdministration/TeachSwitch/Form',
  26. width: 600,
  27. height: 400,
  28. callBack: function (id) {
  29. return top[id].acceptClick(refreshGirdData);
  30. }
  31. });
  32. });
  33. // 编辑
  34. $('#lr_edit').on('click', function () {
  35. var keyValue = $('#gridtable').jfGridValue('ID');
  36. if (learun.checkrow(keyValue)) {
  37. learun.layerForm({
  38. id: 'form',
  39. title: '编辑',
  40. url: top.$.rootUrl + '/EducationalAdministration/TeachSwitch/Form?keyValue=' + keyValue,
  41. width: 600,
  42. height: 400,
  43. callBack: function (id) {
  44. return top[id].acceptClick(refreshGirdData);
  45. }
  46. });
  47. }
  48. });
  49. // 删除
  50. $('#lr_delete').on('click', function () {
  51. var keyValue = $('#gridtable').jfGridValue('ID');
  52. if (learun.checkrow(keyValue)) {
  53. learun.layerConfirm('是否确认删除该项!', function (res) {
  54. if (res) {
  55. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TeachSwitch/DeleteForm', { keyValue: keyValue }, function () {
  56. refreshGirdData();
  57. });
  58. }
  59. });
  60. }
  61. });
  62. // 打印
  63. $('#lr_print').on('click', function () {
  64. $('#gridtable').jqprintTable();
  65. });
  66. },
  67. // 初始化列表
  68. initGird: function () {
  69. $('#gridtable').lrAuthorizeJfGrid({
  70. url: top.$.rootUrl + '/EducationalAdministration/TeachSwitch/GetPageList',
  71. headData: [
  72. {
  73. label: "开关名称", name: "type", width: 300, align: "left",
  74. formatter: function (val) {
  75. if (val == 'js') {
  76. return '教师注册开关';
  77. } else if (val == 'fx') {
  78. return '飞信下载开关';
  79. } else if (val == 'ssosystem') {
  80. return '网上办事大厅开关';
  81. } else if (val == 'wxloginforpc') {
  82. return '微信快捷登录PC端';
  83. } else if (val == 'modifypwdtip') {
  84. return '30天未修改密码登录后提示修改';
  85. }else if (val == 'modifypwdfirstday') {
  86. return '每月1日强制修改密码';
  87. }
  88. }
  89. },
  90. {
  91. label: "功能开启", name: "status", width: 100, align: "left",
  92. formatterAsync: function (callback, value, row, op, $cell) {
  93. learun.clientdata.getAsync('dataItem', {
  94. key: value,
  95. code: 'YesOrNoInt',
  96. callback: function (_data) {
  97. callback(_data.text);
  98. }
  99. });
  100. }
  101. },
  102. ],
  103. mainId: 'ID',
  104. isPage: true
  105. });
  106. page.search();
  107. },
  108. search: function (param) {
  109. param = param || {};
  110. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  111. }
  112. };
  113. refreshGirdData = function () {
  114. page.search();
  115. };
  116. page.init();
  117. }