CN-671 Dashboard - 多维度表格优化:network overview – app list 点击标题触发下钻;npm 类别评分表格点击触发下钻;

This commit is contained in:
hanyuxia
2022-08-30 16:45:13 +08:00
parent 72f058ff7e
commit 72f3877eb4
8 changed files with 210 additions and 15 deletions

View File

@@ -382,6 +382,22 @@ export default {
if (!this.showTabs) {
this.activeCustomize = 'metrics'
}
const tabList = this.list.filter(item => item.checked === true)
const defaultTab = tabList.length > 0 ? tabList[0] : {}
const columnName = this.$store.getters.getBreadcrumbColumnName
const columnValue = this.$store.getters.getBreadcrumbColumnValue
if (tabList.length === 1) {
defaultTab.disabled = true
} else if (tabList.length > 1) {
this.list.forEach(item => {
item.disabled = false
if (columnValue) {
if (item.label === columnName) {
item.disabled = true
}
}
})
}
},
getDefaultTab () {
let tabObjGroup = this.list.filter(item => item.checked)
@@ -409,7 +425,15 @@ export default {
},
initData () {
const curTab = this.getCurTab()
// 针对network overview app list 点击标题触发下钻,相关内容处理
const columnName = this.$store.getters.getBreadcrumbColumnName
if (columnName) {
this.list.forEach(item => {
if (item.label === columnName) {
item.checked = false
}
})
}
this.list.forEach(item => {
const tabDom = document.getElementById('tab-' + item.label)
@@ -430,6 +454,7 @@ export default {
this.hideTabs(curTab)
this.customTableTitles[0].label = curTab.label
this.showTabs = false
this.showRecordNum = 10
} else if (curOperationType === operationType.fourthMenu) { // 点击的为第四级菜单
const curTab = this.getDefaultTab()
if (curTab) {
@@ -670,11 +695,18 @@ export default {
const tabList = this.list.filter(item => item.checked === true)
const defaultTab = tabList.length > 0 ? tabList[0] : {}
// 当前操作之后只有1个tab被选中则这一个不允许取消选中
const columnName = this.$store.getters.getBreadcrumbColumnName
const columnValue = this.$store.getters.getBreadcrumbColumnValue
if (tabList.length === 1) {
defaultTab.disabled = true
} else if (tabList.length > 1) {
this.list.forEach(item => {
item.disabled = false
if (columnValue) {
if (item.label === columnName) {
item.disabled = true
}
}
})
}
@@ -773,8 +805,6 @@ export default {
this.$store.commit('setNetworkOverviewCurrentTab', curTab)
}
const tab = this.list.filter(item => item.checked)
// 如果面包屑的columnValue有值则不更新valueList
const valueList = []
this.tableData.map(item => {
@@ -1043,6 +1073,13 @@ export default {
} else {
this.$store.commit('setNetworkOverviewTabList', this.list)
}
const tabList = this.list.filter(item => item.checked === true)
const columnName = this.$store.getters.getBreadcrumbColumnName
const columnValue = this.$store.getters.getBreadcrumbColumnValue
if (tabList.length === 0) { // 没有选中任何tab时默认选中第一个
this.list[0].checked = true
}
const curOperationType = this.$store.getters.getTabOperationType
if (curOperationType === operationType.thirdMenu) { // 点击的为第三级菜单
const curTab = this.getCurTab()