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,5 +1,5 @@
|
||||
import { CloudUploadOutlined, DeleteOutlined, PictureOutlined } from "@ant-design/icons";
|
||||
import { Alert, Button, Image, Popconfirm, Space, Spin, Upload, message } from "antd";
|
||||
import { Alert, Button, Image, Popconfirm, Spin, Upload, message } from "antd";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { createApiClient } from "../lib/api.js";
|
||||
|
||||
@@ -71,7 +71,7 @@ export function ImageUrlField({ id, value, onChange, placeholder, scope }: Image
|
||||
}
|
||||
|
||||
return (
|
||||
<Space direction="vertical" size={4} style={{ width: "100%" }}>
|
||||
<div className="admin-field-stack-xs admin-block">
|
||||
{storageStatus !== "ok" ? (
|
||||
<Alert
|
||||
type={storageStatus === "loading" ? "info" : "warning"}
|
||||
@@ -86,33 +86,17 @@ export function ImageUrlField({ id, value, onChange, placeholder, scope }: Image
|
||||
/>
|
||||
) : null}
|
||||
{imageUrl ? (
|
||||
<div
|
||||
style={{
|
||||
position: "relative",
|
||||
width: "100%",
|
||||
minHeight: 140,
|
||||
borderRadius: 8,
|
||||
overflow: "hidden",
|
||||
border: "1px solid #d9d9d9",
|
||||
background: "#f5f5f5",
|
||||
}}
|
||||
>
|
||||
<div className="admin-media-preview">
|
||||
<Image
|
||||
src={imageUrl}
|
||||
alt={placeholder ?? "图片预览"}
|
||||
width="100%"
|
||||
height={180}
|
||||
preview
|
||||
style={{ objectFit: "cover" }}
|
||||
fallback="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="
|
||||
/>
|
||||
<Popconfirm title="移除这张图片?" onConfirm={() => onChange?.("")}>
|
||||
<Button
|
||||
danger
|
||||
size="small"
|
||||
icon={<DeleteOutlined />}
|
||||
style={{ position: "absolute", top: 8, right: 8 }}
|
||||
>
|
||||
<Button danger size="small" icon={<DeleteOutlined />} className="admin-thumb-remove">
|
||||
移除
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
@@ -150,6 +134,6 @@ export function ImageUrlField({ id, value, onChange, placeholder, scope }: Image
|
||||
</Button>
|
||||
) : null}
|
||||
<input {...(id ? { id } : {})} type="hidden" value={imageUrl} />
|
||||
</Space>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user