feat: 完善后台设计语言细节

- 统一说明文案层级:Typography.Paragraph 次要文案迁移到 admin-section-description
- 状态色补齐边框与中间调令牌,Alert/错误条/Descriptions 与 StatusTag 同源
- 咨询详情描述列表去表格线,改为键值展示并统一令牌
- 新增 BrandMark,侧栏与登录页标识改用品牌首字
- 信任内容改用列表行,空状态、表格骨架屏、主按钮脏检查落地
- design.md 同步令牌映射、切换控件选型与组件清单
This commit is contained in:
que01 committed 2026-10-14 11:21:31 +08:00
1 parent 2f26828f09
commit 3ef46b0aa8
25 files changed
+836 -393

No files matched your search

@@ -17,8 +17,10 @@ import {
} from "./workspace-mutations.js";
import { supportsIndustry, type IndustryTarget } from "./workspace-templates.js";
import { AdminPageHeader } from "../../components/AdminPageHeader.js";
import { EmptyState } from "../../components/EmptyState.js";
import { MutationError } from "../../components/QueryState.js";
import { StatusTag } from "../../components/StatusTag.js";
import { ListSkeleton } from "../../components/TableSkeleton.js";
export const inquiryFieldTypes = [
{ value: "text", label: "简短文字" },
@@ -153,9 +155,9 @@ export function WorkspacePage() {
description="日常小程序内容请从页面配置、业务展示和信任证明进入;这里主要管理模板、咨询入口和负责人设置。"
/>
<Card title="先完成日常配置">
<Typography.Paragraph type="secondary">
<p className="admin-section-description admin-offset-bottom">
下面这些入口面向日常经营,不需要理解模板或技术设置。完成后回到“配置与发布”统一检查并上线。
</Typography.Paragraph>
</p>
<Space wrap>
<Button onClick={() => navigate("/admin/brand")}>配置小程序页面</Button>
<Button onClick={() => navigate("/admin/services")}>添加业务展示内容</Button>
@@ -201,7 +203,7 @@ export function WorkspacePage() {
</Card>
))}
{!runtimeQuery.data?.plugins?.length && (
<p className="admin-empty-inline">当前模板未启用能力插件。</p>
<EmptyState compact title="当前模板未启用能力插件" />
)}
</div>
<Space wrap>
@@ -237,7 +239,7 @@ export function WorkspacePage() {
))}
</div>
) : (
<p className="admin-empty-inline">暂无历史版本</p>
<EmptyState compact title="暂无历史版本" />
)}
{visualHistory.data?.history.length ? (
<Button
@@ -290,9 +292,9 @@ export function WorkspacePage() {
当前模板:{runtimeQuery.data?.visualTemplate?.name ?? "林境建筑画册"}
</Typography.Paragraph>
<Typography.Paragraph>目标模板:林境建筑画册</Typography.Paragraph>
<Typography.Paragraph type="secondary">
<p className="admin-section-description">
只会替换视觉主题和模块变体,不会覆盖品牌内容、业务提供项或咨询记录。
</Typography.Paragraph>
</p>
</Modal>
</div>
)}
@@ -313,9 +315,9 @@ export function WorkspacePage() {
</Space>
}
>
<Typography.Paragraph type="secondary">
<p className="admin-section-description admin-offset-bottom">
模板只提供行业表达样例,不会替代你的品牌定位、经历、作品和合作方式。
</Typography.Paragraph>
</p>
<StatusTag
tone={installations.length ? "info" : "neutral"}
label={installations.length ? `已安装 ${installations.length} 个模板` : "尚未安装模板"}
@@ -329,10 +331,10 @@ export function WorkspacePage() {
</Typography.Text>
{templatePreview.data?.canUpgrade ? (
<>
<Typography.Paragraph type="secondary" className="admin-flush">
<p className="admin-section-description">
可升级内容:新增 {templatePreview.data.missingModules.length} 个模块,新增{" "}
{templatePreview.data.missingFields.length} 个字段。已有内容不会被覆盖。
</Typography.Paragraph>
</p>
<Button
type="primary"
onClick={() => upgrade.mutate()}
@@ -369,20 +371,20 @@ export function WorkspacePage() {
}}
confirmLoading={install.isPending}
>
<Typography.Title level={5}>{industryTarget?.name}</Typography.Title>
<Typography.Paragraph>{industryTarget?.description}</Typography.Paragraph>
<Typography.Paragraph type="secondary">
<h3 className="admin-subhead">{industryTarget?.name}</h3>
<p className="admin-section-description">{industryTarget?.description}</p>
<p className="admin-section-description">
模板会初始化模块、字段和默认业务表达,不会覆盖已有品牌内容。依赖能力:
{industryTarget?.capabilities.join("、") || "无"}。
</Typography.Paragraph>
</p>
</Modal>
<Card
title="模板组合预览"
extra={<Typography.Text type="secondary">高级预览</Typography.Text>}
>
<Typography.Paragraph type="secondary">
<p className="admin-section-description admin-offset-bottom">
用于负责人确认行业表达和视觉风格是否匹配,日常内容配置通常不需要使用这里。
</Typography.Paragraph>
</p>
<Space wrap>
<Select
value={previewIndustryKey ?? null}
@@ -423,73 +425,84 @@ export function WorkspacePage() {
</Button>
}
>
<Table
rowKey="id"
loading={forms.isLoading}
dataSource={forms.data ?? []}
locale={{ emptyText: "还没有咨询入口,点击右上角即可从默认表单开始。" }}
columns={[
{ title: "名称", dataIndex: "name" },
{
title: "版本",
dataIndex: "version",
render: (value) => <StatusTag tone="neutral" label={`v${value}`} />,
},
{
title: "字段数",
dataIndex: "fieldsSnapshot",
render: (value: unknown[]) => value?.length ?? 0,
},
{
title: "状态",
dataIndex: "isEnabled",
render: (value: boolean) => (
<StatusTag tone={value ? "success" : "neutral"} label={value ? "启用" : "停用"} />
{forms.isLoading && !forms.data ? (
<ListSkeleton rows={2} />
) : (
<Table
rowKey="id"
dataSource={forms.data ?? []}
locale={{
emptyText: (
<EmptyState
compact
title="还没有咨询入口"
description="点击右上角「新增表单」,从默认表单开始配置。"
/>
),
},
{
title: "操作",
render: (_: unknown, item: InquiryForm) => (
<Space>
<Button
type="link"
size="small"
onClick={() => {
setEditingForm(item);
inquiryForm.resetFields();
inquiryForm.setFieldsValue({
name: item.name,
purpose: item.purpose,
offeringId: item.offeringId ?? undefined,
fieldsSnapshot: item.fieldsSnapshot.map((field: unknown) => {
const value = field as Record<string, unknown>;
return {
...value,
options: normalizeOptionLabels(value.options),
};
}),
});
setFormOpen(true);
}}
>
编辑
</Button>
<Select
size="small"
value={item.isEnabled}
options={[
{ value: true, label: "启用" },
{ value: false, label: "停用" },
]}
onChange={(isEnabled) =>
updateForm.mutate({ id: item.id, body: { isEnabled } })
}
/>
</Space>
),
},
]}
/>
}}
columns={[
{ title: "名称", dataIndex: "name" },
{
title: "版本",
dataIndex: "version",
render: (value) => <StatusTag tone="neutral" label={`v${value}`} />,
},
{
title: "字段数",
dataIndex: "fieldsSnapshot",
render: (value: unknown[]) => value?.length ?? 0,
},
{
title: "状态",
dataIndex: "isEnabled",
render: (value: boolean) => (
<StatusTag tone={value ? "success" : "neutral"} label={value ? "启用" : "停用"} />
),
},
{
title: "操作",
render: (_: unknown, item: InquiryForm) => (
<Space>
<Button
type="link"
size="small"
onClick={() => {
setEditingForm(item);
inquiryForm.resetFields();
inquiryForm.setFieldsValue({
name: item.name,
purpose: item.purpose,
offeringId: item.offeringId ?? undefined,
fieldsSnapshot: item.fieldsSnapshot.map((field: unknown) => {
const value = field as Record<string, unknown>;
return {
...value,
options: normalizeOptionLabels(value.options),
};
}),
});
setFormOpen(true);
}}
>
编辑
</Button>
<Select
size="small"
value={item.isEnabled}
options={[
{ value: true, label: "启用" },
{ value: false, label: "停用" },
]}
onChange={(isEnabled) =>
updateForm.mutate({ id: item.id, body: { isEnabled } })
}
/>
</Space>
),
},
]}
/>
)}
<MutationError error={createForm.error} />
<MutationError error={updateForm.error} />
</Card>
@@ -507,6 +520,15 @@ export function WorkspacePage() {
<Table
rowKey="id"
dataSource={fields.filter((item) => item.source === "custom")}
locale={{
emptyText: (
<EmptyState
compact
title="还没有高级自定义字段"
description="仅在需要跨业务复用的字段时才添加。"
/>
),
}}
columns={[
{ title: "字段", dataIndex: "label" },
{
@@ -614,9 +636,9 @@ export function WorkspacePage() {
confirmLoading={createForm.isPending || updateForm.isPending}
width={760}
>
<Typography.Paragraph type="secondary">
<p className="admin-section-description admin-offset-bottom">
先确定客户要提交的事情,再设置你希望客户填写的问题。保存后还需要在“配置与发布”中检查并发布,才会在小程序生效。
</Typography.Paragraph>
</p>
<Form
form={inquiryForm}
layout="vertical"