diff --git a/client/src/components/Layout.tsx b/client/src/components/Layout.tsx
index 59e1ea5..35a248e 100644
--- a/client/src/components/Layout.tsx
+++ b/client/src/components/Layout.tsx
@@ -2,6 +2,7 @@ import { ReactNode, useState } from 'react'
import { Link, useLocation } from 'react-router-dom'
import { LayoutDashboard, Store, ClipboardList, TrendingUp, Settings, LogOut, Menu, X, Package, DollarSign, ShoppingBag, Users, AlertTriangle, Clock, Database, MapPin, PieChart, Wallet, CalendarClock, Activity, Crown, BarChart3, Receipt, Utensils, Landmark, ChefHat, Truck, Network, TrendingUp as TrendingUpIcon } from 'lucide-react'
import { cn } from '@/lib/utils'
+import { StatusBanner } from '@/components/StatusBanner'
interface LayoutProps {
children: ReactNode
@@ -114,7 +115,8 @@ export function Layout({ children, user, onLogout }: LayoutProps) {
'fixed left-0 top-0 z-40 h-full w-56 border-r bg-card transition-transform lg:translate-x-0',
sidebarOpen ? 'translate-x-0' : '-translate-x-full'
)}>
-
+
+ {/* 风险分布条 */}
+
+
+
门店风险分布
+
+ {riskSummary['红色'] || 0} 红色 ({Math.round((riskSummary['红色'] || 0) / totalStores * 100)}%)
+ {riskSummary['黄色'] || 0} 黄色 ({Math.round((riskSummary['黄色'] || 0) / totalStores * 100)}%)
+ {riskSummary['绿色'] || 0} 绿色 ({Math.round((riskSummary['绿色'] || 0) / totalStores * 100)}%)
+
+
+
+
+
+ {/* 态势感知预警 - 前置 */}
+ {alerts.length > 0 && (
+ 0}
+ headerRight={
+
+ {alertSummary?.red > 0 && {alertSummary.red} 红色}
+ {alertSummary?.orange > 0 && {alertSummary.orange} 橙色}
+ 共 {alertSummary?.total || 0} 条
+
+ }
+ >
+
+ {alerts.slice(0, 6).map((a, i) => (
+
+
+
+
{a.title}
+
{a.detail}
+
+
+ ))}
+
+
+ )}
+
{/* 经营指标 */}
@@ -296,62 +336,48 @@ export function DashboardPage() {
}
>
-
- {[
- { label: '任务生成率', value: lh.task_generation_rate, desc: '系统自动生成的整改任务占应生成任务的比例' },
- { label: '店长执行率', value: lh.store_execution_rate, desc: '店长已提交反馈的任务占分配任务的比例' },
- { label: '区域周检率', value: lh.weekly_check_rate, desc: '区域经理完成周度检查的比例' },
- { label: '月度验收率', value: lh.monthly_review_rate, desc: '月度完成验收的任务比例' },
- { label: '经验推广率', value: lh.practice_promotion_rate, desc: '达标经验被推广到其他门店的比例' },
- ].map((item) => {
- const num = parseFloat(item.value)
- const isLow = num < 60
- const isMid = num >= 60 && num < 80
- return (
-
-
-
{num.toFixed(1)}%
-
-
- )
- })}
-
-
- )}
-
- {/* 态势感知预警 */}
- {alerts.length > 0 && (
-
- {alertSummary?.red > 0 && 红色 {alertSummary.red}}
- {alertSummary?.orange > 0 && 橙色 {alertSummary.orange}}
- 共 {alertSummary?.total || 0} 条
-
- }
- >
-
- {alerts.slice(0, 6).map((a, i) => (
-
-
- {a.level === 'red' ? '红' : a.level === 'orange' ? '橙' : '黄'}
-
-
-
{a.title}
-
{a.detail}
-
+
+ {/* 仪表盘 */}
+
+
+ = 80 ? '#22c55e' : loopScore >= 60 ? '#eab308' : '#ef4444' }]} startAngle={90} endAngle={-270}>
+
+
+
+
+
= 80 ? 'text-green-600' : loopScore >= 60 ? 'text-yellow-600' : 'text-red-600'}`}>{loopScore.toFixed(1)}%
+
综合健康度
- ))}
+
+ {/* 5个指标条 */}
+
+ {[
+ { label: '任务生成率', value: lh.task_generation_rate, desc: '系统自动生成的整改任务占应生成任务的比例' },
+ { label: '店长执行率', value: lh.store_execution_rate, desc: '店长已提交反馈的任务占分配任务的比例' },
+ { label: '区域周检率', value: lh.weekly_check_rate, desc: '区域经理完成周度检查的比例' },
+ { label: '月度验收率', value: lh.monthly_review_rate, desc: '月度完成验收的任务比例' },
+ { label: '经验推广率', value: lh.practice_promotion_rate, desc: '达标经验被推广到其他门店的比例' },
+ ].map((item) => {
+ const num = parseFloat(item.value)
+ const isLow = num < 60
+ const isMid = num >= 60 && num < 80
+ return (
+
+
+
{num.toFixed(1)}%
+
+
+ )
+ })}
+
)}