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

@@ -149,7 +149,7 @@
<script> <script>
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { get, put } from '@/utils/http' import { get, put } from '@/utils/http'
import { entityType, storageKey, networkOverviewTabList, operationType, networkOverviewSearchUrl } from '@/utils/constants' import { entityType, storageKey, networkOverviewTabList, operationType, networkOverviewSearchUrl,drillDownPanelTypeMapping } from '@/utils/constants'
import { api } from '@/utils/api' import { api } from '@/utils/api'
import { ref } from 'vue' import { ref } from 'vue'
import { getNowTime, getSecond } from '@/utils/date-util' import { getNowTime, getSecond } from '@/utils/date-util'
@@ -293,7 +293,7 @@ export default {
}) })
}, },
initDropdownList () { initDropdownList () {
const currentValue = document.getElementById('breadcrumbValue')?document.getElementById('breadcrumbValue').innerText:'' const currentValue = document.getElementById('breadcrumbValue') ? document.getElementById('breadcrumbValue').innerText : ''
const columnName = this.$store.getters.getBreadcrumbColumnName const columnName = this.$store.getters.getBreadcrumbColumnName
let type = 'ip' let type = 'ip'
const tabObjGroup = networkOverviewTabList.filter(item => item.label == columnName) const tabObjGroup = networkOverviewTabList.filter(item => item.label == columnName)
@@ -329,7 +329,7 @@ export default {
}) })
}, },
showBreadcrumbPopover (valueMenuId) { showBreadcrumbPopover (valueMenuId) {
this.breadcrumbColumnValueListShow.splice(0,this.breadcrumbColumnValueListShow.length) this.breadcrumbColumnValueListShow.splice(0, this.breadcrumbColumnValueListShow.length)
this.curPageNum = 1 this.curPageNum = 1
this.showBackground = true this.showBackground = true
this.dropDownValue = '' this.dropDownValue = ''
@@ -427,6 +427,17 @@ export default {
}) })
} }
}) })
if(opeType===3){
this.$router.push({
params:{...this.$route.params,fourthPanel:''}
})
}else if(opeType!=4){
this.$router.push({
params:{...this.$route.params,fourthPanel:'',thirdPanel:''}
})
}
if (route === this.route) { if (route === this.route) {
this.refresh() this.refresh()
return return

View File

@@ -15,6 +15,7 @@ const routes = [
component: () => import('@/components/layout/Home'), component: () => import('@/components/layout/Home'),
children: [ children: [
{ {
name:'panel',
path: '/panel/:typeName', path: '/panel/:typeName',
component: () => import('@/views/charts2/Panel') component: () => import('@/views/charts2/Panel')
}, },

View File

@@ -41,7 +41,6 @@ const panel = {
panelName: '', // 网络概况的Panel的名称 panelName: '', // 网络概况的Panel的名称
breadcrumbColumnName: '', // 点击tab里的value都会修改此值,为面包屑的菜单 breadcrumbColumnName: '', // 点击tab里的value都会修改此值,为面包屑的菜单
breadcrumbColumnValue: '', // 点击tab里的value都会修改此值,为面包屑的菜单 breadcrumbColumnValue: '', // 点击tab里的value都会修改此值,为面包屑的菜单
breadcrumbColumnValueList: [], // 第四级面包屑的下拉列表 breadcrumbColumnValueList: [], // 第四级面包屑的下拉列表
networkOverviewCurrentTab: null, // 只代表选中的tab有时会与面包屑中显示的值不同 networkOverviewCurrentTab: null, // 只代表选中的tab有时会与面包屑中显示的值不同
networkOverviewBeforeTab: null, // 点击表格的值时使用记录点击当前tab表格的值之前点击的表格值所属的tab networkOverviewBeforeTab: null, // 点击表格的值时使用记录点击当前tab表格的值之前点击的表格值所属的tab

View File

@@ -158,7 +158,7 @@ export const listScrollPath = [
'/detection/performanceEvent', '/detection/performanceEvent',
'/detection/securityEvent' '/detection/securityEvent'
] ]
/*
export const networkOverviewTabs = [ export const networkOverviewTabs = [
'network.ips', 'network.ips',
'network.countries', 'network.countries',
@@ -176,18 +176,18 @@ export const networkOverviewTabs = [
'network.hosts', 'network.hosts',
'network.snis', 'network.snis',
'network.protocolPorts' 'network.protocolPorts'
] ]*/
export const operationType = { export const operationType = {
mainMenu: 0, // 菜单 mainMenu: 0, // 菜单
secondMenu: 1, // 二级菜单 secondMenu: 1, // 二级菜单
thirdMenu: 3, // 三级菜单 thirdMenu: 3, // 三级菜单
fourthMenu: 4, // 四级菜单 fourthMenu: 4, // 四级菜单:点击顶部第四级菜单 OR 点击表格的第一列的值
changeTab: 5, // 切换tab changeTab: 5, // 切换tab
changeMetric: 6, // 切换metric changeMetric: 6, // 切换metric
customize: 7// 操作Customize customize: 7// 操作Customize
} }
/*
export const networkOverviewTableUrlName = { export const networkOverviewTableUrlName = {
ips: 'ips', ips: 'ips',
countries: 'countries', countries: 'countries',
@@ -205,15 +205,62 @@ export const networkOverviewTableUrlName = {
hosts: 'hosts', hosts: 'hosts',
snis: 'snis', snis: 'snis',
protocolPorts: 'protocolPorts' protocolPorts: 'protocolPorts'
}*/
//列的类型:下钻列,环比列,普通列
export const tableColumnType = {
dillDown:'dillDown',
chainRatio:'chainRatio',
normal:'normal'
} }
//AppPerformance类型表格的列
export const customTableTitlesForAppPerformance = [
{ label: 'network.ips', prop: 'tab', checked: true, tabColumn: true,columnType:tableColumnType.dillDown},
{ label: 'network.score', prop: 'score', checked: true, tabColumn: false,columnType:tableColumnType.normal},
{ label: 'networkAppPerformance.throughput', prop: 'throughput', checked: true, tabColumn: false,columnType:tableColumnType.chainRatio},
{ label: 'networkAppPerformance.tcpConnectionEstablishLatency', prop: 'tcpConnectionEstablishLatency', checked: true, tabColumn: false,columnType:tableColumnType.chainRatio},
{ label: 'networkAppPerformance.packetLoss', prop: 'packetLoss', checked: false, tabColumn: false,columnType:tableColumnType.normal},
{ label: 'networkAppPerformance.packetRetrans', prop: 'packetRetrans', checked: false, tabColumn: false,columnType:tableColumnType.normal},
{ label: 'networkAppPerformance.sslResponseLatency', prop: 'sslResponseLatency', checked: false, tabColumn: false,columnType:tableColumnType.normal},
{ label: 'networkAppPerformance.httpResponseLatency', prop: 'httpResponseLatency', checked: false, tabColumn: false,columnType:tableColumnType.normal}
]
//NetworkOverview类型表格的列
export const customTableTitlesForNetworkOverview = [
{ label: 'network.ips', prop: 'tab', checked: true, tabColumn: true,columnType:tableColumnType.dillDown},
{ label: 'network.total', prop: 'total', checked: true, tabColumn: false,columnType:tableColumnType.chainRatio},
{ label: 'network.inbound', prop: 'inbound', checked: true, tabColumn: false,columnType:tableColumnType.normal},
{ label: 'network.outbound', prop: 'outbound', checked: true, tabColumn: false,columnType:tableColumnType.normal},
{ label: 'network.internal', prop: 'internal', checked: true, tabColumn: false,columnType:tableColumnType.normal},
{ label: 'network.through', prop: 'through', checked: true, tabColumn: false,columnType:tableColumnType.normal}
]
//networkOverview:接口url
export const networkOverviewSearchUrl = { export const networkOverviewSearchUrl = {
curUrl: '/interface/overview/dimensionTrafficAnalysis', curUrl: '/interface/overview/dimensionTrafficAnalysis',
cycleUrl: '/interface/overview/dimensionCycleTrafficAnalysis', cycleUrl: '/interface/overview/dimensionCycleTrafficAnalysis',
drilldownCurUrl: '/interface/overview/drilldown/dimensionTrafficAnalysis', drilldownCurUrl: '/interface/overview/drilldown/dimensionTrafficAnalysis',
drilldownCycleUrl: '/interface/overview/drilldown/dimensionCycleTrafficAnalysis', drilldownCycleUrl: '/interface/overview/drilldown/dimensionCycleTrafficAnalysis',
drilldownList: '/interface/overview/drilldown/list' drilldownList: '/interface/overview/drilldown/list'
}
//npm:接口url
export const npmSearchUrl = {
curUrl: '/interface/application/performance/overview/dimensionTrafficAnalysis',
cycleUrl: '/interface/application/performance/overview/dimensionCycleTrafficAnalysis',
drilldownCurUrl: '/interface/application/performance/overview/drilldown/dimensionTrafficAnalysis',
drilldownCycleUrl: '/interface/application/performance/overview/drilldown/dimensionCycleTrafficAnalysis',
drilldownList: '/interface/overview/drilldown/list'
}
/* panel类别和名称之间的映射 */
export const drillDownPanelTypeMapping = {
npmOverviewIp: 8,
npmOverviewDomain: 9,
npmOverviewApp: 10,
npmOverviewCommon: 11,
npmThirdMenu: 12,
networkOverview: 13,
} }
export const networkOverviewTabList = [ export const networkOverviewTabList = [
@@ -223,147 +270,307 @@ export const networkOverviewTabList = [
queryCycleTotalProp: 'ips', queryCycleTotalProp: 'ips',
dillDownProp: ['common_client_ip', 'common_server_ip'], dillDownProp: ['common_client_ip', 'common_server_ip'],
checked: true, checked: true,
url: '/interface/overview/ipsTrafficAnalysis', disabled: false,
cycleTotalUrl: '/interface/overview/ipsCycleTrafficTotal', panelId:drillDownPanelTypeMapping.networkOverview
disabled: false
}, { }, {
label: 'network.countries', label: 'network.countries',
prop: 'country', prop: 'country',
queryCycleTotalProp: 'countries', queryCycleTotalProp: 'countries',
dillDownProp: ['client_country', 'server_country'], dillDownProp: ['client_country', 'server_country'],
checked: true, checked: true,
url: '/interface/overview/countriesTrafficAnalysis', disabled: false,
cycleTotalUrl: '/interface/overview/countriesCycleTrafficTotal', panelId:drillDownPanelTypeMapping.networkOverview
disabled: false
}, { }, {
label: 'network.asns', label: 'network.asns',
prop: 'asn', prop: 'asn',
queryCycleTotalProp: 'asns', queryCycleTotalProp: 'asns',
dillDownProp: ['client_asn', 'server_asn'], dillDownProp: ['client_asn', 'server_asn'],
checked: true, checked: true,
url: '/interface/overview/asnsTrafficAnalysis', disabled: false,
cycleTotalUrl: '/interface/overview/asnsCycleTrafficTotal', panelId:drillDownPanelTypeMapping.networkOverview
disabled: false
}, { }, {
label: 'network.applications', label: 'network.applications',
prop: 'appLabel', prop: 'appLabel',
queryCycleTotalProp: 'applications', queryCycleTotalProp: 'applications',
dillDownProp: ['common_app_label'], dillDownProp: ['common_app_label'],
checked: true, checked: true,
url: '/interface/overview/applicationsTrafficAnalysis', disabled: false,
cycleTotalUrl: '/interface/overview/applicationsCycleTrafficTotal', panelId:drillDownPanelTypeMapping.networkOverview
disabled: false
}, { }, {
label: 'network.providers', label: 'network.providers',
prop: 'appCompany', prop: 'appCompany',
queryCycleTotalProp: 'providers', queryCycleTotalProp: 'providers',
dillDownProp: ['app_company'], dillDownProp: ['app_company'],
checked: true, checked: true,
url: '/interface/overview/providersTrafficAnalysis', disabled: false,
cycleTotalUrl: '/interface/overview/providersCycleTrafficTotal', panelId:drillDownPanelTypeMapping.networkOverview
disabled: false
}, { }, {
label: 'network.domains', label: 'network.domains',
prop: 'domain', prop: 'domain',
queryCycleTotalProp: 'domains', queryCycleTotalProp: 'domains',
dillDownProp: ['domain'], dillDownProp: ['domain'],
checked: true, checked: true,
url: '/interface/overview/domainsTrafficAnalysis', disabled: false,
cycleTotalUrl: '/interface/overview/domainsCycleTrafficTotal', panelId:drillDownPanelTypeMapping.networkOverview
disabled: false
}, { }, {
label: 'network.protocols', label: 'network.protocols',
prop: 'l7Protocol', prop: 'l7Protocol',
queryCycleTotalProp: 'protocols', queryCycleTotalProp: 'protocols',
dillDownProp: ['common_l7_protocol'], dillDownProp: ['common_l7_protocol'],
checked: true, checked: true,
url: '/interface/overview/protocolsTrafficAnalysis', disabled: false,
cycleTotalUrl: '/interface/overview/protocolsCycleTrafficTotal', panelId:drillDownPanelTypeMapping.networkOverview
disabled: false
}, { }, {
label: 'network.idcTenants', label: 'network.idcTenants',
prop: 'idcRenter', prop: 'idcRenter',
queryCycleTotalProp: 'idcTenants', queryCycleTotalProp: 'idcTenants',
dillDownProp: ['client_idc_renter', 'server_idc_renter'], dillDownProp: ['client_idc_renter', 'server_idc_renter'],
checked: true, checked: true,
url: '/interface/overview/idcTenantsTrafficAnalysis', disabled: false,
cycleTotalUrl: '/interface/overview/idcTenantsCycleTrafficTotal', panelId:drillDownPanelTypeMapping.networkOverview
disabled: false
}, { }, {
label: 'network.provinces', label: 'network.provinces',
prop: 'province', prop: 'province',
queryCycleTotalProp: 'provinces', queryCycleTotalProp: 'provinces',
dillDownProp: ['client_province', 'server_province'], dillDownProp: ['client_province', 'server_province'],
checked: false, checked: false,
url: '/interface/overview/provincesTrafficAnalysis', disabled: false,
cycleTotalUrl: '/interface/overview/provincesCycleTrafficTotal', panelId:drillDownPanelTypeMapping.networkOverview
disabled: false
}, { }, {
label: 'network.cities', label: 'network.cities',
prop: 'city', prop: 'city',
queryCycleTotalProp: 'cities', queryCycleTotalProp: 'cities',
dillDownProp: ['client_region', 'server_region'], dillDownProp: ['client_region', 'server_region'],
checked: false, checked: false,
url: '/interface/overview/citiesTrafficAnalysis', disabled: false,
cycleTotalUrl: '/interface/overview/citiesCycleTrafficTotal', panelId:drillDownPanelTypeMapping.networkOverview
disabled: false
}, { }, {
label: 'network.isps', label: 'network.isps',
prop: 'isp', prop: 'isp',
queryCycleTotalProp: 'isps', queryCycleTotalProp: 'isps',
dillDownProp: ['client_isp', 'server_isp'], dillDownProp: ['client_isp', 'server_isp'],
checked: false, checked: false,
url: '/interface/overview/ispsTrafficAnalysis', disabled: false,
cycleTotalUrl: '/interface/overview/ispsCycleTrafficTotal', panelId:drillDownPanelTypeMapping.networkOverview
disabled: false
}, { }, {
label: 'network.applicationCategories', label: 'network.applicationCategories',
prop: 'appSubcategory', prop: 'appSubcategory',
queryCycleTotalProp: 'applicationCategories', queryCycleTotalProp: 'applicationCategories',
dillDownProp: ['app_subcategory'], dillDownProp: ['app_subcategory'],
checked: false, checked: false,
url: '/interface/overview/applicationCategoriesTrafficAnalysis', disabled: false,
cycleTotalUrl: '/interface/overview/applicationCategoriesCycleTrafficTotal', panelId:drillDownPanelTypeMapping.networkOverview
disabled: false
}, { }, {
label: 'network.domainCategories', label: 'network.domainCategories',
prop: 'domainCategoryName', prop: 'domainCategoryName',
queryCycleTotalProp: 'domainCategories', queryCycleTotalProp: 'domainCategories',
dillDownProp: ['domain_category_name'], dillDownProp: ['domain_category_name'],
checked: false, checked: false,
url: '/interface/overview/domainCategoriesTrafficAnalysis', disabled: false,
cycleTotalUrl: '/interface/overview/domainCategoriesCycleTrafficTotal', panelId:drillDownPanelTypeMapping.networkOverview
disabled: false
}, { }, {
label: 'network.hosts', label: 'network.hosts',
prop: 'httpHost', prop: 'httpHost',
queryCycleTotalProp: 'hosts', queryCycleTotalProp: 'hosts',
dillDownProp: ['http_host'], dillDownProp: ['http_host'],
checked: false, checked: false,
url: '/interface/overview/hostsTrafficAnalysis', disabled: false,
cycleTotalUrl: '/interface/overview/hostsCycleTrafficTotal', panelId:drillDownPanelTypeMapping.networkOverview
disabled: false
}, { }, {
label: 'network.snis', label: 'network.snis',
prop: 'sslSni', prop: 'sslSni',
queryCycleTotalProp: 'snis', queryCycleTotalProp: 'snis',
dillDownProp: ['ssl_sni'], dillDownProp: ['ssl_sni'],
checked: false, checked: false,
url: '/interface/overview/snisTrafficAnalysis', disabled: false,
cycleTotalUrl: '/interface/overview/snisCycleTrafficTotal', panelId:drillDownPanelTypeMapping.networkOverview
disabled: false
}, { }, {
label: 'network.protocolPorts', label: 'network.protocolPorts',
prop: 'protocolPort', prop: 'protocolPort',
queryCycleTotalProp: 'protocolports', queryCycleTotalProp: 'protocolports',
dillDownProp: ['common_l7_protocol', 'common_server_port '], dillDownProp: ['common_l7_protocol', 'common_server_port '],
checked: false, checked: false,
url: '/interface/overview/protocolPortsTrafficAnalysis', disabled: false,
cycleTotalUrl: '/interface/overview/protocolPortsCycleTrafficTotal', panelId:drillDownPanelTypeMapping.networkOverview
disabled: false
} }
] ]
export const networkAppPerformanceTabList = [
{
label: 'network.ips',//tab名称对应的il8n
prop: 'ip',//接口返回数据中tab第一列对应的属性名
queryCycleTotalProp: 'ips',//SQL中查询不同纬度的列名称
dillDownProp: ['common_client_ip', 'common_server_ip'],//下钻时传递的查询条件即接口的q参数
checked: true,//自定义设置中,是否默认选中
disabled: false,//自定义设置中,是否可操作(选中或取消选中)
panelId:drillDownPanelTypeMapping.npmOverviewIp//下钻后展示的panelId
}, {
label: 'network.countries',
prop: 'country',
queryCycleTotalProp: 'countries',
dillDownProp: ['client_country', 'server_country'],
checked: true,
disabled: false,
panelId:drillDownPanelTypeMapping.npmOverviewCommon
}, {
label: 'network.asns',
prop: 'asn',
queryCycleTotalProp: 'asns',
dillDownProp: ['client_asn', 'server_asn'],
checked: true,
disabled: false,
panelId:drillDownPanelTypeMapping.npmOverviewCommon
}, {
label: 'network.applications',
prop: 'appLabel',
queryCycleTotalProp: 'applications',
dillDownProp: ['common_app_label'],
checked: true,
disabled: false,
panelId:drillDownPanelTypeMapping.npmOverviewApp
}, {
label: 'network.providers',
prop: 'appCompany',
queryCycleTotalProp: 'providers',
dillDownProp: ['app_company'],
checked: true,
disabled: false,
panelId:drillDownPanelTypeMapping.npmOverviewCommon
}, {
label: 'network.domains',
prop: 'domain',
queryCycleTotalProp: 'domains',
dillDownProp: ['domain'],
checked: true,
disabled: false,
panelId:drillDownPanelTypeMapping.npmOverviewDomain
}, {
label: 'network.protocols',
prop: 'l7Protocol',
queryCycleTotalProp: 'protocols',
dillDownProp: ['common_l7_protocol'],
checked: true,
disabled: false,
panelId:drillDownPanelTypeMapping.npmOverviewCommon
}, {
label: 'network.idcTenants',
prop: 'idcRenter',
queryCycleTotalProp: 'idcTenants',
dillDownProp: ['client_idc_renter', 'server_idc_renter'],
checked: true,
disabled: false,
panelId:drillDownPanelTypeMapping.npmOverviewCommon
}, {
label: 'network.provinces',
prop: 'province',
queryCycleTotalProp: 'provinces',
dillDownProp: ['client_province', 'server_province'],
checked: false,
disabled: false,
panelId:drillDownPanelTypeMapping.npmOverviewCommon
}, {
label: 'network.cities',
prop: 'city',
queryCycleTotalProp: 'cities',
dillDownProp: ['client_region', 'server_region'],
checked: false,
disabled: false,
panelId:drillDownPanelTypeMapping.npmOverviewCommon
}, {
label: 'network.isps',
prop: 'isp',
queryCycleTotalProp: 'isps',
dillDownProp: ['client_isp', 'server_isp'],
checked: false,
disabled: false,
panelId:drillDownPanelTypeMapping.npmOverviewCommon
}, {
label: 'network.applicationCategories',
prop: 'appSubcategory',
queryCycleTotalProp: 'applicationCategories',
dillDownProp: ['app_subcategory'],
checked: false,
disabled: false,
panelId:drillDownPanelTypeMapping.npmOverviewCommon
}, {
label: 'network.domainCategories',
prop: 'domainCategoryName',
queryCycleTotalProp: 'domainCategories',
dillDownProp: ['domain_category_name'],
checked: false,
disabled: false,
panelId:drillDownPanelTypeMapping.npmOverviewCommon
}, {
label: 'network.hosts',
prop: 'httpHost',
queryCycleTotalProp: 'hosts',
dillDownProp: ['http_host'],
checked: false,
disabled: false,
panelId:drillDownPanelTypeMapping.npmOverviewCommon
}, {
label: 'network.snis',
prop: 'sslSni',
queryCycleTotalProp: 'snis',
dillDownProp: ['ssl_sni'],
checked: false,
disabled: false,
panelId:drillDownPanelTypeMapping.npmOverviewCommon
}, {
label: 'network.protocolPorts',
prop: 'protocolPort',
queryCycleTotalProp: 'protocolports',
dillDownProp: ['common_l7_protocol', 'common_server_port '],
checked: false,
disabled: false,
panelId:drillDownPanelTypeMapping.npmOverviewCommon
}
]
export const bytesColumnNameGroup = {
total: 'bytesTotal',
inbound: 'inboundBitsRate',
outbound: 'outboundBitsRate',
internal: 'internalBitsRate',
through: 'throughBitsRate'
}
export const packetsColumnNameGroup = {
total: 'packetsTotal',
inbound: 'inboundPacketsRate',
outbound: 'outboundPacketsRate',
internal: 'internalPacketsRate',
through: 'throughPacketsRate'
}
export const sessionsColumnNameGroup = {
total: 'sessionsRate'
}
//不同表格类型对应的相关数据
export const networkTable = {
networkOverview:{
tabList:networkOverviewTabList,//tab列表
column:customTableTitlesForNetworkOverview,//列
url:networkOverviewSearchUrl,//接口url
hasMetricSearch:true,//顶部是否有metric下拉列表
panelIdOfThirdMenu:drillDownPanelTypeMapping.networkOverview,
bytesColumnNameGroup:bytesColumnNameGroup,
packetsColumnNameGroup:packetsColumnNameGroup,
sessionsColumnNameGroup:sessionsColumnNameGroup
},
networkAppPerformance:{
tabList:networkAppPerformanceTabList,
column:customTableTitlesForAppPerformance,
url:npmSearchUrl,
hasMetricSearch:false,//是否有metric下拉列表
panelIdOfThirdMenu:drillDownPanelTypeMapping.npmThirdMenu,
bytesColumnNameGroup:{},//无metric下拉列表条件用不到此3个属性
packetsColumnNameGroup:{},//无metric下拉列表条件用不到此3个属性
sessionsColumnNameGroup:{}//无metric下拉列表条件用不到此3个属性
}
}
export const dnsServerRole = { export const dnsServerRole = {
RTDNS: 'RTDNS', RTDNS: 'RTDNS',
TLDNS: 'TLDNS', TLDNS: 'TLDNS',

View File

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

View File

@@ -31,7 +31,7 @@
</template> </template>
<script> <script>
import { useRoute } from 'vue-router' import {useRoute, useRouter} from 'vue-router'
import { ref } from 'vue' import { ref } from 'vue'
import { panelTypeAndRouteMapping } from '@/utils/constants' import { panelTypeAndRouteMapping } from '@/utils/constants'
import { getPanelList, getChartList } from '@/utils/api' import { getPanelList, getChartList } from '@/utils/api'
@@ -74,7 +74,16 @@ export default {
const panel = ref({}) const panel = ref({})
let panelType = 1 // 取得panel的type let panelType = 1 // 取得panel的type
const { params } = useRoute() const { params } = useRoute()
panelType = props.entity ? props.entity.type : panelTypeAndRouteMapping[params.typeName] let router = useRouter()
let thirdPanel = router.currentRoute.value.params.thirdPanel
let fourthPanel = router.currentRoute.value.params.fourthPanel
if(fourthPanel){
panelType = Number(fourthPanel)
}else if(thirdPanel){
panelType = Number(thirdPanel)
}else {
panelType = props.entity ? props.entity.type : panelTypeAndRouteMapping[params.typeName]
}
function isEntityDetail (t) { function isEntityDetail (t) {
return [4, 5, 6].indexOf(t) > -1 return [4, 5, 6].indexOf(t) > -1
@@ -108,16 +117,6 @@ export default {
this.initChartAttr(chart) this.initChartAttr(chart)
return chart return chart
}) })
if (this.$store.getters.getBreadcrumbColumnName || this.$store.getters.getBreadcrumbColumnValue) { // networkOverview页面
const list = this.chartList.filter(item => {
return (item.type === 102 || item.type === 601)
})
list.forEach(item => {
item.w = 24
})
this.chartList = ref(list)
}
} }
}, },
initChartAttr (chart) { initChartAttr (chart) {

View File

@@ -35,7 +35,7 @@
<span class="data-column__span">{{$t(item.label)}}</span> <span class="data-column__span">{{$t(item.label)}}</span>
</template> </template>
<template #default="scope" :column="item"> <template #default="scope" :column="item">
<template v-if="item.prop === 'total'" > <template v-if="item.columnType === tableColumnType.chainRatio" >
<div class="data-total" > <div class="data-total" >
{{scope.row[item.prop] ? unitConvert(scope.row[item.prop], unitTypes.number).join(' ') : '-'}} {{scope.row[item.prop] ? unitConvert(scope.row[item.prop], unitTypes.number).join(' ') : '-'}}
<div v-if="scope.row['trend'] === 'up'" class="data-total-trend data-total-trend-red"> <div v-if="scope.row['trend'] === 'up'" class="data-total-trend data-total-trend-red">
@@ -45,14 +45,13 @@
<i class="cn-icon-decline cn-icon"></i><span>{{scope.row['trendValue']}}</span> <i class="cn-icon-decline cn-icon"></i><span>{{scope.row['trendValue']}}</span>
</div> </div>
<div v-else-if="scope.row['trend'] === 'noChange'" class="data-total-trend data-total-trend-black"> <div v-else-if="scope.row['trend'] === 'noChange'" class="data-total-trend data-total-trend-black">
<i class="cn-icon-constant cn-icon"></i><span>{{scope.row['trendValue']}}</span> <i class="cn-icon-constant cn-icon"></i>
</div> </div>
</div> </div>
</template> </template>
<template v-else-if="item.prop === 'tab'" > <template v-else-if="item.columnType === tableColumnType.dillDown" >
<div class="data-click" v-if='drillDown' @click="handleTabValue(item.label,scope.row['tab'])">{{scope.row['tab']}}</div> <div class="data-click" @click="handleTabValue(item.label,scope.row['tab'])">{{scope.row['tab']}}</div>
<div v-else >{{scope.row['tab']}}</div>
</template> </template>
<template v-else> <template v-else>
{{scope.row[item.prop] ? unitConvert(scope.row[item.prop], unitTypes.number).join(' ') : '-'}} {{scope.row[item.prop] ? unitConvert(scope.row[item.prop], unitTypes.number).join(' ') : '-'}}
@@ -66,8 +65,8 @@
</template> </template>
</el-tabs> </el-tabs>
<div class="tab-search"> <div class="tab-search" >
<div class="search-select" v-if="drillDown"> <div class="search-select" v-if="hasMetricSearch">
<span>{{$t('network.metric')}}:</span> <span>{{$t('network.metric')}}:</span>
<el-select v-model="metric" <el-select v-model="metric"
class="option__select select-column" class="option__select select-column"
@@ -140,19 +139,23 @@
</el-tabs> </el-tabs>
</el-popover> </el-popover>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { ref } from 'vue' import { ref } from 'vue'
import { networkOverviewTabs, networkOverviewTabList, operationType, networkOverviewSearchUrl, unitTypes } from '@/utils/constants' import {operationType, unitTypes,networkTable,tableColumnType } from '@/utils/constants'
import { get } from '@/utils/http' import { get } from '@/utils/http'
import unitConvert from '@/utils/unit-convert' import unitConvert from '@/utils/unit-convert'
import { getChainRatio } from '@/utils/tools'
export default { export default {
name: 'NetworkOverviewTabs', name: 'NetworkOverviewTabs',
data () { data () {
return { return {
dragIndex: '',
dragMetricIndex: '',
metric: 'Bits/s', metric: 'Bits/s',
orderBy: 'bytesTotal', orderBy: 'bytesTotal',
tab: 'ip', tab: 'ip',
@@ -172,20 +175,10 @@ export default {
label: 'Sessions/s' label: 'Sessions/s'
} }
], ],
customTableTitles: [ customTableTitles: [],
{ label: 'network.ips', prop: 'tab', checked: true, tabColumn: true }, list: [],//当前状态列表
{ label: 'network.total', prop: 'total', checked: true, tabColumn: false }, networkTabList: [],//原始状态列表
{ label: 'network.inbound', prop: 'inbound', checked: true, tabColumn: false },
{ label: 'network.outbound', prop: 'outbound', checked: true, tabColumn: false },
{ label: 'network.internal', prop: 'internal', checked: true, tabColumn: false },
{ label: 'network.through', prop: 'through', checked: true, tabColumn: false }
],
list: this.$_.cloneDeep(networkOverviewTabList),
dragIndex: '',
dragMetricIndex: '',
showBackground: false, showBackground: false,
tabUrl: networkOverviewTabList[0].url,
cycleTotalUrl: networkOverviewTabList[0].cycleTotalUrl,
tableData: [], tableData: [],
showTabs: true, showTabs: true,
columnNameGroup: { columnNameGroup: {
@@ -197,7 +190,14 @@ export default {
}, },
metricUnit: 'bytes', metricUnit: 'bytes',
loading: false, loading: false,
drillDown: false drillDown: false,
tableColumnType:tableColumnType,
curTable:{},//当前的表格类型
tableType:'',
hasMetricSearch:true,
activeTab:'',
activeCustomize:'',
networkSearchUrl:{}
} }
}, },
props: { props: {
@@ -217,9 +217,6 @@ export default {
} }
} }
} }
},
computed: {
}, },
methods: { methods: {
changeMetric () { changeMetric () {
@@ -231,68 +228,56 @@ export default {
const curTab = this.getCurTab() const curTab = this.getCurTab()
const label = curTab.label const label = curTab.label
if (this.metric === 'Bits/s') { if (this.metric === 'Bits/s') {
this.columnNameGroup = { this.columnNameGroup = this.curTable.bytesColumnNameGroup
total: 'bytesTotal',
inbound: 'inboundBitsRate',
outbound: 'outboundBitsRate',
internal: 'internalBitsRate',
through: 'throughBitsRate'
}
this.orderBy = 'bytesTotal' this.orderBy = 'bytesTotal'
this.metricUnit = 'bytes' this.metricUnit = 'bytes'
const titleGroup = []
if (this.customTableTitles.length === 2) { if (this.customTableTitles.length === 2) {
this.customTableTitles = [ this.curTable.column.forEach((item,index) => {
{ label: label, prop: 'tab', checked: true, tabColumn: true }, if (item.tabColumn) {
{ label: 'network.total', prop: 'total', checked: this.customTableTitles[1].checked, tabColumn: false }, item.label = label
{ label: 'network.inbound', prop: 'inbound', checked: this.customTableTitles[2] ? this.customTableTitles[2].checked : true, tabColumn: false }, }
{ label: 'network.outbound', prop: 'outbound', checked: this.customTableTitles[3] ? this.customTableTitles[3].checked : true, tabColumn: false }, if(index===1){
{ label: 'network.internal', prop: 'internal', checked: this.customTableTitles[4] ? this.customTableTitles[4].checked : true, tabColumn: false }, item.checked = this.customTableTitles[1].checked
{ label: 'network.through', prop: 'through', checked: this.customTableTitles[5] ? this.customTableTitles[5].checked : true, tabColumn: false } }
] titleGroup.push(item)
})
} else { } else {
const titleGroup = []
this.customTableTitles.forEach(item => { this.customTableTitles.forEach(item => {
if (item.tabColumn) { if (item.tabColumn) {
item.label = label item.label = label
} }
titleGroup.push(item) titleGroup.push(item)
}) })
this.customTableTitles = titleGroup
} }
this.customTableTitles = titleGroup
} else if (this.metric === 'Packets/s') { } else if (this.metric === 'Packets/s') {
this.columnNameGroup = { this.columnNameGroup = this.curTable.packetsColumnNameGroup
total: 'packetsTotal',
inbound: 'inboundPacketsRate',
outbound: 'outboundPacketsRate',
internal: 'internalPacketsRate',
through: 'throughPacketsRate'
}
this.orderBy = 'packetsTotal' this.orderBy = 'packetsTotal'
this.metricUnit = 'packets' this.metricUnit = 'packets'
const titleGroup = []
if (this.customTableTitles.length === 2) { if (this.customTableTitles.length === 2) {
this.customTableTitles = [ this.curTable.column.forEach((item,index) => {
{ label: label, prop: 'tab', checked: true, tabColumn: true }, if (item.tabColumn) {
{ label: 'network.total', prop: 'total', checked: this.customTableTitles[1].checked, tabColumn: false }, item.label = label
{ label: 'network.inbound', prop: 'inbound', checked: this.customTableTitles[2] ? this.customTableTitles[2].checked : true, tabColumn: false }, }
{ label: 'network.outbound', prop: 'outbound', checked: this.customTableTitles[3] ? this.customTableTitles[3].checked : true, tabColumn: false }, if(index===1){
{ label: 'network.internal', prop: 'internal', checked: this.customTableTitles[4] ? this.customTableTitles[4].checked : true, tabColumn: false }, item.checked = this.customTableTitles[1].checked
{ label: 'network.through', prop: 'through', checked: this.customTableTitles[5] ? this.customTableTitles[5].checked : true, tabColumn: false } }
] titleGroup.push(item)
})
} else { } else {
const titleGroup = []
this.customTableTitles.forEach(item => { this.customTableTitles.forEach(item => {
if (item.tabColumn) { if (item.tabColumn) {
item.label = label item.label = label
} }
titleGroup.push(item) titleGroup.push(item)
}) })
this.customTableTitles = titleGroup
} }
this.customTableTitles = titleGroup
} else if (this.metric === 'Sessions/s') { } else if (this.metric === 'Sessions/s') {
this.columnNameGroup = { this.columnNameGroup = this.curTable.sessionsColumnNameGroup
total: 'sessionsRate'
}
this.orderBy = 'sessions' this.orderBy = 'sessions'
this.metricUnit = 'sessions' this.metricUnit = 'sessions'
let totalChecked = true let totalChecked = true
@@ -302,8 +287,8 @@ export default {
} }
}) })
this.customTableTitles = [ this.customTableTitles = [
{ label: label, prop: 'tab', checked: true, tabColumn: true }, { label: label, prop: 'tab', checked: true, tabColumn: true,columnType:this.curTable.column[0].columnType},
{ label: 'network.total', prop: 'total', checked: totalChecked, tabColumn: false } { label: 'network.total', prop: 'total', checked: totalChecked, tabColumn: false,columnType:this.curTable.column[1].columnType}
] ]
} }
let queryParams = { let queryParams = {
@@ -334,7 +319,7 @@ export default {
if (tabObjGroup && tabObjGroup.length > 0) { if (tabObjGroup && tabObjGroup.length > 0) {
return tabObjGroup[0] return tabObjGroup[0]
} else { } else {
return tabObjGroup = networkOverviewTabList.filter(item => item.checked)[0] return tabObjGroup = this.networkTabList.filter(item => item.checked)[0]
} }
}, },
initData () { initData () {
@@ -357,7 +342,7 @@ export default {
} }
this.showTabs = true this.showTabs = true
} else if (curOperationType === operationType.thirdMenu) { // 点击的为第三级菜单 } else if (curOperationType === operationType.thirdMenu) { // 点击的为第三级菜单
// 此处的id为tab- name // 此处的id为tab-name
this.list.forEach(item => { this.list.forEach(item => {
const tabDom = document.getElementById('tab-' + item.label) const tabDom = document.getElementById('tab-' + item.label)
const paneDom = document.getElementById('pane-' + item.label) const paneDom = document.getElementById('pane-' + item.label)
@@ -472,23 +457,30 @@ export default {
cycleTotalList = response.data.result cycleTotalList = response.data.result
tableDataTmp.forEach(item => { tableDataTmp.forEach(item => {
const cycle = cycleTotalList.find(i => i[curTab.prop] === item.tab) const cycle = cycleTotalList.find(i => i[curTab.prop] === item.tab)
let trend = '' let trend = ''//空无图标up向上的图标down向下的图标noChange横向箭头图标
let trendPercent = '' let trendPercent = ''
if (cycle) { if (cycle) {
const totalDiff = item.total - cycle[this.metricUnit] const totalDiff = item.total - cycle[this.metricUnit]
if (cycle[this.metricUnit]) { if (cycle[this.metricUnit] && cycle[this.metricUnit]!=0) {
trendPercent = Math.round((Math.abs(totalDiff) / cycle[this.metricUnit]) * 100) let chainRatio = getChainRatio(item.total, cycle[this.metricUnit])
if (totalDiff > 0) { if (chainRatio === '-') {
trend = 'up' trend = ''
} else if (totalDiff < 0) {
trend = 'down'
} else {
trend = 'noChange'
}
trendPercent = trendPercent + '%'
if (trendPercent === '0%') {
trend = 'noChange'
trendPercent = '' trendPercent = ''
}else {
trendPercent = Math.round(Math.abs(chainRatio)* 100)
if (totalDiff > 0) {
trend = 'up'
trendPercent = trendPercent + '%'
} else if (totalDiff < 0) {
trend = 'down'
trendPercent = trendPercent + '%'
} else {
trend = 'noChange'//横向图标
}
if (trendPercent === '0%') {
trend = 'noChange'
trendPercent = ''
}
} }
} }
} }
@@ -539,8 +531,6 @@ export default {
}) })
} }
this.tabUrl = tabList[0].url
this.cycleTotalUrl = tabList[0].cycleTotalUrl
this.$store.commit('setNetworkOverviewCurrentTab', tabList[0]) this.$store.commit('setNetworkOverviewCurrentTab', tabList[0])
let queryParams = { let queryParams = {
@@ -603,9 +593,11 @@ export default {
}) })
} }
}) })
let toPanel = null
this.list.forEach((item, index) => { this.list.forEach((item, index) => {
if (item.label === columnName) { if (item.label === columnName) {
item.checked = false item.checked = false
toPanel = item.panelId
} }
if (oldCurTab && (item.label === oldCurTab.label)) { if (oldCurTab && (item.label === oldCurTab.label)) {
item.checked = true item.checked = true
@@ -621,8 +613,6 @@ export default {
} }
const tab = this.list.filter(item => item.checked) const tab = this.list.filter(item => item.checked)
this.tabUrl = tab.url
this.cycleTotalUrl = tab.cycleTotalUrl
// 如果面包屑的columnValue有值则不更新valueList // 如果面包屑的columnValue有值则不更新valueList
const valueList = [] const valueList = []
@@ -631,9 +621,14 @@ export default {
}) })
this.$store.commit('setBreadcrumbColumnValueList', valueList) this.$store.commit('setBreadcrumbColumnValueList', valueList)
this.$router.push({ this.$router.push({
name:'panel',
path: this.$route.path, path: this.$route.path,
query: { query: {
t: +new Date() t: +new Date()
},
params:{
thirdPanel:this.curTable.panelIdOfThirdMenu,
fourthPanel:toPanel
} }
}) })
}, },
@@ -688,8 +683,6 @@ export default {
if (tabObjGroup && tabObjGroup.length > 0) { if (tabObjGroup && tabObjGroup.length > 0) {
const curTab = tabObjGroup[0] const curTab = tabObjGroup[0]
this.$store.commit('setNetworkOverviewCurrentTab', curTab) this.$store.commit('setNetworkOverviewCurrentTab', curTab)
this.tabUrl = curTab.url
this.cycleTotalUrl = curTab.cycleTotalUrl
this.tab = curTab.prop this.tab = curTab.prop
let queryParams = { let queryParams = {
@@ -713,9 +706,9 @@ export default {
getCurUrl () { getCurUrl () {
const condition = this.$store.getters.getQueryCondition const condition = this.$store.getters.getQueryCondition
if (condition) { if (condition) {
return networkOverviewSearchUrl.drilldownCurUrl return this.networkSearchUrl.drilldownCurUrl
} else { } else {
return networkOverviewSearchUrl.curUrl return this.networkSearchUrl.curUrl
} }
}, },
handleQueryParams (extraParams) { handleQueryParams (extraParams) {
@@ -723,7 +716,7 @@ export default {
const name = this.$store.getters.getBreadcrumbColumnName const name = this.$store.getters.getBreadcrumbColumnName
let tabList = this.$store.getters.getNetworkOverviewTabList let tabList = this.$store.getters.getNetworkOverviewTabList
if (tabList.length === 0 || !tabList) { if (tabList.length === 0 || !tabList) {
tabList = this.$_.cloneDeep(networkOverviewTabList) tabList = this.$_.cloneDeep(this.networkTabList)
} }
const curOperationType = this.$store.getters.getTabOperationType const curOperationType = this.$store.getters.getTabOperationType
@@ -740,14 +733,14 @@ export default {
this.customTableTitles[0].label = tabCheckedGroup[0].label this.customTableTitles[0].label = tabCheckedGroup[0].label
} }
} else if (curOperationType === operationType.thirdMenu) { // 点击的为第三级菜单 } else if (curOperationType === operationType.thirdMenu) { // 点击的为第三级菜单
const networkOverviewTabList = [] const networkTabList = []
tabList.forEach(item => { tabList.forEach(item => {
if (this.$t(item.label) === name) { if (this.$t(item.label) === name) {
item.checked = true item.checked = true
} }
networkOverviewTabList.push(item) networkTabList.push(item)
}) })
this.$store.commit('setNetworkOverviewTabList', networkOverviewTabList) this.$store.commit('setNetworkOverviewTabList', networkTabList)
const breadcrumbColumnNameUrl = tabList.filter(item => this.$t(item.label) === name) const breadcrumbColumnNameUrl = tabList.filter(item => this.$t(item.label) === name)
if (breadcrumbColumnNameUrl && breadcrumbColumnNameUrl.length > 0) { if (breadcrumbColumnNameUrl && breadcrumbColumnNameUrl.length > 0) {
@@ -770,7 +763,7 @@ export default {
this.$store.commit('setNetworkOverviewCurrentTab', curTab) this.$store.commit('setNetworkOverviewCurrentTab', curTab)
} }
} else if (curOperationType === operationType.secondMenu) { // 点击第二级菜单,点击菜单 } else if (curOperationType === operationType.secondMenu) { // 点击第二级菜单,点击菜单
const list = this.$_.cloneDeep(networkOverviewTabList) const list = this.$_.cloneDeep(this.networkTabList)
const tabObjGroup = list.filter(item => item.checked) const tabObjGroup = list.filter(item => item.checked)
if (tabObjGroup && tabObjGroup.length > 0) { if (tabObjGroup && tabObjGroup.length > 0) {
const curTab = tabObjGroup[0] const curTab = tabObjGroup[0]
@@ -783,7 +776,7 @@ export default {
if (!curTab) { if (!curTab) {
let list = this.$store.getters.getNetworkOverviewTabList let list = this.$store.getters.getNetworkOverviewTabList
if (list.length === 0 || !list) { if (list.length === 0 || !list) {
list = this.$_.cloneDeep(networkOverviewTabList) list = this.$_.cloneDeep(this.networkTabList)
} }
const tabObjGroup = list.filter(item => item.checked) const tabObjGroup = list.filter(item => item.checked)
if (tabObjGroup && tabObjGroup.length > 0) { if (tabObjGroup && tabObjGroup.length > 0) {
@@ -799,7 +792,7 @@ export default {
if (JSON.stringify(extraParams) === '{}') { if (JSON.stringify(extraParams) === '{}') {
extraParams = { extraParams = {
type: queryType || networkOverviewTabList[0].prop, type: queryType || this.networkTabList[0].prop,
orderBy: this.orderBy ? this.orderBy : 'bytesTotal', orderBy: this.orderBy ? this.orderBy : 'bytesTotal',
limit: 10 limit: 10
} }
@@ -813,9 +806,9 @@ export default {
gerCycleUrl () { gerCycleUrl () {
const condition = this.$store.getters.getQueryCondition const condition = this.$store.getters.getQueryCondition
if (condition) { if (condition) {
return networkOverviewSearchUrl.drilldownCycleUrl return this.networkSearchUrl.drilldownCycleUrl
} else { } else {
return networkOverviewSearchUrl.cycleUrl return this.networkSearchUrl.cycleUrl
} }
}, },
handleCustomizeClick (tab) { handleCustomizeClick (tab) {
@@ -841,7 +834,7 @@ export default {
if (tabObjGroup && tabObjGroup.length > 0) { if (tabObjGroup && tabObjGroup.length > 0) {
curTab = tabObjGroup[0] curTab = tabObjGroup[0]
} else { } else {
curTab = networkOverviewTabList[0] curTab = this.networkTabList[0]
} }
this.$store.commit('setNetworkOverviewCurrentTab', curTab) this.$store.commit('setNetworkOverviewCurrentTab', curTab)
} }
@@ -852,8 +845,17 @@ export default {
if (this.chart.params && this.chart.params.drillDown) { if (this.chart.params && this.chart.params.drillDown) {
this.drillDown = this.chart.params.drillDown this.drillDown = this.chart.params.drillDown
} }
//当前表格相关数据初始化
this.tableType = this.chart.params?this.chart.params.name:'networkOverview'
this.curTable = networkTable[this.tableType]?networkTable[this.tableType]:networkTable[0]
this.hasMetricSearch = this.curTable.hasMetricSearch
this.customTableTitles = this.$_.cloneDeep(this.curTable.column)
this.list = this.$_.cloneDeep(this.curTable.tabList)
this.networkTabList = this.curTable.tabList
this.activeTab = this.networkTabList[0].label
this.activeCustomize = ref('tabs')
this.networkSearchUrl = this.curTable.url
this.list = this.$_.cloneDeep(networkOverviewTabList)
if (this.$store.getters.getNetworkOverviewTabList.length > 0) { if (this.$store.getters.getNetworkOverviewTabList.length > 0) {
this.list = this.$store.getters.getNetworkOverviewTabList this.list = this.$store.getters.getNetworkOverviewTabList
} else { } else {
@@ -880,17 +882,9 @@ export default {
}) })
} }
}, },
setup (props) { setup (props) {},
const activeTab = networkOverviewTabList[0].label
const activeCustomize = ref('tabs')
return {
activeTab,
activeCustomize,
networkOverviewTabs
}
},
destroyed () { destroyed () {
this.$store.commit('setNetworkOverviewTabList', this.list) this.$store.commit('setNetworkOverviewTabList', this.list)//保存状态
} }
} }
</script> </script>