CN-668 Dashboard - npm - 下钻功能交互开发:交互部分完成(接口未完成)

This commit is contained in:
hanyuxia
2022-08-19 10:46:24 +08:00
parent fa0a4c359e
commit 6ca3c96eb8
7 changed files with 394 additions and 181 deletions

View File

@@ -36,7 +36,7 @@
import VueGridLayout from 'vue-grid-layout'
import _ from 'lodash'
import Chart from '@/views/charts2/Chart'
import { panelTypeAndRouteMapping, storageKey } from '@/utils/constants'
import { panelTypeAndRouteMapping, storageKey,drillDownPanelTypeMapping } from '@/utils/constants'
import { typeMapping } from '@/views/charts2/chart-tools'
export default {
name: 'ChartList',
@@ -66,6 +66,8 @@ export default {
if (!_.isEmpty(n)) {
if (this.panelType === panelTypeAndRouteMapping.networkAppPerformance) {
this.layout = n.filter(c => c.type === typeMapping.npm.npmTabs || c.params.tabIndex === this.npmTabIndex)
}else if(Object.values(drillDownPanelTypeMapping).indexOf(this.panelType)>=-1){
this.layout = n.filter(c => c.type === typeMapping.npm.npmTabs || c.params.tabIndex === this.npmTabIndex || !c.params.hasOwnProperty('tabIndex'))
} else {
this.layout = [...n]
}
@@ -83,8 +85,9 @@ export default {
}
},
npmTabIndex (n) {
if (this.panelType === panelTypeAndRouteMapping.networkAppPerformance) {
this.layout = this.chartList.filter(c => c.type === typeMapping.npm.npmTabs || c.params.tabIndex === this.npmTabIndex)
if (this.panelType === panelTypeAndRouteMapping.networkAppPerformance ||
Object.values(drillDownPanelTypeMapping).indexOf(this.panelType)>=-1) {
this.layout = this.chartList.filter(c => c.type === typeMapping.npm.npmTabs || c.params.tabIndex === this.npmTabIndex || !c.params.hasOwnProperty('tabIndex'))
}
}
},
@@ -93,7 +96,6 @@ export default {
this.npmTabIndex = parseInt(index)
},
resizeLine () {
console.log(this.$refs)
this.$refs.chartGrid.resizeLine()
}
}