首页细节调整
This commit is contained in:
@@ -57,12 +57,14 @@
|
||||
@tab-close="onTabClose"
|
||||
@close-other="onCloseOther"
|
||||
@close-all="onCloseAll"
|
||||
@refresh="onRefresh"
|
||||
/>
|
||||
|
||||
<!-- 内容展示区 (内部路由渲染) -->
|
||||
<view class="content-scroll">
|
||||
<view class="content-inner" :class="{ 'is-mobile': isMobile }">
|
||||
<component :is="currentComponent" />
|
||||
<component :is="currentComponent" v-if="!isPageLoading" />
|
||||
<AdminPageLoading v-if="isPageLoading" />
|
||||
</view>
|
||||
<AdminFooter />
|
||||
</view>
|
||||
@@ -77,6 +79,7 @@ import AdminSubSider from '@/layouts/admin/components/AdminSubSider.uvue'
|
||||
import AdminHeader from '@/layouts/admin/components/AdminHeader.uvue'
|
||||
import AdminTagsView from '@/layouts/admin/components/AdminTagsView.uvue'
|
||||
import AdminFooter from '@/layouts/admin/components/AdminFooter.uvue'
|
||||
import AdminPageLoading from '@/layouts/admin/components/AdminPageLoading.uvue'
|
||||
|
||||
import {
|
||||
getTopMenus,
|
||||
@@ -117,6 +120,9 @@ import { getComponent } from '@/layouts/admin/router/adminComponentMap.uts'
|
||||
const ASIDE_W = 70
|
||||
const SUB_W = 200
|
||||
|
||||
// 页面加载状态
|
||||
const isPageLoading = ref(false)
|
||||
|
||||
const hasNotification = ref<boolean>(false)
|
||||
|
||||
/**
|
||||
@@ -251,6 +257,12 @@ const currentComponent = computed<any>(() => {
|
||||
|
||||
// 监听路由变化,同步状态 (处理从 Tabs 或外部跳转的情况)
|
||||
watch(() => activeRouteId.value, (newId) => {
|
||||
// 触发页面加载动画
|
||||
isPageLoading.value = true
|
||||
setTimeout(() => {
|
||||
isPageLoading.value = false
|
||||
}, 400) // 给予足够的时间让异步组件加载
|
||||
|
||||
const route = findRouteById(newId)
|
||||
if (route && route.parentId) {
|
||||
// 同步一级菜单
|
||||
@@ -399,7 +411,7 @@ onMounted(() => {
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
background: #f5f7f9;
|
||||
background: #f0f2f5;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -443,7 +455,7 @@ onMounted(() => {
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
transition: margin-left 300ms ease;
|
||||
background: #f5f7f9;
|
||||
background: #f0f2f5;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -473,13 +485,15 @@ onMounted(() => {
|
||||
flex: 1;
|
||||
overflow-y: scroll;
|
||||
overflow-x: auto; /* 允许横向滚动,兼容极端窄屏 */
|
||||
background: #f5f7f9;
|
||||
background: #f0f2f5;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.content-inner {
|
||||
min-height: calc(100vh - 120px);
|
||||
padding: 12px 14px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.content-inner.is-mobile {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,8 @@ function getIconText(icon: string): string {
|
||||
'user': '👥',
|
||||
'product': '📦',
|
||||
'order': '📜',
|
||||
'marketing': '📉', 'share': '📢', 'content': '📝',
|
||||
'marketing': '📉',
|
||||
'content': '📝',
|
||||
'finance': '💰',
|
||||
'statistic': '📊',
|
||||
'setting': '⚙️',
|
||||
|
||||
53
layouts/admin/components/AdminPageLoading.uvue
Normal file
53
layouts/admin/components/AdminPageLoading.uvue
Normal file
@@ -0,0 +1,53 @@
|
||||
<template>
|
||||
<view class="loading-overlay">
|
||||
<view class="loading-content">
|
||||
<view class="spinner"></view>
|
||||
<text class="loading-text">加载中...</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
// 管理后台统一加载动画组件
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.loading-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(255, 255, 255, 0.7);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.loading-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border: 3px solid #f3f3f3;
|
||||
border-top: 3px solid #2d8cf0;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
</style>
|
||||
@@ -225,8 +225,9 @@ const statsData = ref({
|
||||
|
||||
<style scoped>
|
||||
.home-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0;
|
||||
background-color: #f0f2f5;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
/* 兼容旧布局标识,样式逻辑已由 .kpi-grid 接管 */
|
||||
@@ -354,7 +355,7 @@ const statsData = ref({
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.home-page {
|
||||
padding: 12px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.bottom-charts {
|
||||
|
||||
@@ -144,9 +144,10 @@ export const componentMap: Map<string, any> = new Map([
|
||||
['SettingInterfacePayment', defineAsyncComponent(() => import('@/pages/mall/admin/setting/interface/payment.uvue'))],
|
||||
|
||||
// 分销模块
|
||||
['DistributionStatistic', PlaceholderPage],
|
||||
['DistributionPromoter', defineAsyncComponent(() => import('@/pages/mall/admin/distribution/promoter/index.uvue'))],
|
||||
['DistributionLevel', defineAsyncComponent(() => import('@/pages/mall/admin/distribution/level/index.uvue'))],
|
||||
['DistributionConfig', defineAsyncComponent(() => import('@/pages/mall/admin/distribution/setting/index.uvue'))],
|
||||
['DistributionSetting', defineAsyncComponent(() => import('@/pages/mall/admin/distribution/setting/index.uvue'))],
|
||||
['DivisionList', defineAsyncComponent(() => import('@/pages/mall/admin/distribution/division/list.uvue'))],
|
||||
['DivisionAgent', defineAsyncComponent(() => import('@/pages/mall/admin/distribution/division/agent.uvue'))],
|
||||
['DivisionApply', defineAsyncComponent(() => import('@/pages/mall/admin/distribution/division/apply.uvue'))],
|
||||
|
||||
@@ -119,11 +119,10 @@ export const topMenus: TopMenu[] = [
|
||||
id: 'distribution',
|
||||
title: '分销',
|
||||
icon: 'share',
|
||||
path: '/pages/mall/admin/distribution/promoter',
|
||||
path: '/pages/mall/admin/distribution/statistic',
|
||||
order: 6,
|
||||
groups: [
|
||||
{ id: 'distribution-manage', title: '', order: 1 },
|
||||
{ id: 'distribution-division', title: '事业部', order: 2 }
|
||||
{ id: 'distribution-manage', title: '', order: 1 }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1070,6 +1069,15 @@ export const routes: RouteRecord[] = [
|
||||
},
|
||||
|
||||
// ========== 分销模块 ==========
|
||||
{
|
||||
id: 'distribution_statistic',
|
||||
title: '分销统计',
|
||||
path: '/pages/mall/admin/distribution/statistic',
|
||||
componentKey: 'DistributionStatistic',
|
||||
parentId: 'distribution',
|
||||
groupId: 'distribution-manage',
|
||||
order: 1
|
||||
},
|
||||
{
|
||||
id: 'distribution_promoter',
|
||||
title: '分销员管理',
|
||||
@@ -1077,7 +1085,7 @@ export const routes: RouteRecord[] = [
|
||||
componentKey: 'DistributionPromoter',
|
||||
parentId: 'distribution',
|
||||
groupId: 'distribution-manage',
|
||||
order: 1
|
||||
order: 2
|
||||
},
|
||||
{
|
||||
id: 'distribution_level',
|
||||
@@ -1086,43 +1094,43 @@ export const routes: RouteRecord[] = [
|
||||
componentKey: 'DistributionLevel',
|
||||
parentId: 'distribution',
|
||||
groupId: 'distribution-manage',
|
||||
order: 2
|
||||
order: 3
|
||||
},
|
||||
{
|
||||
id: 'distribution_config',
|
||||
id: 'distribution_setting',
|
||||
title: '分销设置',
|
||||
path: '/pages/mall/admin/distribution/setting/index',
|
||||
componentKey: 'DistributionConfig',
|
||||
componentKey: 'DistributionSetting',
|
||||
parentId: 'distribution',
|
||||
groupId: 'distribution-manage',
|
||||
order: 3
|
||||
order: 4
|
||||
},
|
||||
{
|
||||
id: 'division_list',
|
||||
title: '事业部列表',
|
||||
title: '事业部管理',
|
||||
path: '/pages/mall/admin/distribution/division/list',
|
||||
componentKey: 'DivisionList',
|
||||
parentId: 'distribution',
|
||||
groupId: 'distribution-division',
|
||||
order: 1
|
||||
groupId: 'distribution-manage',
|
||||
order: 5
|
||||
},
|
||||
{
|
||||
id: 'division_agent',
|
||||
title: '代理商列表',
|
||||
title: '代理商管理',
|
||||
path: '/pages/mall/admin/distribution/division/agent',
|
||||
componentKey: 'DivisionAgent',
|
||||
parentId: 'distribution',
|
||||
groupId: 'distribution-division',
|
||||
order: 2
|
||||
groupId: 'distribution-manage',
|
||||
order: 6
|
||||
},
|
||||
{
|
||||
id: 'division_apply',
|
||||
title: '代理商申请',
|
||||
title: '事业部申请',
|
||||
path: '/pages/mall/admin/distribution/division/apply',
|
||||
componentKey: 'DivisionApply',
|
||||
parentId: 'distribution',
|
||||
groupId: 'distribution-division',
|
||||
order: 3
|
||||
groupId: 'distribution-manage',
|
||||
order: 7
|
||||
},
|
||||
|
||||
// ========== 客服模块 ==========
|
||||
|
||||
Reference in New Issue
Block a user