|
@@ -102,7 +102,7 @@
|
|
|
<h3>状态累积流量图</h3>
|
|
|
<status-chart :chart-data="cumulativeData" />
|
|
|
</div>
|
|
|
- <el-tabs v-model="activeTab" class="tab-change">
|
|
|
+ <el-tabs v-model="activeTab" class="tab-change" @tab-click="onSubmit">
|
|
|
<el-tab-pane name="1">
|
|
|
<span slot="label" class="tab-item">累计新增</span>
|
|
|
</el-tab-pane>
|
|
@@ -114,10 +114,6 @@
|
|
|
<h3>新增趋势图</h3>
|
|
|
<tendency-chart :chart-data="tendencyData" />
|
|
|
</div>
|
|
|
- <div class="chart-item">
|
|
|
- <h3>所属需求方向分布图</h3>
|
|
|
- <belong-chart :chart-data="orntDistributeData" />
|
|
|
- </div>
|
|
|
<div class="chart-item">
|
|
|
<h3>周期统计<span>(根据排期计算)</span></h3>
|
|
|
<div class="chart-item-tip">
|
|
@@ -132,6 +128,7 @@
|
|
|
<i class="el-icon-warning-outline" />
|
|
|
<span>仅统计状态已变更“已排期”且排期不为空的任务;横坐标表示任务交付日期,纵坐标代表研发交付周期(研发、联调、上线类型排期的总周期)</span>
|
|
|
</div>
|
|
|
+ <development-cycle :chart-data="developmentCycleData" />
|
|
|
</div>
|
|
|
<div class="chart-item">
|
|
|
<h3>需求分布图</h3>
|
|
@@ -139,6 +136,7 @@
|
|
|
:chart-data="distributeData"
|
|
|
:status-list="distributeStatusList"
|
|
|
:status.sync="distributeStatus"
|
|
|
+ :active-tab="activeTab"
|
|
|
@change="getDistributeData()"
|
|
|
/>
|
|
|
</div>
|
|
@@ -146,6 +144,10 @@
|
|
|
<h3>状态停留分布图</h3>
|
|
|
<status-stay-chart :chart-data="statusStayData" />
|
|
|
</div>
|
|
|
+ <!-- <div class="chart-item">
|
|
|
+ <h3>需求方向分布图</h3>
|
|
|
+ <belong-chart :chart-data="orntDistributeData" />
|
|
|
+ </div> -->
|
|
|
</el-main>
|
|
|
</el-container>
|
|
|
</template>
|
|
@@ -154,13 +156,12 @@ import moment from 'moment'
|
|
|
moment.locale('zh-cn')
|
|
|
import { settingQueryBizRqmtOrntList } from '@/api/requirement'
|
|
|
import { teamQueryTeamInfoList } from '@/api/configure'
|
|
|
-import {
|
|
|
- getBugCountTrend,
|
|
|
- getRepairTimeSumData
|
|
|
-} from '@/api/defectStatistics'
|
|
|
import {
|
|
|
getSummary,
|
|
|
- CumulativeFlowDiagram,
|
|
|
+ getCumulativeFlowDiagram,
|
|
|
+ getRequireCountTrend,
|
|
|
+ getRequirePeriodicData,
|
|
|
+ getRequireRdDeliveryPeriodicData,
|
|
|
getDistributeData,
|
|
|
getStatusStayData,
|
|
|
getOrntDistributeData
|
|
@@ -168,17 +169,19 @@ import {
|
|
|
import statusChart from './components/statusChart'
|
|
|
import tendencyChart from './components/tendencyChart'
|
|
|
import cycleStatistic from './components/cycleStatistic'
|
|
|
+import developmentCycle from './components/developmentCycle'
|
|
|
import distributionChart from './components/distributionChart'
|
|
|
import statusStayChart from './components/statusStayChart'
|
|
|
-import belongChart from './components/belongChart'
|
|
|
+// import belongChart from './components/belongChart'
|
|
|
export default {
|
|
|
components: {
|
|
|
statusChart,
|
|
|
tendencyChart,
|
|
|
cycleStatistic,
|
|
|
+ developmentCycle,
|
|
|
distributionChart,
|
|
|
- statusStayChart,
|
|
|
- belongChart
|
|
|
+ statusStayChart
|
|
|
+ // belongChart
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -198,6 +201,7 @@ export default {
|
|
|
cumulativeData: null, // 需求状态累计流数据
|
|
|
tendencyData: null, // 趋势图数据
|
|
|
cycleData: [], // 周期统计数据
|
|
|
+ developmentCycleData: [], // 研发交付周期分布数据
|
|
|
distributeStatus: 1, // 需求分布图需求状态
|
|
|
distributeStatusList: [
|
|
|
{ code: 1, label: '需求状态' },
|
|
@@ -208,7 +212,8 @@ export default {
|
|
|
], // 需求分布图需求状态列表
|
|
|
orntDistributeData: null, // 所属需求方向数据
|
|
|
distributeData: null, // 需求分布图数据
|
|
|
- statusStayData: null // 状态停留图数据
|
|
|
+ statusStayData: null, // 状态停留图数据
|
|
|
+ moduleDistribute: null // 模块分布图数据
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -225,6 +230,26 @@ export default {
|
|
|
}
|
|
|
return params
|
|
|
}
|
|
|
+ },
|
|
|
+ timeType: {
|
|
|
+ get() {
|
|
|
+ let timeType = 0
|
|
|
+ switch (this.dateType) {
|
|
|
+ case 'week':
|
|
|
+ timeType = 1
|
|
|
+ break
|
|
|
+ case 'month':
|
|
|
+ timeType = 2
|
|
|
+ break
|
|
|
+ case 'year':
|
|
|
+ timeType = 3
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ timeType = 0
|
|
|
+ break
|
|
|
+ }
|
|
|
+ return timeType
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -238,10 +263,14 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
onSubmit() {
|
|
|
+ if (this.activeTab === '2' && this.distributeStatus === 1) {
|
|
|
+ this.distributeStatus = 2
|
|
|
+ }
|
|
|
this.getSummary()
|
|
|
this.getCumulativeFlowDiagram()
|
|
|
- this.defectTrendTimeChange()
|
|
|
+ this.getRequireCountTrend()
|
|
|
this.getCycleData()
|
|
|
+ this.getDevelopmentCycle()
|
|
|
this.getOrntDistributeData()
|
|
|
this.getDistributeData()
|
|
|
this.getStatusStayData()
|
|
@@ -293,51 +322,40 @@ export default {
|
|
|
const res = await getSummary(this.globalParams)
|
|
|
if (res.code === 200) this.Summary = res.data || []
|
|
|
},
|
|
|
- async defectTrendTimeChange() { // 趋势图日期变动
|
|
|
- const rqmtOrntIds = this.chartForm.rqmtOrntIds
|
|
|
+ async getRequireCountTrend() { // 趋势图日期变动
|
|
|
const params = {
|
|
|
- beginTime: this.stratAndEnd[0] || null,
|
|
|
- endTime: this.stratAndEnd[1] || null,
|
|
|
- bizId: Number(localStorage.getItem('bizId')),
|
|
|
- teamIds: this.chartForm.team || null,
|
|
|
- rqmtOrntIds: rqmtOrntIds && rqmtOrntIds.length > 0 ? rqmtOrntIds : null,
|
|
|
- timeType: this.bugCountTimeType
|
|
|
+ ...this.globalParams,
|
|
|
+ type: Number(this.activeTab),
|
|
|
+ timeType: this.timeType
|
|
|
}
|
|
|
- const res = await getBugCountTrend(params)
|
|
|
+ const res = await getRequireCountTrend(params)
|
|
|
if (res.code === 200) this.tendencyData = res.data
|
|
|
},
|
|
|
async getCumulativeFlowDiagram() { // 需求状态累计流图
|
|
|
- let timeType = 0
|
|
|
- switch (this.dateType) {
|
|
|
- case 'week':
|
|
|
- timeType = 1
|
|
|
- break
|
|
|
- case 'month':
|
|
|
- timeType = 2
|
|
|
- break
|
|
|
- case 'year':
|
|
|
- timeType = 3
|
|
|
- break
|
|
|
- default:
|
|
|
- timeType = 0
|
|
|
- break
|
|
|
- }
|
|
|
const params = {
|
|
|
...this.globalParams,
|
|
|
- timeType: timeType
|
|
|
+ timeType: this.timeType
|
|
|
}
|
|
|
- const res = await CumulativeFlowDiagram(params)
|
|
|
+ const res = await getCumulativeFlowDiagram(params)
|
|
|
if (res.code === 200) this.cumulativeData = res.data
|
|
|
},
|
|
|
async getCycleData() { // 周期统计数据
|
|
|
const params = {
|
|
|
...this.globalParams,
|
|
|
- type: 1
|
|
|
+ type: Number(this.activeTab)
|
|
|
}
|
|
|
- const res = await getRepairTimeSumData(params)
|
|
|
+ const res = await getRequirePeriodicData(params)
|
|
|
if (res.code === 200) this.cycleData = res.data
|
|
|
},
|
|
|
- async getDistributeData() { // 获取需求统计
|
|
|
+ async getDevelopmentCycle() { // 获取研发交付周期分布数据
|
|
|
+ const params = {
|
|
|
+ ...this.globalParams,
|
|
|
+ type: Number(this.activeTab)
|
|
|
+ }
|
|
|
+ const res = await getRequireRdDeliveryPeriodicData(params)
|
|
|
+ if (res.code === 200) this.developmentCycleData = res.data
|
|
|
+ },
|
|
|
+ async getDistributeData() { // 获取需求分布图
|
|
|
const params = {
|
|
|
...this.globalParams,
|
|
|
type: Number(this.activeTab),
|
|
@@ -360,12 +378,23 @@ export default {
|
|
|
type: Number(this.activeTab)
|
|
|
}
|
|
|
const res = await getOrntDistributeData(params)
|
|
|
- if (res.code === 200) {
|
|
|
- this.orntDistributeData = {
|
|
|
- xaxis: res.data.map(item => item.name),
|
|
|
- yaxis: [{ data: res.data.map(item => item.count) }]
|
|
|
+ if (res.code === 200) this.orntDistributeData = this.handlerData(res.data)
|
|
|
+ },
|
|
|
+ handlerData(arr) { // 处理需求方向分布图数据
|
|
|
+ let num = 0
|
|
|
+ const bfs = (arr) => {
|
|
|
+ for (const item of arr) {
|
|
|
+ item.count++
|
|
|
+ num = num + item.count
|
|
|
+ if (item.children && item.children.length > 0) {
|
|
|
+ bfs(item.children)
|
|
|
+ } else {
|
|
|
+ delete item.children
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ bfs(arr)
|
|
|
+ return { children: arr, name: '总量', count: num }
|
|
|
}
|
|
|
}
|
|
|
}
|