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

View File

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

View File

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