From 3facd9620e0ef3847a042f65092320f18fb9d6a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Mon, 1 Aug 2022 22:35:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xmTestPlan/rpt/biz/questionAttDist.vue | 144 +++++++++--------- 1 file changed, 69 insertions(+), 75 deletions(-) diff --git a/src/views/xm/core/xmTestPlan/rpt/biz/questionAttDist.vue b/src/views/xm/core/xmTestPlan/rpt/biz/questionAttDist.vue index 98dfc5a1..6e357cb7 100644 --- a/src/views/xm/core/xmTestPlan/rpt/biz/questionAttDist.vue +++ b/src/views/xm/core/xmTestPlan/rpt/biz/questionAttDist.vue @@ -1,28 +1,16 @@ @@ -82,7 +78,7 @@ components: { XmIterationSelect,XmProductSelect, }, - props:['xmProduct','xmIteration','xmProject'], + props:['xmTestPlan','xmRptConfig','comp'], computed: { ...mapGetters([ 'userInfo','roles' @@ -92,19 +88,19 @@ return [] }else{ var itemId=""; - if(this.groupBy=='bug_status'){ + if(this.filters.groupBy=='bug_status'){ itemId="bugStatus" - }else if(this.groupBy=='bug_type'){ + }else if(this.filters.groupBy=='bug_type'){ itemId="bugType" - }else if(this.groupBy=='bug_reason'){ + }else if(this.filters.groupBy=='bug_reason'){ itemId="bugReason" - }else if(this.groupBy=='bug_severity'){ + }else if(this.filters.groupBy=='bug_severity'){ itemId="bugSeverity" - }else if(this.groupBy=='priority'){ + }else if(this.filters.groupBy=='priority'){ itemId="priority" - } else if(this.groupBy=='bug_solution'){ + } else if(this.filters.groupBy=='bug_solution'){ itemId="bugSolution" - } else if(this.groupBy=='rep_rate'){ + } else if(this.filters.groupBy=='rep_rate'){ itemId="bugRepRate" } return this.xmQuestionAttDists.map(i=>{ @@ -115,23 +111,23 @@ } }, title(){ - return this.groupBys.find(i=>i.id==this.groupBy).name+'数量分布' + return this.groupBys.find(i=>i.id==this.filters.groupBy).name+'数量分布' }, legendCpd(){ var itemId=""; - if(this.groupBy=='bug_status'){ + if(this.filters.groupBy=='bug_status'){ itemId="bugStatus" - }else if(this.groupBy=='bug_type'){ + }else if(this.filters.groupBy=='bug_type'){ itemId="bugType" - }else if(this.groupBy=='bug_reason'){ + }else if(this.filters.groupBy=='bug_reason'){ itemId="bugReason" - }else if(this.groupBy=='bug_severity'){ + }else if(this.filters.groupBy=='bug_severity'){ itemId="bugSeverity" - }else if(this.groupBy=='priority'){ + }else if(this.filters.groupBy=='priority'){ itemId="priority" - } else if(this.groupBy=='bug_solution'){ + } else if(this.filters.groupBy=='bug_solution'){ itemId="bugSolution" - } else if(this.groupBy=='rep_rate'){ + } else if(this.filters.groupBy=='rep_rate'){ itemId="bugRepRate" } @@ -147,10 +143,18 @@ data() { return { filters:{ - product:null, - iteration:null, - }, - groupBy:'bug_status', + groupBy:'bug_status', + planId:'', + productId:'', + projectId:'', + bugStatus:'', + bugType:'', + bugReason:'', + bugSeverity:'', + priority:'', + solution:'', + repRate:'', + }, groupBys:[ {id:'bug_status', name:'缺陷状态'}, {id:'bug_type', name:'缺陷类型'}, @@ -167,6 +171,7 @@ maxTableHeight:300, visible:false, xmQuestionAttDists:[], + conditionBtnVisible:false, }//end return },//end data @@ -242,40 +247,12 @@ this.xmQuestionAttDists=[] }, searchXmQuestionAttDist(){ - if(!this.groupBy){ + if(!this.filters.groupBy){ this.$notify({position:'bottom-left',showClose:true,message:'请选中分组属性',type:'warning'}) return } - var params={} - if(this.filters.solution){ - params.solution=this.filters.solution - } - if(this.filters.bugType){ - params.bugType=this.filters.bugType - } - if(this.filters.bugStatus){ - params.bugStatus=this.filters.bugStatus - } - if(this.filters.bugReason){ - params.bugReason=this.filters.bugReason - } - if(this.filters.bugSeverity){ - params.bugSeverity=this.filters.bugSeverity - } - if(this.filters.repRate){ - params.repRate=this.filters.repRate - } - if(this.filters.priority){ - params.priority=this.filters.priority - } - params.groupBy=this.groupBy - if(this.filters.product){ - params.productId=this.filters.product.id - } - - if(this.filters.iteration){ - params.iterationId=this.filters.iteration.id - } + var params={...this.filters} + getXmQuestionAttDist(params).then(res=>{ this.xmQuestionAttDists=res.data.data }) @@ -296,12 +273,29 @@ onIterationClear(){ this.filters.iteration=null + }, + initData(){ + if(this.xmTestPlan){ + this.filters.productId=this.xmTestPlan.productId + this.filters.projectId=this.xmTestPlan.projectId + this.filters.planId=this.xmTestPlan.id + } + if(this.xmRptConfig && this.xmRptConfig.cfg){ + var compCfg=this.xmRptConfig.cfg.find(k=>k.id==this.comp.id) + if(compCfg && compCfg.params){ + compCfg.params.forEach(k=>{ + this.filters[k.id]=k.value + }) + } + } } },//end method mounted() { initSimpleDicts('all',['bugSeverity','bugSolution','bugStatus','bugType','priority','bugRepRate','bugReason'] ).then(res=>{ this.dicts=res.data.data; }) + this.initData(); + this.searchXmQuestionAttDist(); //this.charts(); //this.drawCharts();