Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 
 

133 righe
5.7 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2024-09-18 10:42
  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. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  17. page.search(queryJson);
  18. }, 220, 400);
  19. $('#Name').lrDataSourceSelect({ code: 'TeacherInfo',value: 'f_encode',text: 'f_realname' });
  20. $('#Department').lrDataSourceSelect({ code: 'classdata',value: 'id',text: 'name' });
  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 + '/EducationalAdministration/OfficeEquipment/Form',
  31. width: 600,
  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('Id');
  41. if (learun.checkrow(keyValue)) {
  42. learun.layerForm({
  43. id: 'form',
  44. title: '编辑',
  45. url: top.$.rootUrl + '/EducationalAdministration/OfficeEquipment/Form?keyValue=' + keyValue,
  46. width: 600,
  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('Id');
  57. if (learun.checkrow(keyValue)) {
  58. learun.layerConfirm('是否确认删除该项!', function (res) {
  59. if (res) {
  60. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/OfficeEquipment/DeleteForm', { keyValue: keyValue}, function () {
  61. refreshGirdData();
  62. });
  63. }
  64. });
  65. }
  66. });
  67. // 查看二维码
  68. $('#lr_qrCode').on('click', function () {
  69. var keyValue = $('#gridtable').jfGridValue('Id');
  70. if (learun.checkrow(keyValue)) {
  71. learun.layerForm({
  72. id: 'formqrCode',
  73. title: '二维码',
  74. url: top.$.rootUrl + '/EducationalAdministration/OfficeEquipment/qrCode?keyValue=' + keyValue,
  75. width: 700,
  76. height: 900,
  77. btn: null,
  78. end: function () { refreshGirdData(); }
  79. });
  80. }
  81. });
  82. // 打印
  83. $('#lr_print').on('click', function () {
  84. $('#gridtable').jqprintTable();
  85. });
  86. },
  87. // 初始化列表
  88. initGird: function () {
  89. $('#gridtable').lrAuthorizeJfGrid({
  90. url: top.$.rootUrl + '/EducationalAdministration/OfficeEquipment/GetPageList',
  91. headData: [
  92. { label: "名称", name: "Name", width: 100, align: "left",
  93. formatterAsync: function (callback, value, row, op,$cell) {
  94. learun.clientdata.getAsync('custmerData', {
  95. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'TeacherInfo',
  96. key: value,
  97. keyId: 'f_encode',
  98. callback: function (_data) {
  99. callback(_data['f_realname']);
  100. }
  101. });
  102. }},
  103. { label: "部门", name: "Department", width: 100, align: "left",
  104. formatterAsync: function (callback, value, row, op,$cell) {
  105. learun.clientdata.getAsync('custmerData', {
  106. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
  107. key: value,
  108. keyId: 'id',
  109. callback: function (_data) {
  110. callback(_data['name']);
  111. }
  112. });
  113. }},
  114. { label: "设备名称", name: "DeviceName", width: 100, align: "left"},
  115. { label: "配置描述", name: "Description", width: 100, align: "left"},
  116. { label: "备注", name: "Remark", width: 100, align: "left"},
  117. ],
  118. mainId:'Id',
  119. isPage: true
  120. });
  121. page.search();
  122. },
  123. search: function (param) {
  124. param = param || {};
  125. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  126. }
  127. };
  128. refreshGirdData = function () {
  129. $('#gridtable').jfGridSet('reload');
  130. };
  131. page.init();
  132. }