5 changed files with 227 additions and 23 deletions
-
7src/api/xm/core/xmTestPlanCase.js
-
13src/views/xm/core/xmTestPlan/rpt/CompsCard.vue
-
4src/views/xm/core/xmTestPlan/rpt/CompsSet.vue
-
30src/views/xm/core/xmTestPlan/rpt/biz/testPlanCaseExecStatusDist.vue
-
196src/views/xm/core/xmTestPlan/rpt/biz/testPlanCaseUserDist.vue
@ -0,0 +1,196 @@ |
|||
<template> |
|||
<section> |
|||
<el-row class="padding"> |
|||
<span>{{comp?comp.compName:'成员执行结果分布'}}</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-form-item> |
|||
</el-form> |
|||
</el-popover> |
|||
</el-row> |
|||
<el-row> |
|||
<div> |
|||
<div class="main" id="xmTestPlanCaseUserDist" |
|||
style="width:100%;height:600px;margin:0 auto;"></div> |
|||
<div class="progress"></div> |
|||
</div> |
|||
</el-row> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|||
import { mapGetters } from 'vuex' |
|||
|
|||
import { getXmTestPlanCaseUserDist } from '@/api/xm/core/xmTestPlanCase'; |
|||
|
|||
import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue';//修改界面 |
|||
import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//新增界面 |
|||
|
|||
export default { |
|||
|
|||
components: { |
|||
XmIterationSelect,XmProductSelect, |
|||
}, |
|||
props:['xmTestPlan','xmRptConfig','comp'], |
|||
computed: { |
|||
...mapGetters([ |
|||
'userInfo','roles' |
|||
]), |
|||
xmTestPlanCaseUserDistsCpd(){ |
|||
if(this.xmTestPlanCaseUserDists.length==0){ |
|||
return [] |
|||
}else{ |
|||
var itemId="testPlanTcode"; |
|||
return this.xmTestPlanCaseUserDists.map(i=>{ |
|||
var data={...i} |
|||
data.name=this.formatDict(itemId,data.name) |
|||
return data; |
|||
}) |
|||
} |
|||
}, |
|||
title(){ |
|||
return '成员执行结果数量分布' |
|||
}, |
|||
legendCpd(){ |
|||
var itemId="testPlanTcode"; |
|||
return this.dicts[itemId].map(i=>i.name) |
|||
} |
|||
|
|||
}, |
|||
watch: { |
|||
xmTestPlanCaseUserDistsCpd(){ |
|||
this.drawCharts(); |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
filters:{ |
|||
planId:'', |
|||
}, |
|||
|
|||
dicts:{},//下拉选择框的所有静态数据 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, |
|||
visible:false, |
|||
xmTestPlanCaseUserDists:[], |
|||
conditionBtnVisible:false, |
|||
|
|||
}//end return |
|||
},//end data |
|||
methods: { |
|||
formatDict(itemId,val){ |
|||
var dict=this.dicts[itemId] |
|||
if(dict){ |
|||
var item=dict.find(i=>i.id==val) |
|||
if(item){ |
|||
return item.name |
|||
} |
|||
} |
|||
return val; |
|||
}, |
|||
drawCharts() { |
|||
this.myChart = this.$echarts.init(document.getElementById("xmTestPlanCaseUserDist")); |
|||
this.myChart.setOption( |
|||
{ |
|||
title: { |
|||
text: this.title, |
|||
left: 'center' |
|||
}, |
|||
tooltip: { |
|||
trigger: 'item' |
|||
}, |
|||
legend: { |
|||
top:'5%', |
|||
left: 'center', |
|||
data:this.legendCpd, |
|||
}, |
|||
series: [ |
|||
{ |
|||
type: 'pie', |
|||
radius: '50%', |
|||
data: this.xmTestPlanCaseUserDistsCpd, |
|||
emphasis: { |
|||
itemStyle: { |
|||
shadowBlur: 10, |
|||
shadowOffsetX: 0, |
|||
shadowColor: 'rgba(0, 0, 0, 0.5)' |
|||
} |
|||
}, |
|||
|
|||
label: { |
|||
show: true, |
|||
position: 'center' |
|||
}, |
|||
} |
|||
] |
|||
} |
|||
) |
|||
}, |
|||
onXmQuestionSomeFieldsChange(fieldName,$event){ |
|||
this.xmTestPlanCaseUserDists=[] |
|||
}, |
|||
searchXmTestPlanCaseUserDist(){ |
|||
var params={...this.filters} |
|||
getXmTestPlanCaseUserDist(params).then(res=>{ |
|||
this.xmTestPlanCaseUserDists=res.data.data |
|||
}) |
|||
|
|||
}, |
|||
onProductSelected(product){ |
|||
this.filters.product=product |
|||
}, |
|||
|
|||
onProductClear(){ |
|||
this.filters.product=null |
|||
|
|||
}, |
|||
|
|||
onIterationSelected(iteration){ |
|||
this.filters.iteration=iteration |
|||
}, |
|||
|
|||
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',['testPlanTcode'] ).then(res=>{ |
|||
this.dicts=res.data.data; |
|||
}) |
|||
this.initData(); |
|||
this.searchXmTestPlanCaseUserDist(); |
|||
//this.charts(); |
|||
//this.drawCharts(); |
|||
|
|||
}//end mounted |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style scoped> |
|||
.image { |
|||
width: 100%; |
|||
display: block; |
|||
} |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue