2 changed files with 200 additions and 1 deletions
@ -0,0 +1,196 @@ |
|||||
|
<template> |
||||
|
<section> |
||||
|
<el-dialog :title="filters.product?'产品【'+filters.product.productName+'】':''+'需求累积图'" append-to-body modal-append-to-body width="80%" top="20px" :visible.sync="visible"> |
||||
|
<div> |
||||
|
<div class="main" id="main" |
||||
|
style="width:100%;height:600px;margin:0 auto;"></div> |
||||
|
<div class="progress"></div> |
||||
|
</div> |
||||
|
</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'; |
||||
|
export default { |
||||
|
|
||||
|
components: { |
||||
|
}, |
||||
|
props:['xmProduct'], |
||||
|
computed: { |
||||
|
...mapGetters([ |
||||
|
'userInfo','roles' |
||||
|
]), |
||||
|
datesCpd(){ |
||||
|
if(this.xmProductStateHiss.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return this.xmProductStateHiss.map(i=>i.bizDate) |
||||
|
} |
||||
|
}, |
||||
|
menuCloseCntCpd(){ |
||||
|
if(this.xmProductStateHiss.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return this.xmProductStateHiss.map(i=>i.menuCloseCnt) |
||||
|
} |
||||
|
}, |
||||
|
menuUnstartCntCpd(){ |
||||
|
if(this.xmProductStateHiss.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return this.xmProductStateHiss.map(i=> i.menuUnstartCnt) |
||||
|
} |
||||
|
}, |
||||
|
menuExecCntCpd(){ |
||||
|
if(this.xmProductStateHiss.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return this.xmProductStateHiss.map(i=> i.menuExecCnt) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
menuFinishCntCpd(){ |
||||
|
if(this.xmProductStateHiss.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return this.xmProductStateHiss.map(i=>i.menuFinishCnt) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
watch: { |
||||
|
xmProductStateHiss(){ |
||||
|
this.drawWorkload(); |
||||
|
} |
||||
|
}, |
||||
|
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: { |
||||
|
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; |
||||
|
}, |
||||
|
listXmProductStateHis(){ |
||||
|
var params={productId:'mmcloud-xm',orderBy:'biz_date asc'} |
||||
|
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.$nextTick(()=>{ |
||||
|
this.listXmProductStateHis(); |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
drawWorkload() { |
||||
|
this.myChart = this.$echarts.init(document.getElementById("main")); |
||||
|
this.myChart.setOption( |
||||
|
{ |
||||
|
title: { |
||||
|
text: '需求累积图' |
||||
|
}, |
||||
|
tooltip: { |
||||
|
trigger: 'axis' |
||||
|
}, |
||||
|
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', |
||||
|
data: this.menuUnstartCntCpd |
||||
|
}, |
||||
|
{ |
||||
|
name: '执行中', |
||||
|
type: 'line', |
||||
|
stack: 'Total', |
||||
|
data: this.menuExecCntCpd, |
||||
|
}, |
||||
|
{ |
||||
|
name: '已完成', |
||||
|
type: 'line', |
||||
|
stack: 'Total', |
||||
|
data: this.menuFinishCntCpd, |
||||
|
}, |
||||
|
{ |
||||
|
name: '已关闭', |
||||
|
type: 'line', |
||||
|
stack: 'Total', |
||||
|
data: this.menuCloseCntCpd, |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
) |
||||
|
} |
||||
|
},//end method |
||||
|
mounted() { |
||||
|
/** |
||||
|
initSimpleDicts('all',['demandSource','demandLvl','demandType','priority','menuStatus'] ).then(res=>{ |
||||
|
this.dicts=res.data.data; |
||||
|
}) |
||||
|
*/ |
||||
|
//this.charts(); |
||||
|
|
||||
|
}//end mounted |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.image { |
||||
|
width: 100%; |
||||
|
display: block; |
||||
|
} |
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue