|
|
@@ -29,7 +29,7 @@
|
|
|
|
|
|
<!-- KPI 概览 -->
|
|
|
<el-row :gutter="24" class="kpi-row">
|
|
|
- <el-col v-for="card in kpiCards" :key="card.key" :xs="12" :sm="12" :md="6">
|
|
|
+ <el-col v-for="card in kpiCards" :key="card.key" :xs="12" :sm="8" :md="4">
|
|
|
<div
|
|
|
class="kpi-card"
|
|
|
:class="{ 'is-clickable': card.click }"
|
|
|
@@ -45,10 +45,10 @@
|
|
|
</div>
|
|
|
<div class="kpi-card__body">
|
|
|
<div class="kpi-card__value adm-num">
|
|
|
- <template v-if="card.newKey">{{ stats[card.newKey] || 0 }}<span class="kpi-slash">/</span>{{ stats[card.totalKey] || 0 }}</template>
|
|
|
+ <template v-if="card.frontKey"><span class="kpi-front">{{ stats[card.frontKey] || 0 }}</span><span class="kpi-slash">/</span>{{ stats[card.totalKey] || 0 }}</template>
|
|
|
<template v-else>{{ stats[card.key] || 0 }}</template>
|
|
|
</div>
|
|
|
- <div class="kpi-card__label">{{ card.label }}</div>
|
|
|
+ <div class="kpi-card__label"><span>{{ card.label }}</span><span v-if="card.frontLabel" class="kpi-front-label">{{ card.frontLabel }}</span></div>
|
|
|
</div>
|
|
|
<div v-if="card.badge && stats[card.key] > 0" class="kpi-card__badge">待处理</div>
|
|
|
</div>
|
|
|
@@ -300,7 +300,11 @@ export default {
|
|
|
totalArticles: 0,
|
|
|
weekNewArticles: 0,
|
|
|
totalActivities: 0,
|
|
|
- weekNewActivities: 0
|
|
|
+ weekNewActivities: 0,
|
|
|
+ pendingReviewProducts: 0,
|
|
|
+ pendingReviewOrders: 0,
|
|
|
+ pendingReviewArticles: 0,
|
|
|
+ pendingReviewActivities: 0
|
|
|
},
|
|
|
recentTasks: [],
|
|
|
trafficLoading: false,
|
|
|
@@ -338,17 +342,17 @@ export default {
|
|
|
cpuUsagePercent: '--'
|
|
|
},
|
|
|
kpiCards: [
|
|
|
- { key: 'totalFamilies', label: '家庭总数', icon: 'el-icon-s-home', color: 'primary', newKey: 'weekNewFamilies', totalKey: 'totalFamilies', click: '/families' },
|
|
|
+ { key: 'totalFamilies', label: '家庭总数', icon: 'el-icon-s-home', color: 'primary', frontKey: 'weekNewFamilies', frontLabel: '近7天新增', totalKey: 'totalFamilies', click: '/families' },
|
|
|
{ key: 'totalParents', label: '用户总数', icon: 'el-icon-user', color: 'primary', click: '/users' },
|
|
|
{ key: 'totalNonUsers', label: '非用户总数', icon: 'el-icon-s-custom', color: 'warning' },
|
|
|
{ key: 'totalTeachers', label: '规划师总数', icon: 'el-icon-s-cooperation', color: 'success' },
|
|
|
{ key: 'pendingGuideCount', label: '待审规划师', icon: 'el-icon-s-check', color: 'danger', click: '/review-center?tab=guide', badge: true },
|
|
|
{ key: 'pendingPackageCount', label: '待审任务模板', icon: 'el-icon-s-goods', color: 'danger', click: '/review-center?tab=package', badge: true },
|
|
|
{ key: 'activeUsers', label: '活跃用户', icon: 'el-icon-user-solid', color: 'primary' },
|
|
|
- { key: 'totalProducts', label: '商品', icon: 'el-icon-s-goods', color: 'primary', newKey: 'weekNewProducts', totalKey: 'totalProducts', click: '/product-manage' },
|
|
|
- { key: 'totalOrders', label: '订单', icon: 'el-icon-s-order', color: 'primary', newKey: 'weekNewOrders', totalKey: 'totalOrders', click: '/order-manage' },
|
|
|
- { key: 'totalArticles', label: '文章', icon: 'el-icon-document', color: 'primary', newKey: 'weekNewArticles', totalKey: 'totalArticles', click: '/article-manage' },
|
|
|
- { key: 'totalActivities', label: '活动', icon: 'el-icon-star-off', color: 'primary', newKey: 'weekNewActivities', totalKey: 'totalActivities', click: '/activities' }
|
|
|
+ { key: 'totalProducts', label: '商品', icon: 'el-icon-s-goods', color: 'primary', frontKey: 'pendingReviewProducts', frontLabel: '待审核', totalKey: 'totalProducts', click: '/product-manage' },
|
|
|
+ { key: 'totalOrders', label: '订单', icon: 'el-icon-s-order', color: 'primary', frontKey: 'pendingReviewOrders', frontLabel: '待发货、售后', totalKey: 'totalOrders', click: '/order-manage' },
|
|
|
+ { key: 'totalArticles', label: '文章', icon: 'el-icon-document', color: 'primary', frontKey: 'pendingReviewArticles', frontLabel: '待审核', totalKey: 'totalArticles', click: '/article-manage' },
|
|
|
+ { key: 'totalActivities', label: '活动', icon: 'el-icon-star-off', color: 'primary', frontKey: 'pendingReviewActivities', frontLabel: '待审核', totalKey: 'totalActivities', click: '/activities' }
|
|
|
],
|
|
|
dwellSections: [
|
|
|
{ key: 'articleDwell', title: '文章停留时长 Top', sub: '按平均停留排序 · 近30天', icon: 'el-icon-document', iconClass: 'sec--primary', emptyHint: '暂无文章阅读停留数据' },
|
|
|
@@ -517,6 +521,10 @@ export default {
|
|
|
this.stats.weekNewArticles = d.weekNewArticles || 0
|
|
|
this.stats.totalActivities = d.totalActivities || 0
|
|
|
this.stats.weekNewActivities = d.weekNewActivities || 0
|
|
|
+ this.stats.pendingReviewProducts = d.pendingReviewProducts || 0
|
|
|
+ this.stats.pendingReviewOrders = d.pendingReviewOrders || 0
|
|
|
+ this.stats.pendingReviewArticles = d.pendingReviewArticles || 0
|
|
|
+ this.stats.pendingReviewActivities = d.pendingReviewActivities || 0
|
|
|
} catch (error) {
|
|
|
console.error('加载仪表盘数据失败:', error)
|
|
|
}
|
|
|
@@ -854,13 +862,13 @@ export default {
|
|
|
.kpi-card {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- gap: 14px;
|
|
|
+ gap: 10px;
|
|
|
background: var(--adm-bg-container);
|
|
|
border: 1px solid var(--adm-border-split);
|
|
|
border-radius: var(--adm-radius-card);
|
|
|
box-shadow: var(--adm-shadow-card);
|
|
|
- padding: 18px 20px;
|
|
|
- margin-bottom: 24px;
|
|
|
+ padding: 12px 12px;
|
|
|
+ margin-bottom: 16px;
|
|
|
position: relative;
|
|
|
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
|
|
}
|
|
|
@@ -875,13 +883,13 @@ export default {
|
|
|
outline-offset: 2px;
|
|
|
}
|
|
|
.kpi-card__icon {
|
|
|
- width: 46px;
|
|
|
- height: 46px;
|
|
|
+ width: 34px;
|
|
|
+ height: 34px;
|
|
|
border-radius: var(--adm-radius-control);
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
- font-size: 20px;
|
|
|
+ font-size: 15px;
|
|
|
flex-shrink: 0;
|
|
|
}
|
|
|
.kpi-icon--primary { background: var(--adm-info-bg); color: var(--adm-primary); }
|
|
|
@@ -889,12 +897,15 @@ export default {
|
|
|
.kpi-icon--warning { background: var(--adm-warning-bg); color: var(--adm-warning-text); }
|
|
|
.kpi-icon--danger { background: var(--adm-error-bg); color: var(--adm-error-text); }
|
|
|
.kpi-card__value {
|
|
|
- font-size: 26px;
|
|
|
+ font-size: 19px;
|
|
|
font-weight: 700;
|
|
|
color: var(--adm-text-88);
|
|
|
- line-height: 1.2;
|
|
|
+ line-height: 1.15;
|
|
|
+ white-space: nowrap;
|
|
|
}
|
|
|
.kpi-slash { margin: 0 2px; color: var(--adm-text-45, #909399); font-weight: 400; }
|
|
|
+.kpi-front { color: var(--adm-warning-text, #e6a23c); font-weight: 700; }
|
|
|
+.kpi-front-label { margin-left: 4px; padding: 0 4px; font-size: 11px; line-height: 16px; border-radius: 3px; background: var(--adm-warning-bg); color: var(--adm-warning-text, #e6a23c); }
|
|
|
.kpi-card__label {
|
|
|
font-size: 13px;
|
|
|
color: var(--adm-text-45);
|