Browse Source

优化

master
陈裕财 4 years ago
parent
commit
43fdfeab88
  1. 260
      src/views/xm/rpt/product/questionDayAccumulate.vue
  2. 258
      src/views/xm/rpt/product/questionDayTrend.vue
  3. 12
      src/views/xm/rpt/reportIndex.vue

260
src/views/xm/rpt/product/questionDayAccumulate.vue

@ -0,0 +1,260 @@
<template>
<section>
<el-dialog :title="filters.product?'产品【'+filters.product.productName+'】':''+'缺陷累积图'" 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="questionDayAccumulate"
style="width:100%;height:600px;margin:0 auto;"></div>
</div>
</el-col>
<el-col :span="6" class="border">
<el-form :label-position="'top'" label-width="120px" :model="filters">
<el-form-item>
<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="日期区间">
<date-range v-model="filters" value-format="yyyy-MM-dd" start-key="startBizDate" end-key="endBizDate"></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>
</el-dialog>
</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>

258
src/views/xm/rpt/product/questionDayTrend.vue

@ -0,0 +1,258 @@
<template>
<section>
<el-dialog :title="(filters.product?'产品【'+filters.product.productName+'】':'')+'缺陷每日趋势'" 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="questionDayTrend"
style="width:100%;height:600px;margin:0 auto;"></div>
<div class="progress"></div>
</div>
</el-col>
<el-col :span="6" class="border">
<el-form :label-position="'top'" label-width="120px" :model="filters">
<el-form-item>
<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="日期区间">
<date-range v-model="filters" value-format="yyyy-MM-dd" start-key="startBizDate" end-key="endBizDate"></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>
</el-dialog>
</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>

12
src/views/xm/rpt/reportIndex.vue

@ -26,6 +26,10 @@
<xm-menu-day-accumulate ref="xmMenuDayAccumulate"></xm-menu-day-accumulate>
<xm-menu-att-dist ref="xmMenuAttDist"></xm-menu-att-dist>
<xm-menu-age-dist ref="xmMenuAgeDist"></xm-menu-age-dist>
<xm-question-day-trend ref="xmQuestionDayTrend"></xm-question-day-trend>
<xm-question-day-accumulate ref="xmQuestionDayAccumulate"></xm-question-day-accumulate>
<xm-question-att-dist ref="xmQuestionAttDist"></xm-question-att-dist>
<xm-question-age-dist ref="xmQuestionAgeDist"></xm-question-age-dist>
<xm-product-work-item-day-list ref="productWorkItemDayList"></xm-product-work-item-day-list>
@ -43,6 +47,9 @@
import xmMenuAgeDist from './product/menuAgeDist'
import xmProductWorkItemDayList from './product/productWorkItemDayList'
import xmQuestionDayTrend from './product/questionDayTrend'
import xmQuestionDayAccumulate from './product/questionDayAccumulate'
import xmQuestionAttDist from './product/questionAttDist'
import xmQuestionAgeDist from './product/questionAgeDist'
@ -55,7 +62,7 @@
export default {
components: {
xmIterationBurnout,xmMenuDayTrend,xmMenuDayAccumulate,xmMenuAttDist,xmMenuAgeDist,xmProductWorkItemDayList,xmQuestionAttDist,xmQuestionAgeDist
xmIterationBurnout,xmMenuDayTrend,xmMenuDayAccumulate,xmMenuAttDist,xmMenuAgeDist,xmProductWorkItemDayList,xmQuestionDayTrend,xmQuestionDayAccumulate,xmQuestionAttDist,xmQuestionAgeDist
},
props:['xmProduct','xmIteration','xmProject'],
computed: {
@ -103,6 +110,9 @@
{rptName:'需求属性分布',category:'产品级',ref:'xmMenuAttDist',desc:'统计所有需求任意属性数量分布情况(实时数据)',img:pieSimple },
{rptName:'需求年龄分布',category:'产品级',ref:'xmMenuAgeDist',desc:'统计所有需求年龄分布情况(实时数据)',img:pieSimple },
{rptName:'产品工作项每日趋势',category:'产品级',ref:'productWorkItemDayList',desc:'统计产品每日工作项数量分布情况',img:datasetLink },
{rptName:'缺陷每日趋势',category:'产品级',ref:'xmQuestionDayTrend',desc:'跟踪新提出、执行中、已解决、已关闭状态的缺陷数量按日期变化趋势,识别缺陷处理工作情况',img:lineStack },
{rptName:'缺陷每日累积',category:'产品级',ref:'xmQuestionDayAccumulate',desc:'跟踪新提出、执行中、已解决、已关闭状态的缺陷数量按日期累积情况,识别缺陷处理工作的瓶颈',img:areaStack },
{rptName:'缺陷属性分布',category:'产品级',ref:'xmQuestionAttDist',desc:'统计所有缺陷任意属性数量分布情况(实时数据)',img:pieSimple },
{rptName:'缺陷年龄分布',category:'产品级',ref:'xmQuestionAgeDist',desc:'统计所有缺陷年龄分布情况(实时数据)',img:pieSimple },
],

Loading…
Cancel
Save