fix: 修复部分问题

This commit is contained in:
@changcode
2022-08-05 17:40:39 +08:00
parent 81e071cc93
commit 3ff3bfc220
4 changed files with 18 additions and 6 deletions

View File

@@ -122,8 +122,8 @@ export default {
sizes: [3, 4, 6, 8, 9, 10],
echartsLabelValue: '',
echartsType: 'Bits/s',
echartsData: {}
echartsData: {},
dynamicVariable: ''
}
},
watch: {
@@ -134,7 +134,7 @@ export default {
}
},
methods: {
init (val) {
init (val, n) {
if (!val) {
val = 'Bits/s'
}
@@ -142,6 +142,9 @@ export default {
startTime: getSecond(this.timeFilter.startTime),
endTime: getSecond(this.timeFilter.endTime)
}
if (n) {
params.q = n
}
get(api.netWorkOverview.totalTrafficAnalysis, params).then((res) => {
if (res.code === 200) {
res.data.result.forEach((t, i) => {
@@ -342,7 +345,6 @@ export default {
}
this.legendSelectChange(t, 0)
})
this.activeShow = 'total'
} else if (!this.activeShow) {
this.mpackets.forEach((t, i) => {
t.show = true
@@ -401,6 +403,10 @@ export default {
}
},
mounted () {
const _this = this
this.emitter.on('get-chart-data', function (value) {
_this.init('', value)
})
if (this.chart) {
this.echartsData = _.cloneDeep(this.chart)
}