|
@@ -15,10 +15,9 @@
|
|
|
<div class="backStyle" style="margin-top: 10px;">三. bug情况</div>
|
|
|
<div style="border: 1px,solid #ccc;">
|
|
|
<div style="color: #606266">1、bug统计</div>
|
|
|
- <div style="display:flex;">
|
|
|
- <div id="lineShow" style="flex:2; width: 400px;height:430px;" />
|
|
|
- <div style="flex:1; width: 200px;height:400px;" />
|
|
|
- <div id="barShow" style="flex:2; width: 400px;height:400px;" />
|
|
|
+ <div :class="{'space-between' : xaxisTotal < 7} ">
|
|
|
+ <div id="lineShow" :class="{'backTop' : xaxisTotal < 7,'backLeft' : xaxisTotal > 6}" />
|
|
|
+ <div id="barShow" :class="{'backTop' : xaxisTotal < 7, 'backLeft' : xaxisTotal > 6}" />
|
|
|
</div>
|
|
|
<div style="color: #606266; margin: 1% 0;">2、bug说明</div>
|
|
|
<el-row>
|
|
@@ -26,7 +25,6 @@
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</el-form>
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -76,6 +74,7 @@ export default {
|
|
|
statusMap: [],
|
|
|
statusList: [],
|
|
|
dailys: '',
|
|
|
+ xaxisTotal: 0,
|
|
|
setHeight: 500
|
|
|
}
|
|
|
},
|
|
@@ -83,7 +82,14 @@ export default {
|
|
|
this.getRouterData()
|
|
|
},
|
|
|
mounted() {
|
|
|
-
|
|
|
+ const myChart = echarts.init(document.getElementById('lineShow'))
|
|
|
+ const myChartA = echarts.init(document.getElementById('barShow'))
|
|
|
+ window.addEventListener('resize', () => {
|
|
|
+ if (myChart) {
|
|
|
+ myChart.resize()
|
|
|
+ myChartA.resize()
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
getRouterData() {
|
|
@@ -97,6 +103,11 @@ export default {
|
|
|
this.statusMap = res.data.statusMap
|
|
|
this.statusList = res.data.statusList
|
|
|
this.numList = res.data.bugMap
|
|
|
+ if (this.dateList.length >= 6 || this.statusList.length >= 6) {
|
|
|
+ this.xaxisTotal = 7
|
|
|
+ } else {
|
|
|
+ this.xaxisTotal = 1
|
|
|
+ }
|
|
|
for (var ele of this.numList) {
|
|
|
this.bugName.push(ele.name)
|
|
|
}
|
|
@@ -106,24 +117,27 @@ export default {
|
|
|
color: ['#2F54EB', '#13C2C2', '#F78B16', '#9254DE'],
|
|
|
tooltip: { trigger: 'axis' },
|
|
|
legend: { top: 30, data: this.bugName },
|
|
|
- grid: { left: '5%', right: '10%', bottom: '12%', containLabel: true },
|
|
|
+ grid: { left: '5%', right: '5%', bottom: '12%', containLabel: true },
|
|
|
xAxis: { type: 'category', boundaryGap: true, data: this.dateList, axisLabel: { interval: 0, rotate: 30 }},
|
|
|
yAxis: { type: 'value' },
|
|
|
series: this.numList
|
|
|
})
|
|
|
- }, 500)
|
|
|
+ echarts.init(document.getElementById('lineShow')).resize()
|
|
|
+ }, 1000)
|
|
|
setTimeout(item => {
|
|
|
echarts.init(document.getElementById('barShow')).setOption({
|
|
|
title: { text: 'bug状态汇总', x: 'center' },
|
|
|
color: ['#2F54EB', '#13C2C2', '#F78B16', '#9254DE'],
|
|
|
tooltip: { trigger: 'axis' },
|
|
|
legend: { top: 30, data: this.statusMap },
|
|
|
+ grid: { left: '5%', right: '5%', bottom: '12%', containLabel: true },
|
|
|
xAxis: [{ data: this.statusList, axisLabel: { interval: 0, rotate: 45 }}],
|
|
|
yAxis: [{}],
|
|
|
series: this.statusMap
|
|
|
})
|
|
|
- })
|
|
|
- }, 500)
|
|
|
+ echarts.init(document.getElementById('barShow')).resize()
|
|
|
+ }, 500)
|
|
|
+ })
|
|
|
},
|
|
|
parentHandleclick(e, task, id) {
|
|
|
if (e === 1) {
|
|
@@ -189,4 +203,21 @@ export default {
|
|
|
border-radius: 4px;
|
|
|
margin: 1% 0;
|
|
|
}
|
|
|
+
|
|
|
+ .space-between {
|
|
|
+ display:flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+
|
|
|
+ .backTop {
|
|
|
+ flex:1.5;
|
|
|
+ width: 400px;
|
|
|
+ height:400px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .backLeft {
|
|
|
+ width: 100%;
|
|
|
+ height:400px;
|
|
|
+ }
|
|
|
</style>
|