CN-733 完成链路页面下钻后的表格

This commit is contained in:
hyx
2022-10-09 19:58:30 +08:00
parent 705bc0d58d
commit 09e0d95c7b
3 changed files with 295 additions and 66 deletions

View File

@@ -238,6 +238,13 @@ export const npmSearchUrl = {
drilldownCycleUrl: '/interface/application/performance/overview/drilldown/dimensionCycleTrafficAnalysis', drilldownCycleUrl: '/interface/application/performance/overview/drilldown/dimensionCycleTrafficAnalysis',
drilldownList: '/interface/overview/drilldown/list' drilldownList: '/interface/overview/drilldown/list'
} }
export const linkMonitorUrl = {
curUrl: '/interface/link/overview/drilldown/dimension/analysis',
cycleUrl: '/interface/link/overview/drilldown/dimension/cycleAnalysis',
drilldownCurUrl: '/interface/link/overview/drilldown/dimension/analysis',
drilldownCycleUrl: '/interface/link/overview/drilldown/dimension/cycleAnalysis',
drilldownList: ''
}
// dns:接口url主URL // dns:接口url主URL
export const dnsSearchUrl = { export const dnsSearchUrl = {
curUrl: '/interface/dns/overview/dimensionAnalysis', curUrl: '/interface/dns/overview/dimensionAnalysis',
@@ -366,6 +373,94 @@ export const customTableTitlesForAppPerformance = [
isInMainUrl: false isInMainUrl: false
} }
] ]
export const customTableTitlesForLinkMonitor = [
{ 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: 'through',
checked: true,
tabColumn: false,
columnType: tableColumnType.chainRatio,
cycleDataUrl: linkMonitorUrl.cycleUrl,
isInMainUrl: true
}, // 此字段当前周期的数据是否在主URL中npmSearchUrl中的URL为主URL
{
label: 'networkAppPerformance.tcpConnectionEstablishLatency',
prop: 'tcpConEstLatency',
dillDownProp: 'establishLatencyMs',
dillDownCycleProp: 'establishLatencyMs',
checked: true,
tabColumn: false,
columnType: tableColumnType.chainRatio,
cycleDataUrl: '/interface/link/overview/drilldown/dimension/networkAnalysis',
dillDownCycleDataUrl: '/interface/link/overview/drilldown/dimension/networkAnalysis',
cycle: cycle.pre,
scoreType: 0,
isScoreColumn: true,
isInMainUrl: false
},
{
label: 'networkAppPerformance.packetLoss',
prop: 'packetLoss',
dillDownProp: 'tcpLostlenPercent',
dillDownCycleProp: 'tcpLostlenPercent',
checked: false,
tabColumn: false,
columnType: tableColumnType.chainRatio,
cycleDataUrl: '/interface/link/overview/drilldown/dimension/networkAnalysis',
dillDownCycleDataUrl: '/interface/link/overview/drilldown/dimension/networkAnalysis',
cycle: cycle.pre,
scoreType: 3,
isScoreColumn: true,
isInMainUrl: false
},
{
label: 'networkAppPerformance.packetRetrans',
prop: 'packetRetrans',
dillDownProp: 'pktRetransPercent',
dillDownCycleProp: 'pktRetransPercent',
checked: false,
tabColumn: false,
columnType: tableColumnType.chainRatio,
cycleDataUrl: '/interface/link/overview/drilldown/dimension/networkAnalysis',
dillDownCycleDataUrl: '/interface/link/overview/drilldown/dimension/networkAnalysis',
cycle: cycle.pre,
scoreType: 4,
isScoreColumn: true,
isInMainUrl: false
},
{
label: 'networkAppPerformance.sslResponseLatency',
prop: 'sslResponseLatency',
dillDownProp: 'sslConLatency',
dillDownCycleProp: 'sslConLatency',
checked: false,
tabColumn: false,
columnType: tableColumnType.chainRatio,
cycleDataUrl: '/interface/link/overview/drilldown/dimension/sslConDelay',
dillDownCycleDataUrl: '/interface/link/overview/drilldown/dimension/sslConDelay',
cycle: cycle.pre,
scoreType: 2,
isScoreColumn: true,
isInMainUrl: false
},
{
label: 'networkAppPerformance.httpResponseLatency',
prop: 'httpResponseLatency',
dillDownProp: 'httpResponseLatency',
dillDownCycleProp: 'httpResponseLatency',
checked: false,
tabColumn: false,
columnType: tableColumnType.chainRatio,
cycleDataUrl: '/interface/link/overview/drilldown/dimension/httpResponseDelay',
dillDownCycleDataUrl: '/interface/link/overview/drilldown/dimension/httpResponseDelay',
cycle: cycle.pre,
scoreType: 1,
isScoreColumn: true,
isInMainUrl: false
}
]
export const customTableTitlesForDns = [ export const customTableTitlesForDns = [
{ label: 'dns.dnsServer', prop: 'tab', checked: true, tabColumn: true, columnType: tableColumnType.dillDown }, { label: 'dns.dnsServer', prop: 'tab', checked: true, tabColumn: true, columnType: tableColumnType.dillDown },
{ {
@@ -675,6 +770,137 @@ export const networkAppPerformanceTabList = [
panelId: drillDownPanelTypeMapping.npmOverviewCommon panelId: drillDownPanelTypeMapping.npmOverviewCommon
} }
] ]
export const linkMonitorTabList = [
{
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.linkMonitor// 下钻后展示的panelId
}, {
label: 'network.countries',
prop: 'country',
queryCycleTotalProp: 'countries',
dillDownProp: ['client_country', 'server_country'],
checked: true,
disabled: false,
panelId: drillDownPanelTypeMapping.linkMonitor
}, {
label: 'network.asns',
prop: 'asn',
queryCycleTotalProp: 'asns',
dillDownProp: ['client_asn', 'server_asn'],
checked: true,
disabled: false,
panelId: drillDownPanelTypeMapping.linkMonitor
}, {
label: 'network.applications',
prop: 'appLabel',
queryCycleTotalProp: 'applications',
dillDownProp: ['common_app_label'],
checked: true,
disabled: false,
panelId: drillDownPanelTypeMapping.linkMonitor
}, {
label: 'network.providers',
prop: 'appCompany',
queryCycleTotalProp: 'providers',
dillDownProp: ['app_company'],
checked: true,
disabled: false,
panelId: drillDownPanelTypeMapping.linkMonitor
}, {
label: 'network.domains',
prop: 'domain',
queryCycleTotalProp: 'domains',
dillDownProp: ['domain'],
checked: true,
disabled: false,
panelId: drillDownPanelTypeMapping.linkMonitor
}, {
label: 'network.protocols',
prop: 'l7Protocol',
queryCycleTotalProp: 'protocols',
dillDownProp: ['common_l7_protocol'],
checked: true,
disabled: false,
panelId: drillDownPanelTypeMapping.linkMonitor
}, {
label: 'network.idcTenants',
prop: 'idcRenter',
queryCycleTotalProp: 'idcTenants',
dillDownProp: ['client_idc_renter', 'server_idc_renter'],
checked: true,
disabled: false,
panelId: drillDownPanelTypeMapping.linkMonitor
}, {
label: 'network.provinces',
prop: 'province',
queryCycleTotalProp: 'provinces',
dillDownProp: ['client_province', 'server_province'],
checked: false,
disabled: false,
panelId: drillDownPanelTypeMapping.linkMonitor
}, {
label: 'network.cities',
prop: 'city',
queryCycleTotalProp: 'cities',
dillDownProp: ['client_region', 'server_region'],
checked: false,
disabled: false,
panelId: drillDownPanelTypeMapping.linkMonitor
}, {
label: 'network.isps',
prop: 'isp',
queryCycleTotalProp: 'isps',
dillDownProp: ['client_isp', 'server_isp'],
checked: false,
disabled: false,
panelId: drillDownPanelTypeMapping.linkMonitor
}, {
label: 'network.applicationCategories',
prop: 'appSubcategory',
queryCycleTotalProp: 'applicationCategories',
dillDownProp: ['app_subcategory'],
checked: false,
disabled: false,
panelId: drillDownPanelTypeMapping.linkMonitor
}, {
label: 'network.domainCategories',
prop: 'domainCategoryName',
queryCycleTotalProp: 'domainCategories',
dillDownProp: ['domain_category_name'],
checked: false,
disabled: false,
panelId: drillDownPanelTypeMapping.linkMonitor
}, {
label: 'network.hosts',
prop: 'httpHost',
queryCycleTotalProp: 'hosts',
dillDownProp: ['http_host'],
checked: false,
disabled: false,
panelId: drillDownPanelTypeMapping.linkMonitor
}, {
label: 'network.snis',
prop: 'sslSni',
queryCycleTotalProp: 'snis',
dillDownProp: ['ssl_sni'],
checked: false,
disabled: false,
panelId: drillDownPanelTypeMapping.linkMonitor
}, {
label: 'network.protocolPorts',
prop: 'protocolPort',
queryCycleTotalProp: 'protocolports',
dillDownProp: ['common_l7_protocol', 'common_server_port '],
checked: false,
disabled: false,
panelId: drillDownPanelTypeMapping.linkMonitor
}
]
export const dnsServiceInsightsTabList = [ export const dnsServiceInsightsTabList = [
{ {
label: 'dns.dnsServer', // tab名称对应的il8n label: 'dns.dnsServer', // tab名称对应的il8n
@@ -896,6 +1122,15 @@ export const networkTable = {
bytesColumnNameGroup: bytesColumnNameGroupForDns, bytesColumnNameGroup: bytesColumnNameGroupForDns,
bytesCycleColumnNameGroup: bytesCycleColumnNameGroupForDns, bytesCycleColumnNameGroup: bytesCycleColumnNameGroupForDns,
defaultOrderBy: 'totalBytes' defaultOrderBy: 'totalBytes'
},
linkMonitor:{
tabList: linkMonitorTabList,
column: customTableTitlesForLinkMonitor,
url: linkMonitorUrl,
hasMetricSearch: false, // 是否有metric下拉列表
panelIdOfThirdMenu: drillDownPanelTypeMapping.linkMonitor,
bytesColumnNameGroup: bytesColumnNameGroupForNpm,
bytesCycleColumnNameGroup: bytesCycleColumnNameGroupForNmp
} }
} }

View File

@@ -93,7 +93,7 @@ export default {
// this.panelName = this.$store.getters.getPanelName // this.panelName = this.$store.getters.getPanelName
this.panelName = this.$route.query.panelName ? this.$t(this.$route.query.panelName) : '' this.panelName = this.$route.query.panelName ? this.$t(this.$route.query.panelName) : ''
// const curOperationType = this.$store.getters.getTabOperationType // const curOperationType = this.$store.getters.getTabOperationType
/*const curOperationType = this.getUrlParam(this.curTabState.tabOperationType, '', true) /* const curOperationType = this.getUrlParam(this.curTabState.tabOperationType, '', true)
if (this.panelName && this.$route.path === '/panel/networkAppPerformance' && curOperationType !== operationType.thirdMenu) { if (this.panelName && this.$route.path === '/panel/networkAppPerformance' && curOperationType !== operationType.thirdMenu) {
// const columnValue = this.$store.getters.getBreadcrumbColumnValue // const columnValue = this.$store.getters.getBreadcrumbColumnValue
const columnValue = this.getUrlParam(this.curTabState.fourthMenu, '') const columnValue = this.getUrlParam(this.curTabState.fourthMenu, '')
@@ -141,7 +141,7 @@ export default {
}) })
} else if (this.$route.path === '/panel/networkAppPerformance' && curOperationType === operationType.thirdMenu) { } else if (this.$route.path === '/panel/networkAppPerformance' && curOperationType === operationType.thirdMenu) {
this.score = this.$store.getters.getNpmThirdLevelMenuScore this.score = this.$store.getters.getNpmThirdLevelMenuScore
}*/ } */
await this.init() await this.init()
const vm = this const vm = this

View File

@@ -68,7 +68,8 @@
</div> </div>
</template> </template>
<template v-else-if="item.columnType === tableColumnType.dillDown" > <template v-else-if="item.columnType === tableColumnType.dillDown" >
<div class="data-click" @click="handleTabValue(item.label,scope.row['tab'])">{{scope.row['tab']}}</div> <div v-if="isOnlyRead" >{{scope.row['tab']}}</div>
<div v-else class="data-click" @click="handleTabValue(item.label,scope.row['tab'])">{{scope.row['tab']}}</div>
</template> </template>
<template v-else-if="item.columnType === tableColumnType.percent" > <template v-else-if="item.columnType === tableColumnType.percent" >
<div class="dns-in-ex"> <div class="dns-in-ex">
@@ -234,6 +235,7 @@ export default {
metricsList: [], metricsList: [],
curTabState: curTabState, curTabState: curTabState,
curTable: {}, // 当前的表格类型 curTable: {}, // 当前的表格类型
isOnlyRead: false,
curTableInCode: {}, // 代码中的配置 curTableInCode: {}, // 代码中的配置
tableType: '', tableType: '',
userId: null, userId: null,
@@ -350,14 +352,22 @@ export default {
} }
}, },
isThirdMenu () { // 当前是否为3级 isThirdMenu () { // 当前是否为3级
const thirdMenu = this.getUrlParam(this.curTabState.thirdMenu, '') if(this.isOnlyRead){
const fourthMenu = this.getUrlParam(this.curTabState.fourthMenu, '') return false
return thirdMenu && !fourthMenu }else {
const thirdMenu = this.getUrlParam(this.curTabState.thirdMenu, '')
const fourthMenu = this.getUrlParam(this.curTabState.fourthMenu, '')
return thirdMenu && !fourthMenu
}
}, },
isFourthMenu () { // 当前是否为4级 isFourthMenu () { // 当前是否为4级
const thirdMenu = this.getUrlParam(this.curTabState.thirdMenu, '') if(this.isOnlyRead){
const fourthMenu = this.getUrlParam(this.curTabState.fourthMenu, '') return false
return thirdMenu && fourthMenu }else {
const thirdMenu = this.getUrlParam(this.curTabState.thirdMenu, '')
const fourthMenu = this.getUrlParam(this.curTabState.fourthMenu, '')
return thirdMenu && fourthMenu
}
}, },
initState () { initState () {
console.log('InitState开始') console.log('InitState开始')
@@ -400,14 +410,14 @@ export default {
// 针对network overview app list 点击标题触发下钻,相关内容处理 // 针对network overview app list 点击标题触发下钻,相关内容处理
const thirdMenu = this.getUrlParam(this.curTabState.thirdMenu, '') const thirdMenu = this.getUrlParam(this.curTabState.thirdMenu, '')
const fourthMenu = this.getUrlParam(this.curTabState.fourthMenu, '') //const fourthMenu = this.getUrlParam(this.curTabState.fourthMenu, '')
if (thirdMenu && fourthMenu) { if (this.isFourthMenu()) {
this.list.forEach(item => { this.list.forEach(item => {
if (item.label === thirdMenu) { if (item.label === thirdMenu) {
item.checked = false //item.checked = false
} }
}) })
} else if (thirdMenu && !fourthMenu) { } else if (this.isThirdMenu()) {
this.list.forEach(item => { this.list.forEach(item => {
if (item.label === thirdMenu) { if (item.label === thirdMenu) {
item.checked = true item.checked = true
@@ -432,7 +442,6 @@ export default {
} }
const curOperationType = this.getUrlParam(this.curTabState.tabOperationType, '', true) const curOperationType = this.getUrlParam(this.curTabState.tabOperationType, '', true)
const beforeOperationType = this.getUrlParam(this.curTabState.tabOperationBeforeType, '', true)
if (this.isFourthMenu()) { // 点击的为第四级菜单 if (this.isFourthMenu()) { // 点击的为第四级菜单
curTab = this.getCurTab() curTab = this.getCurTab()
if (curTab) { if (curTab) {
@@ -440,7 +449,6 @@ export default {
this.urlChangeParams[this.curTabState.curTab] = curTab.prop this.urlChangeParams[this.curTabState.curTab] = curTab.prop
} }
this.showCustomizeTabs = true this.showCustomizeTabs = true
// this.setShowNum(10)
} else if (this.isThirdMenu()) { // 点击的为第三级菜单 } else if (this.isThirdMenu()) { // 点击的为第三级菜单
const name = this.getUrlParam(this.curTabState.thirdMenu, '') const name = this.getUrlParam(this.curTabState.thirdMenu, '')
// const networkTabList = [] // const networkTabList = []
@@ -448,7 +456,6 @@ export default {
if (item.label === name) { if (item.label === name) {
item.checked = true item.checked = true
} }
// networkTabList.push(item)
}) })
const breadcrumbColumnTab = this.list.find(item => item.label === name) const breadcrumbColumnTab = this.list.find(item => item.label === name)
this.urlChangeParams[this.curTabState.curTab] = breadcrumbColumnTab.prop this.urlChangeParams[this.curTabState.curTab] = breadcrumbColumnTab.prop
@@ -458,13 +465,12 @@ export default {
this.showCustomizeTabs = false this.showCustomizeTabs = false
} else if (curOperationType === operationType.changeTab) { // 切换tab } else if (curOperationType === operationType.changeTab) { // 切换tab
this.showCustomizeTabs = true this.showCustomizeTabs = true
} else if (curOperationType === operationType.secondMenu || curOperationType === operationType.mainMenu) { // 点击的为第二级菜单、或者点击菜单进入、 } else if (curOperationType === operationType.secondMenu || curOperationType === operationType.mainMenu ) { // 点击的为第二级菜单、或者点击菜单进入、
// this.list = this.$_.cloneDeep(this.allList)
if (curTab) { if (curTab) {
this.showTab(curTab) this.showTab(curTab)
this.urlChangeParams[this.curTabState.curTab] = curTab.prop this.urlChangeParams[this.curTabState.curTab] = curTab.prop
} }
if (thirdMenu && fourthMenu) { if (this.isFourthMenu()) {
this.$nextTick(() => { this.$nextTick(() => {
this.list.forEach(item => { this.list.forEach(item => {
if (item.label === thirdMenu) { if (item.label === thirdMenu) {
@@ -472,7 +478,7 @@ export default {
} }
}) })
}) })
} else if (thirdMenu && !fourthMenu) { } else if (this.isThirdMenu()) {
this.list.forEach(item => { this.list.forEach(item => {
if (item.label === thirdMenu) { if (item.label === thirdMenu) {
item.checked = true item.checked = true
@@ -515,6 +521,8 @@ export default {
this.showCustomizeTabs = true this.showCustomizeTabs = true
}) })
} }
}else {
this.showCustomizeTabs = true
} }
this.changeUrlTabState() this.changeUrlTabState()
console.log('InitState: 结束') console.log('InitState: 结束')
@@ -955,7 +963,7 @@ export default {
item.disabled = false item.disabled = false
if (columnValue) { if (columnValue) {
if (item.label === columnName) { if (item.label === columnName) {
item.disabled = true //item.disabled = true
} }
} }
}) })
@@ -995,11 +1003,6 @@ export default {
}, },
// 配置tab显示隐藏与顺序 // 配置tab显示隐藏与顺序
tabChange (index) { tabChange (index) {
console.log('NetworkOverview类------tabChange隐藏或显示tab-开始')
console.log(this.list)
console.log(this.curTable)
console.log(this.drillDownTableConfigs)
console.log('NetworkOverview类------tabChange隐藏或显示tab-开始')
this.isNoData = false this.isNoData = false
// 操作类型设置 // 操作类型设置
const beforeType = this.getUrlParam(this.curTabState.tabOperationBeforeType, '', true) const beforeType = this.getUrlParam(this.curTabState.tabOperationBeforeType, '', true)
@@ -1021,7 +1024,7 @@ export default {
item.disabled = false item.disabled = false
if (columnValue) { if (columnValue) {
if (item.label === columnName) { if (item.label === columnName) {
item.disabled = true //item.disabled = true
} }
} }
}) })
@@ -1067,11 +1070,6 @@ export default {
} else { } else {
this.changeUrlTabState() this.changeUrlTabState()
} }
console.log('NetworkOverview类------tabChange隐藏或显示tab-结束')
console.log(this.list)
console.log(this.curTable)
console.log(this.drillDownTableConfigs)
console.log('NetworkOverview类------tabChange隐藏或显示tab-结束')
}, },
setOperationType (operationType) { setOperationType (operationType) {
this.urlChangeParams[this.curTabState.tabOperationBeforeType] = this.getUrlParam(this.curTabState.tabOperationType, '', true) this.urlChangeParams[this.curTabState.tabOperationBeforeType] = this.getUrlParam(this.curTabState.tabOperationType, '', true)
@@ -1089,6 +1087,7 @@ export default {
this.urlChangeParams[this.curTabState.networkOverviewBeforeTab] = tab.prop this.urlChangeParams[this.curTabState.networkOverviewBeforeTab] = tab.prop
}, },
setQueryCondition (tab, value) { setQueryCondition (tab, value) {
value = value.replaceAll("'","\\\\'")
const queryCondition = [] const queryCondition = []
const searchProps = tab.dillDownProp const searchProps = tab.dillDownProp
if (tab.prop === 'protocolPort') { if (tab.prop === 'protocolPort') {
@@ -1139,7 +1138,6 @@ export default {
} }
}) })
this.list = this.getDrilldownTabList(columnName) this.list = this.getDrilldownTabList(columnName)
// this.combineTabList(this.list)
const curTab = this.getCurTab(clickTab) const curTab = this.getCurTab(clickTab)
tabList.forEach(tab => { tabList.forEach(tab => {
if (tab.label === curTab.label && tab.columns) { if (tab.label === curTab.label && tab.columns) {
@@ -1149,7 +1147,6 @@ export default {
} else { } else {
const changeTab = tabList.find(item => item.label == columnName)// 下钻的tab const changeTab = tabList.find(item => item.label == columnName)// 下钻的tab
this.list = changeTab.drilldownTabs this.list = changeTab.drilldownTabs
// this.combineTabList(this.list)
const curTab = this.getCurTab(clickTab) const curTab = this.getCurTab(clickTab)
tabList.forEach(tab => { tabList.forEach(tab => {
if (tab.label === curTab.label && tab.columns) { if (tab.label === curTab.label && tab.columns) {
@@ -1158,6 +1155,7 @@ export default {
}) })
} }
this.saveUserLocalConfig() this.saveUserLocalConfig()
console.log(this.drillDownTableConfigs)
this.$store.getters.menuList.forEach(menu => { this.$store.getters.menuList.forEach(menu => {
if (this.$_.isEmpty(menu.children) && menu.route) { if (this.$_.isEmpty(menu.children) && menu.route) {
if (this.$route.path === menu.route) { if (this.$route.path === menu.route) {
@@ -1182,17 +1180,14 @@ export default {
} }
}) })
this.changeUrlTabState() this.changeUrlTabState()
this.$router.push({ this.jumpAndCache(this.$route.path, {
path: this.$route.path, ...this.$route.query,
query: { thirdPanel: this.curTable.panelIdOfThirdMenu,
...this.$route.query, fourthPanel: toPanel
thirdPanel: this.curTable.panelIdOfThirdMenu,
fourthPanel: toPanel,
t: +new Date()
}
}) })
}, },
handleSearchParams (columnValue) { handleSearchParams (columnValue) {
columnValue = columnValue.replaceAll("'","\\\\'")
const queryCondition = [] const queryCondition = []
const curTab = this.getCurTab() const curTab = this.getCurTab()
const searchProps = curTab.dillDownProp const searchProps = curTab.dillDownProp
@@ -1266,7 +1261,7 @@ export default {
this.urlChangeParams = this.$_.omit(this.urlChangeParams, [this.curTabState.tableSortColumn, this.curTabState.tableSortType, this.curTabState.tableSortTab]) this.urlChangeParams = this.$_.omit(this.urlChangeParams, [this.curTabState.tableSortColumn, this.curTabState.tableSortType, this.curTabState.tableSortTab])
this.cancleSortArrow() this.cancleSortArrow()
}, },
// 切换tab的时候,只需要修改列即可,但是列需要从indexDB中获取 // 切换tab
handleClick (tab) { handleClick (tab) {
this.tableData = [] this.tableData = []
this.tableDataBackup = [] this.tableDataBackup = []
@@ -1447,10 +1442,10 @@ export default {
}, },
combineTabList (tabList) { combineTabList (tabList) {
console.log('CombineTabList开始') console.log('CombineTabList开始')
const listInCode = this.curTableInCode ? this.curTableInCode.tabList : [] let listInCode = this.curTableInCode ? this.curTableInCode.tabList : []
tabList.forEach(tab => { tabList.forEach(tab => {
const tabName = tab ? (tab.name ? tab.name : tab) : '' let tabName = tab ? (tab.name ? tab.name : tab) : ''
const commonTab = this.commonTabList.find(item => item.name === tabName) let commonTab = this.commonTabList.find(item => item.name === tabName)
tab.label = commonTab ? commonTab.i18n : '' tab.label = commonTab ? commonTab.i18n : ''
tab.prop = commonTab ? commonTab.prop : '' tab.prop = commonTab ? commonTab.prop : ''
if (!tab.hasOwnProperty('checked') || tab.checked === undefined || tab.checked === null) { if (!tab.hasOwnProperty('checked') || tab.checked === undefined || tab.checked === null) {
@@ -1463,37 +1458,34 @@ export default {
tab.panelId = tab ? tab.panelIdOfFourthMenu : null tab.panelId = tab ? tab.panelIdOfFourthMenu : null
} }
// 代码里写死的 // 代码里写死的
const tabInCode = listInCode ? listInCode.find(item => item.label === tab.label) : {} let tabInCode = listInCode ? listInCode.find(item => item.label === tab.label) : {}
tab.queryCycleTotalProp = tabInCode ? tabInCode.queryCycleTotalProp : null tab.queryCycleTotalProp = tabInCode ? tabInCode.queryCycleTotalProp : null
tab.dillDownProp = tabInCode ? tabInCode.dillDownProp : [] tab.dillDownProp = tabInCode ? tabInCode.dillDownProp : []
}) })
// 设置drilldownTabs未下钻状态设置已下钻状态无需设置 // 设置drilldownTabs未下钻状态设置已下钻状态无需设置
const thirdMenu = this.getUrlParam(this.curTabState.thirdMenu, '') let thirdMenu = this.getUrlParam(this.curTabState.thirdMenu, '')
if (!thirdMenu) { //if (!thirdMenu) {
const oldList = this.$_.cloneDeep(tabList) let oldList = this.$_.cloneDeep(tabList)
tabList.forEach(tab => { tabList.forEach(tab => {
const drilldownTabFull = [] let drilldownTabFull = []
const drilldownTabList = tab.drilldownTabs let drilldownTabList = tab.drilldownTabs
drilldownTabList.forEach(drilldownTab => { drilldownTabList.forEach(drilldownTab => {
if (!drilldownTab.hasOwnProperty('name') || drilldownTab.name === undefined || drilldownTab.name === null) { if (!drilldownTab.hasOwnProperty('name') || drilldownTab.name === undefined || drilldownTab.name === null) {
const drilldownTabName = drilldownTab || '' let drilldownTabName = drilldownTab || ''
const fullTab = oldList.find(item => item.name === drilldownTabName) let fullTab = oldList.find(item => item.name === drilldownTabName)
const drilldownTabWithAllInfo = this.$_.cloneDeep(fullTab) let drilldownTabWithAllInfo = this.$_.cloneDeep(fullTab)
if (drilldownTabWithAllInfo) { if (drilldownTabWithAllInfo) {
const commonTab = this.commonTabList.find(item => item.name === drilldownTabName) let commonTab = this.commonTabList.find(item => item.name === drilldownTabName)
drilldownTabWithAllInfo.label = commonTab ? commonTab.i18n : '' drilldownTabWithAllInfo.label = commonTab ? commonTab.i18n : ''
drilldownTabWithAllInfo.prop = commonTab ? commonTab.prop : '' drilldownTabWithAllInfo.prop = commonTab ? commonTab.prop : ''
/* if (!drilldownTabWithAllInfo.hasOwnProperty('panelId') || drilldownTabWithAllInfo.panelId === undefined || drilldownTabWithAllInfo.panelId === null) { //if (!drilldownTabWithAllInfo.hasOwnProperty('checked') || drilldownTabWithAllInfo.checked === undefined || drilldownTabWithAllInfo.checked === null) {
drilldownTabWithAllInfo.panelId = tab ? tab.panelIdOfFourthMenu : ''
} */
if (!drilldownTabWithAllInfo.hasOwnProperty('checked') || drilldownTabWithAllInfo.checked === undefined || drilldownTabWithAllInfo.checked === null) {
drilldownTabWithAllInfo.checked = !((tab.hiddenDrilldownTabs.indexOf(drilldownTabName) >= 0)) drilldownTabWithAllInfo.checked = !((tab.hiddenDrilldownTabs.indexOf(drilldownTabName) >= 0))
} //}
if (!drilldownTabWithAllInfo.hasOwnProperty('disabled') || drilldownTabWithAllInfo.disabled === undefined || drilldownTabWithAllInfo.disabled === null) { //if (!drilldownTabWithAllInfo.hasOwnProperty('disabled') || drilldownTabWithAllInfo.disabled === undefined || drilldownTabWithAllInfo.disabled === null) {
drilldownTabWithAllInfo.disabled = (tab.disabledDrilldownTabs.indexOf(drilldownTabName) >= 0) drilldownTabWithAllInfo.disabled = (tab.disabledDrilldownTabs.indexOf(drilldownTabName) >= 0)
} //}
// 代码里写死的 // 代码里写死的
const tabInCode = listInCode ? listInCode.find(item => item.label === fullTab.label) : {} let tabInCode = listInCode ? listInCode.find(item => item.label === fullTab.label) : {}
drilldownTabWithAllInfo.queryCycleTotalProp = tabInCode ? tabInCode.queryCycleTotalProp : null drilldownTabWithAllInfo.queryCycleTotalProp = tabInCode ? tabInCode.queryCycleTotalProp : null
drilldownTabWithAllInfo.dillDownProp = tabInCode ? tabInCode.dillDownProp : [] drilldownTabWithAllInfo.dillDownProp = tabInCode ? tabInCode.dillDownProp : []
drilldownTabFull.push(drilldownTabWithAllInfo) drilldownTabFull.push(drilldownTabWithAllInfo)
@@ -1504,7 +1496,7 @@ export default {
tab.drilldownTabs = drilldownTabFull tab.drilldownTabs = drilldownTabFull
} }
}) })
} //}
console.log('CombineTabList结束') console.log('CombineTabList结束')
}, },
combineColumnList (tabLabel) { combineColumnList (tabLabel) {
@@ -1553,6 +1545,7 @@ export default {
async getUserLocalConfig () { async getUserLocalConfig () {
const userLocalCongfig = await db[dbDrilldownTableConfig].get({ id: this.userId }) const userLocalCongfig = await db[dbDrilldownTableConfig].get({ id: this.userId })
if (userLocalCongfig) { if (userLocalCongfig) {
console.info(userLocalCongfig.config)
return userLocalCongfig.config return userLocalCongfig.config
} else { } else {
return null return null
@@ -1683,7 +1676,7 @@ export default {
} }
} else { // 非下钻状态 } else { // 非下钻状态
this.list = this.getAllTabList() this.list = this.getAllTabList()
if (!this.isSetDrilldownTabInfo(this.list)) { // 否设置了下钻的详细信息 if (!this.isSetDrilldownTabInfo(this.list)) { // 否设置了下钻的详细信息
this.combineTabList(this.list) this.combineTabList(this.list)
} }
this.allList = this.$_.cloneDeep(this.list)// 备份所有配置,下钻及返回时使用 this.allList = this.$_.cloneDeep(this.list)// 备份所有配置,下钻及返回时使用
@@ -1705,6 +1698,7 @@ export default {
this.curTable.sessionsCycleColumnNameGroup = this.curTableInCode ? this.curTableInCode.sessionsCycleColumnNameGroup : [] this.curTable.sessionsCycleColumnNameGroup = this.curTableInCode ? this.curTableInCode.sessionsCycleColumnNameGroup : []
this.columnNameGroup = this.curTable.bytesColumnNameGroup this.columnNameGroup = this.curTable.bytesColumnNameGroup
this.cycleColumnNameGroup = this.curTable.bytesCycleColumnNameGroup this.cycleColumnNameGroup = this.curTable.bytesCycleColumnNameGroup
this.isOnlyRead = this.curTable.isOnlyRead ? this.curTable.isOnlyRead : false
if (this.curTableInCode.defaultOrderBy) { if (this.curTableInCode.defaultOrderBy) {
this.orderBy = this.curTableInCode.defaultOrderBy this.orderBy = this.curTableInCode.defaultOrderBy
} }