report.html.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. /**
  3. * The report view file of task module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
  5. * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  6. * @author Yanyi Cao <caoyanyi@easycorp.ltd>
  7. * @package task
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $moduleList = array();
  12. foreach($lang->task->report->typeList as $code => $module)
  13. {
  14. $moduleList[$code] = (object)array(
  15. 'key' => $code,
  16. 'id' => $code,
  17. 'name' => $module,
  18. 'parent' => 0,
  19. 'url' => createLink('task', 'report', "executionID=$executionID&browseType=$browseType&param=$param&type=$code")
  20. );
  21. }
  22. jsVar('executionID', $executionID);
  23. jsVar('browseType', $browseType);
  24. detailHeader
  25. (
  26. setClass('gap-4'),
  27. set::backUrl(createLink('execution', 'task', "executionID=$executionID") . "#app={$app->tab}"),
  28. to::title
  29. (
  30. div
  31. (
  32. setClass('clip'),
  33. span
  34. (
  35. setClass('font-bold'),
  36. $lang->task->report->tpl->filter
  37. ),
  38. span
  39. (
  40. set::title($filterDetail),
  41. $filterDetail
  42. )
  43. )
  44. ),
  45. menuViewSwitcher()
  46. );
  47. $staticData->editCanvasConfig->theme = 'light';
  48. $staticData->editCanvasConfig->previewScaleType = 'top';
  49. $staticDataJson = str_replace(array('&quot;', '&#039;'), array("\\\&quot;", "\&#039;"), json_encode($staticData));
  50. div
  51. (
  52. setClass('flex flex-nowrap'),
  53. setStyle(array('height' => 'calc(100vh - 10rem)')),
  54. cell
  55. (
  56. set::width('200'),
  57. moduleMenu
  58. (
  59. set::moduleName('task'),
  60. set::title($lang->task->report->notice),
  61. set::modules($moduleList),
  62. set::showDisplay(false),
  63. set::toggleSidebar(false),
  64. set::activeKey($type),
  65. set::closeLink('')
  66. )
  67. ),
  68. cell
  69. (
  70. setID('chartContainer'),
  71. set::flex('1'),
  72. setClass('ml-4 bg-white px-2 py-2'),
  73. h4
  74. (
  75. setClass('mt-2 ml-1'),
  76. zget($lang->task->report->typeList, $type)
  77. ),
  78. h::iframe
  79. (
  80. setID('staticScreen'),
  81. set('width', '100%'),
  82. set('height', '100%'),
  83. set('scrolling', 'no'),
  84. set('frameborder', '0'),
  85. set('marginheight', '0'),
  86. set('src', createLink('screen', 'staticDataOld')),
  87. on::init()->do(<<<JS
  88. const iframe = document.getElementById('staticScreen');
  89. iframe.onload = function()
  90. {
  91. const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
  92. iframe.contentWindow.setStaticData('{$staticDataJson}', {width: iframe.offsetWidth});
  93. const style = document.createElement('style');
  94. style.textContent = 'body {background-color: #fff !important;}';
  95. iframeDoc.head.appendChild(style);
  96. };
  97. JS
  98. )
  99. )
  100. )
  101. );