Browse Source

需求分析

master
陈裕财 4 years ago
parent
commit
d98260fe40
  1. 2
      src/api/xm/core/xmMenu.js
  2. 4
      src/router/routes_xm.js
  3. 226
      src/views/xm/rpt/product/menuAgeDist.vue
  4. 6
      src/views/xm/rpt/reportIndex.vue

2
src/api/xm/core/xmMenu.js

@ -50,3 +50,5 @@ export const getXmMenuAttDist = params => { return axios.get(`${base}/xm/core/xm
export const getXmMenuAgeDist = params => { return axios.get(`${base}/xm/core/xmMenu/getXmMenuAgeDist`, { params: params }); };

4
src/router/routes_xm.js

@ -94,14 +94,14 @@ export default {
component: Layout,
iconCls: 'fa el-icon-menu',
meta: {
title: '报表统计',
title: '效能分析',
icon: 'report',
hidden:true
},
children: [
{ path: 'reportIndex', component: _import('xm/rpt/reportIndex'), name: 'reportIndex', meta: { title: '报表统计', icon: 'chart' }},
{ path: 'reportIndex', component: _import('xm/rpt/reportIndex'), name: 'reportIndex', meta: { title: '效能分析', icon: 'chart' }},
]
},
{

226
src/views/xm/rpt/product/menuAgeDist.vue

@ -0,0 +1,226 @@
<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="xmMenuAgeDist"
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">
<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>
<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 label="需求状态" prop="status">
<el-select v-model="filters.status" @change="onXmMenuSomeFieldsChange('status',$event)" clearable>
<el-option v-for="i in this.dicts.menuStatus" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="需求类型" prop="dtype" >
<el-select v-model="filters.dtype" @change="onXmMenuSomeFieldsChange('dtype',$event)" clearable>
<el-option v-for="i in this.dicts.demandType" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="需求来源" prop="source">
<el-select v-model="filters.source" @change="onXmMenuSomeFieldsChange('source',$event)" clearable>
<el-option v-for="i in this.dicts.demandSource" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="需求层次" prop="dlvl" >
<el-select v-model="filters.dlvl" @change="onXmMenuSomeFieldsChange('dlvl',$event)" clearable>
<el-option v-for="i in this.dicts.demandLvl" :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="onXmMenuSomeFieldsChange('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>
<el-button type="primary" icon="el-icon-search" @click="searchXmMenuAgeDist">查询</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 { getXmMenuAgeDist } from '@/api/xm/core/xmMenu';
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'
]),
xmMenuAgeDistsCpd(){
if(this.xmMenuAgeDists.length==0){
return []
}else{
var datas=[]
this.xmMenuAgeDists.forEach(i=>{
var data={...i}
data.name=this.legendCpd[i.name]
datas.push(data)
})
return datas;
}
},
title(){
return '需求年龄数量分布'
},
legendCpd(){
return ['0-2天','3-5天','6-7天','8-15天','16-30天','30天以上']
}
},
watch: {
xmMenuAgeDistsCpd(){
this.drawCharts();
}
},
data() {
return {
filters:{
product:null,
iteration: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,
xmMenuAgeDists:[],
}//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("xmMenuAgeDist"));
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.xmMenuAgeDistsCpd,
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
},
label: {
show: true,
position: 'center'
},
}
]
}
)
},
onXmMenuSomeFieldsChange(fieldName,$event){
this.xmMenuAgeDists=[]
},
searchXmMenuAgeDist(){
var params={}
if(this.filters.dtype){
params.dtype=this.filters.dtype
}
if(this.filters.status){
params.status=this.filters.status
}
if(this.filters.source){
params.source=this.filters.source
}
if(this.filters.dlvl){
params.dlvl=this.filters.dlvl
}
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
}
getXmMenuAgeDist(params).then(res=>{
this.xmMenuAgeDists=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',['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>

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

@ -24,7 +24,7 @@
<xm-iteration-burnout ref="xmIterationBurnout"></xm-iteration-burnout>
<xm-menu-day-trend ref="xmMenuDayTrend"></xm-menu-day-trend>
<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>
</section>
</template>
@ -36,10 +36,11 @@
import xmMenuDayTrend from './product/menuDayTrend'
import xmMenuDayAccumulate from './product/menuDayAccumulate'
import xmMenuAttDist from './product/menuAttDist'
import xmMenuAgeDist from './product/menuAgeDist'
export default {
components: {
xmIterationBurnout,xmMenuDayTrend,xmMenuDayAccumulate,xmMenuAttDist,
xmIterationBurnout,xmMenuDayTrend,xmMenuDayAccumulate,xmMenuAttDist,xmMenuAgeDist,
},
props:['xmProduct','xmIteration','xmProject'],
computed: {
@ -85,6 +86,7 @@
{rptName:'需求每日趋势',category:'产品级',ref:'xmMenuDayTrend',desc:'跟踪未开始、执行中、已完成、已关闭状态的需求数量按日期变化趋势,识别需求工作情况' },
{rptName:'需求每日累积',category:'产品级',ref:'xmMenuDayAccumulate',desc:'跟踪未开始、执行中、已完成、已关闭状态的需求数量按日期累积情况,识别需求工作的瓶颈' },
{rptName:'需求属性分布',category:'产品级',ref:'xmMenuAttDist',desc:'统计所有需求任意属性数量分布情况(实时数据)' },
{rptName:'需求年龄分布',category:'产品级',ref:'xmMenuAgeDist',desc:'统计所有需求年龄分布情况(实时数据)' },
],
}//end return
},//end data

Loading…
Cancel
Save