perf: 修改平台

This commit is contained in:
ibuler
2022-08-29 18:30:47 +08:00
parent b4377e0746
commit 3136319352
2 changed files with 18 additions and 9 deletions

View File

@@ -757,7 +757,7 @@
"Dashboard": "仪表盘",
"DatabaseApp": "数据库",
"RemoteApps": "远程应用",
"Clouds": "云设施",
"Clouds": "云平台",
"DatabaseAppCreate": "创建数据库应用",
"DatabaseAppDetail": "数据库详情",
"DatabaseAppPermission": "数据库授权",

View File

@@ -1,5 +1,10 @@
<template>
<TabPage :active-menu.sync="tab.activeMenu" :submenu="tab.submenu" @tab-click="changeMoreCreates">
<TabPage
v-if="!loading"
:active-menu.sync="tab.activeMenu"
:submenu="tab.submenu"
@tab-click="changeMoreCreates"
>
<keep-alive>
<GenericListTable :table-config="tableConfig" :header-actions="headerActions" />
</keep-alive>
@@ -19,7 +24,7 @@ export default {
data() {
const vm = this
return {
show: true,
loading: true,
tab: {
submenu: Categories,
activeMenu: 'host'
@@ -90,8 +95,7 @@ export default {
},
dropdown: []
}
},
categoriesDropdown: this.$store.state.assets.assetCategoriesDropdown
}
}
},
computed: {
@@ -99,13 +103,18 @@ export default {
return `/api/v1/assets/platforms/?category=${this.tab.activeMenu}`
}
},
mounted() {
this.changeMoreCreates()
async mounted() {
try {
await this.$store.dispatch('assets/getAssetCategories')
await this.changeMoreCreates()
} finally {
this.loading = false
}
},
methods: {
changeMoreCreates() {
async changeMoreCreates() {
this.tableConfig.url = this.url
this.headerActions.moreCreates.dropdown = this.categoriesDropdown.filter(item => {
this.headerActions.moreCreates.dropdown = this.$store.state.assets.assetCategoriesDropdown.filter(item => {
return item.category === this.tab.activeMenu
})
}