diff --git a/src/views/charts2/charts/linkMonitor/LinkTrafficSankey.vue b/src/views/charts2/charts/linkMonitor/LinkTrafficSankey.vue index 7d87abca..dbaa78eb 100644 --- a/src/views/charts2/charts/linkMonitor/LinkTrafficSankey.vue +++ b/src/views/charts2/charts/linkMonitor/LinkTrafficSankey.vue @@ -91,8 +91,24 @@ export default { startTime: getSecond(this.timeFilter.startTime), endTime: getSecond(this.timeFilter.endTime) } - if (this.queryCondition) { - params.q = this.queryCondition + let condition = '' + if (this.queryCondition.indexOf(' AND ') > -1) { + condition = this.queryCondition.split(/["'= ](.*?)["'= ]/) + } else { + condition = this.queryCondition + } + if (condition.length > 1 && condition[0] === 'common_egress_link_id') { + if (n == 0) { + params.q = `${condition[0]}=${condition[3]}` + } else { + params.q = `${condition[5]}=${condition[8]}` + } + } else { + if (n == 0) { + params.q = `${condition[0]}=${condition[4]}` + } else { + params.q = `${condition[7]}=${condition[11]}` + } } let url = '' if (n == 0) { diff --git a/src/views/charts2/charts/linkMonitor/localComponents/LinkTrafficDrillDownList.vue b/src/views/charts2/charts/linkMonitor/localComponents/LinkTrafficDrillDownList.vue index 04e2d2f5..21185ccf 100644 --- a/src/views/charts2/charts/linkMonitor/localComponents/LinkTrafficDrillDownList.vue +++ b/src/views/charts2/charts/linkMonitor/localComponents/LinkTrafficDrillDownList.vue @@ -46,14 +46,12 @@ import { ref } from 'vue' import { useRoute } from 'vue-router' import { getSecond } from '@/utils/date-util' import { computeScore } from '@/utils/tools' -import Login from '@/Login' export default { name: 'linkTrafficList', mixins: [chartMixin], setup () { const { query } = useRoute() - // const d = `common_egress_link_id='${256}' AND common_ingress_link_id='${256}'` const queryCondition = ref(query.queryCondition || '') return { queryCondition @@ -94,16 +92,20 @@ export default { this.linkTrafficListData.npmScore = 6 } let condition = '' - if (this.queryCondition.indexOf('AND') > -1) { - condition = this.queryCondition.split(/["|'](.*?)["|']/) + if (this.queryCondition.indexOf(' AND ') > -1) { + condition = this.queryCondition.split(/["'= ](.*?)["'= ]/) } else { condition = this.queryCondition } + let bandwidthAll = 0 this.cnLinkInfo.forEach(e => { - if (condition.length > 1 && condition[1] === e.originalLinkId) { - this.bandWidth = e.bandwidth + if (condition.length > 1 && (condition[3] == e.originalLinkId || condition[8] == e.originalLinkId)) { + bandwidthAll += e.bandwidth + } else if (condition.length > 1 && condition[4] == e.nextHop) { + bandwidthAll += e.bandwidth } }) + this.bandWidth = bandwidthAll } }).catch(e => { console.error(e) diff --git a/src/views/charts2/charts/options/echartOption.js b/src/views/charts2/charts/options/echartOption.js index 52fdb509..13ef9132 100644 --- a/src/views/charts2/charts/options/echartOption.js +++ b/src/views/charts2/charts/options/echartOption.js @@ -456,10 +456,8 @@ export const linksTrafficSankeyOption = { label: { color: 'rgba(0,0,0,0.7)', fontSize: 12 - } - // emphasis: { - // focus: 'adjacency' - // } + }, + draggable: false } ] }