维度类型暴露(使用this.$store.getters.getDimensionType获取)

This commit is contained in:
hyx
2022-08-22 09:57:40 +08:00
parent ab19220e0d
commit e75635741c
3 changed files with 26 additions and 9 deletions

View File

@@ -400,6 +400,9 @@ export default {
child.columnName = columnName
this.$store.commit('setBreadcrumbColumnValue', columnValue)
this.$store.commit('setBreadcrumbColumnName', columnName)
const tabObjGroup = networkOverviewTabList.filter(item => item.label == columnName)
let type = tabObjGroup&&tabObjGroup[0]?tabObjGroup[0].prop:''
this.$store.commit('setDimensionType', type)
this.$store.commit('setPanelName', columnValue)
} else if (columnName) { // 点击的为列名
child.columnValue = ''
@@ -410,6 +413,7 @@ export default {
const tabList = this.$store.getters.getNetworkOverviewTabList
const curTab = tabList.filter(item => this.$t(item.label) === columnName)[0]
this.$store.commit('setNetworkOverviewCurrentTab', curTab)
this.$store.commit('setDimensionType', curTab?curTab.prop:'')
this.$store.commit('setQueryCondition', '')
this.$store.commit('setNetworkOverviewBeforeTab', null)
} else {
@@ -417,6 +421,7 @@ export default {
child.columnValue = ''
this.$store.commit('setBreadcrumbColumnValue', '')
this.$store.commit('setBreadcrumbColumnName', '')
this.$store.commit('setDimensionType', '')
this.$store.commit('setPanelName', '')
this.$store.commit('setBreadcrumbColumnValueList', [])
this.$store.commit('setNetworkOverviewCurrentTab', null)
@@ -427,7 +432,7 @@ export default {
})
}
})
//console.log(this.$store.getters.getDimensionType)
if(opeType===3){
this.$router.push({
params:{...this.$route.params,fourthPanel:''}

View File

@@ -40,6 +40,7 @@ const panel = {
*/
panelName: '', // 网络概况的Panel的名称
breadcrumbColumnName: '', // 点击tab里的value都会修改此值,为面包屑的菜单
dimensionType: '', // 维度
breadcrumbColumnValue: '', // 点击tab里的value都会修改此值,为面包屑的菜单
breadcrumbColumnValueList: [], // 第四级面包屑的下拉列表
networkOverviewCurrentTab: null, // 只代表选中的tab有时会与面包屑中显示的值不同
@@ -106,6 +107,9 @@ const panel = {
setBreadcrumbColumnName (state, breadcrumbColumnName) {
state.breadcrumbColumnName = breadcrumbColumnName
},
setDimensionType (state, dimensionType) {
state.dimensionType = dimensionType
},
setBreadcrumbColumnValue (state, breadcrumbColumnValue) {
state.breadcrumbColumnValue = breadcrumbColumnValue
},
@@ -186,6 +190,9 @@ const panel = {
getBreadcrumbColumnName (state) {
return state.breadcrumbColumnName
},
getDimensionType (state) {
return state.dimensionType
},
getBreadcrumbColumnValue (state) {
return state.breadcrumbColumnValue
},

View File

@@ -20,7 +20,6 @@
:ref="`dataTable_${index}`"
:data="tableData"
border
v-loading="loading"
:cell-style="tableCellStyle"
:header-cell-style="tableHeaderCellStyle"
class="tab-table"
@@ -149,6 +148,7 @@ import {operationType, unitTypes,networkTable,tableColumnType } from '@/utils/co
import { get } from '@/utils/http'
import unitConvert from '@/utils/unit-convert'
import { getChainRatio } from '@/utils/tools'
import chartMixin from '@/views/charts2/chart-mixin'
export default {
name: 'NetworkOverviewTabs',
@@ -218,6 +218,7 @@ export default {
}
}
},
mixins: [chartMixin],
methods: {
changeMetric () {
const beforeType = this.$store.getters.getTabOperationBeforeType
@@ -305,7 +306,7 @@ export default {
q: condition
}
}
this.loading = true
this.toggleLoading(true)
this.$emit('getChartData', this.getCurUrl(), queryParams)
},
handleCustomizeButton (status) {
@@ -495,15 +496,16 @@ export default {
through: item.through
})
})
this.loading = false
this.toggleLoading(false)
} else {
this.tableData = tableDataTmp
this.loading = false
this.toggleLoading(false)
}
}).catch(e => {
this.loading = false
this.toggleLoading(false)
}).finally(e => {
this.loading = false
this.toggleLoading(false)
})
},
tabChange (index) {
@@ -547,7 +549,7 @@ export default {
q: condition
}
}
this.loading = true
this.toggleLoading(true)
this.$emit('getChartData', this.getCurUrl(), queryParams)
},
handleTabValue (columnName, columnValue) {
@@ -579,6 +581,7 @@ export default {
menu.columnValue = columnValue
this.$store.commit('setPanelName', columnValue)
this.$store.commit('setBreadcrumbColumnName', columnName)
this.$store.commit('setDimensionType', tabGroup[0]?tabGroup[0].prop:'')
this.$store.commit('setBreadcrumbColumnValue', columnValue)
}
} else if (!this.$_.isEmpty(menu.children)) {
@@ -588,11 +591,13 @@ export default {
child.columnValue = columnValue
this.$store.commit('setPanelName', columnValue)
this.$store.commit('setBreadcrumbColumnName', columnName)
this.$store.commit('setDimensionType', tabGroup[0]?tabGroup[0].prop:'')
this.$store.commit('setBreadcrumbColumnValue', columnValue)
}
})
}
})
console.log(this.$store.getters.getDimensionType)
let toPanel = null
this.list.forEach((item, index) => {
if (item.label === columnName) {
@@ -699,7 +704,7 @@ export default {
q: condition
}
}
this.loading = true
this.toggleLoading(true)
this.$emit('getChartData', this.getCurUrl(), queryParams, queryParams.q)
}
},