diff --git a/src/views/xm/rpt/testPlan/testPlanCaseExecStatusDist.vue b/src/views/xm/rpt/testPlan/testPlanCaseExecStatusDist.vue index b46d01b5..bbecf13a 100644 --- a/src/views/xm/rpt/testPlan/testPlanCaseExecStatusDist.vue +++ b/src/views/xm/rpt/testPlan/testPlanCaseExecStatusDist.vue @@ -46,14 +46,13 @@ import { getXmTestPlanCaseExecStatusDist } from '@/api/xm/core/xmTestPlanCase'; - import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue';//修改界面 import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//新增界面 import xmTestPlanSelect from '@/views/xm/core/xmTestPlan/XmTestPlanSelect';//计划选择器 export default { components: { - XmIterationSelect,XmProductSelect,xmTestPlanSelect, + XmProductSelect,xmTestPlanSelect, }, props:['xmProject','xmProduct','xmTestCasedb','xmTestPlan'], computed: { diff --git a/src/views/xm/rpt/testPlan/testPlanCaseUserDist.vue b/src/views/xm/rpt/testPlan/testPlanCaseUserDist.vue index 24977269..e667cabe 100644 --- a/src/views/xm/rpt/testPlan/testPlanCaseUserDist.vue +++ b/src/views/xm/rpt/testPlan/testPlanCaseUserDist.vue @@ -1,23 +1,41 @@ @@ -28,15 +46,15 @@ import { getXmTestPlanCaseUserDist } from '@/api/xm/core/xmTestPlanCase'; - import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue';//修改界面 - import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//新增界面 + import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//新增界面 + import xmTestPlanSelect from '@/views/xm/core/xmTestPlan/XmTestPlanSelect';//计划选择器 export default { components: { - XmIterationSelect,XmProductSelect, + XmProductSelect,xmTestPlanSelect, }, - props:['xmTestCasedb','xmTestPlan'], + props:['xmProject','xmProduct','xmTestCasedb','xmTestPlan'], computed: { ...mapGetters([ 'userInfo','roles' @@ -44,20 +62,36 @@ xmTestPlanCaseUserDistsCpd(){ if(this.xmTestPlanCaseUserDists.length==0){ return [] - }else{ - return this.xmTestPlanCaseUserDists - } + }else{ + var datas=[] + this.xmTestPlanCaseUserDists.forEach(i=>{ + var data={} + var itemId="testPlanTcode"; + data.name=this.formatDict(itemId,i.execStatus) + data.value=i.totalCnt + datas.push(data) + }) + return datas; + } }, title(){ - return '成员执行结果数量分布' - }, - legendCpd(){ - return ['已执行','未执行'] - }, - id(){ - return 'testPlanCaseUserDist-001' + return '测试用例执行结果数量分布' }, + /**0-未测,1-通过,2-受阻,3-忽略,4-失败 */ + legendCpd(){ + var itemId="testPlanTcode"; + return this.dicts[itemId].map(i=>this.formatDict(itemId,i.id)) + }, + xmProductCpd(){ + if(this.xmTestPlan && this.xmTestPlan.id){ + return {id:this.xmTestPlan.productId,productName:this.xmTestPlan.productName} + } + if(this.xmProduct && this.xmProduct.id){ + return this.xmProduct + } + return null; + } }, watch: { xmTestPlanCaseUserDistsCpd(){ @@ -67,10 +101,12 @@ data() { return { filters:{ - planId:'', + testPlan:null, + product:null, + project:null, }, - dicts:{},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} + dicts:{testPlanTcode:[]},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} load:{ list: false, edit: false, del: false, add: false },//查询中... dateRanger:[], maxTableHeight:300, @@ -92,7 +128,7 @@ return val; }, drawCharts() { - this.myChart = this.$echarts.init(document.getElementById(this.id)); + this.myChart = this.$echarts.init(document.getElementById("testPlanCaseUserDist")); this.myChart.setOption( { title: { @@ -128,12 +164,30 @@ ] } ) - }, - onXmQuestionSomeFieldsChange(fieldName,$event){ - this.xmTestPlanCaseUserDists=[] - }, + }, searchXmTestPlanCaseUserDist(){ - var params={...this.filters} + + var params={ } + if(this.filters.product && this.filters.product.id){ + params.productId=this.filters.product.id + } + + if(this.filters.project && this.filters.project.id){ + params.projectId=this.filters.project.id + } + + + if(this.filters.project && this.filters.project.id){ + params.projectId=this.filters.project.id + } + + + if(this.filters.testPlan && this.filters.testPlan.id){ + params.planId=this.filters.testPlan.id + } + if(this.filters.testCasedb && this.filters.testCasedb.id){ + params.casedbId=this.filters.testCasedb.id + } getXmTestPlanCaseUserDist(params).then(res=>{ this.xmTestPlanCaseUserDists=res.data.data }) @@ -148,32 +202,40 @@ }, - onIterationSelected(iteration){ - this.filters.iteration=iteration + onXmTestPlanSelected(xmTestPlan){ + this.filters.testPlan=xmTestPlan }, - onIterationClear(){ - this.filters.iteration=null + onXmTestPlanClear(){ + this.filters.testPlan=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.xmTestPlan){ + this.filters.testPlan=this.xmTestPlan } }, sizeAutoChange(){ this.myChart.resize(); + }, + open(params){ + this.visible=true; + this.filters.testPlan=this.xmTestPlan + this.filters.product=this.xmProduct + this.filters.project=this.xmProject + this.filters.testCasedb=this.xmTestCasedb + + if(this.xmTestPlan && this.xmTestPlan.id){ + this.searchXmTestPlanCaseUserDist(); + + } + } },//end method mounted() { initSimpleDicts('all',['testPlanTcode'] ).then(res=>{ this.dicts=res.data.data; }) - this.initData(); - this.searchXmTestPlanCaseUserDist(); - //this.charts(); - //this.drawCharts(); + this.initData(); }//end mounted }