report.html.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. /**
  3. * The view file of product 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 chen.tao <chentao@easycorp.ltd>
  7. * @package product
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. jsVar('params', "productID={$productID}&branchID={$branchID}&storyType={$storyType}&browseType={$browseType}&moduleID={$moduleID}");
  12. jsVar('projectID', $projectID);
  13. jsVar('storyType', $storyType);
  14. data('activeMenuID', $storyType);
  15. detailHeader
  16. (
  17. to::title
  18. (
  19. entityLabel
  20. (
  21. set::level(1),
  22. set::text($lang->story->report->common)
  23. )
  24. )
  25. );
  26. $reports = array();
  27. foreach($lang->story->report->charts as $key => $label) $reports[] = array('text' => $label, 'value' => $key);
  28. function getEcharts($charts, $datas, $chartType)
  29. {
  30. global $lang;
  31. $echarts = array();
  32. foreach($charts as $type => $option)
  33. {
  34. $chartData = $datas[$type];
  35. $echarts[] = tableChart(set::item('chart-' . $type), set::type($chartType), set::title($lang->story->report->charts[$type]), set::datas((array)$chartData));
  36. }
  37. return $echarts;
  38. }
  39. $tabItems = array();
  40. unset($lang->report->typeList['default']);
  41. foreach($lang->report->typeList as $type => $typeName)
  42. {
  43. $tabItems[] = tabPane
  44. (
  45. set::key($type),
  46. set::param($type),
  47. set::title($typeName),
  48. set::active($type == $chartType),
  49. to::prefix(icon($type == 'default' ? 'list-alt' : "chart-{$type}")),
  50. div(setClass('pb-4 pt-2'), span(setClass('text-gray'), html(str_replace('%tab%', $lang->product->unclosed . $lang->story->common, $lang->report->notice->help)))),
  51. div(getEcharts($charts, $datas, $type))
  52. );
  53. }
  54. div
  55. (
  56. setClass('flex items-start'),
  57. cell
  58. (
  59. set::width('240'),
  60. setClass('bg-white p-4 mr-5'),
  61. div(setClass('pb-2'), span(setClass('font-bold'), $lang->story->report->select)),
  62. div
  63. (
  64. setClass('pb-2'),
  65. control
  66. (
  67. set::type('checkList'),
  68. set::name('charts'),
  69. set::items($reports)
  70. )
  71. ),
  72. btn
  73. (
  74. bind::click('selectAll'),
  75. $lang->selectAll
  76. ),
  77. btn
  78. (
  79. setClass('primary ml-4 inited'),
  80. bind::click('clickInit'),
  81. $lang->story->report->create
  82. )
  83. ),
  84. cell
  85. (
  86. set::flex('1'),
  87. setClass('bg-white px-4 py-2'),
  88. setID('report'),
  89. tabs
  90. (
  91. on::show('.tab-pane')->call('handleShowReportTab', jsRaw('event')),
  92. $tabItems
  93. )
  94. )
  95. );