Browse Source

优化

master
陈裕财 3 years ago
parent
commit
fa9cc45012
  1. 3
      src/views/xm/rpt/testPlan/testPlanCaseExecStatusDist.vue
  2. 164
      src/views/xm/rpt/testPlan/testPlanCaseUserDist.vue

3
src/views/xm/rpt/testPlan/testPlanCaseExecStatusDist.vue

@ -46,14 +46,13 @@
import { getXmTestPlanCaseExecStatusDist } from '@/api/xm/core/xmTestPlanCase'; 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 XmProductSelect from '@/views/xm/core/components/XmProductSelect';//
import xmTestPlanSelect from '@/views/xm/core/xmTestPlan/XmTestPlanSelect';// import xmTestPlanSelect from '@/views/xm/core/xmTestPlan/XmTestPlanSelect';//
export default { export default {
components: { components: {
XmIterationSelect,XmProductSelect,xmTestPlanSelect,
XmProductSelect,xmTestPlanSelect,
}, },
props:['xmProject','xmProduct','xmTestCasedb','xmTestPlan'], props:['xmProject','xmProduct','xmTestCasedb','xmTestPlan'],
computed: { computed: {

164
src/views/xm/rpt/testPlan/testPlanCaseUserDist.vue

@ -1,23 +1,41 @@
<template> <template>
<section> <section>
<el-row class="padding">
<span>{{'成员执行结果分布'}}</span>
<el-popover trigger="manual" v-model="conditionBtnVisible" style="float:right;" width="300">
<el-button slot="reference" icon="el-icon-more" @click="conditionBtnVisible=!conditionBtnVisible"></el-button>
<el-form :model="filters">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="searchXmTestPlanCaseUserDist">查询</el-button>
<el-dialog fullscreen :title="title" append-to-body modal-append-to-body width="80%" top="20px" :visible.sync="visible">
<el-row :gutter="5">
<el-col :span="18">
<div>
<div class="main" id="testPlanCaseUserDist"
style="width:100%;height:600px;margin:0 auto;"></div>
<div class="progress"></div>
</div>
</el-col>
<el-col :span="6" class="border padding">
<el-form :model="filters">
<el-form-item label="归属产品" >
<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="xmTestPlan?xmTestPlan.id:null" @clear="onProductClear"></xm-product-select>
<span v-else>{{xmProductCpd.id}} <span v-if="xmProductCpd.productName"><br/>{{ xmProductCpd.productName }} </span> </span>
</el-form-item>
<el-form-item label="测试计划" v-if="xmTestPlan && xmTestPlan.id">
<span> {{xmTestPlan.id}}
<span v-if="xmTestPlan.name"><br/>{{ xmTestPlan.name }} </span>
</span>
</el-form-item> </el-form-item>
</el-form>
</el-popover>
</el-row>
<el-row>
<div>
<div class="main" :id="id"
style="width:100%;height:600px;margin:0 auto;"></div>
<div class="progress"></div>
</div>
</el-row>
<el-form-item label="测试计划" v-else-if="filters.product && filters.product.id">
<span v-if="filters.testPlan">{{ filters.testPlan.name }}</span><el-button type="primary" @click="$refs['xmTestPlanSelectRef'].open()">选择计划</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="searchXmTestPlanCaseUserDist">查询</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</el-dialog>
<xm-test-plan-select ref="xmTestPlanSelectRef" :casedb-id="xmTestCasedb?xmTestCasedb.id:null" :product-id="xmProduct?xmProduct.id:null" :project-id="xmProject?xmProject.id:null" placeholder="迭代" @select="onXmTestPlanSelected" @clear="onXmTestPlanClear"></xm-test-plan-select >
</section> </section>
</template> </template>
@ -28,15 +46,15 @@
import { getXmTestPlanCaseUserDist } from '@/api/xm/core/xmTestPlanCase'; 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 { export default {
components: { components: {
XmIterationSelect,XmProductSelect,
XmProductSelect,xmTestPlanSelect,
}, },
props:['xmTestCasedb','xmTestPlan'],
props:['xmProject','xmProduct','xmTestCasedb','xmTestPlan'],
computed: { computed: {
...mapGetters([ ...mapGetters([
'userInfo','roles' 'userInfo','roles'
@ -44,20 +62,36 @@
xmTestPlanCaseUserDistsCpd(){ xmTestPlanCaseUserDistsCpd(){
if(this.xmTestPlanCaseUserDists.length==0){ if(this.xmTestPlanCaseUserDists.length==0){
return [] 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(){ 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: { watch: {
xmTestPlanCaseUserDistsCpd(){ xmTestPlanCaseUserDistsCpd(){
@ -67,10 +101,12 @@
data() { data() {
return { return {
filters:{ 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 },//... load:{ list: false, edit: false, del: false, add: false },//...
dateRanger:[], dateRanger:[],
maxTableHeight:300, maxTableHeight:300,
@ -92,7 +128,7 @@
return val; return val;
}, },
drawCharts() { drawCharts() {
this.myChart = this.$echarts.init(document.getElementById(this.id));
this.myChart = this.$echarts.init(document.getElementById("testPlanCaseUserDist"));
this.myChart.setOption( this.myChart.setOption(
{ {
title: { title: {
@ -128,12 +164,30 @@
] ]
} }
) )
},
onXmQuestionSomeFieldsChange(fieldName,$event){
this.xmTestPlanCaseUserDists=[]
},
},
searchXmTestPlanCaseUserDist(){ 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=>{ getXmTestPlanCaseUserDist(params).then(res=>{
this.xmTestPlanCaseUserDists=res.data.data 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(){ 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(){ sizeAutoChange(){
this.myChart.resize(); 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 },//end method
mounted() { mounted() {
initSimpleDicts('all',['testPlanTcode'] ).then(res=>{ initSimpleDicts('all',['testPlanTcode'] ).then(res=>{
this.dicts=res.data.data; this.dicts=res.data.data;
}) })
this.initData();
this.searchXmTestPlanCaseUserDist();
//this.charts();
//this.drawCharts();
this.initData();
}//end mounted }//end mounted
} }

Loading…
Cancel
Save