4 changed files with 694 additions and 14 deletions
-
218src/views/xm/core/xmTestPlan/XmTestPlanSelect.vue
-
48src/views/xm/rpt/reportIndex.vue
-
254src/views/xm/rpt/testPlan/testPlanCaseExecStatusDist.vue
-
188src/views/xm/rpt/testPlan/testPlanCaseUserDist.vue
@ -0,0 +1,218 @@ |
|||||
|
<template> |
||||
|
|
||||
|
<section class="page-container border padding" ref="xmTestPlanTable"> |
||||
|
<el-dialog append-to-body modal-append-to-body width="60%" top="20px" :visible.sync="visible"> |
||||
|
<el-row> |
||||
|
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询" clearable></el-input> |
||||
|
<el-button v-loading="load.list" :disabled="load.list==true" @click="searchXmTestPlans" icon="el-icon-search">查询</el-button> |
||||
|
|
||||
|
</el-row> |
||||
|
<el-row class="padding-top"> |
||||
|
<!--列表 XmTestPlan 测试计划--> |
||||
|
<el-table :data="xmTestPlans" :height="maxTableHeight" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
||||
|
<el-table-column type="selection" width="55" show-overflow-tooltip fixed="left"></el-table-column> |
||||
|
<!-- |
||||
|
<el-table-column sortable prop="username" width="55" show-overflow-tooltip fixed="left"> |
||||
|
<span class="cell-text"> {{scope.row.username}}} </span> |
||||
|
<span class="cell-bar"><el-input style="display:inline;" v-model="scope.row.username" placeholder="" @change="editSomeFields(scope.row,'username',$event)" :maxlength="22"></el-input></span> |
||||
|
</el-table-column> |
||||
|
--> |
||||
|
<el-table-column prop="name" label="计划名称" min-width="250" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.name}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="status" label="状态" width="120" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<mdp-select-dict-tag :dict="dicts['testPlanStatus']" v-model="scope.row.status" effect="dark" @change="editSomeFields(scope.row,'status',$event)"></mdp-select-dict-tag> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="stime" label="开始时间" width="120" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.stime}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="etime" label="结束时间" width="120" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span> {{scope.row.etime}} </span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="操作" width="120" fixed="right"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button type="primary" @click="select(scope.row)">选择</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination> |
||||
|
</el-row> |
||||
|
</el-dialog> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import config from '@/common/config';//全局公共库 |
||||
|
import { initDicts,listXmTestPlan } from '@/api/xm/core/xmTestPlan'; |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
export default { |
||||
|
name:'xmTestPlanSelect', |
||||
|
components: { |
||||
|
}, |
||||
|
props:['xmTestCasedb'], |
||||
|
computed: { |
||||
|
...mapGetters(['userInfo']), |
||||
|
|
||||
|
}, |
||||
|
watch:{ |
||||
|
visible(val){ |
||||
|
if(val==true){ |
||||
|
this.initData(); |
||||
|
this.searchXmTestPlans() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
visible:false, |
||||
|
filters: { |
||||
|
key: '' |
||||
|
}, |
||||
|
xmTestPlans: [],//查询结果 |
||||
|
pageInfo:{//分页数据 |
||||
|
total:0,//服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算。 |
||||
|
pageSize:10,//每页数据 |
||||
|
count:true,//是否需要重新计算总记录数 |
||||
|
pageNum:1,//当前页码、从1开始计算 |
||||
|
orderFields:[],//排序列 如 ['sex','student_id'],必须为数据库字段 |
||||
|
orderDirs:[]//升序 asc,降序desc 如 性别 升序、学生编号降序 ['asc','desc'] |
||||
|
}, |
||||
|
load:{ list: false, edit: false, del: false, add: false },//查询中... |
||||
|
sels: [],//列表选中数据 |
||||
|
dicts:{ |
||||
|
testPlanStatus:[],testPlanTcode:[],testStepTcode:[],priority:[],bizFlowState:[] |
||||
|
//sex: [{id:'1',name:'男'},{id:'2',name:'女'}] |
||||
|
},//下拉选择框的所有静态数据 params={categoryId:'all',itemCodes:['sex']} 返回结果 {sex: [{id:'1',name:'男'},{id:'2',name:'女'}]} |
||||
|
addFormVisible: false,//新增xmTestPlan界面是否显示 |
||||
|
addForm: { |
||||
|
id:'',name:'',casedbId:'',casedbName:'',projectId:'',projectName:'',cuserid:'',cusername:'',ctime:'',stime:'',etime:'',status:'',tcode:'',totalCases:'',okCases:'',errCases:'',igCases:'',blCases:'',productId:'',productName:'',flowState:'' |
||||
|
}, |
||||
|
|
||||
|
editFormVisible: false,//编辑界面是否显示 |
||||
|
editForm: { |
||||
|
id:'',name:'',casedbId:'',casedbName:'',projectId:'',projectName:'',cuserid:'',cusername:'',ctime:'',stime:'',etime:'',status:'',tcode:'',totalCases:'',okCases:'',errCases:'',igCases:'',blCases:'',productId:'',productName:'',flowState:'' |
||||
|
}, |
||||
|
maxTableHeight:300, |
||||
|
} |
||||
|
},//end data |
||||
|
methods: { |
||||
|
|
||||
|
...util, |
||||
|
|
||||
|
handleSizeChange(pageSize) { |
||||
|
this.pageInfo.pageSize=pageSize; |
||||
|
this.getXmTestPlans(); |
||||
|
}, |
||||
|
handleCurrentChange(pageNum) { |
||||
|
this.pageInfo.pageNum = pageNum; |
||||
|
this.getXmTestPlans(); |
||||
|
}, |
||||
|
// 表格排序 obj.order=ascending/descending,需转化为 asc/desc ; obj.prop=表格中的排序字段,字段驼峰命名 |
||||
|
sortChange( obj ){ |
||||
|
if(obj.order==null){ |
||||
|
this.pageInfo.orderFields=[]; |
||||
|
this.pageInfo.orderDirs=[]; |
||||
|
}else{ |
||||
|
var dir='asc'; |
||||
|
if(obj.order=='ascending'){ |
||||
|
dir='asc' |
||||
|
}else{ |
||||
|
dir='desc'; |
||||
|
} |
||||
|
|
||||
|
this.pageInfo.orderFields=[util.toLine(obj.prop)]; |
||||
|
this.pageInfo.orderDirs=[dir]; |
||||
|
} |
||||
|
this.getXmTestPlans(); |
||||
|
}, |
||||
|
searchXmTestPlans(){ |
||||
|
this.pageInfo.count=true; |
||||
|
this.getXmTestPlans(); |
||||
|
}, |
||||
|
//获取列表 XmTestPlan 测试计划 |
||||
|
getXmTestPlans() { |
||||
|
let params = { |
||||
|
pageSize: this.pageInfo.pageSize, |
||||
|
pageNum: this.pageInfo.pageNum, |
||||
|
total: this.pageInfo.total, |
||||
|
count:this.pageInfo.count |
||||
|
}; |
||||
|
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){ |
||||
|
let orderBys=[]; |
||||
|
for(var i=0;i<this.pageInfo.orderFields.length;i++){ |
||||
|
orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i]) |
||||
|
} |
||||
|
params.orderBy= orderBys.join(",") |
||||
|
} |
||||
|
if(this.filters.key){ |
||||
|
params.key=this.filters.key |
||||
|
} |
||||
|
|
||||
|
if(this.xmTestCasedb && this.xmTestCasedb.id){ |
||||
|
params.casedbId=this.xmTestCasedb.id |
||||
|
} |
||||
|
|
||||
|
this.load.list = true; |
||||
|
listXmTestPlan(params).then((res) => { |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.pageInfo.total = res.data.total; |
||||
|
this.pageInfo.count=false; |
||||
|
this.xmTestPlans = res.data.data; |
||||
|
}else{ |
||||
|
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: 'error' }); |
||||
|
} |
||||
|
this.load.list = false; |
||||
|
}).catch( err => this.load.list = false ); |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
//选择行xmTestPlan |
||||
|
selsChange: function (sels) { |
||||
|
this.sels = sels; |
||||
|
}, |
||||
|
|
||||
|
rowClick: function(row, event, column){ |
||||
|
this.editForm=row |
||||
|
this.editFormBak={...row}; |
||||
|
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
||||
|
}, |
||||
|
initData: function(){ |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
open(){ |
||||
|
this.visible=true |
||||
|
}, |
||||
|
select(row){ |
||||
|
this.$emit("select",row) |
||||
|
this.visible=false |
||||
|
} |
||||
|
|
||||
|
},//end methods |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
initDicts(this); |
||||
|
this.initData() |
||||
|
//this.searchXmTestPlans(); |
||||
|
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.xmTestPlanTable.$el) |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
</style> |
||||
@ -0,0 +1,254 @@ |
|||||
|
<template> |
||||
|
<section> |
||||
|
|
||||
|
<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="testPlanCaseExecStatusDist" |
||||
|
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 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="searchXmTestPlanCaseExecStatusDist">查询</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> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
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, |
||||
|
}, |
||||
|
props:['xmProject','xmProduct','xmTestCasedb','xmTestPlan'], |
||||
|
computed: { |
||||
|
...mapGetters([ |
||||
|
'userInfo','roles' |
||||
|
]), |
||||
|
xmTestPlanCaseExecStatusDistsCpd(){ |
||||
|
if(this.xmTestPlanCaseExecStatusDists.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
var datas=[] |
||||
|
this.xmTestPlanCaseExecStatusDists.forEach(i=>{ |
||||
|
var data={} |
||||
|
var itemId="testStepTcode"; |
||||
|
data.name=this.formatDict(itemId,i.execStatus) |
||||
|
data.value=i.totalCnt |
||||
|
datas.push(data) |
||||
|
}) |
||||
|
return datas; |
||||
|
} |
||||
|
}, |
||||
|
title(){ |
||||
|
return '测试用例执行结果数量分布' |
||||
|
}, |
||||
|
/**0-未测,1-通过,2-受阻,3-忽略,4-失败 */ |
||||
|
legendCpd(){ |
||||
|
var itemId="testStepTcode"; |
||||
|
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: { |
||||
|
xmTestPlanCaseExecStatusDistsCpd(){ |
||||
|
this.drawCharts(); |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
filters:{ |
||||
|
testPlan:null, |
||||
|
product:null, |
||||
|
project:null, |
||||
|
}, |
||||
|
|
||||
|
dicts:{testStepTcode:[]},//下拉选择框的所有静态数据 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, |
||||
|
xmTestPlanCaseExecStatusDists:[], |
||||
|
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("testPlanCaseExecStatusDist")); |
||||
|
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.xmTestPlanCaseExecStatusDistsCpd, |
||||
|
emphasis: { |
||||
|
itemStyle: { |
||||
|
shadowBlur: 10, |
||||
|
shadowOffsetX: 0, |
||||
|
shadowColor: 'rgba(0, 0, 0, 0.5)' |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
label: { |
||||
|
show: true, |
||||
|
position: 'center' |
||||
|
}, |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
) |
||||
|
}, |
||||
|
onXmQuestionSomeFieldsChange(fieldName,$event){ |
||||
|
this.xmTestPlanCaseExecStatusDists=[] |
||||
|
}, |
||||
|
searchXmTestPlanCaseExecStatusDist(){ |
||||
|
|
||||
|
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 |
||||
|
} |
||||
|
getXmTestPlanCaseExecStatusDist(params).then(res=>{ |
||||
|
this.xmTestPlanCaseExecStatusDists=res.data.data |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
onProductSelected(product){ |
||||
|
this.filters.product=product |
||||
|
}, |
||||
|
|
||||
|
onProductClear(){ |
||||
|
this.filters.product=null |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
onXmTestPlanSelected(xmTestPlan){ |
||||
|
this.filters.testPlan=xmTestPlan |
||||
|
}, |
||||
|
|
||||
|
onXmTestPlanClear(){ |
||||
|
this.filters.testPlan=null |
||||
|
}, |
||||
|
initData(){ |
||||
|
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.searchXmTestPlanCaseExecStatusDist(); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
|
},//end method |
||||
|
mounted() { |
||||
|
initSimpleDicts('all',['testStepTcode'] ).then(res=>{ |
||||
|
this.dicts=res.data.data; |
||||
|
}) |
||||
|
this.initData(); |
||||
|
|
||||
|
}//end mounted |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.image { |
||||
|
width: 100%; |
||||
|
display: block; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,188 @@ |
|||||
|
<template> |
||||
|
<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-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> |
||||
|
</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:['xmTestCasedb','xmTestPlan'], |
||||
|
computed: { |
||||
|
...mapGetters([ |
||||
|
'userInfo','roles' |
||||
|
]), |
||||
|
xmTestPlanCaseUserDistsCpd(){ |
||||
|
if(this.xmTestPlanCaseUserDists.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return this.xmTestPlanCaseUserDists |
||||
|
} |
||||
|
}, |
||||
|
title(){ |
||||
|
return '成员执行结果数量分布' |
||||
|
}, |
||||
|
legendCpd(){ |
||||
|
return ['已执行','未执行'] |
||||
|
}, |
||||
|
id(){ |
||||
|
return 'testPlanCaseUserDist-001' |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
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(this.id)); |
||||
|
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 |
||||
|
} |
||||
|
}, |
||||
|
sizeAutoChange(){ |
||||
|
this.myChart.resize(); |
||||
|
} |
||||
|
},//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