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.

Index.js 3.9 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2018-05-24 10:00
  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. $('#btn_Search').on('click', function () {
  18. var keyword = $('#txt_Keyword').val();
  19. page.search({ keyword: keyword });
  20. });
  21. // 刷新
  22. $('#lr_refresh').on('click', function () {
  23. location.reload();
  24. });
  25. // 新增
  26. $('#lr_add').on('click', function () {
  27. learun.layerForm({
  28. id: 'form',
  29. title: '新增',
  30. url: top.$.rootUrl + '/LR_IM/SysUser/Form',
  31. width: 500,
  32. height: 400,
  33. callBack: function (id) {
  34. return top[id].acceptClick(refreshGirdData);
  35. }
  36. });
  37. });
  38. // 编辑
  39. $('#lr_edit').on('click', function () {
  40. var keyValue = $('#gridtable').jfGridValue('F_Id');
  41. if (learun.checkrow(keyValue)) {
  42. learun.layerForm({
  43. id: 'form',
  44. title: '编辑',
  45. url: top.$.rootUrl + '/LR_IM/SysUser/Form?keyValue=' + keyValue,
  46. width: 500,
  47. height: 400,
  48. callBack: function (id) {
  49. return top[id].acceptClick(refreshGirdData);
  50. }
  51. });
  52. }
  53. });
  54. // 删除
  55. $('#lr_delete').on('click', function () {
  56. var keyValue = $('#gridtable').jfGridValue('F_Id');
  57. if (learun.checkrow(keyValue)) {
  58. learun.layerConfirm('是否确认删除该项!', function (res) {
  59. if (res) {
  60. learun.deleteForm(top.$.rootUrl + '/LR_IM/SysUser/DeleteForm', { keyValue: keyValue }, function () {
  61. });
  62. }
  63. });
  64. }
  65. });
  66. },
  67. initGird: function () {
  68. $('#gridtable').lrAuthorizeJfGrid({
  69. url: top.$.rootUrl + '/LR_IM/SysUser/GetPageList',
  70. headData: [
  71. { label: '用户名称', name: 'F_Name', width: 160, align: "left" },
  72. { label: '用户编码', name: 'F_Code', width: 100, align: "left" },
  73. {
  74. label: '图标', name: 'F_Icon', width: 60, align: 'center',
  75. formatter: function (cellvalue) {
  76. return '<i class="' + cellvalue + '" ></i>';
  77. }
  78. },
  79. { label: '创建用户', name: 'F_CreateUserName', width: 100, align: 'left' },
  80. {
  81. label: '创建时间', name: 'F_CreateDate', width: 130, align: 'left',
  82. formatter: function (cellvalue) {
  83. return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm');
  84. }
  85. },
  86. { label: '备注', name: 'F_Description', width: 200, align: "left" }
  87. ],
  88. mainId: 'F_Id',
  89. isPage: true
  90. });
  91. page.search();
  92. },
  93. search: function (param) {
  94. $('#gridtable').jfGridSet('reload', param || {});
  95. }
  96. };
  97. refreshGirdData = function () {
  98. page.search();
  99. };
  100. page.init();
  101. }