|
@@ -24,10 +24,15 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-if="title !=='缺陷'" class="statistics-chart">
|
|
|
- <h2>未上线{{ title }}状态分布</h2>
|
|
|
+ <!-- <h2>未上线{{ title }}状态分布</h2> -->
|
|
|
+ <el-radio-group v-model="itemType" @change="onChangeTagRadio">
|
|
|
+ <el-radio-button label="0">未上线{{ title }}状态分布</el-radio-button>
|
|
|
+ <el-radio-button label="1">本周{{ title }}状态流入图</el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
<h3 @click="getAll()">总数:<span>{{ totalTask }}</span></h3>
|
|
|
<div class="chart-contain">
|
|
|
- <normal-echart v-if="echartsOption" :chart-id="type+title" :option="echartsOption" @onClick="chartChange" />
|
|
|
+ <status-stay-chart :chart-data="echartsOption" @onClick="chartChange" />
|
|
|
+ <!-- <normal-echart v-if="echartsOption" :chart-id="type+title" :option="echartsOption" @onClick="chartChange" /> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-if="title ==='缺陷'" class="statistics-chart">
|
|
@@ -57,9 +62,13 @@
|
|
|
|
|
|
<script>
|
|
|
import normalEchart from '@/components/chart/normalEchart'
|
|
|
+import statusStayChart from '@/components/chart/statusStayChart'
|
|
|
export default {
|
|
|
name: 'StatisticsSectionVue',
|
|
|
- components: { normalEchart },
|
|
|
+ components: {
|
|
|
+ normalEchart,
|
|
|
+ statusStayChart
|
|
|
+ },
|
|
|
props: {
|
|
|
searchForm: { // 搜索项的信息
|
|
|
type: Object,
|
|
@@ -95,6 +104,7 @@ export default {
|
|
|
echartsOption2: null,
|
|
|
totalTask: 0, // 所有总数
|
|
|
totalIdList: 0, // 所有总数的idList
|
|
|
+ itemType: '0', // 0: 未上线的需求分布 1: 本周状态流入图
|
|
|
tips: {
|
|
|
'需求': [
|
|
|
'交付日期为今天,且状态仍未变更为“已上线”的需求数量(不包含当前状态为hold的需求)。',
|
|
@@ -143,10 +153,14 @@ export default {
|
|
|
this.getChart(requestChart, '3')
|
|
|
this.getChart(requestChart, '5')
|
|
|
} else {
|
|
|
- this.getChart(requestChart)
|
|
|
+ this.getChart(requestChart, this.itemType)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ onChangeTagRadio(e) {
|
|
|
+ const { requestChart } = this.requestObj
|
|
|
+ this.getChart(requestChart, this.itemType)
|
|
|
+ },
|
|
|
async getData(requestUrl) { // 获取顶部数据
|
|
|
const res = await requestUrl({ teamSearchInfo: this.searchForm })
|
|
|
if (res.code === 200) {
|
|
@@ -165,18 +179,16 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async getChart(requestUrl, type) { // 获取图表数据
|
|
|
- if (type) {
|
|
|
- const res = await requestUrl({ teamSearchInfo: this.searchForm, type: type })
|
|
|
- if (type === '3') {
|
|
|
- this.echartsOption = this.setChart(res.data)
|
|
|
- } else if (type === '5') {
|
|
|
- this.echartsOption2 = this.setChart(res.data)
|
|
|
- }
|
|
|
+ const res = await requestUrl({ teamSearchInfo: this.searchForm, type: type })
|
|
|
+ if (type === '3') {
|
|
|
+ this.echartsOption = this.setChart(res.data)
|
|
|
+ } else if (type === '5') {
|
|
|
+ this.echartsOption2 = this.setChart(res.data)
|
|
|
} else {
|
|
|
- const res = await requestUrl({ teamSearchInfo: this.searchForm })
|
|
|
+ const res = await requestUrl({ teamSearchInfo: this.searchForm, type })
|
|
|
this.totalTask = res.data.total
|
|
|
this.totalIdList = res.data.idList
|
|
|
- this.echartsOption = this.setChart(res.data)
|
|
|
+ this.echartsOption = { ...res.data, type: this.itemType }
|
|
|
}
|
|
|
},
|
|
|
setChart(chartData) { // 设置图表options
|
|
@@ -204,8 +216,17 @@ export default {
|
|
|
this.changeData(this.totalIdList, `未上线的`)
|
|
|
},
|
|
|
chartChange(params) { // 点击图表产生触发列表更改
|
|
|
+ let idList = params.data.idList || []
|
|
|
+ // 本周需求状态流入图需要特殊处理。循环出对应下标的idlist
|
|
|
+ if (this.itemType === '1') {
|
|
|
+ // console.log(this.echartsOption.xaxis)
|
|
|
+ const dataIndex = params.dataIndex
|
|
|
+ this.echartsOption.yaxis.forEach(t => {
|
|
|
+ idList = [...idList, ...t.idList[dataIndex]]
|
|
|
+ })
|
|
|
+ }
|
|
|
this.clickItem = -1
|
|
|
- this.changeData(params.data.idList, params.name)
|
|
|
+ this.changeData(idList, params.name)
|
|
|
},
|
|
|
changeData(idList, name) { // 点击顶部数据触发列表更改
|
|
|
this.$emit('change', this.title, idList, name)
|