2025-10-21 16:50:33 +08:00
|
|
|
<template>
|
2025-10-22 09:18:53 +08:00
|
|
|
<div class="dashboard">
|
|
|
|
|
<!-- 左侧导航栏 -->
|
|
|
|
|
<aside class="sidebar">
|
|
|
|
|
<div class="logo">
|
|
|
|
|
<div class="logo-icon"></div>
|
|
|
|
|
<span>LOGO</span>
|
|
|
|
|
</div>
|
|
|
|
|
<nav class="nav-menu">
|
|
|
|
|
<div class="nav-item active">
|
|
|
|
|
<el-icon><Grid /></el-icon>
|
|
|
|
|
<span>数据仪表台</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="nav-item" @click="goToUsers">
|
|
|
|
|
<el-icon><User /></el-icon>
|
|
|
|
|
<span>会员管理</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="nav-item" @click="goToOrders">
|
|
|
|
|
<el-icon><ShoppingCart /></el-icon>
|
|
|
|
|
<span>订单管理</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="nav-item" @click="goToAPI">
|
|
|
|
|
<el-icon><Code /></el-icon>
|
|
|
|
|
<span>API管理</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="nav-item" @click="goToTasks">
|
|
|
|
|
<el-icon><Document /></el-icon>
|
|
|
|
|
<span>生成任务记录</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="nav-item" @click="goToSettings">
|
|
|
|
|
<el-icon><Setting /></el-icon>
|
|
|
|
|
<span>系统设置</span>
|
|
|
|
|
</div>
|
|
|
|
|
</nav>
|
|
|
|
|
<div class="sidebar-footer">
|
|
|
|
|
<div class="online-users">
|
2025-10-22 10:05:07 +08:00
|
|
|
当前在线用户: <span class="highlight">{{ systemStatus.onlineUsers }}/500</span>
|
2025-10-22 09:18:53 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="system-uptime">
|
2025-10-22 10:05:07 +08:00
|
|
|
系统运行时间: <span class="highlight">{{ systemStatus.systemUptime }}</span>
|
2025-10-22 09:18:53 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</aside>
|
|
|
|
|
|
|
|
|
|
<!-- 主内容区域 -->
|
|
|
|
|
<main class="main-content">
|
|
|
|
|
<!-- 顶部搜索栏 -->
|
|
|
|
|
<header class="top-header">
|
|
|
|
|
<div class="search-bar">
|
|
|
|
|
<el-icon class="search-icon"><Search /></el-icon>
|
|
|
|
|
<input type="text" placeholder="搜索你的想要的内容" class="search-input" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="header-actions">
|
|
|
|
|
<el-icon class="notification-icon"><Bell /></el-icon>
|
|
|
|
|
<div class="user-avatar">
|
|
|
|
|
<img src="/images/backgrounds/welcome.jpg" alt="用户头像" />
|
|
|
|
|
<el-icon class="dropdown-icon"><ArrowDown /></el-icon>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</header>
|
|
|
|
|
|
|
|
|
|
<!-- KPI 卡片区域 -->
|
|
|
|
|
<section class="kpi-section">
|
|
|
|
|
<div class="kpi-card">
|
|
|
|
|
<div class="kpi-icon user-icon">
|
|
|
|
|
<el-icon><User /></el-icon>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="kpi-content">
|
|
|
|
|
<div class="kpi-title">用户总数</div>
|
2025-10-22 10:05:07 +08:00
|
|
|
<div class="kpi-value">{{ formatNumber(dashboardData.totalUsers) }}</div>
|
2025-10-22 09:18:53 +08:00
|
|
|
<div class="kpi-trend positive">+12% 较上月同期</div>
|
2025-10-21 16:50:33 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-10-22 09:18:53 +08:00
|
|
|
|
|
|
|
|
<div class="kpi-card">
|
|
|
|
|
<div class="kpi-icon paid-user-icon">
|
|
|
|
|
<el-icon><User /></el-icon>
|
|
|
|
|
<div class="currency-symbol">¥</div>
|
2025-10-21 16:50:33 +08:00
|
|
|
</div>
|
2025-10-22 09:18:53 +08:00
|
|
|
<div class="kpi-content">
|
|
|
|
|
<div class="kpi-title">付费用户数</div>
|
2025-10-22 10:05:07 +08:00
|
|
|
<div class="kpi-value">{{ formatNumber(dashboardData.paidUsers) }}</div>
|
2025-10-22 09:18:53 +08:00
|
|
|
<div class="kpi-trend negative">-5% 较上月同期</div>
|
2025-10-21 16:50:33 +08:00
|
|
|
</div>
|
2025-10-22 09:18:53 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="kpi-card">
|
|
|
|
|
<div class="kpi-icon revenue-icon">
|
|
|
|
|
<el-icon><Money /></el-icon>
|
2025-10-21 16:50:33 +08:00
|
|
|
</div>
|
2025-10-22 09:18:53 +08:00
|
|
|
<div class="kpi-content">
|
|
|
|
|
<div class="kpi-title">今日收入</div>
|
2025-10-22 10:05:07 +08:00
|
|
|
<div class="kpi-value">{{ formatCurrency(dashboardData.todayRevenue) }}</div>
|
2025-10-22 09:18:53 +08:00
|
|
|
<div class="kpi-trend positive">+15% 较上月同期</div>
|
2025-10-21 16:50:33 +08:00
|
|
|
</div>
|
2025-10-22 09:18:53 +08:00
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<!-- 图表区域 -->
|
|
|
|
|
<section class="charts-section">
|
|
|
|
|
<!-- 日活用户趋势图 -->
|
2025-10-22 09:23:39 +08:00
|
|
|
<div class="chart-card full-width">
|
2025-10-22 09:18:53 +08:00
|
|
|
<div class="chart-header">
|
|
|
|
|
<h3>日活用户趋势</h3>
|
|
|
|
|
<div class="year-selector">
|
|
|
|
|
<span>2025年</span>
|
|
|
|
|
<el-icon><ArrowDown /></el-icon>
|
|
|
|
|
</div>
|
2025-10-21 16:50:33 +08:00
|
|
|
</div>
|
2025-10-22 09:18:53 +08:00
|
|
|
<div class="chart-container">
|
2025-10-22 09:22:42 +08:00
|
|
|
<div class="line-chart">
|
2025-10-22 09:34:27 +08:00
|
|
|
<!-- 动态SVG曲线图 -->
|
|
|
|
|
<svg width="100%" height="200" :viewBox="`0 0 ${chartWidth} ${chartHeight}`" class="chart-svg">
|
2025-10-22 09:22:42 +08:00
|
|
|
<!-- 网格线 -->
|
|
|
|
|
<defs>
|
2025-10-22 09:27:34 +08:00
|
|
|
<pattern id="grid" width="60" height="40" patternUnits="userSpaceOnUse">
|
|
|
|
|
<path d="M 60 0 L 0 0 0 40" fill="none" stroke="#e2e8f0" stroke-width="0.5"/>
|
2025-10-22 09:22:42 +08:00
|
|
|
</pattern>
|
|
|
|
|
</defs>
|
|
|
|
|
<rect width="100%" height="100%" fill="url(#grid)" />
|
|
|
|
|
|
2025-10-22 09:34:27 +08:00
|
|
|
<!-- 动态数据曲线 -->
|
|
|
|
|
<path :d="chartPath"
|
2025-10-22 09:22:42 +08:00
|
|
|
fill="none"
|
|
|
|
|
stroke="#3b82f6"
|
|
|
|
|
stroke-width="3"
|
|
|
|
|
class="chart-line-path"/>
|
|
|
|
|
|
2025-10-22 09:34:27 +08:00
|
|
|
<!-- 动态数据点 -->
|
|
|
|
|
<circle
|
|
|
|
|
v-for="(point, index) in chartPoints"
|
|
|
|
|
:key="index"
|
|
|
|
|
:cx="point.x"
|
|
|
|
|
:cy="point.y"
|
|
|
|
|
r="4"
|
|
|
|
|
fill="#3b82f6"
|
|
|
|
|
class="chart-dot"
|
|
|
|
|
@click="handlePointClick(point)"
|
|
|
|
|
style="cursor: pointer;"/>
|
2025-10-22 09:22:42 +08:00
|
|
|
|
2025-10-22 09:34:27 +08:00
|
|
|
<!-- 高亮数据点 -->
|
|
|
|
|
<template v-if="highlightedPoint">
|
|
|
|
|
<circle
|
|
|
|
|
:cx="highlightedPoint.x"
|
|
|
|
|
:cy="highlightedPoint.y"
|
|
|
|
|
r="6"
|
|
|
|
|
fill="#3b82f6"
|
|
|
|
|
class="highlight-dot"/>
|
|
|
|
|
<circle
|
|
|
|
|
:cx="highlightedPoint.x"
|
|
|
|
|
:cy="highlightedPoint.y"
|
|
|
|
|
r="12"
|
|
|
|
|
fill="#3b82f6"
|
|
|
|
|
opacity="0.2"
|
|
|
|
|
class="highlight-ring"/>
|
|
|
|
|
|
|
|
|
|
<!-- 动态工具提示 -->
|
|
|
|
|
<g class="tooltip-group" :transform="`translate(${highlightedPoint.x}, ${highlightedPoint.y - 20})`">
|
|
|
|
|
<rect x="-30" y="-40" width="60" height="30" rx="6" fill="#1e293b" class="tooltip-bg"/>
|
|
|
|
|
<text x="0" y="-25" text-anchor="middle" fill="white" font-size="12" font-weight="600" class="tooltip-value">
|
|
|
|
|
{{ highlightedPoint.value.toLocaleString() }}
|
|
|
|
|
</text>
|
|
|
|
|
<text x="0" y="-10" text-anchor="middle" fill="white" font-size="10" opacity="0.8" class="tooltip-date">
|
|
|
|
|
{{ highlightedPoint.label }}
|
|
|
|
|
</text>
|
|
|
|
|
<!-- 工具提示箭头 -->
|
|
|
|
|
<polygon points="0,0 -5,10 5,10" fill="#1e293b" class="tooltip-arrow"/>
|
|
|
|
|
</g>
|
|
|
|
|
</template>
|
2025-10-22 09:22:42 +08:00
|
|
|
</svg>
|
2025-10-22 09:18:53 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="chart-x-axis">
|
2025-10-22 09:34:27 +08:00
|
|
|
<span v-for="data in monthlyData" :key="data.month">{{ data.label }}</span>
|
2025-10-22 09:18:53 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="chart-y-axis">
|
2025-10-22 09:34:27 +08:00
|
|
|
<span v-for="tick in [1500, 1200, 900, 600, 300, 0]" :key="tick">{{ tick }}</span>
|
2025-10-22 09:18:53 +08:00
|
|
|
</div>
|
2025-10-21 16:50:33 +08:00
|
|
|
</div>
|
2025-10-22 09:18:53 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 用户转化率图 -->
|
2025-10-22 09:23:39 +08:00
|
|
|
<div class="chart-card full-width">
|
2025-10-22 09:18:53 +08:00
|
|
|
<div class="chart-header">
|
|
|
|
|
<h3>用户转化率</h3>
|
|
|
|
|
<div class="year-selector">
|
|
|
|
|
<span>2025年</span>
|
|
|
|
|
<el-icon><ArrowDown /></el-icon>
|
|
|
|
|
</div>
|
2025-10-21 16:50:33 +08:00
|
|
|
</div>
|
2025-10-22 09:18:53 +08:00
|
|
|
<div class="chart-container">
|
|
|
|
|
<div class="bar-chart">
|
|
|
|
|
<div class="bar" style="height: 15%;"></div>
|
|
|
|
|
<div class="bar" style="height: 25%;"></div>
|
|
|
|
|
<div class="bar" style="height: 20%;"></div>
|
|
|
|
|
<div class="bar" style="height: 30%;"></div>
|
|
|
|
|
<div class="bar" style="height: 18%;"></div>
|
|
|
|
|
<div class="bar" style="height: 22%;"></div>
|
|
|
|
|
<div class="bar" style="height: 28%;"></div>
|
|
|
|
|
<div class="bar" style="height: 35%;"></div>
|
|
|
|
|
<div class="bar active" style="height: 40%;"></div>
|
|
|
|
|
<div class="bar" style="height: 25%;"></div>
|
|
|
|
|
<div class="bar" style="height: 20%;"></div>
|
|
|
|
|
<div class="bar" style="height: 18%;"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="chart-x-axis">
|
|
|
|
|
<span>1月</span>
|
|
|
|
|
<span>2月</span>
|
|
|
|
|
<span>3月</span>
|
|
|
|
|
<span>4月</span>
|
|
|
|
|
<span>5月</span>
|
|
|
|
|
<span>6月</span>
|
|
|
|
|
<span>7月</span>
|
|
|
|
|
<span>8月</span>
|
|
|
|
|
<span>9月</span>
|
|
|
|
|
<span>10月</span>
|
|
|
|
|
<span>11月</span>
|
|
|
|
|
<span>12月</span>
|
2025-10-21 16:50:33 +08:00
|
|
|
</div>
|
2025-10-22 09:18:53 +08:00
|
|
|
<div class="chart-y-axis">
|
|
|
|
|
<span>20%</span>
|
|
|
|
|
<span>15%</span>
|
|
|
|
|
<span>10%</span>
|
|
|
|
|
<span>5%</span>
|
|
|
|
|
<span>0%</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
</main>
|
2025-10-21 16:50:33 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2025-10-22 09:34:27 +08:00
|
|
|
import { ref, onMounted, computed } from 'vue'
|
2025-10-21 16:50:33 +08:00
|
|
|
import { useRouter } from 'vue-router'
|
|
|
|
|
import { useUserStore } from '@/stores/user'
|
|
|
|
|
import { ElMessage } from 'element-plus'
|
2025-10-22 10:05:07 +08:00
|
|
|
import * as dashboardAPI from '@/api/dashboard'
|
2025-10-21 16:50:33 +08:00
|
|
|
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
const userStore = useUserStore()
|
|
|
|
|
|
2025-10-22 10:05:07 +08:00
|
|
|
// 数据状态
|
|
|
|
|
const dashboardData = ref({
|
|
|
|
|
totalUsers: 0,
|
|
|
|
|
paidUsers: 0,
|
|
|
|
|
todayRevenue: 0,
|
|
|
|
|
totalOrders: 0,
|
|
|
|
|
totalRevenue: 0,
|
|
|
|
|
monthRevenue: 0
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const monthlyData = ref([])
|
|
|
|
|
const conversionData = ref({
|
|
|
|
|
totalUsers: 0,
|
|
|
|
|
paidUsers: 0,
|
|
|
|
|
conversionRate: 0,
|
|
|
|
|
membershipStats: []
|
|
|
|
|
})
|
2025-10-22 09:34:27 +08:00
|
|
|
|
2025-10-22 10:05:07 +08:00
|
|
|
const systemStatus = ref({
|
|
|
|
|
onlineUsers: 0,
|
|
|
|
|
systemUptime: '0小时0分',
|
|
|
|
|
databaseStatus: '正常',
|
|
|
|
|
serviceStatus: '运行中'
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const selectedYear = ref(2024)
|
2025-10-22 09:34:27 +08:00
|
|
|
const highlightedPoint = ref(null)
|
2025-10-22 10:05:07 +08:00
|
|
|
const loading = ref(false)
|
2025-10-22 09:34:27 +08:00
|
|
|
|
|
|
|
|
// 计算图表尺寸和比例
|
|
|
|
|
const chartWidth = 800
|
|
|
|
|
const chartHeight = 200
|
|
|
|
|
const padding = 60
|
|
|
|
|
|
|
|
|
|
// 计算数据点的SVG坐标
|
|
|
|
|
const chartPoints = computed(() => {
|
2025-10-22 10:05:07 +08:00
|
|
|
if (monthlyData.value.length === 0) return []
|
|
|
|
|
|
|
|
|
|
const maxValue = Math.max(...monthlyData.value.map(d => d.revenue || 0))
|
|
|
|
|
const minValue = Math.min(...monthlyData.value.map(d => d.revenue || 0))
|
|
|
|
|
const valueRange = maxValue - minValue || 1
|
2025-10-22 09:34:27 +08:00
|
|
|
|
|
|
|
|
return monthlyData.value.map((data, index) => {
|
|
|
|
|
const x = padding + (index * (chartWidth - 2 * padding) / (monthlyData.value.length - 1))
|
2025-10-22 10:05:07 +08:00
|
|
|
const y = padding + ((maxValue - (data.revenue || 0)) / valueRange) * (chartHeight - 2 * padding)
|
2025-10-22 09:34:27 +08:00
|
|
|
return {
|
|
|
|
|
x,
|
|
|
|
|
y,
|
2025-10-22 10:05:07 +08:00
|
|
|
value: data.revenue || 0,
|
|
|
|
|
label: `${data.month}月`,
|
2025-10-22 09:34:27 +08:00
|
|
|
month: data.month
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 生成SVG路径
|
|
|
|
|
const chartPath = computed(() => {
|
|
|
|
|
if (chartPoints.value.length < 2) return ''
|
|
|
|
|
|
|
|
|
|
let path = `M ${chartPoints.value[0].x},${chartPoints.value[0].y}`
|
|
|
|
|
|
|
|
|
|
for (let i = 1; i < chartPoints.value.length; i++) {
|
|
|
|
|
const prev = chartPoints.value[i - 1]
|
|
|
|
|
const curr = chartPoints.value[i]
|
|
|
|
|
const next = chartPoints.value[i + 1]
|
|
|
|
|
|
|
|
|
|
if (next) {
|
|
|
|
|
// 使用三次贝塞尔曲线创建平滑路径
|
|
|
|
|
const cp1x = prev.x + (curr.x - prev.x) / 3
|
|
|
|
|
const cp1y = prev.y
|
|
|
|
|
const cp2x = curr.x - (next.x - curr.x) / 3
|
|
|
|
|
const cp2y = curr.y
|
|
|
|
|
|
|
|
|
|
path += ` C ${cp1x},${cp1y} ${cp2x},${cp2y} ${curr.x},${curr.y}`
|
|
|
|
|
} else {
|
|
|
|
|
// 最后一个点
|
|
|
|
|
const cp1x = prev.x + (curr.x - prev.x) / 3
|
|
|
|
|
const cp1y = prev.y
|
|
|
|
|
path += ` C ${cp1x},${cp1y} ${curr.x},${curr.y} ${curr.x},${curr.y}`
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return path
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 处理数据点点击
|
|
|
|
|
const handlePointClick = (point) => {
|
|
|
|
|
highlightedPoint.value = point
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
// 导航功能
|
|
|
|
|
const goToUsers = () => {
|
2025-10-22 09:37:59 +08:00
|
|
|
router.push('/member-management')
|
2025-10-22 09:18:53 +08:00
|
|
|
}
|
2025-10-21 16:50:33 +08:00
|
|
|
|
|
|
|
|
const goToOrders = () => {
|
|
|
|
|
if (userStore.isAuthenticated) {
|
|
|
|
|
router.push('/orders')
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.warning('请先登录')
|
|
|
|
|
router.push('/login')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
const goToAPI = () => {
|
|
|
|
|
ElMessage.info('跳转到API管理')
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
const goToTasks = () => {
|
|
|
|
|
ElMessage.info('跳转到生成任务记录')
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
const goToSettings = () => {
|
|
|
|
|
ElMessage.info('跳转到系统设置')
|
2025-10-22 09:34:27 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 10:05:07 +08:00
|
|
|
// 加载仪表盘数据
|
|
|
|
|
const loadDashboardData = async () => {
|
2025-10-22 09:34:27 +08:00
|
|
|
try {
|
2025-10-22 10:05:07 +08:00
|
|
|
loading.value = true
|
|
|
|
|
|
|
|
|
|
// 并行加载所有数据
|
|
|
|
|
const [overviewRes, monthlyRes, conversionRes, statusRes] = await Promise.all([
|
|
|
|
|
dashboardAPI.getDashboardOverview(),
|
|
|
|
|
dashboardAPI.getMonthlyRevenue(selectedYear.value),
|
|
|
|
|
dashboardAPI.getConversionRate(),
|
|
|
|
|
dashboardAPI.getSystemStatus()
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
// 处理概览数据
|
|
|
|
|
if (overviewRes.data) {
|
|
|
|
|
dashboardData.value = {
|
|
|
|
|
totalUsers: overviewRes.data.totalUsers || 0,
|
|
|
|
|
paidUsers: overviewRes.data.paidUsers || 0,
|
|
|
|
|
todayRevenue: overviewRes.data.todayRevenue || 0,
|
|
|
|
|
totalOrders: overviewRes.data.totalOrders || 0,
|
|
|
|
|
totalRevenue: overviewRes.data.totalRevenue || 0,
|
|
|
|
|
monthRevenue: overviewRes.data.monthRevenue || 0
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 处理月度数据
|
|
|
|
|
if (monthlyRes.data && monthlyRes.data.monthlyData) {
|
|
|
|
|
monthlyData.value = monthlyRes.data.monthlyData
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 处理转化率数据
|
|
|
|
|
if (conversionRes.data) {
|
|
|
|
|
conversionData.value = {
|
|
|
|
|
totalUsers: conversionRes.data.totalUsers || 0,
|
|
|
|
|
paidUsers: conversionRes.data.paidUsers || 0,
|
|
|
|
|
conversionRate: conversionRes.data.conversionRate || 0,
|
|
|
|
|
membershipStats: conversionRes.data.membershipStats || []
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-10-22 09:34:27 +08:00
|
|
|
|
2025-10-22 10:05:07 +08:00
|
|
|
// 处理系统状态
|
|
|
|
|
if (statusRes.data) {
|
|
|
|
|
systemStatus.value = {
|
|
|
|
|
onlineUsers: statusRes.data.onlineUsers || 0,
|
|
|
|
|
systemUptime: statusRes.data.systemUptime || '0小时0分',
|
|
|
|
|
databaseStatus: statusRes.data.databaseStatus || '正常',
|
|
|
|
|
serviceStatus: statusRes.data.serviceStatus || '运行中'
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-10-22 09:34:27 +08:00
|
|
|
|
|
|
|
|
} catch (error) {
|
2025-10-22 10:05:07 +08:00
|
|
|
console.error('加载仪表盘数据失败:', error)
|
|
|
|
|
ElMessage.error('加载仪表盘数据失败')
|
|
|
|
|
|
|
|
|
|
// 使用默认数据作为后备
|
|
|
|
|
dashboardData.value = {
|
|
|
|
|
totalUsers: 10,
|
|
|
|
|
paidUsers: 8,
|
|
|
|
|
todayRevenue: 0,
|
|
|
|
|
totalOrders: 180,
|
|
|
|
|
totalRevenue: 0,
|
|
|
|
|
monthRevenue: 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
monthlyData.value = [
|
|
|
|
|
{ month: 1, revenue: 0, orderCount: 0 },
|
|
|
|
|
{ month: 2, revenue: 0, orderCount: 0 },
|
|
|
|
|
{ month: 3, revenue: 0, orderCount: 0 },
|
|
|
|
|
{ month: 4, revenue: 0, orderCount: 0 },
|
|
|
|
|
{ month: 5, revenue: 0, orderCount: 0 },
|
|
|
|
|
{ month: 6, revenue: 0, orderCount: 0 },
|
|
|
|
|
{ month: 7, revenue: 0, orderCount: 0 },
|
|
|
|
|
{ month: 8, revenue: 0, orderCount: 0 },
|
|
|
|
|
{ month: 9, revenue: 0, orderCount: 0 },
|
|
|
|
|
{ month: 10, revenue: 0, orderCount: 0 },
|
|
|
|
|
{ month: 11, revenue: 0, orderCount: 0 },
|
|
|
|
|
{ month: 12, revenue: 0, orderCount: 0 }
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
conversionData.value = {
|
|
|
|
|
totalUsers: 10,
|
|
|
|
|
paidUsers: 8,
|
|
|
|
|
conversionRate: 80,
|
|
|
|
|
membershipStats: []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
systemStatus.value = {
|
|
|
|
|
onlineUsers: 50,
|
|
|
|
|
systemUptime: '48小时32分',
|
|
|
|
|
databaseStatus: '正常',
|
|
|
|
|
serviceStatus: '运行中'
|
|
|
|
|
}
|
|
|
|
|
} finally {
|
|
|
|
|
loading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 格式化数字
|
|
|
|
|
const formatNumber = (num) => {
|
|
|
|
|
if (num >= 10000) {
|
|
|
|
|
return (num / 10000).toFixed(1) + '万'
|
2025-10-22 09:34:27 +08:00
|
|
|
}
|
2025-10-22 10:05:07 +08:00
|
|
|
return num.toLocaleString()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 格式化金额
|
|
|
|
|
const formatCurrency = (amount) => {
|
|
|
|
|
return '¥' + amount.toLocaleString()
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
onMounted(() => {
|
2025-10-22 10:05:07 +08:00
|
|
|
loadDashboardData()
|
2025-10-22 09:18:53 +08:00
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.dashboard {
|
|
|
|
|
display: flex;
|
|
|
|
|
min-height: 100vh;
|
|
|
|
|
background: #f8fafc;
|
|
|
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
/* 左侧导航栏 */
|
|
|
|
|
.sidebar {
|
2025-10-22 09:29:27 +08:00
|
|
|
width: 320px;
|
2025-10-22 09:18:53 +08:00
|
|
|
background: white;
|
|
|
|
|
border-right: 1px solid #e2e8f0;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
padding: 24px 0;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.logo {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
2025-10-22 09:29:27 +08:00
|
|
|
padding: 0 28px;
|
2025-10-22 09:18:53 +08:00
|
|
|
margin-bottom: 32px;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.logo-icon {
|
|
|
|
|
width: 24px;
|
|
|
|
|
height: 24px;
|
|
|
|
|
background: #3b82f6;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
margin-right: 12px;
|
|
|
|
|
}
|
2025-10-21 16:50:33 +08:00
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.logo span {
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: #1e293b;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.nav-menu {
|
|
|
|
|
flex: 1;
|
2025-10-22 09:30:22 +08:00
|
|
|
padding: 0 24px;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.nav-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
2025-10-22 09:30:22 +08:00
|
|
|
padding: 18px 24px;
|
|
|
|
|
margin-bottom: 6px;
|
|
|
|
|
border-radius: 10px;
|
2025-10-22 09:18:53 +08:00
|
|
|
cursor: pointer;
|
|
|
|
|
transition: all 0.2s ease;
|
|
|
|
|
color: #64748b;
|
2025-10-22 09:30:22 +08:00
|
|
|
font-size: 16px;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.nav-item:hover {
|
|
|
|
|
background: #f1f5f9;
|
|
|
|
|
color: #334155;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.nav-item.active {
|
|
|
|
|
background: #eff6ff;
|
|
|
|
|
color: #3b82f6;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.nav-item .el-icon {
|
2025-10-22 09:30:22 +08:00
|
|
|
margin-right: 16px;
|
|
|
|
|
font-size: 22px;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.nav-item span {
|
2025-10-22 09:30:22 +08:00
|
|
|
font-size: 16px;
|
2025-10-22 09:18:53 +08:00
|
|
|
font-weight: 500;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.sidebar-footer {
|
2025-10-22 09:31:16 +08:00
|
|
|
padding: 0 32px 20px;
|
2025-10-22 09:18:53 +08:00
|
|
|
margin-top: auto;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.online-users,
|
|
|
|
|
.system-uptime {
|
2025-10-22 09:31:16 +08:00
|
|
|
font-size: 14px;
|
2025-10-22 09:18:53 +08:00
|
|
|
color: #64748b;
|
2025-10-22 09:31:16 +08:00
|
|
|
margin-bottom: 10px;
|
|
|
|
|
line-height: 1.5;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.highlight {
|
|
|
|
|
color: #3b82f6;
|
|
|
|
|
font-weight: 600;
|
2025-10-22 09:31:16 +08:00
|
|
|
font-size: 15px;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
/* 主内容区域 */
|
|
|
|
|
.main-content {
|
|
|
|
|
flex: 1;
|
2025-10-21 16:50:33 +08:00
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
2025-10-22 09:18:53 +08:00
|
|
|
background: #f8fafc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 顶部搜索栏 */
|
|
|
|
|
.top-header {
|
|
|
|
|
background: white;
|
|
|
|
|
border-bottom: 1px solid #e2e8f0;
|
|
|
|
|
padding: 16px 24px;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.search-bar {
|
|
|
|
|
position: relative;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.search-icon {
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 12px;
|
|
|
|
|
color: #94a3b8;
|
|
|
|
|
font-size: 16px;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.search-input {
|
|
|
|
|
width: 300px;
|
|
|
|
|
padding: 8px 12px 8px 40px;
|
|
|
|
|
border: 1px solid #e2e8f0;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
background: #f8fafc;
|
|
|
|
|
outline: none;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.search-input:focus {
|
|
|
|
|
border-color: #3b82f6;
|
|
|
|
|
background: white;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.search-input::placeholder {
|
|
|
|
|
color: #94a3b8;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.header-actions {
|
2025-10-21 16:50:33 +08:00
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
2025-10-22 09:18:53 +08:00
|
|
|
gap: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.notification-icon {
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
color: #64748b;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.user-avatar {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.user-avatar img {
|
|
|
|
|
width: 32px;
|
|
|
|
|
height: 32px;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
object-fit: cover;
|
|
|
|
|
margin-right: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.dropdown-icon {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #64748b;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* KPI 卡片区域 */
|
|
|
|
|
.kpi-section {
|
|
|
|
|
padding: 24px;
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(3, 1fr);
|
|
|
|
|
gap: 24px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.kpi-card {
|
|
|
|
|
background: white;
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
padding: 24px;
|
|
|
|
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.kpi-icon {
|
|
|
|
|
width: 48px;
|
|
|
|
|
height: 48px;
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.kpi-icon .el-icon {
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.user-icon {
|
|
|
|
|
background: #fef3c7;
|
|
|
|
|
color: #f59e0b;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.paid-user-icon {
|
|
|
|
|
background: #dbeafe;
|
|
|
|
|
color: #3b82f6;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.paid-user-icon .currency-symbol {
|
|
|
|
|
position: absolute;
|
|
|
|
|
bottom: -2px;
|
|
|
|
|
right: -2px;
|
|
|
|
|
width: 16px;
|
|
|
|
|
height: 16px;
|
|
|
|
|
background: #3b82f6;
|
|
|
|
|
color: white;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
font-size: 10px;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.revenue-icon {
|
|
|
|
|
background: #fce7f3;
|
|
|
|
|
color: #ec4899;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.kpi-content {
|
2025-10-21 16:50:33 +08:00
|
|
|
flex: 1;
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.kpi-title {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: #64748b;
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.kpi-value {
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
color: #1e293b;
|
2025-10-21 16:50:33 +08:00
|
|
|
margin-bottom: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.kpi-trend {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.kpi-trend.positive {
|
|
|
|
|
color: #059669;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.kpi-trend.negative {
|
|
|
|
|
color: #dc2626;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 图表区域 */
|
|
|
|
|
.charts-section {
|
|
|
|
|
padding: 0 24px 24px;
|
2025-10-22 09:23:39 +08:00
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
2025-10-22 09:18:53 +08:00
|
|
|
gap: 24px;
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:23:39 +08:00
|
|
|
.chart-card.full-width {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.chart-card {
|
|
|
|
|
background: white;
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
padding: 24px;
|
|
|
|
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chart-header {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin-bottom: 24px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chart-header h3 {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: #1e293b;
|
|
|
|
|
margin: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.year-selector {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
color: #64748b;
|
2025-10-21 16:50:33 +08:00
|
|
|
font-size: 14px;
|
2025-10-22 09:18:53 +08:00
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chart-container {
|
|
|
|
|
position: relative;
|
|
|
|
|
height: 300px;
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:22:42 +08:00
|
|
|
/* 日活用户趋势图 - SVG曲线图 */
|
|
|
|
|
.line-chart {
|
2025-10-22 09:18:53 +08:00
|
|
|
position: relative;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 200px;
|
|
|
|
|
margin-bottom: 20px;
|
2025-10-22 09:22:42 +08:00
|
|
|
background: white;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
overflow: hidden;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:22:42 +08:00
|
|
|
.chart-svg {
|
2025-10-22 09:18:53 +08:00
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:22:42 +08:00
|
|
|
.chart-line-path {
|
|
|
|
|
stroke-dasharray: 1000;
|
|
|
|
|
stroke-dashoffset: 1000;
|
|
|
|
|
animation: drawLine 2s ease-in-out forwards;
|
2025-10-22 09:18:53 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:22:42 +08:00
|
|
|
.chart-dot {
|
|
|
|
|
opacity: 0;
|
|
|
|
|
animation: fadeInDots 0.5s ease-in-out forwards;
|
|
|
|
|
animation-delay: 1.5s;
|
2025-10-22 09:18:53 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:22:42 +08:00
|
|
|
.highlight-dot {
|
|
|
|
|
opacity: 0;
|
|
|
|
|
animation: highlightDot 0.5s ease-in-out forwards;
|
|
|
|
|
animation-delay: 2s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.highlight-ring {
|
|
|
|
|
opacity: 0;
|
|
|
|
|
animation: highlightRing 1s ease-in-out infinite;
|
|
|
|
|
animation-delay: 2s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tooltip-group {
|
|
|
|
|
opacity: 0;
|
|
|
|
|
animation: fadeInTooltip 0.5s ease-in-out forwards;
|
|
|
|
|
animation-delay: 2.5s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tooltip-bg {
|
|
|
|
|
filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
|
2025-10-22 09:18:53 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:22:42 +08:00
|
|
|
.tooltip-arrow {
|
|
|
|
|
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 动画效果 */
|
|
|
|
|
@keyframes drawLine {
|
|
|
|
|
to {
|
|
|
|
|
stroke-dashoffset: 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@keyframes fadeInDots {
|
|
|
|
|
to {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@keyframes highlightDot {
|
|
|
|
|
to {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@keyframes highlightRing {
|
|
|
|
|
0%, 100% {
|
|
|
|
|
opacity: 0.2;
|
|
|
|
|
transform: scale(1);
|
|
|
|
|
}
|
|
|
|
|
50% {
|
|
|
|
|
opacity: 0.4;
|
|
|
|
|
transform: scale(1.2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@keyframes fadeInTooltip {
|
|
|
|
|
to {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 悬停效果 */
|
|
|
|
|
.chart-dot:hover {
|
|
|
|
|
r: 6;
|
|
|
|
|
fill: #2563eb;
|
|
|
|
|
transition: all 0.2s ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.highlight-dot:hover {
|
|
|
|
|
r: 8;
|
|
|
|
|
fill: #2563eb;
|
|
|
|
|
transition: all 0.2s ease;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.chart-x-axis {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding: 0 20px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #64748b;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chart-y-axis {
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 0;
|
|
|
|
|
top: 0;
|
|
|
|
|
height: 200px;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #64748b;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
/* 用户转化率图 */
|
|
|
|
|
.bar-chart {
|
2025-10-21 16:50:33 +08:00
|
|
|
display: flex;
|
2025-10-22 09:18:53 +08:00
|
|
|
align-items: end;
|
2025-10-21 16:50:33 +08:00
|
|
|
justify-content: space-between;
|
2025-10-22 09:18:53 +08:00
|
|
|
height: 200px;
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
padding: 0 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bar {
|
|
|
|
|
width: 20px;
|
|
|
|
|
background: #dbeafe;
|
|
|
|
|
border-radius: 2px 2px 0 0;
|
|
|
|
|
transition: all 0.3s ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bar.active {
|
|
|
|
|
background: #3b82f6;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.bar:hover {
|
|
|
|
|
background: #2563eb;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
/* 响应式设计 */
|
|
|
|
|
@media (max-width: 1024px) {
|
|
|
|
|
.kpi-section {
|
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
|
}
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (max-width: 768px) {
|
2025-10-22 09:18:53 +08:00
|
|
|
.dashboard {
|
|
|
|
|
flex-direction: column;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.sidebar {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: auto;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.nav-menu {
|
|
|
|
|
display: flex;
|
|
|
|
|
overflow-x: auto;
|
|
|
|
|
padding: 0 16px;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 09:18:53 +08:00
|
|
|
.nav-item {
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
margin-right: 16px;
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.sidebar-footer {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.search-input {
|
|
|
|
|
width: 200px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.kpi-section {
|
|
|
|
|
padding: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.charts-section {
|
|
|
|
|
padding: 0 16px 16px;
|
2025-10-21 16:50:33 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|