perf: 优化菜单显示

This commit is contained in:
ibuler
2024-03-04 19:08:45 +08:00
parent 64eacb5237
commit 2438c2fd04
7 changed files with 27 additions and 18 deletions

View File

@@ -91,7 +91,7 @@ export default {
return {
defaultMoreActions: [
{
title: this.$t('BatchDelete'),
title: this.$t('DeleteSelected'),
name: 'actionDeleteSelected',
has: this.hasBulkDelete,
icon: 'fa fa-trash-o',

View File

@@ -162,6 +162,7 @@ export default {
& > > > .svg-icon {
color: #FFF !important;
font-size: 16px;
}
& > > > .el-badge {
@@ -174,25 +175,18 @@ export default {
border: none;
}
}
}
.header-item {
padding-left: 8px;
padding-right: 8px;
& > > > i {
color: #FFF;
font-size: 16px;
&.el-icon-arrow-down {
font-size: 13px;
}
}
& > > > i.el-dialog__close.el-icon-close {
color: #7c7e7f;
}
& > > > .svg-icon {
color: #FFF;
font-size: 16px;
}
}
}
}

View File

@@ -23,6 +23,7 @@
import PageHeading from './PageHeading'
import PageContent from './PageContent'
import UserConfirmDialog from '@/components/Apps/UserConfirmDialog/index.vue'
import { toSentenceCase } from '@/utils/common'
export default {
name: 'Page',
@@ -49,7 +50,12 @@ export default {
},
computed: {
iTitle() {
return this.title || this.$route.meta.title
let title = this.title || this.$route.meta.title
if (!title) {
title = this.$t('NoTitle')
}
title = toSentenceCase(title)
return title
},
gobackDisabled() {
if (this.$route.path.endsWith('dashboard')) {

View File

@@ -1,5 +1,6 @@
import i18n from '@/i18n/i18n'
import empty from '@/layout/empty'
import store from '@/store'
export default [
{
@@ -116,10 +117,12 @@ export default [
path: 'account-push',
component: empty,
redirect: '',
name: 'AccountPush',
meta: {
app: 'accounts',
name: 'AccountPushList',
resource: 'pushaccountautomation'
resource: 'pushaccountautomation',
hidden: () => store.getters.publicSettings.LITE
},
children: [
{
@@ -190,6 +193,7 @@ export default [
meta: {
title: i18n.t('AccountGatherList'),
app: 'accounts',
hidden: () => store.getters.publicSettings.LITE,
licenseRequired: true
},
children: [
@@ -259,10 +263,10 @@ export default [
{
path: 'account-change-secret',
component: empty,
redirect: '',
meta: {
title: i18n.t('AccountChangeSecret'),
app: 'accounts',
hidden: () => store.getters.publicSettings.LITE,
licenseRequired: true
},
children: [
@@ -335,6 +339,7 @@ export default [
title: i18n.t('AccountBackup'),
app: 'accounts',
resource: 'accountbackupautomation',
hidden: () => store.getters.publicSettings.LITE,
licenseRequired: true
},
children: [

View File

@@ -1,5 +1,6 @@
import i18n from '@/i18n/i18n'
import empty from '@/layout/empty'
import store from '@/store'
const globalSubmenu = () => import('@/layout/globalOrg.vue')
@@ -54,6 +55,7 @@ export default [
title: i18n.t('AssetAclList'),
licenseRequired: true,
app: 'acls',
hidden: () => store.getters.publicSettings.LITE,
resource: 'loginassetacl'
},
children: [
@@ -149,6 +151,7 @@ export default [
licenseRequired: true,
app: 'acls',
disableOrgsChange: true,
hidden: () => store.getters.publicSettings.LITE,
resource: 'connectmethodacl'
},
children: [
@@ -189,6 +192,7 @@ export default [
title: i18n.t('UserLoginAclList'),
app: 'acls',
resource: 'loginacl',
hidden: () => store.getters.publicSettings.LITE,
disableOrgsChange: true
},
children: [

View File

@@ -10,7 +10,7 @@ const state = {
fixedHeader: fixedHeader,
sidebarLogo: sidebarLogo,
tagsView: tagsView,
publicSettings: null,
publicSettings: {},
hasValidLicense: false,
themeColors: JSON.parse(localStorage.getItem('themeColors')) || {}
}

View File

@@ -35,9 +35,10 @@ async function checkLogin({ to, from, next }) {
async function getPublicSetting({ to, from, next }, isOpen) {
// 获取Public settings
const publicSettings = store.getters.publicSettings
if (!publicSettings || !isOpen) {
if (!publicSettings || Object.keys(publicSettings).length === 0 || !isOpen) {
await store.dispatch('settings/getPublicSettings', isOpen)
}
console.log('Get public setting done')
}
async function refreshCurrentOrg() {
@@ -163,7 +164,6 @@ export async function startup({ to, from, next }) {
await getPublicSetting({ to, from, next }, true)
await checkLogin({ to, from, next })
await onI18nLoaded()
console.log('...')
await getPublicSetting({ to, from, next }, false)
await changeCurrentViewIfNeed({ to, from, next })
await changeCurrentOrgIfNeed({ to, from, next })