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,17 +1,4 @@
|
||||
import {
|
||||
Alert,
|
||||
Button,
|
||||
Col,
|
||||
Form,
|
||||
Input,
|
||||
Row,
|
||||
Select,
|
||||
Segmented,
|
||||
Space,
|
||||
Tag,
|
||||
Typography,
|
||||
message,
|
||||
} from "antd";
|
||||
import { Alert, Button, Col, Form, Input, Row, Select, Segmented, message } from "antd";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { useState } from "react";
|
||||
import { Link, useLocation } from "react-router-dom";
|
||||
@@ -20,6 +7,7 @@ import { createApiClient } from "../../lib/api.js";
|
||||
import { AdminPageHeader } from "../../components/AdminPageHeader.js";
|
||||
import { ImageUrlField } from "../../components/ImageUrlField.js";
|
||||
import { MutationError, QueryState } from "../../components/QueryState.js";
|
||||
import { StatusTag } from "../../components/StatusTag.js";
|
||||
import { PresentationEditor } from "./PresentationEditor.js";
|
||||
import type { PreviewSelection } from "./preview-selection.js";
|
||||
import "./BrandPage.css";
|
||||
@@ -72,7 +60,7 @@ export function BrandPage() {
|
||||
? `先让访客理解你是谁、服务谁,以及为什么值得信任。${template.data.description}`
|
||||
: "先让访客理解你是谁、服务谁,以及为什么值得信任。"
|
||||
}
|
||||
extra={<Tag color="blue">{template.data?.name ?? "当前模板"}</Tag>}
|
||||
extra={<StatusTag tone="info" label={template.data?.name ?? "当前模板"} />}
|
||||
/>
|
||||
<div className="brand-page__toolbar">
|
||||
<Segmented
|
||||
@@ -84,12 +72,13 @@ export function BrandPage() {
|
||||
{ value: "brand", label: "品牌资料" },
|
||||
]}
|
||||
/>
|
||||
<Space>
|
||||
<Tag color={dirty ? "orange" : "default"}>
|
||||
{dirty ? "品牌资料有未保存修改" : "草稿工作区"}
|
||||
</Tag>
|
||||
<div className="brand-page__toolbar-actions">
|
||||
<StatusTag
|
||||
tone={dirty ? "warning" : "neutral"}
|
||||
label={dirty ? "品牌资料有未保存修改" : "草稿工作区"}
|
||||
/>
|
||||
<Link to="/admin/publication">检查与发布 →</Link>
|
||||
</Space>
|
||||
</div>
|
||||
</div>
|
||||
<div className="brand-page__content" hidden={panel !== "brand"}>
|
||||
<div className="brand-page__settings">
|
||||
@@ -101,14 +90,14 @@ export function BrandPage() {
|
||||
onFinish={(values) => save.mutate(values)}
|
||||
>
|
||||
<section className="brand-settings-section" aria-labelledby="brand-identity-title">
|
||||
<div className="brand-settings-section__header">
|
||||
<div className="admin-section-head">
|
||||
<div>
|
||||
<Typography.Title id="brand-identity-title" level={4}>
|
||||
<h2 id="brand-identity-title" className="admin-section-title">
|
||||
我是谁
|
||||
</Typography.Title>
|
||||
<Typography.Text type="secondary">公开展示的品牌身份和定位。</Typography.Text>
|
||||
</h2>
|
||||
<p className="admin-section-description">公开展示的品牌身份和定位。</p>
|
||||
</div>
|
||||
<Tag>品牌基础信息</Tag>
|
||||
<StatusTag tone="neutral" label="品牌基础信息" />
|
||||
</div>
|
||||
<Form.Item
|
||||
name="name"
|
||||
@@ -136,14 +125,14 @@ export function BrandPage() {
|
||||
</Form.Item>
|
||||
</section>
|
||||
<section className="brand-settings-section" aria-labelledby="brand-contact-title">
|
||||
<div className="brand-settings-section__header">
|
||||
<div className="admin-section-head">
|
||||
<div>
|
||||
<Typography.Title id="brand-contact-title" level={4}>
|
||||
<h2 id="brand-contact-title" className="admin-section-title">
|
||||
如何联系与合作
|
||||
</Typography.Title>
|
||||
<Typography.Text type="secondary">
|
||||
</h2>
|
||||
<p className="admin-section-description">
|
||||
让访客知道联系渠道、服务范围和响应预期。
|
||||
</Typography.Text>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<Row gutter={16}>
|
||||
@@ -177,14 +166,14 @@ export function BrandPage() {
|
||||
</Form.Item>
|
||||
</section>
|
||||
<section className="brand-settings-section" aria-labelledby="brand-visual-title">
|
||||
<div className="brand-settings-section__header">
|
||||
<div className="admin-section-head">
|
||||
<div>
|
||||
<Typography.Title id="brand-visual-title" level={4}>
|
||||
<h2 id="brand-visual-title" className="admin-section-title">
|
||||
模板与品牌视觉
|
||||
</Typography.Title>
|
||||
<Typography.Text type="secondary">
|
||||
</h2>
|
||||
<p className="admin-section-description">
|
||||
模板负责业务表达,品牌信息仍由你统一维护。
|
||||
</Typography.Text>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<Form.Item
|
||||
@@ -221,12 +210,12 @@ export function BrandPage() {
|
||||
</Col>
|
||||
</Row>
|
||||
</section>
|
||||
<Space direction="vertical" style={{ width: "100%", marginTop: 24 }}>
|
||||
<div className="admin-actions admin-offset-top-lg">
|
||||
<MutationError error={save.error} />
|
||||
<Button type="primary" htmlType="submit" loading={save.isPending} size="large">
|
||||
保存品牌表达
|
||||
</Button>
|
||||
</Space>
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
{template.data ? (
|
||||
|
||||
Reference in new issue
Block a user