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.5 KiB

  1. /*
  2. * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  3. * Copyright (c) 2013-2018 北京泉江科技有限公司
  4. * 创建人:陈彬彬
  5. * 日 期:2017.03.22
  6. * 描 述:数据字典管理
  7. */
  8. var refreshGirdData; // 更新数据
  9. var selectedRow;
  10. var bootstrap = function ($, learun) {
  11. "use strict";
  12. var page = {
  13. init: function () {
  14. page.initGrid();
  15. page.bind();
  16. },
  17. bind: function () {
  18. // 查询
  19. $('#btn_Search').on('click', function () {
  20. var keyword = $('#txt_Keyword').val();
  21. page.search({keyword: keyword });
  22. });
  23. // 刷新
  24. $('#lr_refresh').on('click', function () {
  25. location.reload();
  26. });
  27. // 新增
  28. $('#lr_add').on('click', function () {
  29. var f_ItemId = $('#gridtable').jfGridValue('F_ItemId');
  30. selectedRow = null;
  31. learun.layerForm({
  32. id: 'ClassifyForm',
  33. title: '添加分类',
  34. url: top.$.rootUrl + '/LR_SystemModule/DataItem/ClassifyForm?parentId=' + f_ItemId,
  35. width: 500,
  36. height: 400,
  37. callBack: function (id) {
  38. return top[id].acceptClick(refreshGirdData);
  39. }
  40. });
  41. });
  42. // 编辑
  43. $('#lr_edit').on('click', function () {
  44. selectedRow = $('#gridtable').jfGridGet('rowdata');
  45. var keyValue = $('#gridtable').jfGridValue('F_ItemId');
  46. if (learun.checkrow(keyValue)) {
  47. learun.layerForm({
  48. id: 'ClassifyForm',
  49. title: '编辑分类',
  50. url: top.$.rootUrl + '/LR_SystemModule/DataItem/ClassifyForm',
  51. width: 500,
  52. height: 400,
  53. callBack: function (id) {
  54. return top[id].acceptClick(refreshGirdData);
  55. }
  56. });
  57. }
  58. });
  59. // 删除
  60. $('#lr_delete').on('click', function () {
  61. var keyValue = $('#gridtable').jfGridValue('F_ItemId');
  62. if (learun.checkrow(keyValue)) {
  63. learun.layerConfirm('是否确认删除该项!', function (res) {
  64. if (res) {
  65. learun.deleteForm(top.$.rootUrl + '/LR_SystemModule/DataItem/DeleteClassifyForm', { keyValue: keyValue }, function () {
  66. refreshGirdData();
  67. });
  68. }
  69. });
  70. }
  71. });
  72. },
  73. initGrid: function () {
  74. $('#gridtable').jfGrid({
  75. url: top.$.rootUrl + '/LR_SystemModule/DataItem/GetClassifyList',
  76. headData: [
  77. {
  78. label: '标准编码', name: 'F_ItemCodeGB', width: 200, align: 'left'
  79. },
  80. { label: '名称', name: 'F_ItemName', width: 200, align: 'left' },
  81. { label: '编号', name: 'F_ItemCode', width: 200, align: 'left' },
  82. { label: '排序', name: 'F_SortCode', width: 50, align: 'center' },
  83. {
  84. label: "树型", name: "F_IsTree",width: 50, align: "center",
  85. formatter: function (cellvalue) {
  86. return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  87. }
  88. },
  89. {
  90. label: "有效", name: "F_EnabledMark",width: 50, align: "center",
  91. formatter: function (cellvalue) {
  92. return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  93. }
  94. },
  95. { label: "备注", name: "F_Description", width: 200, align: "left" }
  96. ],
  97. isTree: true,
  98. mainId: 'F_ItemId',
  99. parentId: 'F_ParentId',
  100. reloadSelected:true
  101. });
  102. page.search();
  103. },
  104. search: function (param) {
  105. $('#gridtable').jfGridSet('reload', param);
  106. }
  107. };
  108. // 保存数据后回调刷新
  109. refreshGirdData = function () {
  110. page.search();
  111. }
  112. page.init();
  113. }