ajaxgetcfd.html.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. /**
  3. * The ajaxGetCFD view file of execution 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 Shujie Tian<tianshujie@easycorp.ltd>
  7. * @package execution
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $index = 0;
  12. $chartColors = array('#33B4DB', '#7ECF69', '#FFC73A', '#FF5A61', '#50C8D0', '#AF5AFF', '#4EA3FF', '#FF8C5A', '#6C73FF');
  13. $chartSeries = array();
  14. if(!empty($chartData['line']))
  15. {
  16. foreach($chartData['line'] as $label => $set)
  17. {
  18. $chartSeries[] = array(
  19. 'name' => $label,
  20. 'type' => 'line',
  21. 'stack' => 'Total',
  22. 'data' => array_values($set),
  23. 'color' => $chartColors[$index],
  24. 'areaStyle' => array('color' => $chartColors[$index], 'opacity' => 0.2),
  25. 'itemStyle' => array('normal' => array('lineStyle' => array('width' => 1))),
  26. 'emphasis' => array('focus' => 'series')
  27. );
  28. $index ++;
  29. }
  30. }
  31. $cfdChart = null;
  32. if(hasPriv('execution', 'cfd'))
  33. {
  34. $cfdChart = isset($chartData['labels']) && count($chartData['labels']) != 1 ? echarts
  35. (
  36. set::series($chartSeries),
  37. set::width('100%'),
  38. set::height('150%'),
  39. set::tooltip(array(
  40. 'trigger' => 'axis',
  41. 'axisPointer' => array('type' => 'cross', 'label' => array('backgroundColor' => '#6a7985')),
  42. 'textStyle' => array('fontWeight' => 100),
  43. 'formatter' => "RAWJS<function(rowDatas){return window.randTipInfo(rowDatas);}>RAWJS"
  44. )),
  45. set::grid(array(
  46. 'left' => '3%',
  47. 'right' => '5%',
  48. 'bottom' => '3%',
  49. 'containLabel' => true
  50. )),
  51. set::xAxis(array(array(
  52. 'type' => 'category',
  53. 'boundaryGap' => false,
  54. 'data' => $chartData['labels'],
  55. 'name' => $lang->execution->burnXUnit,
  56. 'axisLine' => array('show' => true, 'lineStyle' =>array('color' => '#999', 'width' => 1))
  57. ))),
  58. set::yAxis(array(array(
  59. 'type' => 'value',
  60. 'name' => $lang->execution->count,
  61. 'minInterval' => 1,
  62. 'nameTextStyle' => array('fontWeight' => 'normal'),
  63. 'axisPointer' => array('label' => array('show' => true, 'precision' => 0)),
  64. 'axisLine' => array('show' => true, 'lineStyle' => array('color' => '#999', 'width' => 1))
  65. )))
  66. ) : div
  67. (
  68. setClass('table-empty-tip text-center'),
  69. span
  70. (
  71. setClass('text-gray'),
  72. $lang->execution->noPrintData
  73. )
  74. );
  75. }
  76. panel
  77. (
  78. div
  79. (
  80. set::className('flex flex-nowrap justify-between'),
  81. div(set('class', 'panel-title'), $execution->name . $lang->execution->CFD),
  82. common::hasPriv('execution', 'cfd') ? btn
  83. (
  84. setClass('ghost text-gray'),
  85. set::url(createLink('execution', 'cfd', "executionID={$execution->id}")),
  86. $lang->more
  87. ) : null
  88. ),
  89. div($cfdChart)
  90. );
  91. /* ====== Render page ====== */
  92. render();