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.
 
 
 
 
 
 

78 lines
2.3 KiB

  1. /*
  2. * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  3. * Copyright (c) 2013-2018 北京泉江科技有限公司
  4. * 创建人:陈彬彬
  5. * 日 期:2017.04.17
  6. * 描 述:自定义查询
  7. */
  8. var tableName = request('tableName');
  9. var databaseLinkId = request('databaseLinkId');
  10. var bootstrap = function ($, learun) {
  11. "use strict";
  12. var fieldData;
  13. var page = {
  14. init: function () {
  15. page.bind();
  16. },
  17. bind: function () {
  18. //获取字段数据
  19. learun.httpAsync('GET', top.$.rootUrl + '/LR_SystemModule/DatabaseTable/GetFieldList', { databaseLinkId: databaseLinkId, tableName: tableName }, function (data) {
  20. fieldData = data;
  21. $('#field').lrselectRefresh({
  22. data: fieldData
  23. });
  24. var headData = [];
  25. for (var i = 0, l = data.length; i < l; i++) {
  26. var item = data[i];
  27. var point = { label: item.f_remark, name: item.f_column.toLowerCase(), width: 150, align: "left" };
  28. headData.push(point);
  29. }
  30. $('#gridtable').jfGrid({
  31. url: top.$.rootUrl + '/LR_SystemModule/DatabaseTable/GetTableDataList',
  32. headData: headData,
  33. isPage: true
  34. });
  35. page.search();
  36. });
  37. // 功能选择
  38. $('#field').lrselect({
  39. title: 'f_column',
  40. text: 'f_remark',
  41. value:'f_column',
  42. maxHeight: 300,
  43. allowSearch: true
  44. });
  45. $('#logic').lrselect({
  46. maxHeight: 300
  47. });
  48. // 查询
  49. $('#btn_Search').on('click', function () {
  50. page.search();
  51. });
  52. },
  53. search: function () {
  54. var param = {};
  55. param.databaseLinkId = databaseLinkId;
  56. param.tableName = tableName;
  57. param.field = $('#field').lrselectGet();
  58. param.logic = $('#logic').lrselectGet();
  59. param.keyword = $('#keyword').val();
  60. $('#gridtable').jfGridSet('reload', param);
  61. }
  62. };
  63. page.init();
  64. }