singlebugstatisticblock.html.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <?php
  2. /**
  3. * The singleproductbugstatistic block view file of block 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 Mengyi Liu <liumengyi@easycorp.ltd>
  7. * @package block
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $uniqid = uniqid();
  12. $isEn = $app->getClientLang() == 'en';
  13. panel
  14. (
  15. to::titleSuffix
  16. (
  17. icon
  18. (
  19. setClass('text-light text-sm cursor-pointer'),
  20. toggle::tooltip
  21. (
  22. array
  23. (
  24. 'title' => sprintf($lang->block->tooltips['metricTime'], $metricTime),
  25. 'placement' => $isEn ? 'bottom-end' : 'bottom',
  26. 'type' => 'white',
  27. 'className' => 'text-dark border border-light leading-5'
  28. )
  29. ),
  30. 'help'
  31. )
  32. ),
  33. setClass('singlebugstatistic-block ' . ($longBlock ? 'block-long' : 'block-sm')),
  34. set::bodyClass('no-shadow border-t p-0'),
  35. set::title($block->title),
  36. div
  37. (
  38. setClass('flex' . ($longBlock ? ' flex-nowrap' : ' flex-wrap')),
  39. cell
  40. (
  41. setClass('flex flex-wrap items-center content-center progress-circle' . (!$longBlock ? ' pt-8 pb-4' : '')),
  42. set::width($longBlock ? '30%' : '100%'),
  43. div(setClass('flex justify-center w-full'), progressCircle
  44. (
  45. set::percent($resolvedRate),
  46. set::size($isEn ? 140 : 112),
  47. set::text(false),
  48. set::circleWidth(0.06),
  49. div(span(setClass('text-2xl font-bold'), $resolvedRate), '%'),
  50. div
  51. (
  52. setClass('row text-sm text-gray items-center gap-1'),
  53. $lang->block->qastatistic->fixBugRate,
  54. icon
  55. (
  56. setClass('text-light text-sm'),
  57. toggle::tooltip
  58. (
  59. array
  60. (
  61. 'title' => $lang->block->tooltips['resolvedRate'],
  62. 'placement' => 'bottom-end',
  63. 'type' => 'white',
  64. 'className' => 'text-dark border border-light leading-5'
  65. )
  66. ),
  67. 'help'
  68. )
  69. )
  70. )),
  71. cell
  72. (
  73. setClass('flex justify-center w-full mt-3 gap-x-4'),
  74. col
  75. (
  76. span
  77. (
  78. setClass('flex justify-center'),
  79. $totalBugs
  80. ),
  81. span
  82. (
  83. setClass('text-sm text-gray'),
  84. $lang->block->bugstatistic->effective
  85. )
  86. ),
  87. col
  88. (
  89. span
  90. (
  91. setClass('flex justify-center'),
  92. $closedBugs
  93. ),
  94. span
  95. (
  96. setClass('text-sm text-gray'),
  97. $lang->block->bugstatistic->fixed
  98. )
  99. ),
  100. col
  101. (
  102. span
  103. (
  104. setClass('flex justify-center'),
  105. $unresovledBugs
  106. ),
  107. span
  108. (
  109. setClass('text-sm text-gray'),
  110. $lang->block->bugstatistic->activated
  111. )
  112. )
  113. )
  114. ),
  115. cell
  116. (
  117. setClass('p-4' . ($longBlock ? ' mt-3' : ' pb-0')),
  118. set::width($longBlock ? '70%' : '100%'),
  119. echarts
  120. (
  121. set::title(array('text' => $lang->block->qastatistic->bugStatusStat, 'textStyle' => array('fontSize' => '12'))),
  122. set::color(array('#66a2ff', '#9ea3b0')),
  123. set::width('100%'),
  124. set::height(200),
  125. set::tooltip(array('trigger' => 'axis')),
  126. set::grid(array('left' => '10px', 'top' => '50px', 'right' => '0', 'bottom' => '10px', 'containLabel' => true)),
  127. set::legend(array('show' => true, 'right' => '0', 'top' => '25px', 'textStyle' => array('fontSize' => '11'))),
  128. set::xAxis(array('type' => 'category', 'data' => array_keys($activateBugs), 'splitLine' => array('show' => false), 'axisTick' => array('alignWithLabel' => true, 'interval' => 0), 'axisLabel' => array('fontSize' => $longBlock ? '8' : '10'))),
  129. set::yAxis(array('type' => 'value', 'splitLine' => array('show' => false), 'axisLine' => array('show' => true, 'color' => '#DDD'), 'axisLabel' => array('showMaxLabel' => true, 'interval' => 'auto'))),
  130. set::tooptop(array('show' => true, 'formatter' => '{b}: {c}')),
  131. set::series
  132. (
  133. array
  134. (
  135. array
  136. (
  137. 'type' => 'bar',
  138. 'barWidth' => '8',
  139. 'name' => $lang->bug->createAB,
  140. 'data' => array_values($activateBugs)
  141. ),
  142. array
  143. (
  144. 'type' => 'bar',
  145. 'barWidth' => '8',
  146. 'name' => $lang->bug->close,
  147. 'data' => array_values($closeBugs)
  148. )
  149. )
  150. )
  151. )
  152. )
  153. )
  154. );
  155. render();