From aa6d5f1598a8b8c0e0291892ecb917f920dc0b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B4=AA=E6=B4=AA?= <2498601771@qq.com> Date: Wed, 9 Nov 2022 17:41:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=9A=90=E8=97=8F=E6=A1=86=E9=80=89?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../networkOverview/NetworkOverviewLine.vue | 19 +++++++++---------- .../charts2/charts/options/echartOption.js | 9 ++++++--- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/views/charts2/charts/networkOverview/NetworkOverviewLine.vue b/src/views/charts2/charts/networkOverview/NetworkOverviewLine.vue index b441b2f7..7029ad77 100644 --- a/src/views/charts2/charts/networkOverview/NetworkOverviewLine.vue +++ b/src/views/charts2/charts/networkOverview/NetworkOverviewLine.vue @@ -149,7 +149,7 @@ export default { overwriteUrl(newUrl) }, timeFilter: { - handler (n) { + handler () { if (this.lineTab) { this.init(this.metric, this.showMarkLine, 'active') } else { @@ -160,7 +160,7 @@ export default { metric (n) { this.handleActiveBar() this.showMarkLine = !this.showMarkLine - this.mpackets.forEach((e, i) => { + this.mpackets.forEach((e) => { if (!e.invertTab) { e.invertTab = true } @@ -196,7 +196,7 @@ export default { { analysis: {}, name: 'network.other', class: 'other', show: true, invertTab: true, positioning: 5, data: [], unitType: '' } ] } - res.data.result.forEach((t, i) => { + res.data.result.forEach((t) => { if (t.type === 'bytes' && val === 'Bits/s') { const mpackets = _.cloneDeep(this.mpackets) mpackets[0].analysis = t.totalBitsRate.analysis @@ -214,7 +214,7 @@ export default { let num = 0 mpackets.forEach(e => { e.unitType = 'bps' - if (e.name !== 'network.total' && e.analysis.avg == 0) { + if (e.name !== 'network.total' && e.analysis.avg === 0) { e.show = false num += 1 } else { @@ -262,7 +262,7 @@ export default { let num = 0 mpackets.forEach(e => { e.unitType = 'packets/s' - if (e.name !== 'network.total' && e.analysis.avg == 0) { + if (e.name !== 'network.total' && e.analysis.avg === 0) { e.show = false num += 1 } else { @@ -367,7 +367,7 @@ export default { width: 1 }, stack: t.name !== 'network.total' ? 'network.total' : '', - symbolSize: function (value, params) { + symbolSize: function (value) { return _this.symbolSizeSortChange(i, value[0]) }, itemStyle: { @@ -411,7 +411,7 @@ export default { } }) if (!show) { - this.chartOption.series.forEach((t, i) => { + this.chartOption.series.forEach((t) => { t.markLine.label.show = false t.markLine = [] }) @@ -464,7 +464,7 @@ export default { brushOption: { // 参见 brush 组件的 brushType。如果设置为 false 则关闭“可刷选状态”。 brushType: 'lineX', - xAxisIndex: 0, + xAxisIndex: 'all', // 单击清除选框 brushMode: 'single', // 选择完毕再返回所选数据 @@ -482,7 +482,6 @@ export default { if (!self.mouseDownFlag) { // 避免点击空白区域报错 if (params.areas !== undefined && params.areas.length > 0) { - // 因为人工选择不可能出现框选范围和x轴重合的情况 self.brushHistory.unshift({ startTime: _.cloneDeep(self.timeFilter.startTime) * 1000, endTime: _.cloneDeep(self.timeFilter.endTime) * 1000 @@ -558,7 +557,7 @@ export default { }) } }, - handleActiveBar (value) { + handleActiveBar () { if (document.querySelector('.network .line-value-mpackets.is-active')) { const { offsetLeft, clientWidth, clientLeft } = document.querySelector('.network .line-value-mpackets.is-active') const activeBar = document.querySelector('.network .line-value-active') diff --git a/src/views/charts2/charts/options/echartOption.js b/src/views/charts2/charts/options/echartOption.js index 439d97f4..c972bb96 100644 --- a/src/views/charts2/charts/options/echartOption.js +++ b/src/views/charts2/charts/options/echartOption.js @@ -44,7 +44,7 @@ export const pieChartOption1 = { const data = pieChartOption1.series[0].data let value data.forEach(t => { - if (t.name == name) { + if (t.name === name) { value = t.value } }) @@ -103,7 +103,7 @@ export const pieChartOption2 = { const data = pieChartOption2.series[0].data let value data.forEach(t => { - if (t.name == name) { + if (t.name === name) { value = t.value } }) @@ -164,9 +164,12 @@ export const stackedLineChartOption = { trigger: 'axis', className: 'echarts-tooltip echarts-tooltip-dark' }, + toolbox: { + show: false + }, brush: { toolbox: ['lineX'], - xAxisIndex: 0, + xAxisIndex: 'all', throttleType: 'debounce', transformable: false },