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.

301 lines
8.4 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <section>
  3. <el-dialog fullscreen :title="dialogTitle" append-to-body modal-append-to-body width="80%" top="20px" :visible.sync="visible">
  4. <el-row :gutter="5" v-if="visible">
  5. <el-col :span="18"> <div>
  6. <div class="main" id="iterationQuestionDayAccumulate"
  7. style="width:100%;height:600px;margin:0 auto;"></div>
  8. </div>
  9. </el-col>
  10. <el-col :span="6" class="border padding">
  11. <el-form :model="filters">
  12. <el-form-item label="归属产品" >
  13. <xm-product-select v-if="!xmProductCpd || !xmProductCpd.id" ref="xmProductSelect" style="display:inline;" :auto-select="false" :link-project-id="xmProject?xmProject.id:null" @row-click="onProductSelected" :iterationId="xmIteration?xmIteration.id:null" @clear="onProductClear"></xm-product-select>
  14. <span v-else>{{xmProductCpd.id}} <span v-if="xmProductCpd.productName"><br/>{{ xmProductCpd.productName }} </span> </span>
  15. </el-form-item>
  16. <el-form-item label="归属迭代">
  17. <xm-iteration-select v-if="!xmIteration || !xmIteration.id" ref="xmIterationSelect" :auto-select="false" :product-id="filters.product?filters.product.id:null" :link-project-id="xmProject?xmProject.id:null" placeholder="迭代" @row-click="onIterationSelected" @clear="onIterationClear"></xm-iteration-select>
  18. <span v-else> {{xmIteration.id}}
  19. <span v-if="xmIteration.iterationName"><br/>{{ xmIteration.iterationName }} </span></span>
  20. </el-form-item>
  21. <el-form-item label="日期区间">
  22. <br>
  23. <mdp-date-range v-model="filters" value-format="yyyy-MM-dd" start-key="startBizDate" end-key="endBizDate"></mdp-date-range>
  24. </el-form-item>
  25. <el-form-item>
  26. <el-button type="primary" icon="el-icon-search" @click="listXmIterationStateHis">查询</el-button>
  27. </el-form-item>
  28. </el-form>
  29. </el-col>
  30. </el-row>
  31. </el-dialog>
  32. </section>
  33. </template>
  34. <script>
  35. import util from '@/common/js/util';//全局公共库
  36. import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询
  37. import { mapGetters } from 'vuex'
  38. import { listXmIterationStateHis } from '@/api/xm/core/xmIterationStateHis';
  39. import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//产品选择界面
  40. import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect';//迭代选择界面
  41. export default {
  42. components: {
  43. XmIterationSelect,XmProductSelect,
  44. },
  45. props:['xmProduct','xmProject','xmIteration'],
  46. computed: {
  47. ...mapGetters([
  48. 'userInfo','roles'
  49. ]),
  50. datesCpd(){
  51. if(this.xmProductStateHiss.length==0){
  52. return []
  53. }else{
  54. return this.xmProductStateHiss.map(i=>i.bizDate)
  55. }
  56. },
  57. closedBugsCpd(){
  58. if(this.xmProductStateHiss.length==0){
  59. return []
  60. }else{
  61. return this.xmProductStateHiss.map(i=>i.closedBugs)
  62. }
  63. },
  64. activeBugsCpd(){
  65. if(this.xmProductStateHiss.length==0){
  66. return []
  67. }else{
  68. return this.xmProductStateHiss.map(i=> i.menuUnstartCnt)
  69. }
  70. },
  71. confirmedBugsCpd(){
  72. if(this.xmProductStateHiss.length==0){
  73. return []
  74. }else{
  75. return this.xmProductStateHiss.map(i=> i.confirmedBugs)
  76. }
  77. },
  78. resolvedBugsCpd(){
  79. if(this.xmProductStateHiss.length==0){
  80. return []
  81. }else{
  82. return this.xmProductStateHiss.map(i=>i.resolvedBugs)
  83. }
  84. },
  85. dialogTitle(){
  86. if(this.xmIteration && this.xmIteration.id){
  87. return (this.xmIteration?'迭代【'+this.xmIteration.iterationName+'】':'')+'缺陷每日累积图'
  88. }else {
  89. return (this.filters.product?'产品【'+this.filters.product.productName+'】':'')+'缺陷每日累积图'
  90. }
  91. },
  92. xmProductCpd(){
  93. if(this.xmIteration && this.xmIteration.id){
  94. return {id:this.xmIteration.productId,productName:this.xmIteration.productName}
  95. }
  96. if(this.xmProduct && this.xmProduct.id){
  97. return this.xmProduct
  98. }
  99. return null;
  100. }
  101. },
  102. watch: {
  103. datesCpd(){
  104. this.$nextTick(()=>{
  105. this.drawCharts();
  106. })
  107. }
  108. },
  109. data() {
  110. return {
  111. filters:{
  112. category:'',
  113. product:null,
  114. project:null,
  115. iteration:null,
  116. },
  117. dicts:{},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]}
  118. load:{ list: false, edit: false, del: false, add: false },//查询中...
  119. dateRanger:[],
  120. maxTableHeight:300,
  121. visible:false,
  122. xmProductStateHiss:[],
  123. }//end return
  124. },//end data
  125. methods: {
  126. listXmIterationStateHis(){
  127. if(!this.filters.product){
  128. this.$notify({position:'bottom-left',showClose:true,message:'请先选中产品',type:'warning'})
  129. return;
  130. }
  131. if(!this.filters.iteration){
  132. this.$notify({position:'bottom-left',showClose:true,message:'请先选中迭代',type:'warning'})
  133. return;
  134. }
  135. var params={productId:this.filters.product.id,iterationId:this.filters.iteration.id,orderBy:'biz_date asc'}
  136. if(this.filters.startBizDate && this.filters.endBizDate){
  137. params.startBizDate=this.filters.startBizDate;
  138. params.endBizDate=this.filters.endBizDate;
  139. }
  140. listXmIterationStateHis(params).then(res=>{
  141. this.xmProductStateHiss=res.data.tips.isOk?res.data.data:this.xmProductStateHiss;
  142. })
  143. },
  144. open(params){
  145. this.visible=true;
  146. this.filters.product=params.xmProduct
  147. this.filters.project=params.xmProject
  148. this.filters.iteration=params.xmIteration
  149. this.xmProductStateHiss=[]
  150. if(this.$refs['xmProductSelect'])this.$refs['xmProductSelect'].clearSelect();
  151. if(this.$refs['xmIterationSelect'])this.$refs['xmIterationSelect'].clearSelect();
  152. this.$nextTick(()=>{
  153. this.listXmIterationStateHis();
  154. })
  155. },
  156. drawCharts() {
  157. this.myChart = this.$echarts.init(document.getElementById("iterationQuestionDayAccumulate"));
  158. this.myChart.setOption(
  159. {
  160. title: {
  161. text: '缺陷累积图'
  162. },
  163. tooltip: {
  164. trigger: 'axis',
  165. axisPointer: {
  166. type: 'cross',
  167. label: {
  168. backgroundColor: '#6a7985'
  169. }
  170. }
  171. },
  172. legend: {
  173. data: ['新提出', '执行中', '已解决', '已关闭']
  174. },
  175. grid: {
  176. left: '3%',
  177. right: '4%',
  178. bottom: '3%',
  179. containLabel: true
  180. },
  181. toolbox: {
  182. feature: {
  183. saveAsImage: {}
  184. }
  185. },
  186. xAxis: {
  187. type: 'category',
  188. boundaryGap: false,
  189. data: this.datesCpd,
  190. },
  191. yAxis: {
  192. type: 'value'
  193. },
  194. series: [
  195. {
  196. name: '新提出',
  197. type: 'line',
  198. stack: 'Total',
  199. areaStyle: {},
  200. emphasis: {
  201. focus: 'series'
  202. },
  203. data: this.activeBugsCpd
  204. },
  205. {
  206. name: '执行中',
  207. type: 'line',
  208. stack: 'Total',
  209. areaStyle: {},
  210. emphasis: {
  211. focus: 'series'
  212. },
  213. data: this.confirmedBugsCpd,
  214. },
  215. {
  216. name: '已解决',
  217. type: 'line',
  218. stack: 'Total',
  219. areaStyle: {},
  220. emphasis: {
  221. focus: 'series'
  222. },
  223. data: this.resolvedBugsCpd,
  224. },
  225. {
  226. name: '已关闭',
  227. type: 'line',
  228. stack: 'Total',
  229. areaStyle: {},
  230. emphasis: {
  231. focus: 'series'
  232. },
  233. label: {
  234. show: true,
  235. position: 'top'
  236. },
  237. data: this.closedBugsCpd,
  238. }
  239. ]
  240. }
  241. )
  242. },
  243. onProductSelected(product){
  244. this.filters.product=product
  245. this.xmProductStateHiss=[];
  246. },
  247. onProductClear(){
  248. this.filters.product=null
  249. this.xmProductStateHiss=[];
  250. },
  251. onIterationSelected(iteration){
  252. this.filters.iteration=iteration
  253. this.xmProductStateHiss=[];
  254. },
  255. onIterationClear(){
  256. this.filters.iteration=null
  257. this.xmProductStateHiss=[];
  258. }
  259. },//end method
  260. mounted() {
  261. /**
  262. initSimpleDicts('all',['demandSource','demandLvl','demandType','priority','menuStatus'] ).then(res=>{
  263. this.dicts=res.data.data;
  264. })
  265. */
  266. //this.charts();
  267. //this.drawCharts()
  268. }//end mounted
  269. }
  270. </script>
  271. <style scoped>
  272. .image {
  273. width: 100%;
  274. display: block;
  275. }
  276. </style>