只会多出第七把尺子。
+ */
+export function Divider({ className, dashed, text }: { className?: string; dashed?: boolean; text?: ReactNode }) {
+ return {text}
}
/** 空态:antd Empty(简单图,站内不放插画——卡片里那块地方给不起) */
@@ -251,13 +284,21 @@ export function Spinner({ className }: { className?: string }) {
* 提示条:antd Alert。成功/普通信息用 info(站内 colorInfo=主色),错误用 error。
* 只放一句人话,长说明收进抽屉(G2)。
*/
-export function Notice({ children, danger, className, onClose }: {
+export function Notice({ children, description, danger, className, onClose, type }: {
children: ReactNode; danger?: boolean; className?: string; onClose?: () => void
+ /**
+ * 第二层说明(与 antd Alert 同名):`children` 是「一句人话」的标题,
+ * 多条明细 / 善后按钮属于正文,塞进 children 会让 Alert 只有一层粗体、
+ * 明细和按钮跟着一起加粗,于是页面又自己写 + 造第二层。
+ */
+ description?: ReactNode
+ /** Alert 的四档语义;`danger` 是站内先写下的 error 简写,两者等价 */
+ type?: 'info' | 'success' | 'warning' | 'error'
}) {
if (!children) return null
return (
-
+
)
}
@@ -295,6 +336,50 @@ export function ExtLink({ href, children, className, download }: {
)
}
+/**
+ * 小块(.block):卡内 / 页面里那些「比一行文字重、比一张卡轻」的自绘信息块统一骨架。
+ *
+ * 症状(用户截图里反复出现的“布局不对”):站内有六种各自手写的小块——总控台的
+ * 指令回显、资产库的 AI 建议条 / 参考图状态 / 供应商告警 / 生成参考、
+ * 复检的可视化质检结论、仪表盘的进度小结。每一块都自己写
+ * `rounded-lg border border-fill bg-fill p-3`,圆角有的 8px 有的 12px、
+ * 内边距有的 8px 有的 16px、状态色有的用 Tailwind 原生调色板(已被清掉,
+ * 于是整块变成透明)——同一个语义在六处看着像六个组件。
+ * 做法:一把尺子。容器交给 antd Flex(wrap + gap),底色/描边走 antd 语义色族
+ * (info / success / warning / error 的 bg + border),圆角用 borderRadiusLG、
+ * 内边距用 paddingSM,都靠 Tailwind 的 antd 变量映射(styles/index.css @theme)取。
+ * 为什么不再套一层 Card:这些块永远在卡片**内部**,再套一层 antd Card 会出现
+ * 「卡中卡」的双层描边;antd 自己给的语义色底块(Alert 之外)就是这种轻量盒子。
+ */
+export const BLOCK_TONE: Record<'default' | 'info' | 'ok' | 'warn' | 'bad', string> = {
+ default: 'border-border-secondary bg-fill-tertiary',
+ info: 'border-info-border bg-info-bg',
+ ok: 'border-success-border bg-success-bg',
+ warn: 'border-warning-border bg-warning-bg',
+ bad: 'border-error-border bg-error-bg'
+}
+
+export function Block({ children, tone = 'default', align = 'center', vertical, gap = 8, title, className, style }: {
+ children?: ReactNode; tone?: keyof typeof BLOCK_TONE;
+ align?: 'center' | 'start' | 'baseline'; className?: string; style?: CSSProperties;
+ /** 只读说明块的悬浮解释(和 antd 组件一样挂在容器上,不另起一个 tooltip 组件) */
+ title?: string;
+ /** 竖排:块里装的是「一段筛选条 + 一段列表」这种上下叠放的复合内容时用 */
+ vertical?: boolean
+ /** 子项间距(antd Flex 的 gap 档位):左侧气泡 + 右侧正文这种两列内容给 12 */
+ gap?: number
+}) {
+ return (
+
+ {children}
+
+ )
+}
+
/**
* 卡片行(.cardrow):标题 + 说明 + 右侧动作,列表里重复项的统一骨架。
*
diff --git a/frontend/src/components/ui/Status.tsx b/frontend/src/components/ui/Status.tsx
index 901ad4f..a3ec4de 100644
--- a/frontend/src/components/ui/Status.tsx
+++ b/frontend/src/components/ui/Status.tsx
@@ -10,7 +10,7 @@
* Chip 可点的筛选 / 开关胶囊(ui/Controls.tsx)
*/
import type { ReactNode } from 'react'
-import { Tag as AntTag } from 'antd'
+import { Badge as AntBadge, Tag as AntTag } from 'antd'
import { cn } from '../../lib/cn'
import { statusLabel, statusTone } from '../../lib/format'
import { GROUP_LABEL_CLS } from './Controls'
@@ -40,9 +40,11 @@ export function Tag({ tone = 'default', size = 'md', icon, children, className,
title?: string
}) {
const v = TONE_VARS[tone as keyof typeof TONE_VARS]
+ // 默认档也要有底纹:统计信息块「有底」才读得出「这是一块回显」而不是一个待点的按钮;
+ // 语义色档走各自的 -bg / -border,两层互不影响(Tag 与 Badge 同一套尺子)。
const style = v
? { background: `var(--ant-color-${v}-bg)`, borderColor: `var(--ant-color-${v}-border)`, color: `var(--ant-color-${v})` }
- : undefined
+ : { background: 'var(--ant-color-fill-tertiary)', borderColor: 'var(--ant-color-border-secondary)' }
return (
@@ -72,6 +74,21 @@ export function Status({ value, tone, size, children, className }: {
return {children ?? statusLabel(value)}
}
+/**
+ * 运行指示点:antd `Badge status`(processing = 那圈自己跳的扩散环)。
+ *
+ * 症状:总控台右上角那颗「在跑 / 空闲」的点自己写了 7px 圆 + 一层
+ * shadow 扩散动画,颜色走 bg-border / bg-primary,深色主题下几乎看不见,
+ * 动画还得在 index.css 里另养一条 @keyframes。
+ * 做法:把「进行中」交回 antd——status="processing" 的颜色(colorPrimary)与
+ * 扩散动画是 Badge 自带的,off 态就是 status="default"(colorBorder)。
+ * 为什么还留一个壳:页面不准 import antd(R8),且站内只有这一种「活体指示」,
+ * 统一从这里出,避免再长出第二颗各色调各色的圆点。
+ */
+export function LiveDot({ on, className }: { on?: boolean; className?: string }) {
+ return
+}
+
/** 数字气泡:与标签同度量,只是收成 pill 并加粗 */
export function Badge({ children, tone = 'default', size = 'md', className }: {
children: ReactNode
@@ -80,9 +97,11 @@ export function Badge({ children, tone = 'default', size = 'md', className }: {
className?: string
}) {
const v = TONE_VARS[tone as keyof typeof TONE_VARS]
+ // 默认档也要有底纹:统计信息块「有底」才读得出「这是一块回显」而不是一个待点的按钮;
+ // 语义色档走各自的 -bg / -border,两层互不影响(Tag 与 Badge 同一套尺子)。
const style = v
? { background: `var(--ant-color-${v}-bg)`, borderColor: `var(--ant-color-${v}-border)`, color: `var(--ant-color-${v})` }
- : undefined
+ : { background: 'var(--ant-color-fill-tertiary)', borderColor: 'var(--ant-color-border-secondary)' }
return (
{children}
diff --git a/frontend/src/components/ui/Steps.tsx b/frontend/src/components/ui/Steps.tsx
index 09ef7f0..904e337 100644
--- a/frontend/src/components/ui/Steps.tsx
+++ b/frontend/src/components/ui/Steps.tsx
@@ -38,7 +38,17 @@ export function nodeHint(node: any): string {
(light #52c41a / white = 2.3:1,dark #95de64 / white = 1.8:1),
所以「完成」这一档取绿色族的浅底 + 主色字——正是 antd Tag color="success"
与站内 用的那三个 token,不新造档位。
- 「进行中」是实心主色(antd 的 processing 就是主色蓝),和完成一眼分得开。 */
+ 「进行中」是实心主色(antd 的 processing 就是主色蓝),和完成一眼分得开。
+
+ 整卡的底色口径(2026-11 第四轮改的,别再改回「完成=整块绿」):
+ 症状是已交付项目的这条 rail **12 格全部铺成浅绿**(这条产品里 12 个项目有 9 个
+ 已交付,等于默认状态就是一堵绿墙),而绿墙同时把「进行中」那格的蓝给淹了——
+ 读者扫一遍拿不到「走到哪儿了」。antd Steps 自己也不给 finish 步铺色,
+ 只给一枚对勾。所以这里:
+ · **done** = 容器底 + `border-secondary` 细边,绿只留在**对勾圆点与 `4/4`** 上;
+ · **active** = 主色浅底 + 主色环(全条唯一的色块,一眼定位当前节点);
+ · **failed** = 容器底 + 红边;**pending** = 容器底 + 更淡的边 + 70% 不透明度。
+ 「完成了多少」由一串绿勾 + 下面的 `FlowCaption`(已完成 x / y)负责,不靠铺面积。 */
const NUM: Record = {
done: 'bg-success-bg text-success',
active: 'bg-primary text-on-primary',
@@ -61,7 +71,7 @@ export function Step({ node, index, current, compact, onClick, className }: {
className={cn('flex-1 basis-[118px] min-w-[96px] bg-bg-container border rounded-lg py-2 px-3 relative transition-colors',
onClick && 'cursor-pointer',
current && 'shadow-[0_0_0_1px_var(--ant-color-primary-border)]',
- st === 'done' && 'border-success-border bg-success-bg',
+ st === 'done' && 'border-border-secondary',
st === 'active' && 'border-primary-border bg-primary-bg shadow-[inset_0_0_0_1px_var(--ant-color-primary-border)]',
st === 'failed' && 'border-error-border bg-bg-container',
st === 'pending' && 'border-[var(--ant-color-fill-secondary)] opacity-70', className)}>
diff --git a/frontend/src/components/ui/Table.tsx b/frontend/src/components/ui/Table.tsx
index 19ae6f3..8e125b9 100644
--- a/frontend/src/components/ui/Table.tsx
+++ b/frontend/src/components/ui/Table.tsx
@@ -1,62 +1,108 @@
+/**
+ * 表格:antd `Table` 的唯一切面(列定义 + 数据源)。
+ *
+ * 症状(2026-11 第三轮重写的对象):前两轮只把单元格**里面的**控件换成了 antd,
+ * 表格本身仍是自绘 ``——表头吸顶、单元格描边、行悬停/选中底色
+ * 全靠 上那一串 `[&_th]:…[&_td]:…` 子选择器手工维持,
+ * 横向滚动和高度上限又外包给 `` 手搓一个 overflow div。
+ * 于是它永远只有 antd 表格的七分像:表头没有排序/分组的能力、
+ * 列宽靠内容随机浮动、空态得由页面自己在表外补一个 、
+ * 选中行要用 `[data-chosen]` 加一段 arbitrary variant 才能生效。
+ * 用户说「所有界面全部换掉」,表格是全站最密的地方,也是最露馅的地方。
+ * 做法:页面改成 antd 的标准用法——`columns` + `dataSource`。
+ * 四件原来手搓的事全部交还给 antd:
+ * · 密度 → `size`(默认 small,站内表格一律紧凑档)
+ * · 表头吸顶 + 高度上限 → `scroll.y`(由 maxHeight 翻译,false 就整页滚)
+ * · 窄屏横向滚动 → `scroll.x`(由 minWidth 翻译,0 表示不设下限、吃满容器)
+ * · 空态 → antd 自己的空态(需要专属文案时用 empty 覆写 locale.emptyText)
+ * 整行热区走 `onPick`(antd 的 onRow),选中行走 `chosen` 判定,
+ * 底色直接复用 antd 自己的 `.ant-table-row-selected`——它的颜色来自
+ * Table.rowSelectedBg token,不需要再写一条 arbitrary variant。
+ * 为什么删 TableBox / WideTable:滚动容器、吸顶表头、空态都是 Table 的内建能力,
+ * 在外面再套一层 div 等于把两套尺子请回来;列宽请写在 column.width 上
+ * (antd 在 scroll.y 下用的是 fixed 布局,没有 width 的列才拿剩余宽度)。
+ */
import type { ReactNode } from 'react'
+import { Table as AntTable, type TableProps } from 'antd'
import { cn } from '../../lib/cn'
+/** 列定义:直接借用 antd 的类型,页面不需要(也不准)自己 import antd */
+export type Column = NonNullable['columns']>[number]
+export type Columns = NonNullable['columns']>
+
/**
- * 表格。
- *
- * 表头 sticky、单元格描边、行悬停底色都收在 上(用 [&_th] 之类的子选择器),
- * 页面因此可以继续写原生 thead/tr/td,不必再 import 一套单元格组件。
- * 超宽的表格交给外层 TableBox 横向滚动,而不是把整页顶出屏幕。
+ * 长文本列:允许折行而不是把整张表顶宽(旧 cellWrap)。
+ * 用法是 column.className——antd 会把它落到该列的每个单元格上。
*/
-export function TableBox({ children, className, maxHeight = 520 }: { children: ReactNode; className?: string; maxHeight?: number | false }) {
+export const cellWrap = 'max-w-[340px] whitespace-normal leading-normal wrap-anywhere'
+
+type TableExtra = {
+ /** 列定义(antd Columns) */
+ columns: Columns
+ /** 数据源 */
+ dataSource: readonly T[] | undefined
+ /** 行主键:字段名或取值函数,默认取 id */
+ rowKey?: TableProps['rowKey']
+ /** 横向滚动下限(px)。0 = 不设下限,表格吃满容器;默认 720 沿用旧站窄屏兜底 */
+ minWidth?: number | false
+ /** 内容区高度上限(px)。false = 不内滚、不吸顶,跟随页面滚动 */
+ maxHeight?: number | false
+ /** 整行是热区(账号列表、模型列表这类「点一行看详情」):指针形状说明可点 */
+ onPick?: (row: T, index: number) => void
+ /** 当前选中的行:命中就用 antd 的选中行底色(排在 hover 之后,两层状态都看得见) */
+ chosen?: (row: T, index: number) => boolean
+ /** 密度:站内表格一律 sm;只有一张表例外(帮助页的属性表)也保持 sm,档位留着是为了别再写 size */
+ size?: 'sm' | 'md'
+ /** 空态文案(默认交还 antd 的「暂无数据」) */
+ empty?: ReactNode
+ className?: string
+ /** 行级样式追加(拖拽落点、临时高亮这类「只有页面知道」的状态):与内部选中态叠加 */
+ rowClassName?: TableProps['rowClassName']
+ /** 行级事件追加:拖拽排序(draggable/onDrop)走这里,整行热区仍由 onPick 负责 */
+ onRow?: TableProps['onRow']
+ /** 分页:站内表格默认全量渲染 + 容器内滚,需要时再传 antd 的分页配置 */
+ pagination?: TableProps['pagination']
+ loading?: TableProps['loading']
+ expandable?: TableProps['expandable']
+ footer?: TableProps['footer']
+ summary?: TableProps['summary']
+ rowSelection?: TableProps['rowSelection']
+ onChange?: TableProps['onChange']
+}
+
+export function Table({
+ columns, dataSource, rowKey = 'id', minWidth = 720, maxHeight = 520,
+ onPick, chosen, size = 'sm', empty, className, rowClassName, onRow, ...rest
+}: TableExtra) {
+ const x = minWidth === false ? undefined : minWidth || undefined
+ const y = maxHeight === false ? undefined : maxHeight || undefined
return (
-
- {children}
+
+
+ columns={columns}
+ dataSource={dataSource as T[]}
+ rowKey={rowKey as never}
+ size={size === 'sm' ? 'small' : 'middle'}
+ pagination={rest.pagination === undefined ? false : rest.pagination}
+ scroll={{ x, y }}
+ locale={empty === undefined ? undefined : { emptyText: empty }}
+ rowClassName={(row, index) => cn(
+ onPick && 'cursor-pointer',
+ chosen?.(row, index ?? 0) && 'ant-table-row-selected',
+ typeof rowClassName === 'function' ? rowClassName(row, index, 0) : rowClassName
+ )}
+ onRow={(row, index) => {
+ const extra = onRow?.(row, index) || {}
+ if (!onPick) return extra
+ return {
+ ...extra,
+ onClick: (e) => { extra.onClick?.(e); onPick(row, index ?? 0) },
+ onKeyDown: (e) => { if (e.key === 'Enter') onPick(row, index ?? 0) },
+ tabIndex: 0
+ } as typeof extra
+ }}
+ {...rest}
+ />
)
}
-
-export function Table({ children, className, minWidth = 720, pickable }: {
- children: ReactNode; className?: string; minWidth?: number; pickable?: boolean
-}) {
- return (
-
之前是失效的:上面那条 [&_th]:text-left 带一个
- 元素选择器,特异性 (0,1,1) 高于 .text-right 的 (0,1,0),表头全部退回左对齐。
- 这里把两种对齐写回同一层特异性关系,表头和它下面的数字列才对得上。 */
- '[&_th.text-right]:text-right [&_th.text-center]:text-center',
- '[&_td]:px-2 [&_td]:py-2 [&_td]:border-b [&_td]:border-split [&_td]:align-middle',
- /* 表格是全站最密的地方:把标签档位令牌压到 sm,单元格里的 Tag / Status
- 自动一起降一档(同 Ctlbar 下发 antd small 的思路),页面不用逐个写 size="sm"。 */
- '[&_td]:[--tag-h:var(--tag-h-sm)] [&_td]:[--tag-px:var(--tag-px-sm)] '
- + '[&_td]:[--tag-gap:var(--tag-gap-sm)] [&_td]:[--tag-text:var(--tag-text-sm)]',
- '[&_tbody_tr:hover>td]:bg-bg-container',
- /* 整行是热区的表(账号列表、模型列表):指针形状说明「点这一行有用」 */
- pickable && '[&_tbody_tr]:cursor-pointer',
- /* 选中态排在 hover 之后:同一行既被选中又被悬停时,仍然要看得出选中的是它 */
- pickable && '[&_tbody_tr[data-chosen]>td]:bg-primary-bg [&_tbody_tr[data-chosen]>td]:border-b-primary-border',
- className)}>
- {children}
-
- )
-}
-
-/** 窄屏时的兜底:表格至少多宽由调用方说清楚(旧站统一 720px) */
-export function WideTable({ children, className, minWidth = 720 }: { children: ReactNode; className?: string; minWidth?: number }) {
- return (
-
-
-
- )
-}
-
-/** 单元格对齐辅助:居中 / 右对齐 / 可折行长文本 */
-export const cellCenter = 'text-center'
-export const cellRight = 'text-right'
-export const cellWrap = 'max-w-[340px] whitespace-normal leading-normal wrap-anywhere'
diff --git a/frontend/src/components/ui/grid.tsx b/frontend/src/components/ui/grid.tsx
index 910f432..03bd69f 100644
--- a/frontend/src/components/ui/grid.tsx
+++ b/frontend/src/components/ui/grid.tsx
@@ -48,3 +48,23 @@ export function toCols(children: ReactNode, spans: Partial
>,
{child}
))
}
+
+/**
+ * 两栏正文的栅格换算:主栏 / 侧栏各占几等分、到哪个断点折成单列。
+ *
+ * 症状:Layout 的 1.5fr/0.8fr、总控台的 .82fr/1.45fr 以前各自写在页面上,
+ * 折列宽度一个是 max-xl、一个是 max-lg,两栏版式在站内有三套尺子。
+ * 做法:比例与折列档位都作为参数进来,换算复用上面那一份 BP_MIN/AT_MIN,
+ * 所以「≤xl 折单列」在 Layout 和总控台里落到 DOM 上是同一组 Col 断点。
+ * 为什么放 grid.tsx:Page(Layout/Stack)与页面都从这里取,铺列只有一个来源。
+ */
+export function splitSpans(main: number, aside: number, oneAt: GridCollapse = 'xl') {
+ const limit = AT_MIN[oneAt] ?? 0
+ const fill = BP_ORDER.filter((bp) => BP_MIN[bp] < limit)
+ const build = (wide: number, narrow: number) => {
+ const out: Partial> = {}
+ BP_ORDER.forEach((bp) => { out[bp] = fill.includes(bp) ? 24 : wide })
+ return out
+ }
+ return { main: build(main, 24), aside: build(aside, 24) }
+}
diff --git a/frontend/src/stores/theme.ts b/frontend/src/stores/theme.ts
index f29659b..73b6178 100644
--- a/frontend/src/stores/theme.ts
+++ b/frontend/src/stores/theme.ts
@@ -9,7 +9,7 @@
* 钥匙 nex-the 与 index.html 里的首帧脚本共用(值缺失 = 跟随系统)。
*/
import { create } from 'zustand'
-import { applyRootVars } from '../theme/antd'
+import { SHELL_BG, applyRootVars } from '../theme/antd'
export type ThemeMode = 'dark' | 'light'
@@ -46,7 +46,7 @@ export function applyTheme() {
const meta = document.querySelector('meta[name="color-scheme"]')
if (meta) meta.setAttribute('content', mode)
const bg = document.querySelector('meta[name="theme-color"]')
- if (bg) bg.setAttribute('content', mode === 'light' ? '#f0f4f8' : '#0d1117')
+ if (bg) bg.setAttribute('content', SHELL_BG[mode])
applyRootVars(mode)
}
diff --git a/frontend/src/styles/app.css b/frontend/src/styles/app.css
index ff198b1..b2de3c0 100644
--- a/frontend/src/styles/app.css
+++ b/frontend/src/styles/app.css
@@ -115,6 +115,21 @@ textarea) { width: 100%; min-width: 0 }
}
.nex-field .ant-form-item-label { white-space: normal; overflow: visible }
.nex-field .ant-form-item-label > label { height: auto; white-space: normal }
+
+/* ⑤ 筛选条里的字段(``):标签在左、控件在右,**同一行**垂直居中。
+ 症状(用户第三轮截图):项目列表的「搜索 / 状态」两个字段占了整两行——
+ 上面一排标签、下面一排控件,右边还空着半条。筛选是一次扫读的动作,
+ 不该用「填表」的排版。
+ antd 的 horizontal 布局本身就是标签在左,只是它为表单场景把标签**右对齐**
+ 并留了 8px 标签内边距;横扫读的筛选条要左起、且标签不许把控件顶歪,
+ 所以标签列 flex:none + 左对齐,控件列也不参与挤压(工具条里的控件宽度
+ 由字段自己的 width / grow 决定,见 Controls.tsx 的 WIDTHS)。 */
+.nex-field-inline { margin-block-end: 0 }
+.nex-field-inline .ant-form-item-row { flex-wrap: nowrap; align-items: center }
+.nex-field-inline .ant-form-item-label { flex: none; text-align: start; padding: 0; margin-inline-end: var(--ant-margin-xs) }
+.nex-field-inline .ant-form-item-label > label { height: auto; white-space: nowrap; color: var(--ant-color-text) }
+/* 控件列吃 --nex-ctl-w(inline 的 narrow/wide 由组件写进变量);没写变量的字段照旧按内容定尺 */
+.nex-field-inline .ant-form-item-control { flex: none; width: var(--nex-ctl-w, auto) }
/* 必填星号:antd 画在标签前,颜色取它自己的 colorError,这里只保证不被折行拆开 */
.nex-req { color: var(--ant-color-error); font-weight: var(--ant-font-weight-strong); margin-inline-start: 1px }
diff --git a/frontend/src/theme/antd.ts b/frontend/src/theme/antd.ts
index 80f0f8c..1647924 100644
--- a/frontend/src/theme/antd.ts
+++ b/frontend/src/theme/antd.ts
@@ -94,6 +94,17 @@ const SEED: Record> = {
}
}
+/**
+ * 页面最底色(= `colorBgLayout`):唯一需要把色值搬到 antd 之外的地方是
+ * `index.html` 里的 ``——浏览器地址栏要在 React 挂载前就有值,
+ * 读不到 antd 注入的 CSS var。这里直接从 SEED 取,不再抄第二遍字面量,
+ * 「改了表面色忘了同步 meta」这种漂移就不会出现(规范 §2:`#hex` 只许出现在本文件)。
+ */
+export const SHELL_BG: Record = {
+ light: SEED.light.colorBgLayout,
+ dark: SEED.dark.colorBgLayout
+}
+
/** 站内字体:保留品牌字体栈,度量(字号 / 行高 / 字重)用 antd 默认 */
const FONT_FAMILY =
"'DM Sans', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif"
@@ -116,18 +127,25 @@ export function buildAntdTheme(mode: ThemeMode): ThemeConfig {
antd 默认 colorLink = colorInfo = colorPrimary,主色是标准蓝的时候,
「蓝链接 + 蓝信息」本来就是同一套强调,不需要当初那条压同色的补丁;
主按钮上的文字回到默认白。
- 三个状态色保留覆盖,但它们不是品牌色而是语义色:喂进去的是
- @ant-design/colors 现成色板的档位(dark 取 5~6 档,light 取 7 档),
- 只调深浅不改含义——出厂的深色档(success #49aa19 / warning #d89614 /
- error #dc4446)压在 #0d1117 上偏闷,而「已完成 / 有风险 / 失败」是
- 工作台的主信息,读不清就是功能问题。
- 注意这三条和 colorPrimary 一样会再走一遍 darkAlgorithm 的色板:
- 实测 dark 落地的不是 #95de64 而是 #82c058(warning #d8bd14、error #dc6966),
- light 原样保留(#389e0d / #d48806 / #cf1322)。这两个口径都由探针量过,
- 别按字面量去猜。除这三条以外,站内没有任何自造色。 */
- colorSuccess: dark ? '#95de64' : '#389e0d',
- colorWarning: dark ? '#fadb14' : '#d48806',
- colorError: dark ? '#ff7875' : '#cf1322'
+ 状态色(success / warning / error):**浅色一套不写,深色只抬亮一档**。
+ ① 浅色为什么删干净:上一版在这里写了 #389e0d / #d48806 / #cf1322,
+ 那是 light 色板的第 7 档——把「派生出来的文字档」当 seed 喂回去,
+ 和上面 colorPrimary 是同一个坑,只是这次连累的是底纹与描边:
+ 实测 colorSuccessBg 从出厂的 #f6ffed 变成 #d2dec8(一块发灰的脏绿),
+ colorSuccessBorder 从 #b7eb8f 变成 #91c46e。全站每一枚「完成 / 就绪」
+ 标签都穿着这块灰绿,用户看到的「浅绿色标签没换干净」就是它。
+ 删掉之后浅色状态标签 = antd 官网同款 #f6ffed 底 / #b7eb8f 边 / #52c41a 字,
+ 的皮肤与 antd 自带 逐项相等
+ (见 node_modules/antd/lib/tag/style/statusCmp.js:color/-bg/-border 三件套)。
+ ② 深色为什么留:dark 的出厂档 #49aa19 压在本站容器 #141b23 上,
+ successBg #162312 与容器只差 RGB(2,8,17),读不出「这是一块状态标签」;
+ 抬亮一档后实测文字对比 7.10(出厂 5.49)。喂进去的仍是 @ant-design/colors
+ 现成色板的档位(success 5 档 #95de64 / warning 6 档 #fadb14 /
+ error 5 档 #ff7875),只调明度不改语义;和 colorPrimary 一样,
+ 这三条会再走一遍 darkAlgorithm 的色板,实测落地是 #82c058 / #d8bd14 /
+ #dc6966——要引用数值就引用这三个,别按字面量猜。
+ 除这三条以外,站内没有任何自造色。 */
+ ...(dark ? { colorSuccess: '#95de64', colorWarning: '#fadb14', colorError: '#ff7875' } : {})
},
components: {
/**