Browse Source

优化

master
陈裕财 3 years ago
parent
commit
b0e787e80e
  1. 63
      src/views/xm/core/xmTestPlan/rpt/CompsCard.vue
  2. 3
      src/views/xm/core/xmTestPlan/rpt/biz/questionAskUserSort.vue
  3. 3
      src/views/xm/core/xmTestPlan/rpt/biz/questionFuncSort.vue
  4. 3
      src/views/xm/core/xmTestPlan/rpt/biz/questionHandlerUserSort.vue
  5. 3
      src/views/xm/core/xmTestPlan/rpt/biz/questionMenuSort.vue
  6. 47
      src/views/xm/core/xmTestPlan/rpt/biz/questionSort.vue
  7. 14
      src/views/xm/core/xmTestPlan/rpt/biz/testPlanCaseUserDist.vue
  8. 3
      src/views/xm/core/xmTestPlan/rpt/index.vue

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

@ -6,12 +6,12 @@
</el-col> </el-col>
<el-col :span="18" :style="{height:maxTableHeight+'px',overflow:'auto'}" ref="table"> <el-col :span="18" :style="{height:maxTableHeight+'px',overflow:'auto'}" ref="table">
<div> <div>
<div class="empty" v-if="layout.length == 0" >
<div class="empty" v-if="compCfgList.length == 0" >
<el-empty description="暂未选择模块"></el-empty> <el-empty description="暂未选择模块"></el-empty>
</div> </div>
<div v-else style="width: 100%; min-height: 800px; margin-top: 10px"> <div v-else style="width: 100%; min-height: 800px; margin-top: 10px">
<grid-layout <grid-layout
:layout.sync="layout"
:layout.sync="compCfgList"
:col-num="layoutColNum" :col-num="layoutColNum"
:row-height="120" :row-height="120"
:is-draggable="true" :is-draggable="true"
@ -22,14 +22,14 @@
:use-css-transforms="true" :use-css-transforms="true"
> >
<grid-item <grid-item
v-for="(item) in layout"
v-for="(item) in compCfgList"
:x="item.x" :x="item.x"
:y="item.y" :y="item.y"
:w="item.w" :w="item.w"
:h="item.h" :h="item.h"
:i="item.i" :i="item.i"
:key="item.i"> :key="item.i">
<component :is="item.compId"></component>
<component :is="item.compId" :xm-test-plan="xmTestPlan" :comp-cfg="item"></component>
</grid-item> </grid-item>
</grid-layout> </grid-layout>
</div> </div>
@ -37,8 +37,8 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="rptConfigVisible==false" :style="{height:maxTableHeight+'px',overflow:'auto'}" ref="table" class="page-center border"> <el-row v-if="rptConfigVisible==false" :style="{height:maxTableHeight+'px',overflow:'auto'}" ref="table" class="page-center border">
<el-row v-for="(item,index) in layout" :key="index">
<component :is="item.compId"></component>
<el-row v-for="(item,index) in initCompCfg" :key="index">
<component :is="item.compId" :xm-test-plan="xmTestPlan" :comp-cfg="item"></component>
</el-row> </el-row>
</el-row> </el-row>
</section> </section>
@ -52,10 +52,11 @@ 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 xmQuestionAttDist from '@/views/xm/core/xmTestPlan/rpt/biz/questionAttDist'
import xmQuestionSort from '@/views/xm/core/xmTestPlan/rpt/biz/questionSort'
import xmQuestionHandlerUserSort from '@/views/xm/core/xmTestPlan/rpt/biz/questionHandlerUserSort'
import xmQuestionAskUserSort from '@/views/xm/core/xmTestPlan/rpt/biz/questionAskUserSort'
import xmQuestionMenuSort from '@/views/xm/core/xmTestPlan/rpt/biz/questionMenuSort'
import xmQuestionFuncSort from '@/views/xm/core/xmTestPlan/rpt/biz/questionFuncSort'
import xmTestPlanCaseExecStatusDist from '@/views/xm/core/xmTestPlan/rpt/biz/testPlanCaseExecStatusDist' import xmTestPlanCaseExecStatusDist from '@/views/xm/core/xmTestPlan/rpt/biz/testPlanCaseExecStatusDist'
import xmTestPlanCaseUserDist from '@/views/xm/core/xmTestPlan/rpt/biz/testPlanCaseUserDist' import xmTestPlanCaseUserDist from '@/views/xm/core/xmTestPlan/rpt/biz/testPlanCaseUserDist'
@ -69,40 +70,50 @@ export default {
XmTestPlanMng, XmTestPlanMng,
XmQuestionAgeDist, XmQuestionAgeDist,
xmQuestionAttDist, xmQuestionAttDist,
xmQuestionSort,
xmQuestionHandlerUserSort,xmQuestionAskUserSort,xmQuestionMenuSort,xmQuestionFuncSort,
xmTestPlanCaseExecStatusDist, xmTestPlanCaseExecStatusDist,
xmTestPlanCaseUserDist, xmTestPlanCaseUserDist,
CompsSet, CompsSet,
}, },
props:['bizId','rptConfigVisible'],
props:['xmTestPlan','rptConfigVisible'],
computed: { computed: {
...mapGetters(['userInfo']), ...mapGetters(['userInfo']),
compIds(){ compIds(){
if(this.xmRptConfig && this.xmRptConfig.cfg){ if(this.xmRptConfig && this.xmRptConfig.cfg){
var cfgJson=JSON.parse(this.xmRptConfig.cfg) var cfgJson=JSON.parse(this.xmRptConfig.cfg)
return cfgJson.map(k=>k.id)
return cfgJson.map(k=>k.compId)
}else{ }else{
return [] return []
} }
}
},
}, },
watch: { watch: {
xmRptConfig:{
handler(){
this.initCompCfgList();
},
deep:true,
}
}, },
data() { data() {
return { return {
xmRptConfig:null, xmRptConfig:null,
compCfgList:[],
maxTableHeight:300, maxTableHeight:300,
// //
layout: [
{ i: 0, x: 0, y: 12, w: 12, h: 4, compId:'XmQuestionAgeDist', },
{ i: 3, x: 0, y: 12, w: 12, h: 4, compId:'xmQuestionAttDist', },
{ i: 4, x: 0, y: 12, w: 12, h: 4, compId:'xmQuestionSort', },
{ i: 4, x: 0, y: 12, w: 12, h: 4, compId:'xmTestPlanCaseExecStatusDist', },
{ i: 4, x: 0, y: 12, w: 12, h: 4, compId:'xmTestPlanCaseUserDist', },
initCompCfg: [
{ id:'xmQuestionAgeDist',name:'缺陷年龄分布',compId:'xmQuestionAgeDist', params:[] },
{ id:'xmQuestionAttDist',name:'缺陷属性分布',compId:'xmQuestionAttDist', },
{ id:'xmQuestionHandlerUserSort',name:'缺陷负责人排行榜',compId:'xmQuestionHandlerUserSort', },
{ id:'xmQuestionAskUserSort',name:'缺陷提出人排行榜', compId:'xmQuestionAskUserSort', },
{ id:'xmQuestionMenuSort',name:'缺陷需求分布', compId:'xmQuestionMenuSort', },
{ id:'xmQuestionFuncSort',name:'缺陷模块分布', compId:'xmQuestionFuncSort', },
{ id:'xmTestPlanCaseExecStatusDist',name:'用例执行结果分布', compId:'xmTestPlanCaseExecStatusDist', },
{ id:'xmTestPlanCaseUserDist',name:'用例执行人情况分布', compId:'xmTestPlanCaseUserDist', },
], ],
@ -113,12 +124,20 @@ export default {
methods: { methods: {
getXmRptConfig(){ getXmRptConfig(){
if(!this.bizId){
if(!this.xmTestPlan){
return; return;
} }
listXmRptConfig({bizId:this.bizId}).then(res=>{
listXmRptConfig({bizId:this.xmTestPlan.id}).then(res=>{
this.xmRptConfig=res.data.data[0] this.xmRptConfig=res.data.data[0]
}) })
},
initCompCfgList(){
if(this.xmRptConfig && this.xmRptConfig.cfg){
var cfgJson=JSON.parse(this.xmRptConfig.cfg)
this.compCfgList=cfgJson;
}else{
this.compCfgList=JSON.parse(JSON.stringify(this.initCompCfg))
}
} }
}, },

3
src/views/xm/core/xmTestPlan/rpt/biz/questionAskUserSort.vue

@ -1,7 +1,7 @@
<template> <template>
<section> <section>
<el-row> <el-row>
<question-sort ref="questionSort" :rpt-config-visible="rptConfigVisible" :group-by="'ask_userid'"/>
<question-sort ref="questionSort" :xm-test-plan="xmTestPlan" :comp-cfg="compCfg" :rpt-config-visible="rptConfigVisible" :group-by="'ask_userid'"/>
</el-row> </el-row>
</section> </section>
</template> </template>
@ -13,6 +13,7 @@ import { mapGetters } from 'vuex'
import dayjs from 'dayjs' import dayjs from 'dayjs'
export default { export default {
props:['xmTestPlan','compCfg'],
components: {questionSort}, components: {questionSort},
computed: { computed: {
...mapGetters([ ...mapGetters([

3
src/views/xm/core/xmTestPlan/rpt/biz/questionFuncSort.vue

@ -1,7 +1,7 @@
<template> <template>
<section> <section>
<el-row> <el-row>
<question-sort ref="questionSort" :rpt-config-visible="rptConfigVisible" :group-by="'func_id'"/>
<question-sort ref="questionSort" :xm-test-plan="xmTestPlan" :comp-cfg="compCfg" :rpt-config-visible="rptConfigVisible" :group-by="'func_id'"/>
</el-row> </el-row>
</section> </section>
</template> </template>
@ -13,6 +13,7 @@ import { mapGetters } from 'vuex'
import dayjs from 'dayjs' import dayjs from 'dayjs'
export default { export default {
props:['xmTestPlan','compCfg'],
components: {questionSort}, components: {questionSort},
computed: { computed: {
...mapGetters([ ...mapGetters([

3
src/views/xm/core/xmTestPlan/rpt/biz/questionHandlerUserSort.vue

@ -1,7 +1,7 @@
<template> <template>
<section> <section>
<el-row> <el-row>
<question-sort ref="questionSort" :rpt-config-visible="rptConfigVisible" :group-by="'handler_userid'"/>
<question-sort ref="questionSort" :xm-test-plan="xmTestPlan" :comp-cfg="compCfg" :rpt-config-visible="rptConfigVisible" :group-by="'handler_userid'"/>
</el-row> </el-row>
</section> </section>
</template> </template>
@ -13,6 +13,7 @@ import { mapGetters } from 'vuex'
import dayjs from 'dayjs' import dayjs from 'dayjs'
export default { export default {
props:['xmTestPlan','compCfg'],
components: {questionSort}, components: {questionSort},
computed: { computed: {
...mapGetters([ ...mapGetters([

3
src/views/xm/core/xmTestPlan/rpt/biz/questionMenuSort.vue

@ -1,7 +1,7 @@
<template> <template>
<section> <section>
<el-row> <el-row>
<question-sort ref="questionSort" :rpt-config-visible="rptConfigVisible" :group-by="'menu_id'"/>
<question-sort ref="questionSort" :xm-test-plan="xmTestPlan" :comp-cfg="compCfg" :rpt-config-visible="rptConfigVisible" :group-by="'menu_id'"/>
</el-row> </el-row>
</section> </section>
</template> </template>
@ -13,6 +13,7 @@ import { mapGetters } from 'vuex'
import dayjs from 'dayjs' import dayjs from 'dayjs'
export default { export default {
props:['xmTestPlan','compCfg'],
components: {questionSort}, components: {questionSort},
computed: { computed: {
...mapGetters([ ...mapGetters([

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

@ -60,7 +60,7 @@
</el-row> </el-row>
<el-row > <el-row >
<div> <div>
<div class="main" id="xmQuestionSort"
<div class="main" :id="id"
style="width:100%;height:600px;margin:0 auto;"></div> style="width:100%;height:600px;margin:0 auto;"></div>
<div class="progress"></div> <div class="progress"></div>
</div> </div>
@ -83,7 +83,7 @@
components: { components: {
XmIterationSelect,XmProductSelect, XmIterationSelect,XmProductSelect,
}, },
props:['xmTestPlan','xmRptConfig','comp','groupBy'],
props:['xmTestPlan','compCfg','groupBy'],
computed: { computed: {
...mapGetters([ ...mapGetters([
'userInfo','roles' 'userInfo','roles'
@ -96,7 +96,7 @@
} }
}, },
title(){ title(){
return this.groupBys.find(i=>i.id==this.filters.groupBy).name+'排行榜'
return compCfg.name
}, },
legendCpd(){ legendCpd(){
if(this.xmQuestionSorts.length==0){ if(this.xmQuestionSorts.length==0){
@ -104,7 +104,11 @@
}else{ }else{
return this.xmQuestionSorts.map(i=>i.name) return this.xmQuestionSorts.map(i=>i.name)
} }
}
},
id(){
return compCfg.id
},
}, },
watch: { watch: {
@ -151,7 +155,7 @@
}, },
drawCharts() { drawCharts() {
this.myChart = this.$echarts.init(document.getElementById("xmQuestionSort"));
this.myChart = this.$echarts.init(document.getElementById(this.id));
this.myChart.setOption( this.myChart.setOption(
{ {
xAxis: { xAxis: {
@ -184,35 +188,7 @@
total: this.pageInfo.total, total: this.pageInfo.total,
count: this.pageInfo.count, 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.filters.groupBy
if(this.filters.product){
params.productId=this.filters.product.id
}
if(this.filters.iteration){
params.iterationId=this.filters.iteration.id
}
Object.assign(params,this.filters)
if ( if (
@ -257,8 +233,7 @@
this.filters.projectId=this.xmTestPlan.projectId this.filters.projectId=this.xmTestPlan.projectId
this.filters.planId=this.xmTestPlan.id 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(this.compCfg && compCfg.id){
if(compCfg && compCfg.params){ if(compCfg && compCfg.params){
compCfg.params.forEach(k=>{ compCfg.params.forEach(k=>{
this.filters[k.id]=k.value this.filters[k.id]=k.value

14
src/views/xm/core/xmTestPlan/rpt/biz/testPlanCaseUserDist.vue

@ -44,21 +44,15 @@
xmTestPlanCaseUserDistsCpd(){ xmTestPlanCaseUserDistsCpd(){
if(this.xmTestPlanCaseUserDists.length==0){ if(this.xmTestPlanCaseUserDists.length==0){
return [] return []
}else{
var itemId="testPlanTcode";
return this.xmTestPlanCaseUserDists.map(i=>{
var data={...i}
data.name=this.formatDict(itemId,data.name)
return data;
})
}else{
return this.xmTestPlanCaseUserDists
} }
}, },
title(){ title(){
return '成员执行结果数量分布' return '成员执行结果数量分布'
}, },
legendCpd(){
var itemId="testPlanTcode";
return this.dicts[itemId].map(i=>i.name)
legendCpd(){
return ['已执行','未执行']
} }
}, },

3
src/views/xm/core/xmTestPlan/rpt/index.vue

@ -4,7 +4,7 @@
<span style="float:right;"> <el-button @click="rptConfigVisible=false">取消配置</el-button><el-button @click="rptConfigVisible=true" type="primary">保存配置</el-button></span> <span style="float:right;"> <el-button @click="rptConfigVisible=false">取消配置</el-button><el-button @click="rptConfigVisible=true" type="primary">保存配置</el-button></span>
</el-row> </el-row>
<el-row> <el-row>
<comps-card ref="compsCard" :rpt-config-visible="rptConfigVisible"/>
<comps-card ref="compsCard" :xm-test-plan="xmTestPlan" :rpt-config-visible="rptConfigVisible"/>
</el-row> </el-row>
</section> </section>
</template> </template>
@ -18,6 +18,7 @@ import { mapGetters } from 'vuex'
import dayjs from 'dayjs' import dayjs from 'dayjs'
export default { export default {
props:['xmTestPlan'],
components: {compsSet, compsCard}, components: {compsSet, compsCard},
computed: { computed: {
...mapGetters([ ...mapGetters([

Loading…
Cancel
Save