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), startTime: getSecond(this.timeFilter.startTime),
endTime: getSecond(this.timeFilter.endTime) endTime: getSecond(this.timeFilter.endTime)
} }
if (this.queryCondition) { let condition = ''
params.q = this.queryCondition 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 = '' let url = ''
if (n == 0) { if (n == 0) {

View File

@@ -46,14 +46,12 @@ import { ref } from 'vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { getSecond } from '@/utils/date-util' import { getSecond } from '@/utils/date-util'
import { computeScore } from '@/utils/tools' import { computeScore } from '@/utils/tools'
import Login from '@/Login'
export default { export default {
name: 'linkTrafficList', name: 'linkTrafficList',
mixins: [chartMixin], mixins: [chartMixin],
setup () { setup () {
const { query } = useRoute() const { query } = useRoute()
// const d = `common_egress_link_id='${256}' AND common_ingress_link_id='${256}'`
const queryCondition = ref(query.queryCondition || '') const queryCondition = ref(query.queryCondition || '')
return { return {
queryCondition queryCondition
@@ -94,16 +92,20 @@ export default {
this.linkTrafficListData.npmScore = 6 this.linkTrafficListData.npmScore = 6
} }
let condition = '' let condition = ''
if (this.queryCondition.indexOf('AND') > -1) { if (this.queryCondition.indexOf(' AND ') > -1) {
condition = this.queryCondition.split(/["|'](.*?)["|']/) condition = this.queryCondition.split(/["'= ](.*?)["'= ]/)
} else { } else {
condition = this.queryCondition condition = this.queryCondition
} }
let bandwidthAll = 0
this.cnLinkInfo.forEach(e => { this.cnLinkInfo.forEach(e => {
if (condition.length > 1 && condition[1] === e.originalLinkId) { if (condition.length > 1 && (condition[3] == e.originalLinkId || condition[8] == e.originalLinkId)) {
this.bandWidth = e.bandwidth bandwidthAll += e.bandwidth
} else if (condition.length > 1 && condition[4] == e.nextHop) {
bandwidthAll += e.bandwidth
} }
}) })
this.bandWidth = bandwidthAll
} }
}).catch(e => { }).catch(e => {
console.error(e) console.error(e)

View File

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