report.ui.js 902 B

123456789101112131415161718192021222324252627282930313233343536
  1. window.selectAll = function(e)
  2. {
  3. let allChecked = true;
  4. $('input[name=charts]').each(function()
  5. {
  6. if(!$(this).prop('checked')) allChecked = false;
  7. });
  8. $('input[name=charts]').each(function()
  9. {
  10. $(this).prop('checked', !allChecked);
  11. });
  12. };
  13. window.clickInit = function()
  14. {
  15. const chartType = $('a[data-toggle=tab].active').data('param');
  16. initReport(chartType);
  17. };
  18. window.changeTab = function(e)
  19. {
  20. const chartType = $(e.target).closest('.font-medium').data('param');
  21. initReport(chartType);
  22. }
  23. window.initReport = function(chartType)
  24. {
  25. const form = new FormData();
  26. $('input[name=charts]').each(function()
  27. {
  28. if($(this).prop('checked')) form.append('charts[]', $(this).val());
  29. })
  30. postAndLoadPage($.createLink('testtask', 'report', params + '&chartType=' + chartType), form, '#report,pageJS/.zin-page-js,#configJS');
  31. }