加入全局加载效果

This commit is contained in:
Leo_Ding 2025-11-10 09:56:24 +08:00
parent 82b0108091
commit 36f5af21da

View File

@ -1,4 +1,5 @@
<template> <template>
<a-spin :spinning="spinning" tip="Loading...">
<a-layout class="layout"> <a-layout class="layout">
<template #default> <template #default>
<!-- 上下布局 --> <!-- 上下布局 -->
@ -30,7 +31,8 @@
<template #left> <template #left>
<brand :theme="config.headerTheme"></brand> <brand :theme="config.headerTheme"></brand>
</template> </template>
<basic-menu mode="horizontal" :theme="config.headerTheme" :data-list="topMenuList"></basic-menu> <basic-menu mode="horizontal" :theme="config.headerTheme"
:data-list="topMenuList"></basic-menu>
</basic-header> </basic-header>
<a-layout> <a-layout>
<template v-if="sideMenuList.length"> <template v-if="sideMenuList.length">
@ -104,7 +106,7 @@
</template> </template>
</template> </template>
</a-layout> </a-layout>
</a-spin>
<config-dialog ref="configDialogRef"></config-dialog> <config-dialog ref="configDialogRef"></config-dialog>
</template> </template>
@ -127,15 +129,22 @@ defineOptions({
}) })
useMultiTab() useMultiTab()
const spinning = ref(false)
const appStore = useAppStore() const appStore = useAppStore()
const dicsStore = useDicsStore() const dicsStore = useDicsStore()
initData() initData()
async function initData() { async function initData() {
storage.local.setItem('companyId','C001') try {
spinning.value = true
storage.local.setItem('companyId', 'C001')
await dicsStore.loadProvinces() // await dicsStore.loadProvinces() //
await dicsStore.loadAllDictData() // await dicsStore.loadAllDictData() //
await dicsStore.loadOrgTree() await dicsStore.loadOrgTree()
spinning.value = false
} catch (error) {
spinning.value = false
}
} }
const { sideMenuList, topMenuList } = useMenu() const { sideMenuList, topMenuList } = useMenu()