fix: 链路下钻接口请求参数调整,桑基图拖拽功能禁用

This commit is contained in:
@changcode
2022-10-10 15:30:14 +08:00
parent 442f65743a
commit 59467c7f6b
3 changed files with 28 additions and 12 deletions

View File

@@ -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) {

View File

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

View File

@@ -456,10 +456,8 @@ export const linksTrafficSankeyOption = {
label: {
color: 'rgba(0,0,0,0.7)',
fontSize: 12
}
// emphasis: {
// focus: 'adjacency'
// }
},
draggable: false
}
]
}