|
|
@ -1,28 +1,16 @@ |
|
|
<template> |
|
|
<template> |
|
|
<section> |
|
|
<section> |
|
|
<el-row :gutter="5"> |
|
|
|
|
|
<el-col :span="18"> |
|
|
|
|
|
<div> |
|
|
|
|
|
<div class="main" id="xmQuestionAttDist" |
|
|
|
|
|
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-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 label="分组属性"> |
|
|
<el-form-item label="分组属性"> |
|
|
<el-select v-model="groupBy" @change="onXmQuestionSomeFieldsChange('groupBy',$event)" clearable> |
|
|
|
|
|
|
|
|
<el-select v-model="filters.groupBy" @change="onXmQuestionSomeFieldsChange('groupBy',$event)" clearable> |
|
|
<el-option v-for="i in this.groupBys" :label="i.name" :key="i.id" :value="i.id"></el-option> |
|
|
<el-option v-for="i in this.groupBys" :label="i.name" :key="i.id" :value="i.id"></el-option> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="归属产品" v-if="!xmProduct && !xmIteration"> |
|
|
|
|
|
<xm-product-select class="padding" v-if="!xmProduct && !xmIteration" ref="xmProductSelect" style="display:inline;" :auto-select="false" :link-project-id="xmProject?xmProject.id:null" @row-click="onProductSelected" :iterationId="xmIteration?xmIteration.id:null" @clear="onProductClear"></xm-product-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="归属迭代" v-if="!xmIteration || !xmIteration.id"> |
|
|
|
|
|
<xm-iteration-select ref="xmIterationSelect" class="padding" v-if="!xmIteration || !xmIteration.id" :auto-select="false" :product-id="filters.product?filters.product.id:null" :link-project-id="xmProject?xmProject.id:null" placeholder="迭代" @row-click="onIterationSelected" @clear="onIterationClear"></xm-iteration-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="缺陷状态" prop="bugStatus"> |
|
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="缺陷状态" prop="bugStatus"> |
|
|
<el-select v-model="filters.bugStatus" @change="onXmQuestionSomeFieldsChange('bugStatus',$event)" clearable> |
|
|
<el-select v-model="filters.bugStatus" @change="onXmQuestionSomeFieldsChange('bugStatus',$event)" clearable> |
|
|
<el-option v-for="i in this.dicts.bugStatus" :label="i.name" :key="i.id" :value="i.id"></el-option> |
|
|
<el-option v-for="i in this.dicts.bugStatus" :label="i.name" :key="i.id" :value="i.id"></el-option> |
|
|
</el-select> |
|
|
</el-select> |
|
|
@ -58,12 +46,20 @@ |
|
|
<el-option v-for="i in dicts.bugRepRate" :label="i.name" :key="i.id" :value="i.id"></el-option> |
|
|
<el-option v-for="i in dicts.bugRepRate" :label="i.name" :key="i.id" :value="i.id"></el-option> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item> |
|
|
<el-form-item> |
|
|
<el-button type="primary" icon="el-icon-search" @click="searchXmQuestionAttDist">查询</el-button> |
|
|
|
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="searchXmQuestionAttDist">查询</el-button> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
</el-form> |
|
|
|
|
|
</el-popover> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
<el-row> |
|
|
|
|
|
<div> |
|
|
|
|
|
<div class="main" id="xmQuestionAttDist" |
|
|
|
|
|
style="width:100%;height:600px;margin:0 auto;"></div> |
|
|
|
|
|
<div class="progress"></div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-row> |
|
|
</section> |
|
|
</section> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
@ -82,7 +78,7 @@ |
|
|
components: { |
|
|
components: { |
|
|
XmIterationSelect,XmProductSelect, |
|
|
XmIterationSelect,XmProductSelect, |
|
|
}, |
|
|
}, |
|
|
props:['xmProduct','xmIteration','xmProject'], |
|
|
|
|
|
|
|
|
props:['xmTestPlan','xmRptConfig','comp'], |
|
|
computed: { |
|
|
computed: { |
|
|
...mapGetters([ |
|
|
...mapGetters([ |
|
|
'userInfo','roles' |
|
|
'userInfo','roles' |
|
|
@ -92,19 +88,19 @@ |
|
|
return [] |
|
|
return [] |
|
|
}else{ |
|
|
}else{ |
|
|
var itemId=""; |
|
|
var itemId=""; |
|
|
if(this.groupBy=='bug_status'){ |
|
|
|
|
|
|
|
|
if(this.filters.groupBy=='bug_status'){ |
|
|
itemId="bugStatus" |
|
|
itemId="bugStatus" |
|
|
}else if(this.groupBy=='bug_type'){ |
|
|
|
|
|
|
|
|
}else if(this.filters.groupBy=='bug_type'){ |
|
|
itemId="bugType" |
|
|
itemId="bugType" |
|
|
}else if(this.groupBy=='bug_reason'){ |
|
|
|
|
|
|
|
|
}else if(this.filters.groupBy=='bug_reason'){ |
|
|
itemId="bugReason" |
|
|
itemId="bugReason" |
|
|
}else if(this.groupBy=='bug_severity'){ |
|
|
|
|
|
|
|
|
}else if(this.filters.groupBy=='bug_severity'){ |
|
|
itemId="bugSeverity" |
|
|
itemId="bugSeverity" |
|
|
}else if(this.groupBy=='priority'){ |
|
|
|
|
|
|
|
|
}else if(this.filters.groupBy=='priority'){ |
|
|
itemId="priority" |
|
|
itemId="priority" |
|
|
} else if(this.groupBy=='bug_solution'){ |
|
|
|
|
|
|
|
|
} else if(this.filters.groupBy=='bug_solution'){ |
|
|
itemId="bugSolution" |
|
|
itemId="bugSolution" |
|
|
} else if(this.groupBy=='rep_rate'){ |
|
|
|
|
|
|
|
|
} else if(this.filters.groupBy=='rep_rate'){ |
|
|
itemId="bugRepRate" |
|
|
itemId="bugRepRate" |
|
|
} |
|
|
} |
|
|
return this.xmQuestionAttDists.map(i=>{ |
|
|
return this.xmQuestionAttDists.map(i=>{ |
|
|
@ -115,23 +111,23 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
title(){ |
|
|
title(){ |
|
|
return this.groupBys.find(i=>i.id==this.groupBy).name+'数量分布' |
|
|
|
|
|
|
|
|
return this.groupBys.find(i=>i.id==this.filters.groupBy).name+'数量分布' |
|
|
}, |
|
|
}, |
|
|
legendCpd(){ |
|
|
legendCpd(){ |
|
|
var itemId=""; |
|
|
var itemId=""; |
|
|
if(this.groupBy=='bug_status'){ |
|
|
|
|
|
|
|
|
if(this.filters.groupBy=='bug_status'){ |
|
|
itemId="bugStatus" |
|
|
itemId="bugStatus" |
|
|
}else if(this.groupBy=='bug_type'){ |
|
|
|
|
|
|
|
|
}else if(this.filters.groupBy=='bug_type'){ |
|
|
itemId="bugType" |
|
|
itemId="bugType" |
|
|
}else if(this.groupBy=='bug_reason'){ |
|
|
|
|
|
|
|
|
}else if(this.filters.groupBy=='bug_reason'){ |
|
|
itemId="bugReason" |
|
|
itemId="bugReason" |
|
|
}else if(this.groupBy=='bug_severity'){ |
|
|
|
|
|
|
|
|
}else if(this.filters.groupBy=='bug_severity'){ |
|
|
itemId="bugSeverity" |
|
|
itemId="bugSeverity" |
|
|
}else if(this.groupBy=='priority'){ |
|
|
|
|
|
|
|
|
}else if(this.filters.groupBy=='priority'){ |
|
|
itemId="priority" |
|
|
itemId="priority" |
|
|
} else if(this.groupBy=='bug_solution'){ |
|
|
|
|
|
|
|
|
} else if(this.filters.groupBy=='bug_solution'){ |
|
|
itemId="bugSolution" |
|
|
itemId="bugSolution" |
|
|
} else if(this.groupBy=='rep_rate'){ |
|
|
|
|
|
|
|
|
} else if(this.filters.groupBy=='rep_rate'){ |
|
|
itemId="bugRepRate" |
|
|
itemId="bugRepRate" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -147,10 +143,18 @@ |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
filters:{ |
|
|
filters:{ |
|
|
product:null, |
|
|
|
|
|
iteration:null, |
|
|
|
|
|
}, |
|
|
|
|
|
groupBy:'bug_status', |
|
|
|
|
|
|
|
|
groupBy:'bug_status', |
|
|
|
|
|
planId:'', |
|
|
|
|
|
productId:'', |
|
|
|
|
|
projectId:'', |
|
|
|
|
|
bugStatus:'', |
|
|
|
|
|
bugType:'', |
|
|
|
|
|
bugReason:'', |
|
|
|
|
|
bugSeverity:'', |
|
|
|
|
|
priority:'', |
|
|
|
|
|
solution:'', |
|
|
|
|
|
repRate:'', |
|
|
|
|
|
}, |
|
|
groupBys:[ |
|
|
groupBys:[ |
|
|
{id:'bug_status', name:'缺陷状态'}, |
|
|
{id:'bug_status', name:'缺陷状态'}, |
|
|
{id:'bug_type', name:'缺陷类型'}, |
|
|
{id:'bug_type', name:'缺陷类型'}, |
|
|
@ -167,6 +171,7 @@ |
|
|
maxTableHeight:300, |
|
|
maxTableHeight:300, |
|
|
visible:false, |
|
|
visible:false, |
|
|
xmQuestionAttDists:[], |
|
|
xmQuestionAttDists:[], |
|
|
|
|
|
conditionBtnVisible:false, |
|
|
|
|
|
|
|
|
}//end return |
|
|
}//end return |
|
|
},//end data |
|
|
},//end data |
|
|
@ -242,40 +247,12 @@ |
|
|
this.xmQuestionAttDists=[] |
|
|
this.xmQuestionAttDists=[] |
|
|
}, |
|
|
}, |
|
|
searchXmQuestionAttDist(){ |
|
|
searchXmQuestionAttDist(){ |
|
|
if(!this.groupBy){ |
|
|
|
|
|
|
|
|
if(!this.filters.groupBy){ |
|
|
this.$notify({position:'bottom-left',showClose:true,message:'请选中分组属性',type:'warning'}) |
|
|
this.$notify({position:'bottom-left',showClose:true,message:'请选中分组属性',type:'warning'}) |
|
|
return |
|
|
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=>{ |
|
|
getXmQuestionAttDist(params).then(res=>{ |
|
|
this.xmQuestionAttDists=res.data.data |
|
|
this.xmQuestionAttDists=res.data.data |
|
|
}) |
|
|
}) |
|
|
@ -296,12 +273,29 @@ |
|
|
|
|
|
|
|
|
onIterationClear(){ |
|
|
onIterationClear(){ |
|
|
this.filters.iteration=null |
|
|
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 |
|
|
},//end method |
|
|
mounted() { |
|
|
mounted() { |
|
|
initSimpleDicts('all',['bugSeverity','bugSolution','bugStatus','bugType','priority','bugRepRate','bugReason'] ).then(res=>{ |
|
|
initSimpleDicts('all',['bugSeverity','bugSolution','bugStatus','bugType','priority','bugRepRate','bugReason'] ).then(res=>{ |
|
|
this.dicts=res.data.data; |
|
|
this.dicts=res.data.data; |
|
|
}) |
|
|
}) |
|
|
|
|
|
this.initData(); |
|
|
|
|
|
this.searchXmQuestionAttDist(); |
|
|
//this.charts(); |
|
|
//this.charts(); |
|
|
//this.drawCharts(); |
|
|
//this.drawCharts(); |
|
|
|
|
|
|
|
|
|