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.
 
 
 
 
 
 

74 lines
2.4 KiB

  1. var bootstrap = function ($, learun) {
  2. "use strict";
  3. var year = "";
  4. var page = {
  5. init: function () {
  6. page.bind();
  7. page.initGrid();
  8. page.initChart();
  9. },
  10. bind: function () {
  11. //当前年
  12. var now = learun.formatDate(new Date(), 'yyyy');
  13. $('#year').val(now);
  14. year = now;
  15. // 刷新
  16. $('#lr-replace').on('click', function () {
  17. location.reload();
  18. });
  19. //查询
  20. $('#btn_Search').on('click', function () {
  21. year = $('#year').val();
  22. page.search();
  23. });
  24. },
  25. initGrid: function () {
  26. //$(".lr-layout-grid").height($(window).height() - 110);
  27. //$('#gridtable').lrAuthorizeJfGridLei({
  28. // url: top.$.rootUrl + '/AssetManagementSystem/AssReport/AssAddReportList',
  29. // headData: [
  30. // { name: "name", label: "年份", width: 100, align: "center" },
  31. // { name: "value", label: "金额", width: 150, align: "center" }
  32. // ]
  33. //});
  34. //page.search();
  35. },
  36. initChart: function () {
  37. var myChart1 = echarts.init(document.getElementById('main'));
  38. //var myChart2 = echarts.init(document.getElementById('main1'));
  39. var queryJson = { year: year };
  40. learun.httpAsyncPost(top.$.rootUrl + "/EducationalAdministration/StuEnroll/Peichart", { queryJson: JSON.stringify(queryJson) }, function (res) {
  41. if (res.code == 200) {
  42. var option = {
  43. xAxis: {
  44. type: 'category',
  45. data: res.data.name
  46. },
  47. yAxis: {
  48. type: 'value'
  49. },
  50. series: [{
  51. data: res.data.value,
  52. type: 'bar'
  53. }]
  54. };
  55. myChart1.setOption(option);
  56. }
  57. });
  58. },
  59. search: function (param) {
  60. param = param || {};
  61. param.year = year;
  62. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  63. page.initChart();
  64. }
  65. };
  66. page.init();
  67. }