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

@@ -141,7 +141,9 @@ export const api = {
eventType: '/interface/overview/eventType',
ddosEventAnalysis: '/interface/overview/ddosEventAnalysis',
applicationCycleTrafficTotal: '/interface/overview/applicationCycleTrafficTotal',
appCompanyTrafficAnalysis: '/interface/overview/appCompanyTrafficAnalysis'
applicationTrafficAnalysis: '/interface/overview/applicationTrafficAnalysis',
appCompanyTrafficAnalysis: '/interface/overview/appCompanyTrafficAnalysis',
appCompanyCycleTrafficTotal: '/interface/overview/appCompanyCycleTrafficTotal'
}
}

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)
}

View File

@@ -553,6 +553,7 @@ export default {
this.$emit('getChartData', this.getCurUrl(), queryParams)
},
handleTabValue (columnName, columnValue) {
this.emitter.emit('get-chart-data', columnValue)
const oldCurTab = this.$store.getters.getNetworkOverviewBeforeTab
const tabGroup = this.list.filter(item => item.label === columnName)
if (tabGroup && tabGroup.length > 0) {
@@ -699,7 +700,7 @@ export default {
}
}
this.loading = true
this.$emit('getChartData', this.getCurUrl(), queryParams)
this.$emit('getChartData', this.getCurUrl(), queryParams, queryParams.q)
}
},
getCurUrl () {

View File

@@ -178,6 +178,9 @@ export const stackedLineChartOption = {
yAxis: [
{
type: 'value',
splitLine: {
show: false
},
axisLabel: {
formatter: function (value) {
return unitConvert(value, unitTypes.number).join('')