diff --git a/src/views/charts2/charts/linkMonitor/LinkTrafficSankey.vue b/src/views/charts2/charts/linkMonitor/LinkTrafficSankey.vue
index d1042300..f77b8ec6 100644
--- a/src/views/charts2/charts/linkMonitor/LinkTrafficSankey.vue
+++ b/src/views/charts2/charts/linkMonitor/LinkTrafficSankey.vue
@@ -3,22 +3,22 @@
-
+
-
+
-
+
External Locations
Next-Hop Internets
Links
Internal Locations
-
+
Internal Locations
Links
Next-Hop Internets
@@ -41,6 +41,7 @@ import { overwriteUrl, urlParamsHandler } from '@/utils/tools'
import unitConvert from '@/utils/unit-convert'
import { storageKey, unitTypes } from '@/utils/constants'
import ChartError from '@/components/common/Error'
+import _ from 'lodash'
export default {
name: 'LinksTrafficSankey',
@@ -63,13 +64,14 @@ export default {
data () {
return {
timer: null,
- ingress: false,
- egress: false,
+ ingressNoData: false,
+ egressNoData: false,
unitConvert,
unitTypes,
cnLinkInfo: JSON.parse(localStorage.getItem(storageKey.linkInfo)),
showError: false,
- errorMsg: ''
+ errorMsg: '',
+ chartOption: null
}
},
watch: {
@@ -116,20 +118,32 @@ export default {
const res = response.data
if (response.status === 200) {
this.showError = false
- if (n === 0) {
- this.ingress = res.data.result.length === 0
+ let noData
+ if (res.data.result.length === 0) {
+ noData = true
} else {
- this.egress = res.data.result.length === 0
+ if (n === 0) {
+ noData = !res.data.result.some(d => d.inBitsRate > 0)
+ } else {
+ noData = !res.data.result.some(d => d.outBitsRate > 0)
+ }
+ }
+ if (n === 0) {
+ this.ingressNoData = noData
+ } else {
+ this.egressNoData = noData
+ }
+ if (!noData) {
+ this.dataProcessing(res.data.result, parseInt(n))
}
- this.dataProcessing(res.data.result, parseInt(n))
} else {
this.showError = true
this.errorMsg = this.errorMsgHandler(res)
}
}).catch(e => {
console.error(e)
- this.egress = false
- this.ingress = false
+ this.egressNoData = false
+ this.ingressNoData = false
this.showError = true
this.errorMsg = this.errorMsgHandler(e)
}).finally(() => {
@@ -144,7 +158,7 @@ export default {
t.linkId = e.linkId
t.linkDirection = e.nextHop
t.bandwidth = e.bandwidth
- t.value = parseInt(t.inBitsRate)
+ t.value = _.round(Number(t.inBitsRate), 2)
t.external = `e_${t.externalLocation}`
t.internal = `i_${t.internalLocation}`
}
@@ -157,7 +171,7 @@ export default {
t.linkId = e.linkId
t.bandwidth = e.bandwidth
t.linkDirection = e.nextHop
- t.value = parseInt(t.outBitsRate)
+ t.value = _.round(Number(t.outBitsRate), 2)
t.external = `e_${t.externalLocation}`
t.internal = `i_${t.internalLocation}`
}
@@ -448,12 +462,9 @@ export default {
}
},
mounted () {
- this.myChart = null
- this.myChart2 = null
- this.chartOption = null
this.timer = setTimeout(() => {
this.linkTrafficSankeyDataRequest(this.tab)
- }, 100)
+ }, 200)
window.addEventListener('resize', this.resize)
},
beforeUnmount () {