fix: link-monitor 折线图,桑基图下钻 根据文档增加下钻参数接收
This commit is contained in:
@@ -48,6 +48,7 @@ export default {
|
|||||||
setup () {
|
setup () {
|
||||||
const { query } = useRoute()
|
const { query } = useRoute()
|
||||||
const tab = ref(query.tabIndex || 0)
|
const tab = ref(query.tabIndex || 0)
|
||||||
|
// const d = `egress_link_direction='${256}' AND ingress_link_direction='${256}' `
|
||||||
const queryCondition = ref(query.queryCondition || '')
|
const queryCondition = ref(query.queryCondition || '')
|
||||||
return {
|
return {
|
||||||
tab,
|
tab,
|
||||||
|
|||||||
@@ -73,12 +73,12 @@ export default {
|
|||||||
const { query } = useRoute()
|
const { query } = useRoute()
|
||||||
const lineMetric = ref(query.lineMetric || 'Bits/s')
|
const lineMetric = ref(query.lineMetric || 'Bits/s')
|
||||||
const lineTab = ref(query.lineTab || '')
|
const lineTab = ref(query.lineTab || '')
|
||||||
const d = `common_egress_link_id='${246}' AND common_ingress_link_id='${246}'`
|
// const d = `common_egress_link_id='${246}' AND common_ingress_link_id='${246}'`
|
||||||
const linkId = ref(query.linkId || d)
|
const queryCondition = ref(query.queryCondition || '')
|
||||||
return {
|
return {
|
||||||
lineMetric,
|
lineMetric,
|
||||||
lineTab,
|
lineTab,
|
||||||
linkId,
|
queryCondition,
|
||||||
myChart: shallowRef(null)
|
myChart: shallowRef(null)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -154,9 +154,9 @@ export default {
|
|||||||
endTime: getSecond(this.timeFilter.endTime)
|
endTime: getSecond(this.timeFilter.endTime)
|
||||||
}
|
}
|
||||||
// const condition = this.$store.getters.getQueryCondition
|
// const condition = this.$store.getters.getQueryCondition
|
||||||
// if (this.linkId) {
|
if (this.queryCondition) {
|
||||||
// params.q = this.linkId
|
params.q = this.queryCondition
|
||||||
// }
|
}
|
||||||
this.toggleLoading(true)
|
this.toggleLoading(true)
|
||||||
get(api.linkMonitor.totalTrafficAnalysis, params).then((res) => {
|
get(api.linkMonitor.totalTrafficAnalysis, params).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
|||||||
@@ -46,16 +46,17 @@ 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='${246}' AND common_ingress_link_id='${246}'`
|
// const d = `common_egress_link_id='${256}' AND common_ingress_link_id='${256}'`
|
||||||
const linkId = ref(query.linkId || '256')
|
const queryCondition = ref(query.queryCondition || '')
|
||||||
return {
|
return {
|
||||||
linkId
|
queryCondition
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
@@ -74,9 +75,9 @@ export default {
|
|||||||
startTime: getSecond(this.timeFilter.startTime),
|
startTime: getSecond(this.timeFilter.startTime),
|
||||||
endTime: getSecond(this.timeFilter.endTime)
|
endTime: getSecond(this.timeFilter.endTime)
|
||||||
}
|
}
|
||||||
// if (this.linkId) {
|
if (this.queryCondition) {
|
||||||
// params.q = this.linkId
|
params.q = this.queryCondition
|
||||||
// }
|
}
|
||||||
this.toggleLoading(true)
|
this.toggleLoading(true)
|
||||||
get(api.linkMonitor.networkAnalysis, params).then(res => {
|
get(api.linkMonitor.networkAnalysis, params).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
@@ -92,8 +93,14 @@ export default {
|
|||||||
if (this.linkTrafficListData.npmScore > 6) {
|
if (this.linkTrafficListData.npmScore > 6) {
|
||||||
this.linkTrafficListData.npmScore = 6
|
this.linkTrafficListData.npmScore = 6
|
||||||
}
|
}
|
||||||
|
let condition = ''
|
||||||
|
if (this.queryCondition.indexOf('AND') > -1) {
|
||||||
|
condition = this.queryCondition.split(/["|'](.*?)["|']/)
|
||||||
|
} else {
|
||||||
|
condition = this.queryCondition
|
||||||
|
}
|
||||||
this.cnLinkInfo.forEach(e => {
|
this.cnLinkInfo.forEach(e => {
|
||||||
if (this.linkId === e.originalLinkId) {
|
if (condition.length > 1 && condition[1] === e.originalLinkId) {
|
||||||
this.bandWidth = e.bandwidth
|
this.bandWidth = e.bandwidth
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user