Browse Source

优化

master
陈裕财 3 years ago
parent
commit
44ffb9af47
  1. 51
      src/views/xm/core/xmTestPlan/rpt/CompsCard.vue
  2. 318
      src/views/xm/core/xmTestPlan/rpt/biz/questionAttDist.vue
  3. 259
      src/views/xm/core/xmTestPlan/rpt/biz/questionDayAccumulate.vue
  4. 257
      src/views/xm/core/xmTestPlan/rpt/biz/questionDayTrend.vue
  5. 269
      src/views/xm/core/xmTestPlan/rpt/biz/questionSort.vue

51
src/views/xm/core/xmTestPlan/rpt/CompsCard.vue

@ -52,6 +52,10 @@ import { mapGetters } from 'vuex'
import XmTestPlanMng from '@/views/xm/core/xmTestPlan/XmTestPlanMng' import XmTestPlanMng from '@/views/xm/core/xmTestPlan/XmTestPlanMng'
import CompsSet from '@/views/xm/core/xmTestPlan/rpt/CompsSet' import CompsSet from '@/views/xm/core/xmTestPlan/rpt/CompsSet'
import XmQuestionAgeDist from '@/views/xm/core/xmTestPlan/rpt/biz/questionAgeDist' import XmQuestionAgeDist from '@/views/xm/core/xmTestPlan/rpt/biz/questionAgeDist'
import xmQuestionDayTrend from '@/views/xm/core/xmTestPlan/rpt/biz/questionDayTrend'
import xmQuestionDayAccumulate from '@/views/xm/core/xmTestPlan/rpt/biz/questionDayAccumulate'
import xmQuestionAttDist from '@/views/xm/core/xmTestPlan/rpt/biz/questionAttDist'
import xmQuestionSort from '@/views/xm/core/xmTestPlan/rpt/biz/questionSort'
import { initDicts,listXmRptConfig, delXmRptConfig, batchDelXmRptConfig,editSomeFieldsXmRptConfig } from '@/api/xm/core/xmRptConfig'; import { initDicts,listXmRptConfig, delXmRptConfig, batchDelXmRptConfig,editSomeFieldsXmRptConfig } from '@/api/xm/core/xmRptConfig';
@ -61,6 +65,10 @@ export default {
GridItem: VueGridLayout.GridItem, GridItem: VueGridLayout.GridItem,
XmTestPlanMng, XmTestPlanMng,
XmQuestionAgeDist, XmQuestionAgeDist,
xmQuestionDayTrend,
xmQuestionDayAccumulate,
xmQuestionAttDist,
xmQuestionSort,
CompsSet, CompsSet,
}, },
@ -87,48 +95,19 @@ export default {
maxTableHeight:300, maxTableHeight:300,
// //
layout: [ layout: [
{
// x: (this.layout.length * 6) % (this.layoutColNum || 12),
x: 0,
// y: this.layout.length + (this.layoutColNum || 12),
y: 12,
w: 12,
h: 4,
i: 0,
compId:'xm-test-plan-mng',
},
{
// x: (this.layout.length * 6) % (this.layoutColNum || 12),
x: 0,
// y: this.layout.length + (this.layoutColNum || 12),
y: 12,
w: 12,
h: 4,
i: 1,
compId:'xm-question-age-dist',
}
{ i: 0, x: 0, y: 12, w: 12, h: 4, compId:'XmQuestionAgeDist', },
{ i: 1, x: 0, y: 12, w: 12, h: 4, compId:'xmQuestionDayTrend', },
{ i: 2, x: 0, y: 12, w: 12, h: 4, compId:'xmQuestionDayAccumulate', },
{ i: 3, x: 0, y: 12, w: 12, h: 4, compId:'xmQuestionAttDist', },
{ i: 4, x: 0, y: 12, w: 12, h: 4, compId:'xmQuestionSort', },
], ],
// //
layoutColNum: 12, layoutColNum: 12,
} }
}, },
methods: {
addItem: function(element, index) {
this.layout.push(
{
...element,
// x: (this.layout.length * 6) % (this.layoutColNum || 12),
x: 0,
// y: this.layout.length + (this.layoutColNum || 12),
y: 12,
w: 12,
h: 4,
i: index,
compId:'xm-test-plan-mng',
}
)
},
methods: {
getXmRptConfig(){ getXmRptConfig(){
if(!this.bizId){ if(!this.bizId){
return; return;

318
src/views/xm/core/xmTestPlan/rpt/biz/questionAttDist.vue

@ -0,0 +1,318 @@
<template>
<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-form-item label="分组属性">
<el-select v-model="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-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-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-select>
</el-form-item>
<el-form-item label="缺陷类型" prop="bugType" >
<el-select v-model="filters.bugType" @change="onXmQuestionSomeFieldsChange('bugType',$event)" clearable>
<el-option v-for="i in this.dicts.bugType" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="缺陷原因" prop="bugReason">
<el-select v-model="filters.bugReason" @change="onXmQuestionSomeFieldsChange('bugReason',$event)" clearable>
<el-option v-for="i in this.dicts.bugReason" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="严重程度" prop="bugSeverity" >
<el-select v-model="filters.bugSeverity" @change="onXmQuestionSomeFieldsChange('bugSeverity',$event)" clearable>
<el-option v-for="i in this.dicts.bugSeverity" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="优先级" prop="priority" >
<el-select v-model="filters.priority" @change="onXmQuestionSomeFieldsChange('priority',$event)" clearable>
<el-option v-for="i in dicts.priority" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="解决方案" prop="solution" >
<el-select v-model="filters.solution" @change="onXmQuestionSomeFieldsChange('solution',$event)" clearable>
<el-option v-for="i in dicts.bugSolution" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="重现频率" prop="repRate" >
<el-select v-model="filters.repRate" @change="onXmQuestionSomeFieldsChange('repRate',$event)" clearable>
<el-option v-for="i in dicts.bugRepRate" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="searchXmQuestionAttDist">查询</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { mapGetters } from 'vuex'
import { getXmQuestionAttDist } from '@/api/xm/core/xmQuestion';
import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue';//
import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//
export default {
components: {
XmIterationSelect,XmProductSelect,
},
props:['xmProduct','xmIteration','xmProject'],
computed: {
...mapGetters([
'userInfo','roles'
]),
xmQuestionAttDistsCpd(){
if(this.xmQuestionAttDists.length==0){
return []
}else{
var itemId="";
if(this.groupBy=='bug_status'){
itemId="bugStatus"
}else if(this.groupBy=='bug_type'){
itemId="bugType"
}else if(this.groupBy=='bug_reason'){
itemId="bugReason"
}else if(this.groupBy=='bug_severity'){
itemId="bugSeverity"
}else if(this.groupBy=='priority'){
itemId="priority"
} else if(this.groupBy=='bug_solution'){
itemId="bugSolution"
} else if(this.groupBy=='rep_rate'){
itemId="bugRepRate"
}
return this.xmQuestionAttDists.map(i=>{
var data={...i}
data.name=this.formatDict(itemId,data.name)
return data;
})
}
},
title(){
return this.groupBys.find(i=>i.id==this.groupBy).name+'数量分布'
},
legendCpd(){
var itemId="";
if(this.groupBy=='bug_status'){
itemId="bugStatus"
}else if(this.groupBy=='bug_type'){
itemId="bugType"
}else if(this.groupBy=='bug_reason'){
itemId="bugReason"
}else if(this.groupBy=='bug_severity'){
itemId="bugSeverity"
}else if(this.groupBy=='priority'){
itemId="priority"
} else if(this.groupBy=='bug_solution'){
itemId="bugSolution"
} else if(this.groupBy=='rep_rate'){
itemId="bugRepRate"
}
return this.dicts[itemId].map(i=>i.name)
}
},
watch: {
xmQuestionAttDistsCpd(){
this.drawCharts();
}
},
data() {
return {
filters:{
product:null,
iteration:null,
},
groupBy:'bug_status',
groupBys:[
{id:'bug_status', name:'缺陷状态'},
{id:'bug_type', name:'缺陷类型'},
{id:'bug_reason', name:'缺陷原因'},
{id:'bug_severity', name:'紧急程度'},
{id:'priority', name:'优先级'},
{id:'bug_solution', name:'解决方案'},
{id:'rep_rate', name:'复现频率'},
],
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,
xmQuestionAttDists:[],
}//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;
},
findMax( list ) {
var i, max = list[0];
if(list.length < 2) return max;
for (i = 0; i < list.length; i++) {
if (list[i].distBudgetWorkload > max.distBudgetWorkload) {
max = list[i];
}
}
return max;
},
open(params){
this.visible=true;
this.filters.product=params.xmProduct
this.filters.project=params.xmProject
this.filters.Product=params.xmProduct
},
drawCharts() {
this.myChart = this.$echarts.init(document.getElementById("xmQuestionAttDist"));
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.xmQuestionAttDistsCpd,
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
},
label: {
show: true,
position: 'center'
},
}
]
}
)
},
onXmQuestionSomeFieldsChange(fieldName,$event){
this.xmQuestionAttDists=[]
},
searchXmQuestionAttDist(){
if(!this.groupBy){
this.$notify({position:'bottom-left',showClose:true,message:'请选中分组属性',type:'warning'})
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
}
getXmQuestionAttDist(params).then(res=>{
this.xmQuestionAttDists=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
}
},//end method
mounted() {
initSimpleDicts('all',['bugSeverity','bugSolution','bugStatus','bugType','priority','bugRepRate','bugReason'] ).then(res=>{
this.dicts=res.data.data;
})
//this.charts();
//this.drawCharts();
}//end mounted
}
</script>
<style scoped>
.image {
width: 100%;
display: block;
}
</style>

259
src/views/xm/core/xmTestPlan/rpt/biz/questionDayAccumulate.vue

@ -0,0 +1,259 @@
<template>
<section>
<el-row :gutter="5">
<el-col :span="18"> <div>
<div class="main" id="questionDayAccumulate"
style="width:100%;height:600px;margin:0 auto;"></div>
</div>
</el-col>
<el-col :span="6" class="border padding">
<el-form :model="filters">
<el-form-item label="归属产品">
<xm-product-select v-if="!xmProduct" ref="xmProductSelect" style="display:inline;" :auto-select="false" :link-project-id="xmProject?xmProject.id:null" @row-click="onProductSelected" @clear="onProductClear"></xm-product-select>
</el-form-item>
<el-form-item label="日期区间">
<br>
<mdp-date-range v-model="filters" value-format="yyyy-MM-dd" start-key="startBizDate" end-key="endBizDate"></mdp-date-range>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="listXmProductStateHis">查询</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { mapGetters } from 'vuex'
import { listXmProductStateHis } from '@/api/xm/core/xmProductStateHis';
import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//
export default {
components: {
XmProductSelect,
},
props:['xmProduct','xmProject'],
computed: {
...mapGetters([
'userInfo','roles'
]),
datesCpd(){
if(this.xmProductStateHiss.length==0){
return []
}else{
return this.xmProductStateHiss.map(i=>i.bizDate)
}
},
closedBugsCpd(){
if(this.xmProductStateHiss.length==0){
return []
}else{
return this.xmProductStateHiss.map(i=>i.closedBugs)
}
},
activeBugsCpd(){
if(this.xmProductStateHiss.length==0){
return []
}else{
return this.xmProductStateHiss.map(i=> i.menuUnstartCnt)
}
},
confirmedBugsCpd(){
if(this.xmProductStateHiss.length==0){
return []
}else{
return this.xmProductStateHiss.map(i=> i.confirmedBugs)
}
},
resolvedBugsCpd(){
if(this.xmProductStateHiss.length==0){
return []
}else{
return this.xmProductStateHiss.map(i=>i.resolvedBugs)
}
},
},
watch: {
datesCpd(){
this.$nextTick(()=>{
this.drawCharts();
})
}
},
data() {
return {
filters:{
category:'',
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'}]}
load:{ list: false, edit: false, del: false, add: false },//...
dateRanger:[],
maxTableHeight:300,
visible:false,
xmProductStateHiss:[],
}//end return
},//end data
methods: {
listXmProductStateHis(){
if(!this.filters.product){
this.$notify({position:'bottom-left',showClose:true,message:'请先选中产品',type:'warning'})
return;
}
var params={productId:this.filters.product.id,orderBy:'biz_date asc'}
if(this.filters.startBizDate && this.filters.endBizDate){
params.startBizDate=this.filters.startBizDate;
params.endBizDate=this.filters.endBizDate;
}
listXmProductStateHis(params).then(res=>{
this.xmProductStateHiss=res.data.tips.isOk?res.data.data:this.xmProductStateHiss;
})
},
open(params){
this.visible=true;
this.filters.product=params.xmProduct
this.filters.project=params.xmProject
this.filters.Product=params.xmProduct
this.xmProductStateHiss=[]
if(this.$refs['xmProductSelect'])this.$refs['xmProductSelect'].clearSelect();
this.$nextTick(()=>{
this.listXmProductStateHis();
})
},
drawCharts() {
this.myChart = this.$echarts.init(document.getElementById("questionDayAccumulate"));
this.myChart.setOption(
{
title: {
text: '缺陷累积图'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
legend: {
data: ['新提出', '执行中', '已解决', '已关闭']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: this.datesCpd,
},
yAxis: {
type: 'value'
},
series: [
{
name: '新提出',
type: 'line',
stack: 'Total',
areaStyle: {},
emphasis: {
focus: 'series'
},
data: this.activeBugsCpd
},
{
name: '执行中',
type: 'line',
stack: 'Total',
areaStyle: {},
emphasis: {
focus: 'series'
},
data: this.confirmedBugsCpd,
},
{
name: '已解决',
type: 'line',
stack: 'Total',
areaStyle: {},
emphasis: {
focus: 'series'
},
data: this.resolvedBugsCpd,
},
{
name: '已关闭',
type: 'line',
stack: 'Total',
areaStyle: {},
emphasis: {
focus: 'series'
},
label: {
show: true,
position: 'top'
},
data: this.closedBugsCpd,
}
]
}
)
},
onProductSelected(product){
this.filters.product=product
this.xmProductStateHiss=[];
this.listXmProductStateHis();
},
onProductClear(){
this.filters.product=null
this.xmProductStateHiss=[];
},
},//end method
mounted() {
/**
initSimpleDicts('all',['demandSource','demandLvl','demandType','priority','menuStatus'] ).then(res=>{
this.dicts=res.data.data;
})
*/
//this.charts();
//this.drawCharts()
}//end mounted
}
</script>
<style scoped>
.image {
width: 100%;
display: block;
}
</style>

257
src/views/xm/core/xmTestPlan/rpt/biz/questionDayTrend.vue

@ -0,0 +1,257 @@
<template>
<section>
<el-row :gutter="5">
<el-col :span="18">
<div>
<div class="main" id="questionDayTrend"
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="归属产品" v-if="!xmProduct" >
<xm-product-select ref="xmProductSelect" style="display:inline;" :auto-select="false" :link-project-id="xmProject?xmProject.id:null" @row-click="onProductSelected" @clear="onProductClear"></xm-product-select>
</el-form-item>
<el-form-item label="日期区间">
<br>
<mdp-date-range v-model="filters" value-format="yyyy-MM-dd" start-key="startBizDate" end-key="endBizDate"></mdp-date-range>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="listXmProductStateHis">查询</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { mapGetters } from 'vuex'
import { listXmProductStateHis } from '@/api/xm/core/xmProductStateHis';
import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//
export default {
components: {
XmProductSelect,
},
props:['xmProduct','xmProject'],
computed: {
...mapGetters([
'userInfo','roles'
]),
datesCpd(){
if(this.xmProductStateHiss.length==0){
return []
}else{
return this.xmProductStateHiss.map(i=>i.bizDate)
}
},
closedBugsCpd(){
if(this.xmProductStateHiss.length==0){
return []
}else{
return this.xmProductStateHiss.map(i=>i.closedBugs)
}
},
activeBugsCpd(){
if(this.xmProductStateHiss.length==0){
return []
}else{
return this.xmProductStateHiss.map(i=> i.activeBugs)
}
},
confirmedBugsCpd(){
if(this.xmProductStateHiss.length==0){
return []
}else{
return this.xmProductStateHiss.map(i=> i.confirmedBugs)
}
},
resolvedBugsCpd(){
if(this.xmProductStateHiss.length==0){
return []
}else{
return this.xmProductStateHiss.map(i=>i.resolvedBugs)
}
},
},
watch: {
datesCpd(){
this.$nextTick(()=>{
this.drawCharts();
})
}
},
data() {
return {
filters:{
category:'',
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'}]}
load:{ list: false, edit: false, del: false, add: false },//...
dateRanger:[],
maxTableHeight:300,
visible:false,
xmProductStateHiss:[],
}//end return
},//end data
methods: {
listXmProductStateHis(){
if(!this.filters.product){
this.$notify({position:'bottom-left',showClose:true,message:'请先选中产品',type:'warning'})
return;
}
var params={productId:this.filters.product.id,orderBy:'biz_date asc'}
if(this.filters.startBizDate && this.filters.endBizDate){
params.startBizDate=this.filters.startBizDate;
params.endBizDate=this.filters.endBizDate;
}
listXmProductStateHis(params).then(res=>{
this.xmProductStateHiss=res.data.tips.isOk?res.data.data:this.xmProductStateHiss;
})
},
open(params){
this.visible=true;
this.filters.product=params.xmProduct
this.filters.project=params.xmProject
this.filters.Product=params.xmProduct
if(this.$refs['xmProductSelect'])this.$refs['xmProductSelect'].clearSelect();
this.$nextTick(()=>{
this.listXmProductStateHis();
})
},
drawCharts() {
this.myChart = this.$echarts.init(document.getElementById("questionDayTrend"));
this.myChart.setOption(
{
legend: {
right: 40,
data: ['新提出','执行中','已解决','已关闭']
},
xAxis: {
type: 'category',
data: this.datesCpd
},
yAxis: {
type: 'value'
},
series: [
{
name:'新提出',
data: this.activeBugsCpd,
type: 'line',
smooth: true,
itemStyle: {
normal: {
//
color: 'orange',
lineStyle: {
// 线
color: 'orange'
}
}
},
},
{
name:'执行中',
data: this.confirmedBugsCpd,
type: 'line',
smooth: true,
itemStyle: {
normal: {
//
color: 'blue',
lineStyle: {
// 线
color: 'blue'
}
}
},
},
{
name:'已解决',
data: this.resolvedBugsCpd,
type: 'line',
smooth: true,
itemStyle: {
normal: {
//
color: 'green',
lineStyle: {
// 线
color: 'green'
}
}
},
},
{
name:'已关闭',
data: this.closedBugsCpd,
type: 'line',
smooth: true,
itemStyle: {
normal: {
//
color: 'red',
lineStyle: {
// 线
color: 'red'
}
}
},
}
]
}
)
},
onProductSelected(product){
this.filters.product=product
this.xmProductStateHiss=[];
this.listXmProductStateHis();
},
onProductClear(){
this.filters.product=null
this.xmProductStateHiss=[];
},
},//end method
mounted() {
/**
initSimpleDicts('all',['demandSource','demandLvl','demandType','priority','menuStatus'] ).then(res=>{
this.dicts=res.data.data;
})
*/
//this.charts();
//this.drawCharts();
}//end mounted
}
</script>
<style scoped>
.image {
width: 100%;
display: block;
}
</style>

269
src/views/xm/core/xmTestPlan/rpt/biz/questionSort.vue

@ -0,0 +1,269 @@
<template>
<section>
<el-row :gutter="5">
<el-col :span="18">
<div>
<div class="main" id="xmQuestionSort"
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="分组属性">
<el-select v-model="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-select>
</el-form-item>
<el-form-item label="归属产品" v-if="!xmProduct && !xmIteration">
<xm-product-select 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" :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-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-select>
</el-form-item>
<el-form-item label="缺陷类型" prop="bugType" >
<el-select v-model="filters.bugType" @change="onXmQuestionSomeFieldsChange('bugType',$event)" clearable>
<el-option v-for="i in this.dicts.bugType" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="缺陷原因" prop="bugReason">
<el-select v-model="filters.bugReason" @change="onXmQuestionSomeFieldsChange('bugReason',$event)" clearable>
<el-option v-for="i in this.dicts.bugReason" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="严重程度" prop="bugSeverity" >
<el-select v-model="filters.bugSeverity" @change="onXmQuestionSomeFieldsChange('bugSeverity',$event)" clearable>
<el-option v-for="i in this.dicts.bugSeverity" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="优先级" prop="priority" >
<el-select v-model="filters.priority" @change="onXmQuestionSomeFieldsChange('priority',$event)" clearable>
<el-option v-for="i in dicts.priority" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="解决方案" prop="solution" >
<el-select v-model="filters.solution" @change="onXmQuestionSomeFieldsChange('solution',$event)" clearable>
<el-option v-for="i in dicts.bugSolution" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="重现频率" prop="repRate" >
<el-select v-model="filters.repRate" @change="onXmQuestionSomeFieldsChange('repRate',$event)" clearable>
<el-option v-for="i in dicts.bugRepRate" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="searchXmQuestionSort">查询</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { mapGetters } from 'vuex'
import { getXmQuestionSort } from '@/api/xm/core/xmQuestion';
import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue';//
import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//
export default {
components: {
XmIterationSelect,XmProductSelect,
},
props:['xmProduct','xmIteration','xmProject'],
computed: {
...mapGetters([
'userInfo','roles'
]),
xmQuestionSortsCpd(){
if(this.xmQuestionSorts.length==0){
return []
}else{
return this.xmQuestionSorts.map(i=>i.value)
}
},
title(){
return this.groupBys.find(i=>i.id==this.groupBy).name+'排行榜'
},
legendCpd(){
if(this.xmQuestionSorts.length==0){
return []
}else{
return this.xmQuestionSorts.map(i=>i.name)
}
}
},
watch: {
xmQuestionSortsCpd(){
this.drawCharts();
}
},
data() {
return {
filters:{
product:null,
iteration:null,
},
groupBy:'handler_userid',
groupBys:[
{id:'create_userid', name:'创建人'},
{id:'ask_userid', name:'提出人'},
{id:'handler_userid', name:'负责人'},
{id:'menu_id', name:'故事'},
],
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,
xmQuestionSorts:[],
pageInfo: {
//
total: 0, //0>0
pageSize: 20, //
count: false, //
pageNum: 1, //1
orderFields: ["value"], // ['sex','student_id']
orderDirs: ["desc"], // asc,desc ['asc','desc']
},
}//end return
},//end data
methods: {
open(params){
this.visible=true;
this.filters.product=params.xmProduct
this.filters.project=params.xmProject
this.filters.Product=params.xmProduct
},
drawCharts() {
this.myChart = this.$echarts.init(document.getElementById("xmQuestionSort"));
this.myChart.setOption(
{
xAxis: {
type: 'category',
data: this.legendCpd
},
yAxis: {
type: 'value'
},
series: [
{
data: this.xmQuestionSortsCpd,
type: 'bar'
}
]
}
)
},
onXmQuestionSomeFieldsChange(fieldName,$event){
this.xmQuestionSorts=[]
},
searchXmQuestionSort(){
if(!this.groupBy){
this.$notify({position:'bottom-left',showClose:true,message:'请选中分组属性',type:'warning'})
return
}
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,
count: this.pageInfo.count,
};
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
}
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(",");
}
getXmQuestionSort(params).then(res=>{
this.xmQuestionSorts=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
}
},//end method
mounted() {
initSimpleDicts('all',['bugSeverity','bugSolution','bugStatus','bugType','priority','bugRepRate','bugReason'] ).then(res=>{
this.dicts=res.data.data;
})
//this.charts();
//this.drawCharts();
}//end mounted
}
</script>
<style scoped>
.image {
width: 100%;
display: block;
}
</style>
Loading…
Cancel
Save