feat: 统一 Admin 后台设计语言
用中性灰底 + 单一强调色重做后台视觉,并集中到一套令牌: - 新增 apps/admin/src/lib/theme.ts,通过 ConfigProvider 注入主题令牌 - 新增 apps/admin/src/styles/admin.css 与 AdminSection、MetricCard、StatusTag 组件 - 侧栏改白底浅色并补图标,顶栏改 56px 白底,内容区最大宽 1200px - 全部页面接入状态标签,antd 原生彩色 Tag 与内联色值清零 - 登录与改密页、加载态骨架屏、错误提示条统一 - brand 页两个 Tab 统一为白卡片容器,消除双标题与宽度不一致 设计规范见 apps/admin/design.md。
This commit is contained in:
1 parent
bb94d80e13
commit
2f26828f09
34 files changed
+2159
-922
No files matched your search
@@ -1,9 +1,11 @@
|
||||
import { Button, Card, Col, List, Progress, Row, Space, Statistic, Tag, Typography } from "antd";
|
||||
import { Button, Card, Col, Progress, Row, Typography } from "antd";
|
||||
import { useQueries, useQuery } from "@tanstack/react-query";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { createApiClient } from "../../lib/api.js";
|
||||
import { AdminPageHeader } from "../../components/AdminPageHeader.js";
|
||||
import { QueryState } from "../../components/QueryState.js";
|
||||
import { MetricCard } from "../../components/MetricCard.js";
|
||||
import { StatusTag } from "../../components/StatusTag.js";
|
||||
|
||||
export function OverviewPage() {
|
||||
const navigate = useNavigate();
|
||||
@@ -82,41 +84,32 @@ export function OverviewPage() {
|
||||
title="品牌概览"
|
||||
description="从这里检查品牌表达、信任内容和业务承接是否完整。"
|
||||
/>
|
||||
<Space direction="vertical" size={24} style={{ width: "100%" }}>
|
||||
<div className="admin-stack">
|
||||
<Card>
|
||||
<Typography.Title level={3} style={{ marginTop: 0 }}>
|
||||
{brand?.name || "未命名品牌"}
|
||||
</Typography.Title>
|
||||
<Typography.Paragraph type="secondary">
|
||||
{brand?.tagline || "还没有设置一句话定位"}
|
||||
</Typography.Paragraph>
|
||||
<Tag color="blue">
|
||||
当前模板:{workspace?.templateContent?.displayName ?? "尚未安装模板"}
|
||||
</Tag>
|
||||
<h2 className="admin-brand-title">{brand?.name || "未命名品牌"}</h2>
|
||||
<p className="admin-brand-tagline">{brand?.tagline || "还没有设置一句话定位"}</p>
|
||||
<StatusTag
|
||||
tone="info"
|
||||
label={`当前模板:${workspace?.templateContent?.displayName ?? "尚未安装模板"}`}
|
||||
/>
|
||||
</Card>
|
||||
<Row gutter={[16, 16]}>
|
||||
<Col xs={24} sm={12} lg={6}>
|
||||
<Card>
|
||||
<Statistic
|
||||
title="信任证明"
|
||||
value={trust?.filter((item) => item.isPublished).length ?? 0}
|
||||
suffix="条已发布"
|
||||
/>
|
||||
</Card>
|
||||
<Col xs={24} sm={8}>
|
||||
<MetricCard
|
||||
label="信任证明"
|
||||
value={trust?.filter((item) => item.isPublished).length ?? 0}
|
||||
suffix="条已发布"
|
||||
/>
|
||||
</Col>
|
||||
<Col xs={24} sm={12} lg={6}>
|
||||
<Card>
|
||||
<Statistic
|
||||
title="业务展示内容"
|
||||
value={offerings?.filter((item) => item.isEnabled).length ?? 0}
|
||||
suffix="项公开"
|
||||
/>
|
||||
</Card>
|
||||
<Col xs={24} sm={8}>
|
||||
<MetricCard
|
||||
label="业务展示内容"
|
||||
value={offerings?.filter((item) => item.isEnabled).length ?? 0}
|
||||
suffix="项公开"
|
||||
/>
|
||||
</Col>
|
||||
<Col xs={24} sm={12} lg={6}>
|
||||
<Card>
|
||||
<Statistic title="咨询提交" value={submissions?.length ?? 0} suffix="条" />
|
||||
</Card>
|
||||
<Col xs={24} sm={8}>
|
||||
<MetricCard label="咨询提交" value={submissions?.length ?? 0} suffix="条" />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row gutter={[16, 16]}>
|
||||
@@ -139,57 +132,51 @@ export function OverviewPage() {
|
||||
: `还有 ${incompleteChecks.length} 项需要完善,完成后才能发布。`}
|
||||
</Typography.Paragraph>
|
||||
{incompleteChecks.length > 0 && (
|
||||
<List
|
||||
size="small"
|
||||
dataSource={incompleteChecks.slice(0, 4)}
|
||||
renderItem={(item) => (
|
||||
<List.Item
|
||||
actions={[
|
||||
<Button
|
||||
key={item.key}
|
||||
type="link"
|
||||
size="small"
|
||||
onClick={() => navigate(item.destination ?? "/admin/publication")}
|
||||
>
|
||||
去处理
|
||||
</Button>,
|
||||
]}
|
||||
>
|
||||
{item.label}
|
||||
</List.Item>
|
||||
)}
|
||||
/>
|
||||
<ul className="admin-list">
|
||||
{incompleteChecks.slice(0, 4).map((item) => (
|
||||
<li key={item.key} className="admin-row">
|
||||
<span className="admin-row-title">{item.label}</span>
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
onClick={() => navigate(item.destination ?? "/admin/publication")}
|
||||
>
|
||||
去处理
|
||||
</Button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
</Card>
|
||||
</Col>
|
||||
<Col xs={24} lg={12}>
|
||||
<Card title="品牌内容检查">
|
||||
<List
|
||||
dataSource={checks}
|
||||
renderItem={(item) => (
|
||||
<List.Item>
|
||||
<Space>
|
||||
<Tag color={item.passed ? "success" : "default"}>
|
||||
{item.passed ? "已完成" : "待完善"}
|
||||
</Tag>
|
||||
<span>{item.label}</span>
|
||||
{!item.passed && (
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
onClick={() => navigate(item.destination ?? "/admin/publication")}
|
||||
>
|
||||
去处理
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
</List.Item>
|
||||
)}
|
||||
/>
|
||||
<ul className="admin-list">
|
||||
{checks.map((item) => (
|
||||
<li key={item.key} className="admin-row">
|
||||
<div className="admin-row-line">
|
||||
<StatusTag
|
||||
tone={item.passed ? "success" : "neutral"}
|
||||
label={item.passed ? "已完成" : "待完善"}
|
||||
/>
|
||||
<span className="admin-row-title">{item.label}</span>
|
||||
</div>
|
||||
{!item.passed ? (
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
onClick={() => navigate(item.destination ?? "/admin/publication")}
|
||||
>
|
||||
去处理
|
||||
</Button>
|
||||
) : null}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
</Space>
|
||||
</div>
|
||||
</QueryState>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user