burn.html.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <?php include $app->getModuleRoot() . 'common/view/header.lite.html.php';?>
  2. <?php include $app->getModuleRoot() . 'common/view/chart.html.php';?>
  3. <?php js::import($jsRoot . 'echarts/echarts.common.min.js');?>
  4. <?php js::import($jsRoot . 'echarts/timeline.min.js');?>
  5. <?php js::set('executions', $executions);?>
  6. <?php js::set('burnXUnit', $lang->execution->burnXUnit);?>
  7. <?php js::set('burnYUnit', $lang->execution->burnYUnit);?>
  8. <?php js::set('workHour', $lang->execution->workHour);?>
  9. <?php js::set('workHourUnit', $lang->execution->workHourUnit);?>
  10. <div class='header'>
  11. <div class='img-header'>
  12. <h2 class='title'><?php echo $screen->name;?></h2>
  13. <span class='time'><?php echo '更新时间:' . $date;?></span>
  14. </div>
  15. </div>
  16. <div class='content'>
  17. <?php if(!empty($executions)):?>
  18. <div class='burn'>
  19. <?php foreach($executions as $executionID => $execution):?>
  20. <div class="container" id="<?php echo 'burn' . $executionID;?>">
  21. </div>
  22. <?php endforeach;?>
  23. </div>
  24. <?php else:?>
  25. <div class="table-empty-tip">
  26. <p>
  27. <span class="text-muted"><?php echo $lang->screen->noData;?></span>
  28. </p>
  29. </div>
  30. <?php endif;?>
  31. </div>
  32. <script>
  33. function initBurnChar()
  34. {
  35. console.log(executions);
  36. Object.values(executions).forEach(function(execution)
  37. {
  38. var chartDom = document.getElementById('burn' + execution.id);
  39. var myChart = echarts.init(chartDom);
  40. var title = truncateCustomString(execution.name, 36);
  41. var option = {
  42. title: {
  43. text: title,
  44. top: 10,
  45. textStyle: {
  46. color: '#a1c4e9',
  47. fontSize: 15
  48. }
  49. },
  50. tooltip: {
  51. trigger: 'axis',
  52. valueFormatter: (value) => (value == undefined ? 0 : value) + ' ' + workHour + '/' + workHourUnit
  53. },
  54. legend: {
  55. data: ["<?php echo $lang->execution->charts->burn->graph->actuality;?>","<?php echo $lang->execution->charts->burn->graph->reference;?>"],
  56. textStyle:{
  57. color: '#dee0e4',
  58. fontSize: 14
  59. },
  60. top: 10,
  61. right: 0
  62. },
  63. color: ['#42526a', '#2567cf', 'red'],
  64. grid: {
  65. left: '3%',
  66. right: '4%',
  67. top: 65,
  68. bottom: '3%',
  69. containLabel: true
  70. },
  71. toolbox: {
  72. feature: {
  73. saveAsImage: {}
  74. }
  75. },
  76. xAxis: {
  77. type: 'category',
  78. name: burnXUnit,
  79. nameTextStyle:{
  80. padding: [20, 0, 0, -40],
  81. verticalAlign: "top"
  82. },
  83. boundaryGap: false,
  84. axisLabel: {
  85. show: true,
  86. textStyle: {
  87. color: '#dee0e4'
  88. }
  89. },
  90. data: execution.chartData['labels']
  91. },
  92. yAxis: {
  93. type: 'value',
  94. name: burnYUnit,
  95. nameTextStyle:{
  96. padding: [0, 0, -40, -45]
  97. },
  98. axisLabel: {
  99. show: true,
  100. textStyle: {
  101. color: '#dee0e4'
  102. }
  103. },
  104. axisLine: {
  105. show: true
  106. },
  107. splitLine: {
  108. show: true,
  109. lineStyle:{
  110. color: ['#182a43'],
  111. width: 2,
  112. type: 'solid'
  113. }
  114. },
  115. },
  116. series: [
  117. {
  118. name: "<?php echo $lang->execution->charts->burn->graph->reference;?>",
  119. symbol: 'circle',
  120. symbolSize: 4,
  121. type: 'line',
  122. areaStyle: {color: '#2667cf00'},
  123. lineStyle: {
  124. "width": 2,
  125. "type": "solid"
  126. },
  127. data: execution.chartData['baseLine']
  128. },
  129. {
  130. name: "<?php echo $lang->execution->charts->burn->graph->actuality;?>",
  131. symbol: 'circle',
  132. symbolSize: 4,
  133. type: 'line',
  134. areaStyle: {
  135. "opacity": 0.8,
  136. "color": {
  137. "colorStops": [
  138. {
  139. "offset": 0,
  140. "color": "rgba(73, 146, 255, 0.5)"
  141. },
  142. {
  143. "offset": 1,
  144. "color": "rgba(73, 146, 255, 0.1)"
  145. }
  146. ],
  147. "x": 0,
  148. "y": 0,
  149. "x2": 0,
  150. "y2": 1,
  151. "type": "linear",
  152. "global": false
  153. }
  154. },
  155. lineStyle: {
  156. "width": 2,
  157. "type": "solid"
  158. },
  159. data: execution.chartData['burnLine']
  160. },
  161. ]
  162. };
  163. if(execution.chartData['delayLine'])
  164. {
  165. var delaySets =
  166. {
  167. name: "<?php echo $lang->execution->charts->burn->graph->delay;?>",
  168. symbol: 'circle',
  169. symbolSize: 4,
  170. type: 'line',
  171. areaStyle: {color: '#2667cf00'},
  172. lineStyle: {
  173. "width": 2,
  174. "type": "solid"
  175. },
  176. data: execution.chartData['delayLine']
  177. }
  178. option.title.subtext = '已延期';
  179. option.title.subtextStyle = {color:"red", fontSize: 15};
  180. option.series.push(delaySets);
  181. }
  182. myChart.setOption(option);
  183. });
  184. }
  185. </script>
  186. <?php include $app->getModuleRoot() . 'common/view/footer.lite.html.php';?>