You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

210 lines
5.2 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <template>
  2. <section>
  3. <el-dialog :title="filters.iteration?'【'+filters.iterationName+'】':''+'迭代燃尽图'" append-to-body modal-append-to-body width="80%" top="20px" :visible.sync="visible">
  4. <div>
  5. <div class="main" id="main"
  6. style="width:100%;height:600px;margin:0 auto;"></div>
  7. <div class="progress"></div>
  8. </div>
  9. </el-dialog>
  10. </section>
  11. </template>
  12. <script>
  13. import util from '@/common/js/util';//全局公共库
  14. import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询
  15. import { mapGetters } from 'vuex'
  16. import { listXmIterationStateHis } from '@/api/xm/core/xmIterationStateHis';
  17. export default {
  18. components: {
  19. },
  20. props:['xmProduct','xmIteration','xmProject'],
  21. computed: {
  22. ...mapGetters([
  23. 'userInfo','roles'
  24. ]),
  25. datesCpd(){
  26. if(this.xmIterationStateHiss.length==0){
  27. return []
  28. }else{
  29. return this.xmIterationStateHiss.map(i=>i.bizDate)
  30. }
  31. },
  32. remainStandWorkloadsCpd(){
  33. if(this.xmIterationStateHiss.length==0){
  34. return []
  35. }else{
  36. var max=this.findMax(this.xmIterationStateHiss);
  37. var length=this.xmIterationStateHiss.length;
  38. return this.xmIterationStateHiss.map((i,index)=>{
  39. return max.distBudgetWorkload*(length-index)/length
  40. })
  41. }
  42. },
  43. remainWorkloadsCpd(){
  44. if(this.xmIterationStateHiss.length==0){
  45. return []
  46. }else{
  47. return this.xmIterationStateHiss.map(i=>i.distBudgetWorkload-i.actWorkload)
  48. }
  49. },
  50. remainEstimateWorkloadsCpd(){
  51. if(this.xmIterationStateHiss.length==0){
  52. return []
  53. }else{
  54. return this.xmIterationStateHiss.map(i=>i.distBudgetWorkload-i.estimateWorkload)
  55. }
  56. },
  57. },
  58. watch: {
  59. xmIterationStateHiss(){
  60. this.drawWorkload();
  61. }
  62. },
  63. data() {
  64. return {
  65. filters:{
  66. category:'',
  67. product:null,
  68. iteration:null,
  69. project:null,
  70. },
  71. dicts:{},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]}
  72. load:{ list: false, edit: false, del: false, add: false },//查询中...
  73. dateRanger:[],
  74. maxTableHeight:300,
  75. visible:false,
  76. xmIterationStateHiss:[],
  77. }//end return
  78. },//end data
  79. methods: {
  80. findMax( list ) {
  81. var i, max = list[0];
  82. if(list.length < 2) return max;
  83. for (i = 0; i < list.length; i++) {
  84. if (list[i].distBudgetWorkload > max.distBudgetWorkload) {
  85. max = list[i];
  86. }
  87. }
  88. return max;
  89. },
  90. listXmIterationStateHis(){
  91. var params={iterationId:'IT2022-0001-Z5TA',orderBy:'biz_date asc'}
  92. listXmIterationStateHis(params).then(res=>{
  93. this.xmIterationStateHiss=res.data.tips.isOk?res.data.data:this.xmIterationStateHiss;
  94. })
  95. },
  96. open(params){
  97. this.visible=true;
  98. this.filters.product=params.xmProduct
  99. this.filters.project=params.xmProject
  100. this.filters.iteration=params.xmIteration
  101. this.$nextTick(()=>{
  102. this.listXmIterationStateHis();
  103. })
  104. },
  105. drawWorkload() {
  106. this.myChart = this.$echarts.init(document.getElementById("main"));
  107. this.myChart.setOption({
  108. title: {
  109. text: '燃尽图:',
  110. },
  111. tooltip: {
  112. trigger: 'axis'
  113. },
  114. legend: {
  115. right: 40,
  116. data: ['理想线','预估剩余工时', '剩余工时']
  117. },
  118. xAxis: {
  119. type: 'category',
  120. boundaryGap: false,
  121. splitLine: {
  122. show: false
  123. },
  124. data: this.datesCpd,
  125. },
  126. yAxis: {},
  127. series: [
  128. {
  129. name: '理想线',
  130. type: 'line',
  131. // stack: '剩余工作量',
  132. data: this.remainStandWorkloadsCpd,
  133. itemStyle: {
  134. normal: {
  135. // 折点颜色样式
  136. color: 'green',
  137. lineStyle: {
  138. // 折线颜色样式
  139. color: 'green'
  140. }
  141. }
  142. },
  143. // data: this.opinionData,
  144. },
  145. {
  146. name: '预估剩余工时',
  147. type: 'line',
  148. // stack: '剩余工作量',
  149. data: this.remainEstimateWorkloadsCpd,
  150. itemStyle: {
  151. normal: {
  152. // 折点颜色样式
  153. color: 'blue',
  154. lineStyle: {
  155. // 折线颜色样式
  156. color: 'blue'
  157. }
  158. }
  159. },
  160. // data: this.opinionData,
  161. },
  162. {
  163. name: '剩余工时',
  164. type: 'line',
  165. // stack: '剩余工作量',
  166. data: this.remainWorkloadsCpd,
  167. itemStyle: {
  168. normal: {
  169. // 折点颜色样式
  170. color: 'orange',
  171. lineStyle: {
  172. // 折线颜色样式
  173. color: 'orange'
  174. }
  175. }
  176. },
  177. // data: this.opinionData,
  178. },
  179. ]
  180. })
  181. }
  182. },//end method
  183. mounted() {
  184. /**
  185. initSimpleDicts('all',['demandSource','demandLvl','demandType','priority','menuStatus'] ).then(res=>{
  186. this.dicts=res.data.data;
  187. })
  188. */
  189. //this.charts();
  190. }//end mounted
  191. }
  192. </script>
  193. <style scoped>
  194. .image {
  195. width: 100%;
  196. display: block;
  197. }
  198. </style>