7 changed files with 1545 additions and 3 deletions
-
247src/views/xm/rpt/project/projectWorkItemDayList.vue
-
222src/views/xm/rpt/project/taskAgeDist.vue
-
286src/views/xm/rpt/project/taskAttDist.vue
-
260src/views/xm/rpt/project/taskDayAccumulate.vue
-
258src/views/xm/rpt/project/taskDayTrend.vue
-
247src/views/xm/rpt/project/taskSort.vue
-
28src/views/xm/rpt/reportIndex.vue
@ -0,0 +1,247 @@ |
|||||
|
<template> |
||||
|
<section> |
||||
|
<el-dialog :title="(filters.project?'【'+filters.project.name+'】':'')+'工作项按日分布趋势图'" 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="projectWorkItemDayList" style="width:100%;height:600px;margin:0 auto;"></div> |
||||
|
</div> |
||||
|
</el-col> |
||||
|
<el-col :span="6" class="border"> |
||||
|
<el-form :label-position="'top'" :model="filters"> |
||||
|
<el-form-item> |
||||
|
<xm-project-select v-if="!xmProduct" ref="xmProjectSelect" style="display:inline;" :auto-select="false" :link-project-id="xmProject?xmProject.id:null" @row-click="onProjectSelected" @clear="onProjectClear"></xm-project-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="listXmProjectStateHis">查询</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 XmProjectSelect from '@/views/xm/core/components/XmProjectSelect';//新增界面 |
||||
|
import { listXmProjectStateHis } from '@/api/xm/core/xmProjectStateHis'; |
||||
|
export default { |
||||
|
|
||||
|
components: { |
||||
|
XmProjectSelect, |
||||
|
}, |
||||
|
props:['xmProduct','xmProject'], |
||||
|
computed: { |
||||
|
...mapGetters([ |
||||
|
'userInfo','roles' |
||||
|
]), |
||||
|
dataSetCpd(){ |
||||
|
return [ |
||||
|
['日期',...this.xmProjectStateHiss.map(i=>i.bizDate)], |
||||
|
['未关故事',...this.xmProjectStateHiss.map(i=>i.menuCnt-i.menuFinishCnt)], |
||||
|
['已关故事',...this.xmProjectStateHiss.map(i=>i.menuFinishCnt)], |
||||
|
['未关任务',...this.xmProjectStateHiss.map(i=>i.taskCnt-i.finishTaskCnt)], |
||||
|
['已关任务',...this.xmProjectStateHiss.map(i=>i.finishTaskCnt)], |
||||
|
['未关缺陷',...this.xmProjectStateHiss.map(i=>i.bugCnt-i.closedBugs)], |
||||
|
['已关缺陷',...this.xmProjectStateHiss.map(i=>i.closedBugs)] |
||||
|
] |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
watch: { |
||||
|
dataSetCpd(){ |
||||
|
this.$nextTick(()=>{ |
||||
|
this.drawCharts(); |
||||
|
}) |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
filters:{ |
||||
|
category:'', |
||||
|
product:null, |
||||
|
iteration:null, |
||||
|
project:null, |
||||
|
startBizDate:'', |
||||
|
endBizDate:'', |
||||
|
}, |
||||
|
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, |
||||
|
xmProjectStateHiss:[], |
||||
|
|
||||
|
}//end return |
||||
|
},//end data |
||||
|
methods: { |
||||
|
listXmProjectStateHis(){ |
||||
|
if(!this.filters.project){ |
||||
|
this.$notify({position:'bottom-left',showClose:true,message:'请先选中项目',type:'warning'}) |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
var params={projectId: this.filters.project.id,orderBy:'biz_date asc'} |
||||
|
if(this.filters.startBizDate && this.filters.endBizDate){ |
||||
|
params.startBizDate=this.filters.startBizDate; |
||||
|
params.endBizDate=this.filters.endBizDate; |
||||
|
} |
||||
|
listXmProjectStateHis(params).then(res=>{ |
||||
|
this.xmProjectStateHiss=res.data.tips.isOk?res.data.data:this.xmProjectStateHiss; |
||||
|
}) |
||||
|
}, |
||||
|
open(params){ |
||||
|
this.visible=true; |
||||
|
this.filters.product=params.xmProduct |
||||
|
this.filters.project=params.xmProject |
||||
|
this.filters.iteration=params.xmIteration |
||||
|
this.xmProjectStateHiss=[] |
||||
|
|
||||
|
this.$nextTick(()=>{ |
||||
|
if(this.$refs['xmProjectSelect'])this.$refs['xmProjectSelect'].clearSelect(); |
||||
|
this.listXmProjectStateHis(); |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
drawCharts() { |
||||
|
this.myChart = this.$echarts.init(document.getElementById("projectWorkItemDayList")); |
||||
|
var that=this; |
||||
|
this.myChart.on('updateAxisPointer', function (event) { |
||||
|
const xAxisInfo = event.axesInfo[0]; |
||||
|
if (xAxisInfo) { |
||||
|
const dimension = xAxisInfo.value + 1; |
||||
|
that.myChart.setOption({ |
||||
|
series: { |
||||
|
id: 'pie', |
||||
|
label: { |
||||
|
formatter: '{b}: {@[' + dimension + ']} ({d}%)' |
||||
|
}, |
||||
|
encode: { |
||||
|
value: dimension, |
||||
|
tooltip: dimension |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
this.myChart.setOption({ |
||||
|
title: { |
||||
|
text: '工作项分布', |
||||
|
}, |
||||
|
tooltip: { |
||||
|
trigger: 'axis', |
||||
|
showContent: false |
||||
|
}, |
||||
|
legend: { |
||||
|
}, |
||||
|
|
||||
|
dataset: { |
||||
|
source: this.dataSetCpd |
||||
|
}, |
||||
|
xAxis: { |
||||
|
type: 'category', |
||||
|
}, |
||||
|
yAxis: { gridIndex: 0 }, |
||||
|
grid: { top: '55%' }, |
||||
|
series: [ |
||||
|
{ name:'未关故事', |
||||
|
type: 'line', |
||||
|
seriesLayoutBy: 'row', |
||||
|
smooth:true, |
||||
|
emphasis: { focus: 'series' }, |
||||
|
}, |
||||
|
{ name:'已关故事', |
||||
|
type: 'line', |
||||
|
seriesLayoutBy: 'row', |
||||
|
smooth:true, |
||||
|
emphasis: { focus: 'series' }, |
||||
|
}, |
||||
|
{ |
||||
|
name:'未关任务', |
||||
|
type: 'line', |
||||
|
seriesLayoutBy: 'row', |
||||
|
smooth:true, |
||||
|
emphasis: { focus: 'series' }, |
||||
|
}, |
||||
|
{ |
||||
|
name:'已关任务', |
||||
|
type: 'line', |
||||
|
seriesLayoutBy: 'row', |
||||
|
smooth:true, |
||||
|
emphasis: { focus: 'series' }, |
||||
|
}, |
||||
|
{ name:'未关缺陷', |
||||
|
type: 'line', |
||||
|
seriesLayoutBy: 'row', |
||||
|
smooth:true, |
||||
|
emphasis: { focus: 'series' }, |
||||
|
}, |
||||
|
{ name:'已关缺陷', |
||||
|
type: 'line', |
||||
|
seriesLayoutBy: 'row', |
||||
|
smooth:true, |
||||
|
emphasis: { focus: 'series' }, |
||||
|
}, |
||||
|
{ |
||||
|
type: 'pie', |
||||
|
id: 'pie', |
||||
|
radius: '30%', |
||||
|
center: ['50%', '25%'], |
||||
|
emphasis: { |
||||
|
focus: 'self' |
||||
|
}, |
||||
|
label: { |
||||
|
formatter: '{b}: {@日期} ({d}%)' |
||||
|
}, |
||||
|
encode: { |
||||
|
itemName: '日期', |
||||
|
value: '日期', |
||||
|
tooltip: '日期' |
||||
|
} |
||||
|
} |
||||
|
] |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
onProjectSelected(project){ |
||||
|
this.filters.project=project |
||||
|
this.xmProjectStateHiss=[]; |
||||
|
this.listXmProjectStateHis(); |
||||
|
}, |
||||
|
|
||||
|
onProjectClear(){ |
||||
|
this.filters.project=null |
||||
|
|
||||
|
this.xmProjectStateHiss=[]; |
||||
|
|
||||
|
}, |
||||
|
},//end method |
||||
|
mounted() { |
||||
|
/** |
||||
|
initSimpleDicts('all',['planType','xmTaskSettleSchemel','taskType','priority','taskState'] ).then(res=>{ |
||||
|
this.dicts=res.data.data; |
||||
|
}) |
||||
|
*/ |
||||
|
//this.charts(); |
||||
|
//this.drawCharts(); |
||||
|
|
||||
|
}//end mounted |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.image { |
||||
|
width: 100%; |
||||
|
display: block; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,222 @@ |
|||||
|
<template> |
||||
|
<section> |
||||
|
<el-dialog :title="(filters.project?'【'+filters.project.name+'】':'')+'任务属性分布'" 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="xmTaskAgeDist" |
||||
|
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-project-select class="padding" v-if="!xmProject" ref="xmProjectSelect" style="display:inline;" :auto-select="false" :link-project-id="xmProject?xmProject.id:null" @row-click="onProjectSelected" :iterationId="xmIteration?xmIteration.id:null" @clear="onProjectClear"></xm-project-select> |
||||
|
<el-form-item label="任务状态" prop="taskState"> |
||||
|
<el-select v-model="filters.taskState" @change="onXmTaskSomeFieldsChange('taskState',$event)" clearable> |
||||
|
<el-option v-for="i in this.dicts.taskState" :label="i.name" :key="i.id" :value="i.id"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="任务类型" prop="taskType" > |
||||
|
<el-select v-model="filters.taskType" @change="onXmTaskSomeFieldsChange('taskType',$event)" clearable> |
||||
|
<el-option v-for="i in this.dicts.taskType" :label="i.name" :key="i.id" :value="i.id"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="任务来源" prop="planType"> |
||||
|
<el-select v-model="filters.planType" @change="onXmTaskSomeFieldsChange('planType',$event)" clearable> |
||||
|
<el-option v-for="i in this.dicts.planType" :label="i.name" :key="i.id" :value="i.id"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="任务层次" prop="settleSchemel" > |
||||
|
<el-select v-model="filters.settleSchemel" @change="onXmTaskSomeFieldsChange('settleSchemel',$event)" clearable> |
||||
|
<el-option v-for="i in this.dicts.xmTaskSettleSchemel" :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="onXmTaskSomeFieldsChange('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="searchXmTaskAgeDist">查询</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 { getXmTaskAgeDist } from '@/api/xm/core/xmTask'; |
||||
|
import XmProjectSelect from '@/views/xm/core/components/XmProjectSelect';//新增界面 |
||||
|
|
||||
|
export default { |
||||
|
|
||||
|
components: { |
||||
|
XmProjectSelect, |
||||
|
}, |
||||
|
props:['xmProduct','xmIteration','xmProject'], |
||||
|
computed: { |
||||
|
...mapGetters([ |
||||
|
'userInfo','roles' |
||||
|
]), |
||||
|
xmTaskAgeDistsCpd(){ |
||||
|
if(this.xmTaskAgeDists.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
var datas=[] |
||||
|
this.xmTaskAgeDists.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: { |
||||
|
xmTaskAgeDistsCpd(){ |
||||
|
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, |
||||
|
xmTaskAgeDists:[], |
||||
|
|
||||
|
}//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("xmTaskAgeDist")); |
||||
|
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.xmTaskAgeDistsCpd, |
||||
|
emphasis: { |
||||
|
itemStyle: { |
||||
|
shadowBlur: 10, |
||||
|
shadowOffsetX: 0, |
||||
|
shadowColor: 'rgba(0, 0, 0, 0.5)' |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
label: { |
||||
|
show: true, |
||||
|
position: 'center' |
||||
|
}, |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
) |
||||
|
}, |
||||
|
onXmTaskSomeFieldsChange(fieldName,$event){ |
||||
|
this.xmTaskAgeDists=[] |
||||
|
}, |
||||
|
searchXmTaskAgeDist(){ |
||||
|
var params={} |
||||
|
if(this.filters.taskType){ |
||||
|
params.taskType=this.filters.taskType |
||||
|
} |
||||
|
if(this.filters.taskState){ |
||||
|
params.taskState=this.filters.taskState |
||||
|
} |
||||
|
if(this.filters.planType){ |
||||
|
params.planType=this.filters.planType |
||||
|
} |
||||
|
if(this.filters.settleSchemel){ |
||||
|
params.settleSchemel=this.filters.settleSchemel |
||||
|
} |
||||
|
if(this.filters.priority){ |
||||
|
params.priority=this.filters.priority |
||||
|
} |
||||
|
params.groupBy=this.groupBy |
||||
|
if(this.filters.project){ |
||||
|
params.projectId=this.filters.project.id |
||||
|
} |
||||
|
|
||||
|
if(this.filters.iteration){ |
||||
|
params.iterationId=this.filters.iteration.id |
||||
|
} |
||||
|
getXmTaskAgeDist(params).then(res=>{ |
||||
|
this.xmTaskAgeDists=res.data.data |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
onProjectSelected(project){ |
||||
|
this.filters.project=project |
||||
|
}, |
||||
|
|
||||
|
onProjectClear(){ |
||||
|
this.filters.project=null |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
onIterationSelected(iteration){ |
||||
|
this.filters.iteration=iteration |
||||
|
}, |
||||
|
|
||||
|
onIterationClear(){ |
||||
|
this.filters.iteration=null |
||||
|
} |
||||
|
},//end method |
||||
|
mounted() { |
||||
|
initSimpleDicts('all',['planType','xmTaskSettleSchemel','taskType','priority','taskState'] ).then(res=>{ |
||||
|
this.dicts=res.data.data; |
||||
|
}) |
||||
|
//this.charts(); |
||||
|
//this.drawCharts(); |
||||
|
|
||||
|
}//end mounted |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.image { |
||||
|
width: 100%; |
||||
|
display: block; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,286 @@ |
|||||
|
<template> |
||||
|
<section> |
||||
|
<el-dialog :title="(filters.project?'【'+filters.project.name+'】':'')+'任务属性分布'" 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="xmTaskAttDist" |
||||
|
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 label="分组属性"> |
||||
|
<el-select v-model="groupBy" @change="onXmTaskSomeFieldsChange('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> |
||||
|
<xm-project-select class="padding" v-if="!xmProject" ref="xmProjectSelect" style="display:inline;" :auto-select="false" :link-project-id="xmProject?xmProject.id:null" @row-click="onProjectSelected" :iterationId="xmIteration?xmIteration.id:null" @clear="onProjectClear"></xm-project-select> |
||||
|
|
||||
|
<el-form-item label="任务状态" prop="taskState"> |
||||
|
<el-select v-model="filters.taskState" @change="onXmTaskSomeFieldsChange('taskState',$event)" clearable> |
||||
|
<el-option v-for="i in this.dicts.taskState" :label="i.name" :key="i.id" :value="i.id"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="任务类型" prop="taskType" > |
||||
|
<el-select v-model="filters.taskType" @change="onXmTaskSomeFieldsChange('taskType',$event)" clearable> |
||||
|
<el-option v-for="i in this.dicts.taskType" :label="i.name" :key="i.id" :value="i.id"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="计划类型" prop="planType"> |
||||
|
<el-select v-model="filters.planType" @change="onXmTaskSomeFieldsChange('planType',$event)" clearable> |
||||
|
<el-option v-for="i in this.dicts.planType" :label="i.name" :key="i.id" :value="i.id"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="结算方案" prop="settleSchemel" > |
||||
|
<el-select v-model="filters.settleSchemel" @change="onXmTaskSomeFieldsChange('settleSchemel',$event)" clearable> |
||||
|
<el-option v-for="i in this.dicts.xmTaskSettleSchemel" :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="onXmTaskSomeFieldsChange('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="searchXmTaskAttDist">查询</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 { getXmTaskAttDist } from '@/api/xm/core/xmTask'; |
||||
|
|
||||
|
import XmProjectSelect from '@/views/xm/core/components/XmProjectSelect';//新增界面 |
||||
|
|
||||
|
export default { |
||||
|
|
||||
|
components: { |
||||
|
XmProjectSelect, |
||||
|
}, |
||||
|
props:['xmProduct','xmIteration','xmProject'], |
||||
|
computed: { |
||||
|
...mapGetters([ |
||||
|
'userInfo','roles' |
||||
|
]), |
||||
|
xmTaskAttDistsCpd(){ |
||||
|
if(this.xmTaskAttDists.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
var itemId=""; |
||||
|
if(this.groupBy=='task_state'){ |
||||
|
itemId="taskState" |
||||
|
}else if(this.groupBy=='settle_schemel'){ |
||||
|
itemId="xmTaskSettleSchemel" |
||||
|
}else if(this.groupBy=='task_type'){ |
||||
|
itemId="taskType" |
||||
|
}else if(this.groupBy=='priority'){ |
||||
|
itemId="priority" |
||||
|
}else if(this.groupBy=='plan_type'){ |
||||
|
itemId="planType" |
||||
|
} |
||||
|
return this.xmTaskAttDists.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=='task_state'){ |
||||
|
itemId="taskState" |
||||
|
}else if(this.groupBy=='settle_schemel'){ |
||||
|
itemId="xmTaskSettleSchemel" |
||||
|
}else if(this.groupBy=='task_type'){ |
||||
|
itemId="taskType" |
||||
|
}else if(this.groupBy=='priority'){ |
||||
|
itemId="priority" |
||||
|
}else if(this.groupBy=='plan_type'){ |
||||
|
itemId="planType" |
||||
|
} |
||||
|
|
||||
|
return this.dicts[itemId].map(i=>i.name) |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
watch: { |
||||
|
xmTaskAttDistsCpd(){ |
||||
|
this.drawCharts(); |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
filters:{ |
||||
|
product:null, |
||||
|
iteration:null, |
||||
|
}, |
||||
|
groupBy:'task_state', |
||||
|
groupBys:[ |
||||
|
{id:'task_state', name:'任务状态'}, |
||||
|
{id:'task_type', name:'任务类型'}, |
||||
|
{id:'plan_type', name:'计划类型'}, |
||||
|
{id:'settle_schemel', name:'结算方案'}, |
||||
|
{id:'priority', 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, |
||||
|
xmTaskAttDists:[], |
||||
|
|
||||
|
}//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("xmTaskAttDist")); |
||||
|
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.xmTaskAttDistsCpd, |
||||
|
emphasis: { |
||||
|
itemStyle: { |
||||
|
shadowBlur: 10, |
||||
|
shadowOffsetX: 0, |
||||
|
shadowColor: 'rgba(0, 0, 0, 0.5)' |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
label: { |
||||
|
show: true, |
||||
|
position: 'center' |
||||
|
}, |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
) |
||||
|
}, |
||||
|
onXmTaskSomeFieldsChange(fieldName,$event){ |
||||
|
this.xmTaskAttDists=[] |
||||
|
}, |
||||
|
searchXmTaskAttDist(){ |
||||
|
if(!this.groupBy){ |
||||
|
this.$notify({position:'bottom-left',showClose:true,message:'请选中分组属性',type:'warning'}) |
||||
|
return |
||||
|
} |
||||
|
var params={} |
||||
|
if(this.filters.taskType){ |
||||
|
params.taskType=this.filters.taskType |
||||
|
} |
||||
|
if(this.filters.taskState){ |
||||
|
params.taskState=this.filters.taskState |
||||
|
} |
||||
|
if(this.filters.planType){ |
||||
|
params.planType=this.filters.planType |
||||
|
} |
||||
|
if(this.filters.settleSchemel){ |
||||
|
params.settleSchemel=this.filters.settleSchemel |
||||
|
} |
||||
|
if(this.filters.priority){ |
||||
|
params.priority=this.filters.priority |
||||
|
} |
||||
|
params.groupBy=this.groupBy |
||||
|
if(this.filters.project){ |
||||
|
params.projectId=this.filters.project.id |
||||
|
} |
||||
|
|
||||
|
if(this.filters.iteration){ |
||||
|
params.iterationId=this.filters.iteration.id |
||||
|
} |
||||
|
getXmTaskAttDist(params).then(res=>{ |
||||
|
this.xmTaskAttDists=res.data.data |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
onProjectSelected(project){ |
||||
|
this.filters.project=project |
||||
|
}, |
||||
|
|
||||
|
onProjectClear(){ |
||||
|
this.filters.project=null |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
onIterationSelected(iteration){ |
||||
|
this.filters.iteration=iteration |
||||
|
}, |
||||
|
|
||||
|
onIterationClear(){ |
||||
|
this.filters.iteration=null |
||||
|
} |
||||
|
},//end method |
||||
|
mounted() { |
||||
|
initSimpleDicts('all',['planType','xmTaskSettleSchemel','taskType','priority','taskState'] ).then(res=>{ |
||||
|
this.dicts=res.data.data; |
||||
|
}) |
||||
|
//this.charts(); |
||||
|
//this.drawCharts(); |
||||
|
|
||||
|
}//end mounted |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.image { |
||||
|
width: 100%; |
||||
|
display: block; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,260 @@ |
|||||
|
<template> |
||||
|
<section> |
||||
|
<el-dialog :title="(filters.project?'【'+filters.project.name+'】':'')+'任务累积图'" 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="menuDayAccumulate" |
||||
|
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-project-select v-if="!xmProduct" ref="xmProjectSelect" style="display:inline;" :auto-select="false" :link-project-id="xmProject?xmProject.id:null" @row-click="onProjectSelected" @clear="onProjectClear"></xm-project-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="listXmProjectStateHis">查询</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 { listXmProjectStateHis } from '@/api/xm/core/xmProjectStateHis'; |
||||
|
import XmProjectSelect from '@/views/xm/core/components/XmProjectSelect';//新增界面 |
||||
|
export default { |
||||
|
|
||||
|
components: { |
||||
|
XmProjectSelect, |
||||
|
}, |
||||
|
props:['xmProduct','xmProject'], |
||||
|
computed: { |
||||
|
...mapGetters([ |
||||
|
'userInfo','roles' |
||||
|
]), |
||||
|
datesCpd(){ |
||||
|
if(this.xmProjectStateHiss.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return this.xmProjectStateHiss.map(i=>i.bizDate) |
||||
|
} |
||||
|
}, |
||||
|
menuCloseCntCpd(){ |
||||
|
if(this.xmProjectStateHiss.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return this.xmProjectStateHiss.map(i=>i.menuCloseCnt) |
||||
|
} |
||||
|
}, |
||||
|
menuUnstartCntCpd(){ |
||||
|
if(this.xmProjectStateHiss.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return this.xmProjectStateHiss.map(i=> i.menuUnstartCnt) |
||||
|
} |
||||
|
}, |
||||
|
menuExecCntCpd(){ |
||||
|
if(this.xmProjectStateHiss.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return this.xmProjectStateHiss.map(i=> i.menuExecCnt) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
menuFinishCntCpd(){ |
||||
|
if(this.xmProjectStateHiss.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return this.xmProjectStateHiss.map(i=>i.menuFinishCnt) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
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, |
||||
|
xmProjectStateHiss:[], |
||||
|
|
||||
|
}//end return |
||||
|
},//end data |
||||
|
methods: { |
||||
|
listXmProjectStateHis(){ |
||||
|
if(!this.filters.project){ |
||||
|
this.$notify({position:'bottom-left',showClose:true,message:'请先选中项目',type:'warning'}) |
||||
|
return; |
||||
|
} |
||||
|
var params={projectId: this.filters.project.id,orderBy:'biz_date asc'} |
||||
|
|
||||
|
if(this.filters.startBizDate && this.filters.endBizDate){ |
||||
|
params.startBizDate=this.filters.startBizDate; |
||||
|
params.endBizDate=this.filters.endBizDate; |
||||
|
} |
||||
|
listXmProjectStateHis(params).then(res=>{ |
||||
|
this.xmProjectStateHiss=res.data.tips.isOk?res.data.data:this.xmProjectStateHiss; |
||||
|
}) |
||||
|
}, |
||||
|
open(params){ |
||||
|
this.visible=true; |
||||
|
this.filters.product=params.xmProduct |
||||
|
this.filters.project=params.xmProject |
||||
|
this.filters.Product=params.xmProduct |
||||
|
this.xmProjectStateHiss=[] |
||||
|
if(this.$refs['xmProjectSelect'])this.$refs['xmProjectSelect'].clearSelect(); |
||||
|
this.$nextTick(()=>{ |
||||
|
this.listXmProjectStateHis(); |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
drawCharts() { |
||||
|
this.myChart = this.$echarts.init(document.getElementById("menuDayAccumulate")); |
||||
|
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.menuUnstartCntCpd |
||||
|
}, |
||||
|
{ |
||||
|
name: '执行中', |
||||
|
type: 'line', |
||||
|
stack: 'Total', |
||||
|
areaStyle: {}, |
||||
|
emphasis: { |
||||
|
focus: 'series' |
||||
|
}, |
||||
|
data: this.menuExecCntCpd, |
||||
|
}, |
||||
|
{ |
||||
|
name: '已完成', |
||||
|
type: 'line', |
||||
|
stack: 'Total', |
||||
|
areaStyle: {}, |
||||
|
emphasis: { |
||||
|
focus: 'series' |
||||
|
}, |
||||
|
data: this.menuFinishCntCpd, |
||||
|
}, |
||||
|
{ |
||||
|
name: '已关闭', |
||||
|
type: 'line', |
||||
|
stack: 'Total', |
||||
|
areaStyle: {}, |
||||
|
emphasis: { |
||||
|
focus: 'series' |
||||
|
}, |
||||
|
|
||||
|
label: { |
||||
|
show: true, |
||||
|
position: 'top' |
||||
|
}, |
||||
|
data: this.menuCloseCntCpd, |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
) |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
onProjectSelected(project){ |
||||
|
this.filters.project=project |
||||
|
this.xmProjectStateHiss=[]; |
||||
|
this.listXmProjectStateHis(); |
||||
|
}, |
||||
|
|
||||
|
onProjectClear(){ |
||||
|
this.filters.project=null |
||||
|
|
||||
|
this.xmProjectStateHiss=[]; |
||||
|
|
||||
|
}, |
||||
|
},//end method |
||||
|
mounted() { |
||||
|
/** |
||||
|
initSimpleDicts('all',['planType','xmTaskSettleSchemel','taskType','priority','taskState'] ).then(res=>{ |
||||
|
this.dicts=res.data.data; |
||||
|
}) |
||||
|
*/ |
||||
|
//this.charts(); |
||||
|
//this.drawCharts() |
||||
|
|
||||
|
}//end mounted |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.image { |
||||
|
width: 100%; |
||||
|
display: block; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,258 @@ |
|||||
|
<template> |
||||
|
<section> |
||||
|
<el-dialog :title="(filters.project?'【'+filters.project.name+'】':'')+'任务每日趋势'" 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="menuDayTrend" |
||||
|
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-project-select v-if="!xmProduct" ref="xmProjectSelect" style="display:inline;" :auto-select="false" :link-project-id="xmProject?xmProject.id:null" @row-click="onProjectSelected" @clear="onProjectClear"></xm-project-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="listXmProjectStateHis">查询</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 { listXmProjectStateHis } from '@/api/xm/core/xmProjectStateHis'; |
||||
|
import XmProjectSelect from '@/views/xm/core/components/XmProjectSelect';//新增界面 |
||||
|
export default { |
||||
|
|
||||
|
components: { |
||||
|
XmProjectSelect, |
||||
|
}, |
||||
|
props:['xmProduct','xmProject'], |
||||
|
computed: { |
||||
|
...mapGetters([ |
||||
|
'userInfo','roles' |
||||
|
]), |
||||
|
datesCpd(){ |
||||
|
if(this.xmProjectStateHiss.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return this.xmProjectStateHiss.map(i=>i.bizDate) |
||||
|
} |
||||
|
}, |
||||
|
menuCloseCntCpd(){ |
||||
|
if(this.xmProjectStateHiss.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return this.xmProjectStateHiss.map(i=>i.menuCloseCnt) |
||||
|
} |
||||
|
}, |
||||
|
menuUnstartCntCpd(){ |
||||
|
if(this.xmProjectStateHiss.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return this.xmProjectStateHiss.map(i=> i.menuUnstartCnt) |
||||
|
} |
||||
|
}, |
||||
|
menuExecCntCpd(){ |
||||
|
if(this.xmProjectStateHiss.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return this.xmProjectStateHiss.map(i=> i.menuExecCnt) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
menuFinishCntCpd(){ |
||||
|
if(this.xmProjectStateHiss.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return this.xmProjectStateHiss.map(i=>i.menuFinishCnt) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
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, |
||||
|
xmProjectStateHiss:[], |
||||
|
|
||||
|
}//end return |
||||
|
},//end data |
||||
|
methods: { |
||||
|
listXmProjectStateHis(){ |
||||
|
if(!this.filters.project){ |
||||
|
this.$notify({position:'bottom-left',showClose:true,message:'请先选中项目',type:'warning'}) |
||||
|
return; |
||||
|
} |
||||
|
var params={projectId: this.filters.project.id,orderBy:'biz_date asc'} |
||||
|
|
||||
|
if(this.filters.startBizDate && this.filters.endBizDate){ |
||||
|
params.startBizDate=this.filters.startBizDate; |
||||
|
params.endBizDate=this.filters.endBizDate; |
||||
|
} |
||||
|
listXmProjectStateHis(params).then(res=>{ |
||||
|
this.xmProjectStateHiss=res.data.tips.isOk?res.data.data:this.xmProjectStateHiss; |
||||
|
}) |
||||
|
}, |
||||
|
open(params){ |
||||
|
this.visible=true; |
||||
|
this.filters.product=params.xmProduct |
||||
|
this.filters.project=params.xmProject |
||||
|
this.filters.Product=params.xmProduct |
||||
|
if(this.$refs['xmProjectSelect'])this.$refs['xmProjectSelect'].clearSelect(); |
||||
|
this.$nextTick(()=>{ |
||||
|
this.listXmProjectStateHis(); |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
drawCharts() { |
||||
|
this.myChart = this.$echarts.init(document.getElementById("menuDayTrend")); |
||||
|
this.myChart.setOption( |
||||
|
{ |
||||
|
legend: { |
||||
|
right: 40, |
||||
|
data: ['未开始故事数','执行中故事数','已完成故事数','已关闭故事数'] |
||||
|
}, |
||||
|
xAxis: { |
||||
|
type: 'category', |
||||
|
data: this.datesCpd |
||||
|
}, |
||||
|
yAxis: { |
||||
|
type: 'value' |
||||
|
}, |
||||
|
series: [ |
||||
|
{ |
||||
|
name:'未开始故事数', |
||||
|
data: this.menuUnstartCntCpd, |
||||
|
type: 'line', |
||||
|
smooth: true, |
||||
|
itemStyle: { |
||||
|
normal: { |
||||
|
// 折点颜色样式 |
||||
|
color: 'orange', |
||||
|
lineStyle: { |
||||
|
// 折线颜色样式 |
||||
|
color: 'orange' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
name:'执行中故事数', |
||||
|
data: this.menuExecCntCpd, |
||||
|
type: 'line', |
||||
|
smooth: true, |
||||
|
itemStyle: { |
||||
|
normal: { |
||||
|
// 折点颜色样式 |
||||
|
color: 'blue', |
||||
|
lineStyle: { |
||||
|
// 折线颜色样式 |
||||
|
color: 'blue' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
name:'已完成故事数', |
||||
|
data: this.menuFinishCntCpd, |
||||
|
type: 'line', |
||||
|
smooth: true, |
||||
|
itemStyle: { |
||||
|
normal: { |
||||
|
// 折点颜色样式 |
||||
|
color: 'green', |
||||
|
lineStyle: { |
||||
|
// 折线颜色样式 |
||||
|
color: 'green' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
name:'已关闭故事数', |
||||
|
data: this.menuCloseCntCpd, |
||||
|
type: 'line', |
||||
|
smooth: true, |
||||
|
itemStyle: { |
||||
|
normal: { |
||||
|
// 折点颜色样式 |
||||
|
color: 'red', |
||||
|
lineStyle: { |
||||
|
// 折线颜色样式 |
||||
|
color: 'red' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
) |
||||
|
}, |
||||
|
|
||||
|
onProjectSelected(project){ |
||||
|
this.filters.project=project |
||||
|
this.xmProjectStateHiss=[]; |
||||
|
this.listXmProjectStateHis(); |
||||
|
}, |
||||
|
|
||||
|
onProjectClear(){ |
||||
|
this.filters.project=null |
||||
|
|
||||
|
this.xmProjectStateHiss=[]; |
||||
|
|
||||
|
}, |
||||
|
},//end method |
||||
|
mounted() { |
||||
|
/** |
||||
|
initSimpleDicts('all',['planType','xmTaskSettleSchemel','taskType','priority','taskState'] ).then(res=>{ |
||||
|
this.dicts=res.data.data; |
||||
|
}) |
||||
|
*/ |
||||
|
//this.charts(); |
||||
|
//this.drawCharts(); |
||||
|
|
||||
|
}//end mounted |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.image { |
||||
|
width: 100%; |
||||
|
display: block; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,247 @@ |
|||||
|
<template> |
||||
|
<section> |
||||
|
<el-dialog :title="(filters.project?'【'+filters.project.name+'】':'')+'任务排行榜'" 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="xmTaskSort" |
||||
|
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 label="分组属性"> |
||||
|
<el-select v-model="groupBy" @change="onXmTaskSomeFieldsChange('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> |
||||
|
<xm-project-select class="padding" v-if="!xmProject" ref="xmProjectSelect" style="display:inline;" :auto-select="false" :link-project-id="xmProject?xmProject.id:null" @row-click="onProjectSelected" :iterationId="xmIteration?xmIteration.id:null" @clear="onProjectClear"></xm-project-select> |
||||
|
<el-form-item label="任务状态" prop="taskState"> |
||||
|
<el-select v-model="filters.taskState" @change="onXmTaskSomeFieldsChange('taskState',$event)" clearable> |
||||
|
<el-option v-for="i in this.dicts.taskState" :label="i.name" :key="i.id" :value="i.id"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="任务类型" prop="taskType" > |
||||
|
<el-select v-model="filters.taskType" @change="onXmTaskSomeFieldsChange('taskType',$event)" clearable> |
||||
|
<el-option v-for="i in this.dicts.taskType" :label="i.name" :key="i.id" :value="i.id"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="任务来源" prop="planType"> |
||||
|
<el-select v-model="filters.planType" @change="onXmTaskSomeFieldsChange('planType',$event)" clearable> |
||||
|
<el-option v-for="i in this.dicts.planType" :label="i.name" :key="i.id" :value="i.id"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="任务层次" prop="settleSchemel" > |
||||
|
<el-select v-model="filters.settleSchemel" @change="onXmTaskSomeFieldsChange('settleSchemel',$event)" clearable> |
||||
|
<el-option v-for="i in this.dicts.xmTaskSettleSchemel" :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="onXmTaskSomeFieldsChange('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="searchXmTaskSort">查询</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 { getXmTaskSort } from '@/api/xm/core/xmTask'; |
||||
|
|
||||
|
import XmProjectSelect from '@/views/xm/core/components/XmProjectSelect';//新增界面 |
||||
|
|
||||
|
export default { |
||||
|
|
||||
|
components: { |
||||
|
XmProjectSelect, |
||||
|
}, |
||||
|
props:['xmProduct','xmIteration','xmProject'], |
||||
|
computed: { |
||||
|
...mapGetters([ |
||||
|
'userInfo','roles' |
||||
|
]), |
||||
|
xmTaskSortsCpd(){ |
||||
|
if(this.xmTaskSorts.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return this.xmTaskSorts.map(i=>i.value) |
||||
|
} |
||||
|
}, |
||||
|
title(){ |
||||
|
return this.groupBys.find(i=>i.id==this.groupBy).name+'任务数量排行榜' |
||||
|
}, |
||||
|
legendCpd(){ |
||||
|
if(this.xmTaskSorts.length==0){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return this.xmTaskSorts.map(i=>i.name) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
watch: { |
||||
|
xmTaskSortsCpd(){ |
||||
|
this.drawCharts(); |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
filters:{ |
||||
|
product:null, |
||||
|
iteration:null, |
||||
|
}, |
||||
|
groupBy:'create_userid', |
||||
|
groupBys:[ |
||||
|
{id:'create_userid', name:'创建人'}, |
||||
|
{id:'executor_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, |
||||
|
xmTaskSorts:[], |
||||
|
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("xmTaskSort")); |
||||
|
this.myChart.setOption( |
||||
|
{ |
||||
|
xAxis: { |
||||
|
type: 'category', |
||||
|
data: this.legendCpd |
||||
|
}, |
||||
|
yAxis: { |
||||
|
type: 'value' |
||||
|
}, |
||||
|
series: [ |
||||
|
{ |
||||
|
data: this.xmTaskSortsCpd, |
||||
|
type: 'bar' |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
) |
||||
|
}, |
||||
|
onXmTaskSomeFieldsChange(fieldName,$event){ |
||||
|
this.xmTaskSorts=[] |
||||
|
}, |
||||
|
searchXmTaskSort(){ |
||||
|
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.taskType){ |
||||
|
params.taskType=this.filters.taskType |
||||
|
} |
||||
|
if(this.filters.taskState){ |
||||
|
params.taskState=this.filters.taskState |
||||
|
} |
||||
|
if(this.filters.planType){ |
||||
|
params.planType=this.filters.planType |
||||
|
} |
||||
|
if(this.filters.settleSchemel){ |
||||
|
params.settleSchemel=this.filters.settleSchemel |
||||
|
} |
||||
|
if(this.filters.priority){ |
||||
|
params.priority=this.filters.priority |
||||
|
} |
||||
|
params.groupBy=this.groupBy |
||||
|
if(this.filters.project){ |
||||
|
params.projectId=this.filters.project.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(","); |
||||
|
} |
||||
|
getXmTaskSort(params).then(res=>{ |
||||
|
this.xmTaskSorts=res.data.data |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
onProjectSelected(project){ |
||||
|
this.filters.project=project |
||||
|
}, |
||||
|
|
||||
|
onProjectClear(){ |
||||
|
this.filters.project=null |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
onIterationSelected(iteration){ |
||||
|
this.filters.iteration=iteration |
||||
|
}, |
||||
|
|
||||
|
onIterationClear(){ |
||||
|
this.filters.iteration=null |
||||
|
} |
||||
|
},//end method |
||||
|
mounted() { |
||||
|
initSimpleDicts('all',['planType','xmTaskSettleSchemel','taskType','priority','taskState'] ).then(res=>{ |
||||
|
this.dicts=res.data.data; |
||||
|
}) |
||||
|
//this.charts(); |
||||
|
//this.drawCharts(); |
||||
|
|
||||
|
}//end mounted |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.image { |
||||
|
width: 100%; |
||||
|
display: block; |
||||
|
} |
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue